From 305b72cefdfc99a1ca12a476fcd563cff43087ee Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 31 Jul 2010 17:50:15 +0400 Subject: [PATCH] pci: Use proper PCI port names [ penberg@cs.helsinki.fi: rename ops and variables ] Signed-off-by: Cyrill Gorcunov --- include/kvm/pci.h | 4 ++++ pci.c | 34 +++++++++++++++++----------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/include/kvm/pci.h b/include/kvm/pci.h index 6f0c05a..2d743a9 100644 --- a/include/kvm/pci.h +++ b/include/kvm/pci.h @@ -1,6 +1,10 @@ #ifndef KVM__PCI_H #define KVM__PCI_H +/* some known offsets and register names */ +#define PCI_CONFIG_ADDRESS 0xcf8 +#define PCI_CONFIG_DATA 0xcfc + void pci__init(void); #endif /* KVM__PCI_H */ diff --git a/pci.c b/pci.c index 2c49df9..737528c 100644 --- a/pci.c +++ b/pci.c @@ -4,48 +4,48 @@ #include -static uint32_t pci_cse; /* PCI configuration space enable */ +static uint32_t pci_config_address; -static bool pci_cse_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) +static bool pci_config_address_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) { - uint32_t *p = data; + uint32_t *addr = data; - pci_cse = *p; + pci_config_address = *p; return true; } -static bool pci_cse_in(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) +static bool pci_config_address_in(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) { - uint32_t *p = data; + uint32_t *addr = data; - *p = pci_cse; + *addr = pci_config_address; return true; } -static struct ioport_operations pci_cse_ops = { - .io_in = pci_cse_in, - .io_out = pci_cse_out, +static struct ioport_operations pci_config_address_ops = { + .io_in = pci_config_address_in, + .io_out = pci_config_address_out, }; -static bool pci_mechanism_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) +static bool pci_config_data_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) { return true; } -static bool pci_mechanism_in(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) +static bool pci_config_data_in(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) { return true; } -static struct ioport_operations pci_mechanism_ops = { - .io_in = pci_mechanism_in, - .io_out = pci_mechanism_out, +static struct ioport_operations pci_config_data_ops = { + .io_in = pci_config_data_in, + .io_out = pci_config_data_out, }; void pci__init(void) { - ioport__register(0xcfb, &pci_mechanism_ops); - ioport__register(0xcf8, &pci_cse_ops); + ioport__register(PCI_CONFIG_DATA, &pci_config_data_ops); + ioport__register(PCI_CONFIG_ADDRESS, &pci_config_address_ops); }