platform.hh revision 2760:4dbf498165ac
111661Stushar@ece.gatech.edu/*
211661Stushar@ece.gatech.edu * Copyright (c) 2004-2005 The Regents of The University of Michigan
311661Stushar@ece.gatech.edu * All rights reserved.
411661Stushar@ece.gatech.edu *
511661Stushar@ece.gatech.edu * Redistribution and use in source and binary forms, with or without
611661Stushar@ece.gatech.edu * modification, are permitted provided that the following conditions are
711661Stushar@ece.gatech.edu * met: redistributions of source code must retain the above copyright
811661Stushar@ece.gatech.edu * notice, this list of conditions and the following disclaimer;
911661Stushar@ece.gatech.edu * redistributions in binary form must reproduce the above copyright
1011661Stushar@ece.gatech.edu * notice, this list of conditions and the following disclaimer in the
1111661Stushar@ece.gatech.edu * documentation and/or other materials provided with the distribution;
1211661Stushar@ece.gatech.edu * neither the name of the copyright holders nor the names of its
1311661Stushar@ece.gatech.edu * contributors may be used to endorse or promote products derived from
1411661Stushar@ece.gatech.edu * this software without specific prior written permission.
1511661Stushar@ece.gatech.edu *
1611661Stushar@ece.gatech.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1711661Stushar@ece.gatech.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1811661Stushar@ece.gatech.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1911661Stushar@ece.gatech.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2011661Stushar@ece.gatech.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2111661Stushar@ece.gatech.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2211661Stushar@ece.gatech.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2311661Stushar@ece.gatech.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2411661Stushar@ece.gatech.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2511661Stushar@ece.gatech.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2611661Stushar@ece.gatech.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2711661Stushar@ece.gatech.edu *
2811661Stushar@ece.gatech.edu * Authors: Andrew Schultz
2911661Stushar@ece.gatech.edu *          Nathan Binkert
3011661Stushar@ece.gatech.edu */
3111793Sbrandon.potter@amd.com
3211793Sbrandon.potter@amd.com/**
3311661Stushar@ece.gatech.edu * @file
3411661Stushar@ece.gatech.edu * Generic interface for platforms
3511661Stushar@ece.gatech.edu */
3611661Stushar@ece.gatech.edu
3711661Stushar@ece.gatech.edu#ifndef __DEV_PLATFORM_HH__
3811661Stushar@ece.gatech.edu#define __DEV_PLATFORM_HH__
3912334Sgabeblack@google.com
4011661Stushar@ece.gatech.edu#include "sim/sim_object.hh"
4111661Stushar@ece.gatech.edu#include "arch/isa_traits.hh"
4211661Stushar@ece.gatech.edu
4311661Stushar@ece.gatech.educlass PciConfigAll;
4411661Stushar@ece.gatech.educlass IntrControl;
4511661Stushar@ece.gatech.educlass SimConsole;
4611661Stushar@ece.gatech.educlass Uart;
4711661Stushar@ece.gatech.educlass System;
4811661Stushar@ece.gatech.edu
4911661Stushar@ece.gatech.educlass Platform : public SimObject
5011661Stushar@ece.gatech.edu{
5111661Stushar@ece.gatech.edu  public:
5211661Stushar@ece.gatech.edu    /** Pointer to the interrupt controller */
5311661Stushar@ece.gatech.edu    IntrControl *intrctrl;
5411661Stushar@ece.gatech.edu
5511661Stushar@ece.gatech.edu    /** Pointer to the PCI configuration space */
5611661Stushar@ece.gatech.edu    PciConfigAll *pciconfig;
5711661Stushar@ece.gatech.edu
5811661Stushar@ece.gatech.edu    /** Pointer to the UART, set by the uart */
5911661Stushar@ece.gatech.edu    Uart *uart;
6011661Stushar@ece.gatech.edu
6111661Stushar@ece.gatech.edu    /** Pointer to the system for info about the memory system. */
6211661Stushar@ece.gatech.edu    System *system;
6311661Stushar@ece.gatech.edu
6411661Stushar@ece.gatech.edu  public:
6511661Stushar@ece.gatech.edu    Platform(const std::string &name, IntrControl *intctrl);
6611661Stushar@ece.gatech.edu    virtual ~Platform();
6711661Stushar@ece.gatech.edu    virtual void init() { if (pciconfig == NULL) panic("PCI Config not set"); }
6811661Stushar@ece.gatech.edu    virtual void postConsoleInt() = 0;
6911661Stushar@ece.gatech.edu    virtual void clearConsoleInt() = 0;
7011661Stushar@ece.gatech.edu    virtual Tick intrFrequency() = 0;
7111661Stushar@ece.gatech.edu    virtual void postPciInt(int line);
7211661Stushar@ece.gatech.edu    virtual void clearPciInt(int line);
7311661Stushar@ece.gatech.edu    virtual Addr pciToDma(Addr pciAddr) const;
7411661Stushar@ece.gatech.edu};
7511661Stushar@ece.gatech.edu
7611661Stushar@ece.gatech.edu#endif // __DEV_PLATFORM_HH__
7711661Stushar@ece.gatech.edu