summaryrefslogtreecommitdiff
path: root/dev/pciconfigall.cc
diff options
context:
space:
mode:
authorAndrew Schultz <alschult@umich.edu>2004-02-05 02:25:45 -0500
committerAndrew Schultz <alschult@umich.edu>2004-02-05 02:25:45 -0500
commitdaa579fc0f3aca4e042068862b022095734b41d9 (patch)
tree744e2c54646847ea6474aa338700e7f03e6da785 /dev/pciconfigall.cc
parent69e1e10f5d940ee06d2c38f3a1b21c9992587f13 (diff)
downloadgem5-daa579fc0f3aca4e042068862b022095734b41d9.tar.xz
Fix PCI code so it builds properly now
dev/pciconfigall.cc: dev/pciconfigall.hh: dev/pcidev.cc: dev/pcidev.hh: dev/tsunami.cc: dev/tsunami.hh: A bunch of changes to clean up new PCI code and to fix build --HG-- extra : convert_revision : 71063bcc565c50fc293b323ddce2c8e701f544ff
Diffstat (limited to 'dev/pciconfigall.cc')
-rw-r--r--dev/pciconfigall.cc43
1 files changed, 36 insertions, 7 deletions
diff --git a/dev/pciconfigall.cc b/dev/pciconfigall.cc
index 85380c75c..1b19ec368 100644
--- a/dev/pciconfigall.cc
+++ b/dev/pciconfigall.cc
@@ -1,4 +1,30 @@
-/* $Id$ */
+/*
+ * Copyright (c) 2003 The Regents of The University of Michigan
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
/* @file
* PCI Configspace implementation
@@ -25,7 +51,7 @@ PCIConfigAll::PCIConfigAll(const string &name, Tsunami *t,
Addr addr, Addr mask, MemoryController *mmu)
: MmapDevice(name, addr, mask, mmu), tsunami(t)
{
- //Put back pointer in tsunami
+ // Put back pointer in tsunami
tsunami->pciconfig = this;
// Make all the pointers to devices null
@@ -75,7 +101,8 @@ PCIConfigAll::read(MemReqPtr &req, uint8_t *data)
}
}
- DPRINTFN("Tsunami PCI Configspace ERROR: read daddr=%#x size=%d\n", daddr, req->size);
+ DPRINTFN("Tsunami PCI Configspace ERROR: read daddr=%#x size=%d\n",
+ daddr, req->size);
return No_Fault;
}
@@ -83,7 +110,6 @@ PCIConfigAll::read(MemReqPtr &req, uint8_t *data)
Fault
PCIConfigAll::write(MemReqPtr &req, const uint8_t *data)
{
-
Addr daddr = (req->paddr & addr_mask);
int device = (daddr >> 11) & 0x1F;
@@ -96,7 +122,6 @@ PCIConfigAll::write(MemReqPtr &req, const uint8_t *data)
uint32_t word_value;
};
-
if (devices[device][func] == NULL)
panic("Attempting to write to config space on non-existant device\n");
else {
@@ -114,15 +139,15 @@ PCIConfigAll::write(MemReqPtr &req, const uint8_t *data)
panic("invalid access size(?) for PCI configspace!\n");
}
}
+
DPRINTF(PCIConfigAll, "write - va=%#x size=%d data=%#x\n",
req->vaddr, req->size, word_value);
- devices[device][func]->WriteConfig(reg, req->size, word_value);
+ devices[device][func]->WriteConfig(reg, req->size, word_value);
return No_Fault;
}
-
void
PCIConfigAll::serialize(std::ostream &os)
{
@@ -135,6 +160,8 @@ PCIConfigAll::unserialize(Checkpoint *cp, const std::string &section)
//code should be written
}
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
BEGIN_DECLARE_SIM_OBJECT_PARAMS(PCIConfigAll)
SimObjectParam<Tsunami *> tsunami;
@@ -159,3 +186,5 @@ CREATE_SIM_OBJECT(PCIConfigAll)
}
REGISTER_SIM_OBJECT("PCIConfigAll", PCIConfigAll)
+
+#endif // DOXYGEN_SHOULD_SKIP_THIS