projects
/
gem5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge zizzer:/bk/m5 into vm1.reinhardt.house:/z/stever/bk/m5
[gem5.git]
/
dev
/
pcidev.cc
diff --git
a/dev/pcidev.cc
b/dev/pcidev.cc
index 0c64bcb94c6ce37db0f753f3c136ea6c1db3812a..9d568e6cce2f83634f9dd1f4ad2bc3566bccbe7e 100644
(file)
--- a/
dev/pcidev.cc
+++ b/
dev/pcidev.cc
@@
-39,19
+39,20
@@
#include "base/misc.hh"
#include "base/str.hh" // for to_number
#include "base/trace.hh"
#include "base/misc.hh"
#include "base/str.hh" // for to_number
#include "base/trace.hh"
-#include "dev/pciareg.h"
#include "dev/pcidev.hh"
#include "dev/pciconfigall.hh"
#include "dev/pcidev.hh"
#include "dev/pciconfigall.hh"
-#include "mem/functional_mem/memory_control.hh"
+#include "mem/bus/bus.hh"
+#include "mem/functional/memory_control.hh"
#include "sim/builder.hh"
#include "sim/param.hh"
#include "sim/builder.hh"
#include "sim/param.hh"
-#include "sim/
universe
.hh"
+#include "sim/
root
.hh"
#include "dev/tsunamireg.h"
using namespace std;
PciDev::PciDev(Params *p)
#include "dev/tsunamireg.h"
using namespace std;
PciDev::PciDev(Params *p)
- : DmaDevice(p->name), _params(p), plat(p->plat), configData(p->configData)
+ : DmaDevice(p->name, p->plat), _params(p), plat(p->plat),
+ configData(p->configData)
{
// copy the config data from the PciConfigData object
if (configData) {
{
// copy the config data from the PciConfigData object
if (configData) {
@@
-72,6
+73,9
@@
PciDev::PciDev(Params *p)
void
PciDev::ReadConfig(int offset, int size, uint8_t *data)
{
void
PciDev::ReadConfig(int offset, int size, uint8_t *data)
{
+ if (offset >= PCI_DEVICE_SPECIFIC)
+ panic("Device specific PCI config space not implemented!\n");
+
switch(size) {
case sizeof(uint32_t):
memcpy((uint8_t*)data, config.data + offset, sizeof(uint32_t));
switch(size) {
case sizeof(uint32_t):
memcpy((uint8_t*)data, config.data + offset, sizeof(uint32_t));
@@
-107,6
+111,9
@@
PciDev::ReadConfig(int offset, int size, uint8_t *data)
void
PciDev::WriteConfig(int offset, int size, uint32_t data)
{
void
PciDev::WriteConfig(int offset, int size, uint32_t data)
{
+ if (offset >= PCI_DEVICE_SPECIFIC)
+ panic("Device specific PCI config space not implemented!\n");
+
uint32_t barnum;
union {
uint32_t barnum;
union {
@@
-181,7
+188,8
@@
PciDev::WriteConfig(int offset, int size, uint32_t data)
// This is I/O Space, bottom two bits are read only
if(htoa(config.data[offset]) & 0x1) {
// This is I/O Space, bottom two bits are read only
if(htoa(config.data[offset]) & 0x1) {
- *(uint32_t *)&config.data[offset] = htoa((word_value & ~0x3) |
+ *(uint32_t *)&config.data[offset] =
+ htoa((word_value & ~0x3) |
(htoa(config.data[offset]) & 0x3));
if (word_value & ~0x1) {
(htoa(config.data[offset]) & 0x3));
if (word_value & ~0x1) {
@@
-203,7
+211,8
@@
PciDev::WriteConfig(int offset, int size, uint32_t data)
} else {
// This is memory space, bottom four bits are read only
} else {
// This is memory space, bottom four bits are read only
- *(uint32_t *)&config.data[offset] = htoa((word_value & ~0xF) |
+ *(uint32_t *)&config.data[offset] =
+ htoa((word_value & ~0xF) |
(htoa(config.data[offset]) & 0xF));
if (word_value & ~0x3) {
(htoa(config.data[offset]) & 0xF));
if (word_value & ~0x3) {