direct-io.hg

changeset 12529:3127a43786d8

[XEN] Small ioemul cleanup.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Nov 23 17:37:23 2006 +0000 (2006-11-23)
parents 62307643804e
children cd40792968cb
files xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Thu Nov 23 17:32:18 2006 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Thu Nov 23 17:37:23 2006 +0000
     1.3 @@ -1046,8 +1046,7 @@ static int emulate_privileged_op(struct 
     1.4      u8 opcode, modrm_reg = 0, modrm_rm = 0, rep_prefix = 0;
     1.5      unsigned int port, i, op_bytes = 4, data, rc;
     1.6      char io_emul_stub[16];
     1.7 -    void (*io_emul)(struct cpu_user_regs *) __attribute__((__regparm__(1))) \
     1.8 -        = (void*)&io_emul_stub[0];
     1.9 +    void (*io_emul)(struct cpu_user_regs *) __attribute__((__regparm__(1)));
    1.10      u32 l, h;
    1.11  
    1.12      /* Legacy prefixes. */
    1.13 @@ -1190,6 +1189,9 @@ static int emulate_privileged_op(struct 
    1.14      *(s32 *)&io_emul_stub[9] =
    1.15          (char *)guest_to_host_gpr_switch - &io_emul_stub[13];
    1.16  
    1.17 +    /* Handy function-typed pointer to the stub. */
    1.18 +    io_emul = (void *)io_emul_stub;
    1.19 +
    1.20      /* I/O Port and Interrupt Flag instructions. */
    1.21      switch ( opcode )
    1.22      {
    1.23 @@ -1207,13 +1209,13 @@ static int emulate_privileged_op(struct 
    1.24              if ( guest_inb_okay(port, v, regs) )
    1.25                  io_emul(regs);
    1.26              else
    1.27 -                regs->eax = (regs->eax & ~0xffUL) | (u8)~0;
    1.28 +                regs->eax |= (u8)~0;
    1.29              break;
    1.30          case 2:
    1.31              if ( guest_inw_okay(port, v, regs) )
    1.32                  io_emul(regs);
    1.33              else
    1.34 -                regs->eax = (regs->eax & ~0xffffUL) | (u16)~0;
    1.35 +                regs->eax |= (u16)~0;
    1.36              break;
    1.37          case 4:
    1.38              if ( guest_inl_okay(port, v, regs) )