summary refs log tree commit diff stats
path: root/target/i386/emulate/x86_decode.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-05-02 22:21:42 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-05-12 17:48:32 +0200
commit77a2dba45cc9a1be7fec6ab88f43d2fa18af52a3 (patch)
tree757705a4ceddb1b5aa75ddcc12b55abee14ffc9a /target/i386/emulate/x86_decode.h
parentad441b8b7913a26b18edbc076c74ca0cdbfa4ee5 (diff)
downloadfocaccia-qemu-77a2dba45cc9a1be7fec6ab88f43d2fa18af52a3.tar.gz
focaccia-qemu-77a2dba45cc9a1be7fec6ab88f43d2fa18af52a3.zip
target/i386/emulate: stop overloading decode->op[N].ptr
decode->op[N].ptr can contain either a host pointer (!) in CPUState
or a guest virtual address.  Pass the whole struct to read_val_ext
and write_val_ext, so that it can decide the contents based on the
operand type.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/emulate/x86_decode.h')
-rw-r--r--target/i386/emulate/x86_decode.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/target/i386/emulate/x86_decode.h b/target/i386/emulate/x86_decode.h
index 87cc728598..927645af1a 100644
--- a/target/i386/emulate/x86_decode.h
+++ b/target/i386/emulate/x86_decode.h
@@ -266,7 +266,10 @@ typedef struct x86_decode_op {
     int reg;
     target_ulong val;
 
-    target_ulong ptr;
+    union {
+        target_ulong addr;
+        void *regptr;
+    };
 } x86_decode_op;
 
 typedef struct x86_decode {
@@ -301,8 +304,8 @@ uint64_t sign(uint64_t val, int size);
 
 uint32_t decode_instruction(CPUX86State *env, struct x86_decode *decode);
 
-target_ulong get_reg_ref(CPUX86State *env, int reg, int rex_present,
-                         int is_extended, int size);
+void *get_reg_ref(CPUX86State *env, int reg, int rex_present,
+                  int is_extended, int size);
 target_ulong get_reg_val(CPUX86State *env, int reg, int rex_present,
                          int is_extended, int size);
 void calc_modrm_operand(CPUX86State *env, struct x86_decode *decode,