system.hh revision 180
15390SN/A/*
25445SN/A * Copyright (c) 2003 The Regents of The University of Michigan
35390SN/A * All rights reserved.
45390SN/A *
55390SN/A * Redistribution and use in source and binary forms, with or without
65390SN/A * modification, are permitted provided that the following conditions are
75390SN/A * met: redistributions of source code must retain the above copyright
85390SN/A * notice, this list of conditions and the following disclaimer;
95390SN/A * redistributions in binary form must reproduce the above copyright
105390SN/A * notice, this list of conditions and the following disclaimer in the
115390SN/A * documentation and/or other materials provided with the distribution;
125390SN/A * neither the name of the copyright holders nor the names of its
135390SN/A * contributors may be used to endorse or promote products derived from
145390SN/A * this software without specific prior written permission.
155390SN/A *
165390SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
175390SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
185390SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
195390SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
205390SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
215390SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
225390SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
235390SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
245390SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
255390SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
265390SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
275390SN/A */
285390SN/A
295390SN/A#ifndef __SYSTEM_HH__
305390SN/A#define __SYSTEM_HH__
315390SN/A
325445SN/A#include <string>
338232Snate@binkert.org#include <vector>
345636Sgblack@eecs.umich.edu
355636Sgblack@eecs.umich.edu#include "sim/sim_object.hh"
365636Sgblack@eecs.umich.edu#include "cpu/pc_event.hh"
375390SN/A#include "base/loader/symtab.hh"
385390SN/A
395390SN/Aclass MemoryController;
405390SN/Aclass PhysicalMemory;
415390SN/Aclass RemoteGDB;
425636Sgblack@eecs.umich.educlass GDBListener;
435390SN/A
445636Sgblack@eecs.umich.educlass ExecContext;
455636Sgblack@eecs.umich.edu
465445SN/Aclass System : public SimObject
475445SN/A{
485445SN/A  public:
495445SN/A    const int init_param;
505445SN/A    MemoryController *memCtrl;
515898Sgblack@eecs.umich.edu    PhysicalMemory *physmem;
525390SN/A
535390SN/A    PCEventQueue pcEventQueue;
545390SN/A
555390SN/A    std::vector<ExecContext *> execContexts;
565390SN/A
575390SN/A    virtual int registerExecContext(ExecContext *xc);
585636Sgblack@eecs.umich.edu    virtual void replaceExecContext(int xcIndex, ExecContext *xc);
595390SN/A
605390SN/A  public:
615445SN/A    System(const std::string _name, const int _init_param,
625445SN/A           MemoryController *, PhysicalMemory *);
635445SN/A    ~System();
645445SN/A
655445SN/A    virtual Addr getKernelStart() const = 0;
665445SN/A    virtual Addr getKernelEnd() const = 0;
675445SN/A    virtual Addr getKernelEntry() const = 0;
685445SN/A    virtual bool breakpoint() = 0;
695445SN/A
705636Sgblack@eecs.umich.edu
715445SN/A  public:
725898Sgblack@eecs.umich.edu    ////////////////////////////////////////////
735390SN/A    //
745390SN/A    // STATIC GLOBAL SYSTEM LIST
755636Sgblack@eecs.umich.edu    //
767903Shestness@cs.utexas.edu    ////////////////////////////////////////////
7710905Sandreas.sandberg@arm.com
787903Shestness@cs.utexas.edu    static std::vector<System *> systemList;
797903Shestness@cs.utexas.edu    static int numSystemsRunning;
807903Shestness@cs.utexas.edu
817903Shestness@cs.utexas.edu    static void printSystems();
827903Shestness@cs.utexas.edu};
837903Shestness@cs.utexas.edu
8410905Sandreas.sandberg@arm.com#endif // __SYSTEM_HH__
857903Shestness@cs.utexas.edu