direct-io.hg

changeset 14411:670aef15eb55

hvm ioemu: Add support for IOREQ_TYPE_XCHG in qemu-dm.

From: Trolle Selander <trolle.selander@gmail.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Mar 16 16:22:29 2007 +0000 (2007-03-16)
parents f8ef8f466225
children 9e07e0133f52
files tools/ioemu/target-i386-dm/helper2.c
line diff
     1.1 --- a/tools/ioemu/target-i386-dm/helper2.c	Fri Mar 16 16:21:16 2007 +0000
     1.2 +++ b/tools/ioemu/target-i386-dm/helper2.c	Fri Mar 16 16:22:29 2007 +0000
     1.3 @@ -439,6 +439,18 @@ void cpu_ioreq_xor(CPUState *env, ioreq_
     1.4      req->data = tmp1;
     1.5  }
     1.6  
     1.7 +void cpu_ioreq_xchg(CPUState *env, ioreq_t *req)
     1.8 +{
     1.9 +    unsigned long tmp1;
    1.10 +
    1.11 +    if (req->data_is_ptr != 0)
    1.12 +        hw_error("expected scalar value");
    1.13 +
    1.14 +    read_physical(req->addr, req->size, &tmp1);
    1.15 +    write_physical(req->addr, req->size, &req->data);
    1.16 +    req->data = tmp1;
    1.17 +}
    1.18 +
    1.19  void __handle_ioreq(CPUState *env, ioreq_t *req)
    1.20  {
    1.21      if (!req->data_is_ptr && req->dir == IOREQ_WRITE && req->size != 4)
    1.22 @@ -463,6 +475,9 @@ void __handle_ioreq(CPUState *env, ioreq
    1.23      case IOREQ_TYPE_XOR:
    1.24          cpu_ioreq_xor(env, req);
    1.25          break;
    1.26 +    case IOREQ_TYPE_XCHG:
    1.27 +        cpu_ioreq_xchg(env, req);
    1.28 +        break;
    1.29      default:
    1.30          hw_error("Invalid ioreq type 0x%x\n", req->type);
    1.31      }