system.hh revision 77
17008SN/A/*
27008SN/A * Copyright (c) 2003 The Regents of The University of Michigan
37008SN/A * All rights reserved.
47008SN/A *
57008SN/A * Redistribution and use in source and binary forms, with or without
67008SN/A * modification, are permitted provided that the following conditions are
77008SN/A * met: redistributions of source code must retain the above copyright
87008SN/A * notice, this list of conditions and the following disclaimer;
97008SN/A * redistributions in binary form must reproduce the above copyright
107008SN/A * notice, this list of conditions and the following disclaimer in the
117008SN/A * documentation and/or other materials provided with the distribution;
127008SN/A * neither the name of the copyright holders nor the names of its
137008SN/A * contributors may be used to endorse or promote products derived from
147008SN/A * this software without specific prior written permission.
157008SN/A *
167008SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
177008SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
187008SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
197008SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
207008SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
217008SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
227008SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
237008SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
247008SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
257008SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
267008SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
277008SN/A */
286145SN/A
297039SN/A#ifndef __SYSTEM_HH__
307039SN/A#define __SYSTEM_HH__
316145SN/A
329505SN/A#include <string>
336145SN/A#include <vector>
347039SN/A
357039SN/A#include "sim/sim_object.hh"
367039SN/A#include "cpu/pc_event.hh"
3710314Snilay@cs.wisc.edu#include "base/loader/symtab.hh"
387039SN/A
396145SN/Aclass MemoryController;
407039SN/Aclass PhysicalMemory;
4110314Snilay@cs.wisc.educlass RemoteGDB;
426145SN/Aclass GDBListener;
437039SN/A
4410314Snilay@cs.wisc.educlass ExecContext;
456145SN/A
467039SN/Aclass System : public SimObject
4710314Snilay@cs.wisc.edu{
486145SN/A  public:
497039SN/A    MemoryController *memCtrl;
507039SN/A    PhysicalMemory *physmem;
517039SN/A
529505SN/A    PCEventQueue pcEventQueue;
536145SN/A
546145SN/A    std::vector<ExecContext *> xcvec;
556145SN/A    void registerExecContext(ExecContext *xc);
5610314Snilay@cs.wisc.edu
5710314Snilay@cs.wisc.edu  public:
586145SN/A    System(const std::string name, MemoryController *, PhysicalMemory *);
597039SN/A    ~System();
607039SN/A
619505SN/A    virtual void init(ExecContext *xc) = 0;
627039SN/A
639505SN/A    virtual Addr getKernelStart() const = 0;
647039SN/A    virtual Addr getKernelEnd() const = 0;
657039SN/A    virtual Addr getKernelEntry() const = 0;
667039SN/A    virtual bool breakpoint() = 0;
676145SN/A
686145SN/A
696145SN/A  public:
706145SN/A    ////////////////////////////////////////////
716145SN/A    //
726145SN/A    // STATIC GLOBAL SYSTEM LIST
737039SN/A    //
747039SN/A    ////////////////////////////////////////////
757039SN/A
767039SN/A    static std::vector<System *> systemList;
777039SN/A    static int numSystemsRunning;
787039SN/A
797039SN/A    static void printSystems();
806145SN/A};
816145SN/A
826145SN/A#endif // __SYSTEM_HH__
839505SN/A