diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-03-15 15:58:52 +0000 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-03-15 15:58:52 +0000 |
commit | d430aae25c084938dac4aa82d8d2592498b778ae (patch) | |
tree | 5a6d747502347513bf813041d0eb5b4e48c751bd /tools/tests | |
parent | ea847f783284434cf279c18f33da0a443d7fe39a (diff) | |
download | xen-d430aae25c084938dac4aa82d8d2592498b778ae.tar.gz xen-d430aae25c084938dac4aa82d8d2592498b778ae.tar.bz2 xen-d430aae25c084938dac4aa82d8d2592498b778ae.zip |
bitkeeper revision 1.1236.34.3 (4237063cE2rat5RdEGCsTzuaC6XCcA)
Tidy the x86 emulator interface, and use it from within the
writable pagetable algorithm to deal with otherwise unhandleable cases.
For example: L1 mapped at multiple L2 slots; L1 that maps itself; L1
that also maps the code making the update, or the kernel stack.
This provides a proof-of-concept for the emulator that can be picked
up for the VMX code to improve the device-model emulation.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/tests')
-rw-r--r-- | tools/tests/test_x86_emulator.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/tests/test_x86_emulator.c b/tools/tests/test_x86_emulator.c index 2ccc20f97f..e42d598943 100644 --- a/tools/tests/test_x86_emulator.c +++ b/tools/tests/test_x86_emulator.c @@ -26,7 +26,7 @@ static int read_any( case 4: *val = *(u32 *)addr; break; case 8: *val = *(unsigned long *)addr; break; } - return 0; + return X86EMUL_CONTINUE; } static int write_any( @@ -41,17 +41,15 @@ static int write_any( case 4: *(u32 *)addr = (u32)val; break; case 8: *(unsigned long *)addr = val; break; } - return 0; + return X86EMUL_CONTINUE; } static int cmpxchg_any( unsigned long addr, unsigned long old, unsigned long new, - unsigned long *seen, unsigned int bytes) { - *seen = old; switch ( bytes ) { case 1: *(u8 *)addr = (u8)new; break; @@ -59,7 +57,7 @@ static int cmpxchg_any( case 4: *(u32 *)addr = (u32)new; break; case 8: *(unsigned long *)addr = new; break; } - return 0; + return X86EMUL_CONTINUE; } static struct x86_mem_emulator emulops = { |