From 8baccdc6d3239376e547a391b2adb5c6f1d442ad Mon Sep 17 00:00:00 2001 From: Andrew Schultz Date: Mon, 22 Mar 2004 16:50:09 -0500 Subject: Changed to inherit from DmaDevice to avoid multiple inheritance (now assumes that all PCI devices are DmaDevices, and if not, they can just ignore the DMA stuff) --HG-- extra : convert_revision : aa58b658370696674ca4c32b265bc0400e5dda5a --- dev/pcidev.cc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'dev/pcidev.cc') diff --git a/dev/pcidev.cc b/dev/pcidev.cc index 0e0b7f840..2b07c0fed 100644 --- a/dev/pcidev.cc +++ b/dev/pcidev.cc @@ -40,7 +40,6 @@ #include "base/str.hh" // for to_number #include "base/trace.hh" #include "dev/pciareg.h" -#include "dev/scsi_ctrl.hh" #include "dev/pcidev.hh" #include "dev/pciconfigall.hh" #include "mem/functional_mem/memory_control.hh" @@ -53,8 +52,8 @@ using namespace std; PciDev::PciDev(const string &name, MemoryController *mmu, PciConfigAll *cf, PciConfigData *cd, uint32_t bus, uint32_t dev, uint32_t func) - : FunctionalMemory(name), MMU(mmu), ConfigSpace(cf), ConfigData(cd), - Bus(bus), Device(dev), Function(func) + : DmaDevice(name), MMU(mmu), ConfigSpace(cf), ConfigData(cd), BusNum(bus), + DeviceNum(dev), FunctionNum(func) { // copy the config data from the PciConfigData object if (cd) { @@ -79,21 +78,24 @@ PciDev::ReadConfig(int offset, int size, uint8_t *data) memcpy((uint32_t*)data, config.data + offset, sizeof(uint32_t)); DPRINTF(PCIDEV, "read device: %#x function: %#x register: %#x data: %#x\n", - Device, Function, offset, *(uint32_t*)(config.data + offset)); + DeviceNum, FunctionNum, offset, + *(uint32_t*)(config.data + offset)); break; case sizeof(uint16_t): memcpy((uint16_t*)data, config.data + offset, sizeof(uint16_t)); DPRINTF(PCIDEV, "read device: %#x function: %#x register: %#x data: %#x\n", - Device, Function, offset, *(uint16_t*)(config.data + offset)); + DeviceNum, FunctionNum, offset, + *(uint16_t*)(config.data + offset)); break; case sizeof(uint8_t): memcpy((uint8_t*)data, config.data + offset, sizeof(uint8_t)); DPRINTF(PCIDEV, "read device: %#x function: %#x register: %#x data: %#x\n", - Device, Function, offset, (uint16_t)(*(uint8_t*)(config.data + offset))); + DeviceNum, FunctionNum, offset, + (uint16_t)(*(uint8_t*)(config.data + offset))); break; default: @@ -115,7 +117,7 @@ PciDev::WriteConfig(int offset, int size, uint32_t data) DPRINTF(PCIDEV, "write device: %#x function: %#x reg: %#x size: %#x data: %#x\n", - Device, Function, offset, size, word_value); + DeviceNum, FunctionNum, offset, size, word_value); barnum = (offset - PCI0_BASE_ADDR0) >> 2; @@ -184,11 +186,11 @@ PciDev::WriteConfig(int offset, int size, uint32_t data) // It's never been set if (BARAddrs[barnum] == 0) - MMU->add_child(this, + MMU->add_child((FunctionalMemory *)this, Range(base_addr, base_addr + base_size)); else - MMU->update_child(this, + MMU->update_child((FunctionalMemory *)this, Range(BARAddrs[barnum], BARAddrs[barnum] + base_size), @@ -212,11 +214,11 @@ PciDev::WriteConfig(int offset, int size, uint32_t data) // It's never been set if (BARAddrs[barnum] == 0) - MMU->add_child(this, + MMU->add_child((FunctionalMemory *)this, Range(base_addr, base_addr + base_size)); else - MMU->update_child(this, + MMU->update_child((FunctionalMemory *)this, Range(BARAddrs[barnum], BARAddrs[barnum] + base_size), -- cgit v1.2.3 From c8640365c2fef06fe30981cb14df986780e8c7ef Mon Sep 17 00:00:00 2001 From: Andrew Schultz Date: Mon, 22 Mar 2004 16:58:18 -0500 Subject: Change member variable names to lower case --HG-- extra : convert_revision : 390c30b8313e7acbd7d77b106716f7147d181111 --- dev/pcidev.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'dev/pcidev.cc') diff --git a/dev/pcidev.cc b/dev/pcidev.cc index 2b07c0fed..4852fc581 100644 --- a/dev/pcidev.cc +++ b/dev/pcidev.cc @@ -52,8 +52,8 @@ using namespace std; PciDev::PciDev(const string &name, MemoryController *mmu, PciConfigAll *cf, PciConfigData *cd, uint32_t bus, uint32_t dev, uint32_t func) - : DmaDevice(name), MMU(mmu), ConfigSpace(cf), ConfigData(cd), BusNum(bus), - DeviceNum(dev), FunctionNum(func) + : DmaDevice(name), mmu(mmu), configSpace(cf), configData(cd), busNum(bus), + deviceNum(dev), functionNum(func) { // copy the config data from the PciConfigData object if (cd) { @@ -78,7 +78,7 @@ PciDev::ReadConfig(int offset, int size, uint8_t *data) memcpy((uint32_t*)data, config.data + offset, sizeof(uint32_t)); DPRINTF(PCIDEV, "read device: %#x function: %#x register: %#x data: %#x\n", - DeviceNum, FunctionNum, offset, + deviceNum, functionNum, offset, *(uint32_t*)(config.data + offset)); break; @@ -86,7 +86,7 @@ PciDev::ReadConfig(int offset, int size, uint8_t *data) memcpy((uint16_t*)data, config.data + offset, sizeof(uint16_t)); DPRINTF(PCIDEV, "read device: %#x function: %#x register: %#x data: %#x\n", - DeviceNum, FunctionNum, offset, + deviceNum, functionNum, offset, *(uint16_t*)(config.data + offset)); break; @@ -94,7 +94,7 @@ PciDev::ReadConfig(int offset, int size, uint8_t *data) memcpy((uint8_t*)data, config.data + offset, sizeof(uint8_t)); DPRINTF(PCIDEV, "read device: %#x function: %#x register: %#x data: %#x\n", - DeviceNum, FunctionNum, offset, + deviceNum, functionNum, offset, (uint16_t)(*(uint8_t*)(config.data + offset))); break; @@ -117,7 +117,7 @@ PciDev::WriteConfig(int offset, int size, uint32_t data) DPRINTF(PCIDEV, "write device: %#x function: %#x reg: %#x size: %#x data: %#x\n", - DeviceNum, FunctionNum, offset, size, word_value); + deviceNum, functionNum, offset, size, word_value); barnum = (offset - PCI0_BASE_ADDR0) >> 2; @@ -186,11 +186,11 @@ PciDev::WriteConfig(int offset, int size, uint32_t data) // It's never been set if (BARAddrs[barnum] == 0) - MMU->add_child((FunctionalMemory *)this, + mmu->add_child((FunctionalMemory *)this, Range(base_addr, base_addr + base_size)); else - MMU->update_child((FunctionalMemory *)this, + mmu->update_child((FunctionalMemory *)this, Range(BARAddrs[barnum], BARAddrs[barnum] + base_size), @@ -214,11 +214,11 @@ PciDev::WriteConfig(int offset, int size, uint32_t data) // It's never been set if (BARAddrs[barnum] == 0) - MMU->add_child((FunctionalMemory *)this, + mmu->add_child((FunctionalMemory *)this, Range(base_addr, base_addr + base_size)); else - MMU->update_child((FunctionalMemory *)this, + mmu->update_child((FunctionalMemory *)this, Range(BARAddrs[barnum], BARAddrs[barnum] + base_size), -- cgit v1.2.3