From daa579fc0f3aca4e042068862b022095734b41d9 Mon Sep 17 00:00:00 2001 From: Andrew Schultz Date: Thu, 5 Feb 2004 02:25:45 -0500 Subject: 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 --- dev/pciconfigall.cc | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'dev/pciconfigall.cc') 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 §ion) //code should be written } +#ifndef DOXYGEN_SHOULD_SKIP_THIS + BEGIN_DECLARE_SIM_OBJECT_PARAMS(PCIConfigAll) SimObjectParam tsunami; @@ -159,3 +186,5 @@ CREATE_SIM_OBJECT(PCIConfigAll) } REGISTER_SIM_OBJECT("PCIConfigAll", PCIConfigAll) + +#endif // DOXYGEN_SHOULD_SKIP_THIS -- cgit v1.2.3