diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-11-30 17:07:26 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-11-30 17:07:26 +0000 |
commit | cffd8b0db89e6cead31090adf0c96d7d84ee6769 (patch) | |
tree | 4c31a18eeec9555c4b9a13d10463bad100da9ecd /xen/include/asm-x86/x86_emulate.h | |
parent | c04d106a58f584781760e4c828401dfcb0d81580 (diff) | |
download | xen-cffd8b0db89e6cead31090adf0c96d7d84ee6769.tar.gz xen-cffd8b0db89e6cead31090adf0c96d7d84ee6769.tar.bz2 xen-cffd8b0db89e6cead31090adf0c96d7d84ee6769.zip |
[XEN] Proper segmentation emulation added to HVM emulated PTE writes.
Sigmed-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 | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/xen/include/asm-x86/x86_emulate.h b/xen/include/asm-x86/x86_emulate.h index 4bc49c5487..ef23291cdc 100644 --- a/xen/include/asm-x86/x86_emulate.h +++ b/xen/include/asm-x86/x86_emulate.h @@ -11,16 +11,26 @@ struct x86_emulate_ctxt; -#define X86_SEG_CS 0 -#define X86_SEG_SS 1 -#define X86_SEG_DS 2 -#define X86_SEG_ES 3 -#define X86_SEG_FS 4 -#define X86_SEG_GS 5 +/* + * Comprehensive enumeration of x86 segment registers. Note that the system + * registers (TR, LDTR, GDTR, IDTR) are never referenced by the emulator. + */ +enum x86_segment { + /* General purpose. */ + x86_seg_cs, + x86_seg_ss, + x86_seg_ds, + x86_seg_es, + x86_seg_fs, + x86_seg_gs, + /* System. */ + x86_seg_tr, + x86_seg_ldtr, + x86_seg_gdtr, + x86_seg_idtr +}; /* - * x86_emulate_ops: - * * These operations represent the instruction emulator's interface to memory. * * NOTES: @@ -45,7 +55,7 @@ struct x86_emulate_ops { /* * All functions: - * @seg: [IN ] Segment being dereferenced (specified as X86_SEG_??). + * @seg: [IN ] Segment being dereferenced (specified as x86_seg_??). * @offset [IN ] Offset within segment. */ @@ -55,7 +65,7 @@ struct x86_emulate_ops * @bytes: [IN ] Number of bytes to read from memory. */ int (*read)( - unsigned int seg, + enum x86_segment seg, unsigned long offset, unsigned long *val, unsigned int bytes, @@ -67,7 +77,7 @@ struct x86_emulate_ops * @bytes: [IN ] Number of bytes to write to memory. */ int (*write)( - unsigned int seg, + enum x86_segment seg, unsigned long offset, unsigned long val, unsigned int bytes, @@ -80,7 +90,7 @@ struct x86_emulate_ops * @bytes: [IN ] Number of bytes to access using CMPXCHG. */ int (*cmpxchg)( - unsigned int seg, + enum x86_segment seg, unsigned long offset, unsigned long old, unsigned long new, @@ -98,7 +108,7 @@ struct x86_emulate_ops * to defining a function that always returns X86EMUL_UNHANDLEABLE. */ int (*cmpxchg8b)( - unsigned int seg, + enum x86_segment seg, unsigned long offset, unsigned long old_lo, unsigned long old_hi, |