diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-12-23 18:28:33 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-12-23 18:28:33 +0100 |
commit | 62cc71c8a8e64296376ea092a1b3107d269bbeee (patch) | |
tree | ac4cd8f2cc1fc89337bfd4e624ad5297761e9cb1 /xen/include/asm-x86/x86_emulate.h | |
parent | f0010ba27fa5f5f18d051cd427c8a361f3c07cd1 (diff) | |
download | xen-62cc71c8a8e64296376ea092a1b3107d269bbeee.tar.gz xen-62cc71c8a8e64296376ea092a1b3107d269bbeee.tar.bz2 xen-62cc71c8a8e64296376ea092a1b3107d269bbeee.zip |
Generic x86 emulator now properly supports 16-bit addressing
by narrowing accesses to SI/DI/SP registers. Also supports
real-mode addressing by shifting and adding the appropriate
segment register for certain stack and string operations
where the effective address is not already known.
todo: Stack operations should have address size specified
by B bit in stack segment descriptor, not by default address
size or address-size override. Probably nothing depends on
the proper behaviour though.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/asm-x86/x86_emulate.h')
-rw-r--r-- | xen/include/asm-x86/x86_emulate.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xen/include/asm-x86/x86_emulate.h b/xen/include/asm-x86/x86_emulate.h index f6b6190215..19482c1538 100644 --- a/xen/include/asm-x86/x86_emulate.h +++ b/xen/include/asm-x86/x86_emulate.h @@ -141,6 +141,12 @@ x86_emulate_write_std( struct cpu_user_regs; +/* Current execution mode, passed to the emulator. */ +#define X86EMUL_MODE_REAL 0 +#define X86EMUL_MODE_PROT16 2 +#define X86EMUL_MODE_PROT32 4 +#define X86EMUL_MODE_PROT64 8 + /* * x86_emulate_memop: Emulate an instruction that faulted attempting to * read/write a 'special' memory area. @@ -149,6 +155,8 @@ struct cpu_user_regs; * @ops: Interface to access special memory. * @mode: Current execution mode, represented by the default size of memory * addresses, in bytes. Valid values are 2, 4 and 8 (x86/64 only). + * Alternatively use the appropriate X86EMUL_MODE value (which also + * includes a value for emulating real mode). */ extern int x86_emulate_memop( |