platform.hh revision 1762
111663Stushar@ece.gatech.edu/*
211663Stushar@ece.gatech.edu * Copyright (c) 2004-2005 The Regents of The University of Michigan
311663Stushar@ece.gatech.edu * All rights reserved.
411663Stushar@ece.gatech.edu *
511663Stushar@ece.gatech.edu * Redistribution and use in source and binary forms, with or without
611663Stushar@ece.gatech.edu * modification, are permitted provided that the following conditions are
711663Stushar@ece.gatech.edu * met: redistributions of source code must retain the above copyright
811663Stushar@ece.gatech.edu * notice, this list of conditions and the following disclaimer;
911663Stushar@ece.gatech.edu * redistributions in binary form must reproduce the above copyright
1011663Stushar@ece.gatech.edu * notice, this list of conditions and the following disclaimer in the
1111663Stushar@ece.gatech.edu * documentation and/or other materials provided with the distribution;
1211663Stushar@ece.gatech.edu * neither the name of the copyright holders nor the names of its
1311663Stushar@ece.gatech.edu * contributors may be used to endorse or promote products derived from
1411663Stushar@ece.gatech.edu * this software without specific prior written permission.
1511663Stushar@ece.gatech.edu *
1611663Stushar@ece.gatech.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1711663Stushar@ece.gatech.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1811663Stushar@ece.gatech.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1911663Stushar@ece.gatech.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2011663Stushar@ece.gatech.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2111663Stushar@ece.gatech.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2211663Stushar@ece.gatech.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2311663Stushar@ece.gatech.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2411663Stushar@ece.gatech.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2511663Stushar@ece.gatech.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2611663Stushar@ece.gatech.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2711663Stushar@ece.gatech.edu */
2811663Stushar@ece.gatech.edu
2911663Stushar@ece.gatech.edu/**
3011663Stushar@ece.gatech.edu * @file
3111663Stushar@ece.gatech.edu * Generic interface for platforms
3211663Stushar@ece.gatech.edu */
3311663Stushar@ece.gatech.edu
3411663Stushar@ece.gatech.edu#ifndef __DEV_PLATFORM_HH__
3511663Stushar@ece.gatech.edu#define __DEV_PLATFORM_HH__
3611663Stushar@ece.gatech.edu
3711663Stushar@ece.gatech.edu#include "sim/sim_object.hh"
3811663Stushar@ece.gatech.edu#include "targetarch/isa_traits.hh"
3911663Stushar@ece.gatech.edu
4011663Stushar@ece.gatech.educlass PciConfigAll;
4111663Stushar@ece.gatech.educlass IntrControl;
4211663Stushar@ece.gatech.educlass SimConsole;
4311663Stushar@ece.gatech.educlass Uart;
4411663Stushar@ece.gatech.edu
4511663Stushar@ece.gatech.educlass Platform : public SimObject
4611663Stushar@ece.gatech.edu{
4711663Stushar@ece.gatech.edu  public:
4811663Stushar@ece.gatech.edu    /** Pointer to the interrupt controller */
4911663Stushar@ece.gatech.edu    IntrControl *intrctrl;
5011663Stushar@ece.gatech.edu
5111663Stushar@ece.gatech.edu    /** Pointer to the PCI configuration space */
5211663Stushar@ece.gatech.edu    PciConfigAll *pciconfig;
5311663Stushar@ece.gatech.edu
5411663Stushar@ece.gatech.edu    /** Pointer to the UART, set by the uart */
5511663Stushar@ece.gatech.edu    Uart *uart;
5611663Stushar@ece.gatech.edu
5711663Stushar@ece.gatech.edu  public:
5811663Stushar@ece.gatech.edu    Platform(const std::string &name, IntrControl *intctrl, PciConfigAll *pci);
5911663Stushar@ece.gatech.edu    virtual ~Platform();
6011663Stushar@ece.gatech.edu    virtual void postConsoleInt() = 0;
6111663Stushar@ece.gatech.edu    virtual void clearConsoleInt() = 0;
6211663Stushar@ece.gatech.edu    virtual Tick intrFrequency() = 0;
6311663Stushar@ece.gatech.edu    virtual void postPciInt(int line);
6411663Stushar@ece.gatech.edu    virtual void clearPciInt(int line);
6511663Stushar@ece.gatech.edu    virtual Addr pciToDma(Addr pciAddr) const;
6611663Stushar@ece.gatech.edu};
6711663Stushar@ece.gatech.edu
6811663Stushar@ece.gatech.edu#endif // __DEV_PLATFORM_HH__
6911663Stushar@ece.gatech.edu