aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyen Anh Quynh <aquynh@gmail.com>2007-06-03 10:41:13 +0300
committerAvi Kivity <avi@qumranet.com>2007-06-03 10:41:13 +0300
commit3b7b2bf04a23f9c58900fd9bb391ba0df286a9dd (patch)
treebef3d0d41a7946b39d69661e08f8cb646eafa092
parent56646358689edfa42d9b85afa3097b7b1fc502f1 (diff)
Use symbol insted of number
This patch makes hypercall.c use symbol instead of number with hypercall-ioport-size. Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
-rw-r--r--hw/hypercall.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/hypercall.c b/hw/hypercall.c
index 2a42bb8a0..08d27449e 100644
--- a/hw/hypercall.c
+++ b/hw/hypercall.c
@@ -26,6 +26,8 @@
#include "hypercall.h"
#include <stddef.h>
+#define HYPERCALL_IOPORT_SIZE 0x100
+
static int use_hypercall_dev = 0;
typedef struct VmChannelCharDriverState {
@@ -183,8 +185,8 @@ static void hp_map(PCIDevice *pci_dev, int region_num,
PCIHypercallState *d = (PCIHypercallState *)pci_dev;
HypercallState *s = &d->hp;
- register_ioport_write(addr, 0x100, 1, hp_ioport_write, s);
- register_ioport_read(addr, 0x100, 1, hp_ioport_read, s);
+ register_ioport_write(addr, HYPERCALL_IOPORT_SIZE, 1, hp_ioport_write, s);
+ register_ioport_read(addr, HYPERCALL_IOPORT_SIZE, 1, hp_ioport_read, s);
}
@@ -273,7 +275,7 @@ static void pci_hypercall_single_init(PCIBus *bus, uint32_t deviceid, uint32_t i
pci_conf[0x0e] = 0x00; // header_type
pci_conf[0x3d] = 1; // interrupt pin 0
- pci_register_io_region(&d->dev, 0, 0x100,
+ pci_register_io_region(&d->dev, 0, HYPERCALL_IOPORT_SIZE,
PCI_ADDRESS_SPACE_IO, hp_map);
s = &d->hp;
pHypercallStates[index] = s;