2 * Copyright (c) 2002-2004 The Regents of The University of Michigan
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 #include "base/loader/symtab.hh"
36 #include "base/statistics.hh"
37 #include "cpu/pc_event.hh"
38 #include "kern/system_events.hh"
39 #include "sim/sim_object.hh"
41 class MemoryController;
48 namespace Kernel { class Binning; }
50 class System : public SimObject
53 MemoryController *memctrl;
54 PhysicalMemory *physmem;
56 PCEventQueue pcEventQueue;
59 std::vector<ExecContext *> execContexts;
61 /** kernel Symbol table */
62 SymbolTable *kernelSymtab;
64 /** console symbol table */
65 SymbolTable *consoleSymtab;
67 /** pal symbol table */
68 SymbolTable *palSymtab;
70 /** Object pointer for the kernel code */
73 /** Object pointer for the console code */
76 /** Object pointer for the PAL code */
79 /** Begining of kernel code */
82 /** End of kernel code */
85 /** Entry point in the kernel to start at */
88 Kernel::Binning *kernelBinning;
91 /** Event to halt the simulator if the console calls panic() */
92 BreakPCEvent *consolePanicEvent;
96 std::vector<RemoteGDB *> remoteGDB;
97 std::vector<GDBListener *> gdbListen;
104 MemoryController *memctrl;
105 PhysicalMemory *physmem;
108 std::vector<std::string> binned_fns;
111 std::string kernel_path;
112 std::string console_path;
114 std::string boot_osflags;
116 std::string readfile;
117 uint64_t system_type;
127 * Returns the addess the kernel starts at.
128 * @return address the kernel starts at
130 Addr getKernelStart() const { return kernelStart; }
133 * Returns the addess the kernel ends at.
134 * @return address the kernel ends at
136 Addr getKernelEnd() const { return kernelEnd; }
139 * Returns the addess the entry point to the kernel code.
140 * @return entry point of the kernel code
142 Addr getKernelEntry() const { return kernelEntry; }
144 int registerExecContext(ExecContext *xc);
145 void replaceExecContext(ExecContext *xc, int xcIndex);
148 void serialize(std::ostream &os);
149 void unserialize(Checkpoint *cp, const std::string §ion);
152 ////////////////////////////////////////////
154 // STATIC GLOBAL SYSTEM LIST
156 ////////////////////////////////////////////
158 static std::vector<System *> systemList;
159 static int numSystemsRunning;
161 static void printSystems();
164 #endif // __SYSTEM_HH__