-static int addr_port_read(struct guest_info * core, ushort_t port, void * dst, uint_t length, struct vm_device * dev) {
- struct pci_internal * pci_state = (struct pci_internal *)dev->private_data;
+static int addr_port_read(struct guest_info * core, ushort_t port, void * dst, uint_t length, void * priv_data) {
+ struct pci_internal * pci_state = priv_data;
int reg_offset = port & 0x3;
uint8_t * reg_addr = ((uint8_t *)&(pci_state->addr_reg.val)) + reg_offset;
}
-static int addr_port_write(struct guest_info * core, ushort_t port, void * src, uint_t length, struct vm_device * dev) {
- struct pci_internal * pci_state = (struct pci_internal *)dev->private_data;
+static int addr_port_write(struct guest_info * core, ushort_t port, void * src, uint_t length, void * priv_data) {
+ struct pci_internal * pci_state = priv_data;
int reg_offset = port & 0x3;
uint8_t * reg_addr = ((uint8_t *)&(pci_state->addr_reg.val)) + reg_offset;
}
-static int data_port_read(struct guest_info * core, ushort_t port, void * dst, uint_t length, struct vm_device * vmdev) {
- struct pci_internal * pci_state = (struct pci_internal *)(vmdev->private_data);
+static int data_port_read(struct guest_info * core, ushort_t port, void * dst, uint_t length, void * priv_data) {
+ struct pci_internal * pci_state = priv_data;
struct pci_device * pci_dev = NULL;
uint_t reg_num = (pci_state->addr_reg.reg_num << 2) + (port & 0x3);
int i;
}
-static int data_port_write(struct guest_info * core, ushort_t port, void * src, uint_t length, struct vm_device * vmdev) {
- struct pci_internal * pci_state = (struct pci_internal *)vmdev->private_data;
+static int data_port_write(struct guest_info * core, ushort_t port, void * src, uint_t length, void * priv_data) {
+ struct pci_internal * pci_state = priv_data;
struct pci_device * pci_dev = NULL;
uint_t reg_num = (pci_state->addr_reg.reg_num << 2) + (port & 0x3);
int i;
-static int pci_reset_device(struct vm_device * dev) {
- PrintDebug("pci: reset device\n");
- return 0;
-}
-
-
-static int pci_start_device(struct vm_device * dev) {
- PrintDebug("pci: start device\n");
- return 0;
-}
-
-
-static int pci_stop_device(struct vm_device * dev) {
- PrintDebug("pci: stop device\n");
- return 0;
-}
-
-
-
static int pci_free(struct vm_device * dev) {
- int i = 0;
-
- for (i = 0; i < 4; i++){
- v3_dev_unhook_io(dev, CONFIG_ADDR_PORT + i);
- v3_dev_unhook_io(dev, CONFIG_DATA_PORT + i);
- }
return 0;
}
static struct v3_device_ops dev_ops = {
.free = pci_free,
- .reset = pci_reset_device,
- .start = pci_start_device,
- .stop = pci_stop_device,
+
};