platform.hh revision 4059:e9cef915589f
14227SN/A/* 23294SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 33294SN/A * All rights reserved. 43294SN/A * 53294SN/A * Redistribution and use in source and binary forms, with or without 63294SN/A * modification, are permitted provided that the following conditions are 73294SN/A * met: redistributions of source code must retain the above copyright 83294SN/A * notice, this list of conditions and the following disclaimer; 93294SN/A * redistributions in binary form must reproduce the above copyright 103294SN/A * notice, this list of conditions and the following disclaimer in the 113294SN/A * documentation and/or other materials provided with the distribution; 123294SN/A * neither the name of the copyright holders nor the names of its 133294SN/A * contributors may be used to endorse or promote products derived from 143294SN/A * this software without specific prior written permission. 153294SN/A * 163294SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 173294SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 183294SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 193294SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 203294SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 213294SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 223294SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 233294SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 243294SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 253294SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 263294SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 273294SN/A * 283294SN/A * Authors: Andrew Schultz 296654SN/A * Nathan Binkert 303671SN/A */ 313671SN/A 324227SN/A/** 3311851Sbrandon.potter@amd.com * @file 34 * Generic interface for platforms 35 */ 36 37#ifndef __DEV_PLATFORM_HH__ 38#define __DEV_PLATFORM_HH__ 39 40#include <bitset> 41#include <set> 42 43#include "sim/sim_object.hh" 44#include "arch/isa_traits.hh" 45 46class PciConfigAll; 47class IntrControl; 48class SimConsole; 49class Uart; 50class System; 51 52class Platform : public SimObject 53{ 54 public: 55 /** Pointer to the interrupt controller */ 56 IntrControl *intrctrl; 57 58 /** Pointer to the system for info about the memory system. */ 59 System *system; 60 61 public: 62 Platform(const std::string &name, IntrControl *intctrl); 63 virtual ~Platform(); 64 virtual void postConsoleInt() = 0; 65 virtual void clearConsoleInt() = 0; 66 virtual Tick intrFrequency() = 0; 67 virtual void postPciInt(int line); 68 virtual void clearPciInt(int line); 69 virtual Addr pciToDma(Addr pciAddr) const; 70 virtual Addr calcConfigAddr(int bus, int dev, int func) = 0; 71 virtual void registerPciDevice(uint8_t bus, uint8_t dev, uint8_t func, 72 uint8_t intr); 73 74 private: 75 std::bitset<256> intLines; 76 std::set<uint32_t> pciDevices; 77 78}; 79 80#endif // __DEV_PLATFORM_HH__ 81