mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-29 20:54:03 +00:00
pci: Use proper PCI port names
[ penberg@cs.helsinki.fi: rename ops and variables ] Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
committed by
Will Deacon
parent
60742802dc
commit
305b72cefd
@@ -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 */
|
||||
|
||||
@@ -4,48 +4,48 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user