[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [XEN] Small ioemul cleanup.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 3127a43786d801dc27d7ff47e24268d1ed1da240
# Parent  62307643804e069200361d729d598ae92bb14a8b
[XEN] Small ioemul cleanup.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/traps.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -r 62307643804e -r 3127a43786d8 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Thu Nov 23 17:32:18 2006 +0000
+++ b/xen/arch/x86/traps.c      Thu Nov 23 17:37:23 2006 +0000
@@ -1046,8 +1046,7 @@ static int emulate_privileged_op(struct 
     u8 opcode, modrm_reg = 0, modrm_rm = 0, rep_prefix = 0;
     unsigned int port, i, op_bytes = 4, data, rc;
     char io_emul_stub[16];
-    void (*io_emul)(struct cpu_user_regs *) __attribute__((__regparm__(1))) \
-        = (void*)&io_emul_stub[0];
+    void (*io_emul)(struct cpu_user_regs *) __attribute__((__regparm__(1)));
     u32 l, h;
 
     /* Legacy prefixes. */
@@ -1190,6 +1189,9 @@ static int emulate_privileged_op(struct 
     *(s32 *)&io_emul_stub[9] =
         (char *)guest_to_host_gpr_switch - &io_emul_stub[13];
 
+    /* Handy function-typed pointer to the stub. */
+    io_emul = (void *)io_emul_stub;
+
     /* I/O Port and Interrupt Flag instructions. */
     switch ( opcode )
     {
@@ -1207,13 +1209,13 @@ static int emulate_privileged_op(struct 
             if ( guest_inb_okay(port, v, regs) )
                 io_emul(regs);
             else
-                regs->eax = (regs->eax & ~0xffUL) | (u8)~0;
+                regs->eax |= (u8)~0;
             break;
         case 2:
             if ( guest_inw_okay(port, v, regs) )
                 io_emul(regs);
             else
-                regs->eax = (regs->eax & ~0xffffUL) | (u16)~0;
+                regs->eax |= (u16)~0;
             break;
         case 4:
             if ( guest_inl_okay(port, v, regs) )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.