aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build8
-rw-r--r--target/loongarch/tcg/insn_trans/trans_vec.c.inc6
-rwxr-xr-xtests/qemu-iotests/tests/mirror-sparse2
-rw-r--r--ui/curses.c10
4 files changed, 15 insertions, 11 deletions
diff --git a/meson.build b/meson.build
index a7b3c68..50c774a 100644
--- a/meson.build
+++ b/meson.build
@@ -1586,9 +1586,11 @@ if not get_option('brlapi').auto() or have_system
brlapi = cc.find_library('brlapi', has_headers: ['brlapi.h'],
required: get_option('brlapi'))
if brlapi.found() and not cc.links('''
- #include <brlapi.h>
- #include <stddef.h>
- int main(void) { return brlapi__openConnection (NULL, NULL, NULL); }''', dependencies: brlapi)
+ #include <brlapi.h>
+ #include <stddef.h>
+ int main(void) {
+ return brlapi__openConnection(NULL, NULL, NULL) == BRLAPI_INVALID_FILE_DESCRIPTOR;
+ }''', dependencies: brlapi)
brlapi = not_found
if get_option('brlapi').enabled()
error('could not link brlapi')
diff --git a/target/loongarch/tcg/insn_trans/trans_vec.c.inc b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
index 7873002..38bccf2 100644
--- a/target/loongarch/tcg/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
@@ -3585,7 +3585,9 @@ static bool gen_vldi(DisasContext *ctx, arg_vldi *a, uint32_t oprsz)
int sel, vece;
uint64_t value;
- if (!check_valid_vldi_mode(a)) {
+ sel = (a->imm >> 12) & 0x1;
+
+ if (sel && !check_valid_vldi_mode(a)) {
generate_exception(ctx, EXCCODE_INE);
return true;
}
@@ -3594,8 +3596,6 @@ static bool gen_vldi(DisasContext *ctx, arg_vldi *a, uint32_t oprsz)
return true;
}
- sel = (a->imm >> 12) & 0x1;
-
if (sel) {
value = vldi_get_value(ctx, a->imm);
vece = MO_64;
diff --git a/tests/qemu-iotests/tests/mirror-sparse b/tests/qemu-iotests/tests/mirror-sparse
index 3b183ee..ee7101b 100755
--- a/tests/qemu-iotests/tests/mirror-sparse
+++ b/tests/qemu-iotests/tests/mirror-sparse
@@ -40,7 +40,7 @@ cd ..
_supported_fmt qcow2 raw # Format of the source. dst is always raw file
_supported_proto file
_supported_os Linux
-_supported_cache_modes none directsync
+_require_o_direct
_require_disk_usage
echo
diff --git a/ui/curses.c b/ui/curses.c
index a39aee8..161f78c 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -265,7 +265,8 @@ static int curses2foo(const int _curses2foo[], const int _curseskey2foo[],
static void curses_refresh(DisplayChangeListener *dcl)
{
- int chr, keysym, keycode, keycode_alt;
+ wint_t chr = 0;
+ int keysym, keycode, keycode_alt;
enum maybe_keycode maybe_keycode = CURSES_KEYCODE;
curses_winch_check();
@@ -284,8 +285,9 @@ static void curses_refresh(DisplayChangeListener *dcl)
/* while there are any pending key strokes to process */
chr = console_getch(&maybe_keycode);
- if (chr == -1)
+ if (chr == WEOF) {
break;
+ }
#ifdef KEY_RESIZE
/* this shouldn't occur when we use a custom SIGWINCH handler */
@@ -304,9 +306,9 @@ static void curses_refresh(DisplayChangeListener *dcl)
/* alt or esc key */
if (keycode == 1) {
enum maybe_keycode next_maybe_keycode = CURSES_KEYCODE;
- int nextchr = console_getch(&next_maybe_keycode);
+ wint_t nextchr = console_getch(&next_maybe_keycode);
- if (nextchr != -1) {
+ if (nextchr != WEOF) {
chr = nextchr;
maybe_keycode = next_maybe_keycode;
keycode_alt = ALT;