diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-03-21 18:04:36 +0000 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-03-21 18:04:36 +0000 |
commit | 1abc0a00cec5396d12d83c8725b6e33f148684c6 (patch) | |
tree | b1dd3a4ca0085838a36f30b149ce09e2d8040a8f /xen/include/asm-x86/x86_emulate.h | |
parent | 03d7fde4dbfc960fe6b720fa43e2b475c0c8389b (diff) | |
download | xen-1abc0a00cec5396d12d83c8725b6e33f148684c6.tar.gz xen-1abc0a00cec5396d12d83c8725b6e33f148684c6.tar.bz2 xen-1abc0a00cec5396d12d83c8725b6e33f148684c6.zip |
bitkeeper revision 1.1236.1.101 (423f0cb4e4UtnlbkQsaMhXYz4hi__w)
Add CMPXCHG8B support to the instruction emulator.
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 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/xen/include/asm-x86/x86_emulate.h b/xen/include/asm-x86/x86_emulate.h index 895e22a209..79197fed9c 100644 --- a/xen/include/asm-x86/x86_emulate.h +++ b/xen/include/asm-x86/x86_emulate.h @@ -34,6 +34,8 @@ * some out-of-band mechanism, unknown to the emulator. The memop signals * failure by returning X86EMUL_PROPAGATE_FAULT to the emulator, which will * then immediately bail. + * 3. Valid access sizes are 1, 2, 4 and 8 bytes. On x86/32 systems only + * cmpxchg8b_emulated need support 8-byte accesses. */ /* Access completed successfully: continue emulation as normal. */ #define X86EMUL_CONTINUE 0 @@ -104,6 +106,25 @@ struct x86_mem_emulator unsigned long old, unsigned long new, unsigned int bytes); + + /* + * cmpxchg_emulated: Emulate an atomic (LOCKed) CMPXCHG8B operation on an + * emulated/special memory area. + * @addr: [IN ] Linear address to access. + * @old: [IN ] Value expected to be current at @addr. + * @new: [IN ] Value to write to @addr. + * NOTES: + * 1. This function is only ever called when emulating a real CMPXCHG8B. + * 2. This function is *never* called on x86/64 systems. + * 2. Not defining this function (i.e., specifying NULL) is equivalent + * to defining a function that always returns X86EMUL_UNHANDLEABLE. + */ + int (*cmpxchg8b_emulated)( + unsigned long addr, + unsigned long old_lo, + unsigned long old_hi, + unsigned long new_lo, + unsigned long new_hi); }; /* Standard reader/writer functions that callers may wish to use. */ |