system.hh revision 2
1955SN/A/* 2955SN/A * Copyright (c) 2003 The Regents of The University of Michigan 31762SN/A * All rights reserved. 4955SN/A * 5955SN/A * Redistribution and use in source and binary forms, with or without 6955SN/A * modification, are permitted provided that the following conditions are 7955SN/A * met: redistributions of source code must retain the above copyright 8955SN/A * notice, this list of conditions and the following disclaimer; 9955SN/A * redistributions in binary form must reproduce the above copyright 10955SN/A * notice, this list of conditions and the following disclaimer in the 11955SN/A * documentation and/or other materials provided with the distribution; 12955SN/A * neither the name of the copyright holders nor the names of its 13955SN/A * contributors may be used to endorse or promote products derived from 14955SN/A * this software without specific prior written permission. 15955SN/A * 16955SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17955SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18955SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19955SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20955SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21955SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22955SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23955SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24955SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25955SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26955SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27955SN/A */ 282665Ssaidi@eecs.umich.edu 294762Snate@binkert.org#ifndef __SYSTEM_HH__ 30955SN/A#define __SYSTEM_HH__ 315522Snate@binkert.org 326143Snate@binkert.org#include <string> 334762Snate@binkert.org 345522Snate@binkert.org#include "sim_object.hh" 35955SN/A#include "pc_event.hh" 365522Snate@binkert.org#include "symtab.hh" 3711974Sgabeblack@google.com 38955SN/Aclass MemoryController; 395522Snate@binkert.orgclass PhysicalMemory; 404202Sbinkertn@umich.educlass RemoteGDB; 415742Snate@binkert.orgclass GDBListener; 42955SN/A 434381Sbinkertn@umich.educlass ExecContext; 444381Sbinkertn@umich.edu 458334Snate@binkert.orgclass System : public SimObject 46955SN/A{ 47955SN/A private: 484202Sbinkertn@umich.edu 49955SN/A SymbolTable *kernelSymtab; 504382Sbinkertn@umich.edu SymbolTable *consoleSymtab; 514382Sbinkertn@umich.edu 524382Sbinkertn@umich.edu BreakPCEvent kernel_panic_event; 536654Snate@binkert.org BreakPCEvent console_panic_event; 545517Snate@binkert.org BadAddrEvent badaddr_event; 558614Sgblack@eecs.umich.edu SkipFuncEvent skip_power_state; 567674Snate@binkert.org SkipFuncEvent skip_scavenge_boot; 576143Snate@binkert.org PrintfEvent printf_event; 586143Snate@binkert.org DebugPrintfEvent debug_printf_event; 596143Snate@binkert.org DebugPrintfEvent debug_printfr_event; 608233Snate@binkert.org DumpMbufEvent dump_mbuf_event; 618233Snate@binkert.org 628233Snate@binkert.org RegFile *initRegs; 638233Snate@binkert.org 648233Snate@binkert.org Addr kernelStart; 658334Snate@binkert.org Addr kernelEnd; 668334Snate@binkert.org Addr kernelEntry; 6710453SAndrew.Bardsley@arm.com 6810453SAndrew.Bardsley@arm.com public: 698233Snate@binkert.org 708233Snate@binkert.org MemoryController *memCtrl; 718233Snate@binkert.org PhysicalMemory *physmem; 728233Snate@binkert.org 738233Snate@binkert.org PCEventQueue pcEventQueue; 748233Snate@binkert.org 7511983Sgabeblack@google.com ExecContext *xc_array[12/*MAX_CPUS*/]; 7611983Sgabeblack@google.com int num_cpus; 7711983Sgabeblack@google.com 7811983Sgabeblack@google.com RemoteGDB *remoteGDB; 7911983Sgabeblack@google.com GDBListener *gdbListen; 8011983Sgabeblack@google.com 8111983Sgabeblack@google.com System(const std::string name, 8211983Sgabeblack@google.com MemoryController *, PhysicalMemory *, 8311983Sgabeblack@google.com const std::string &kernel_path, const std::string &console_path, 8411983Sgabeblack@google.com const std::string &palcode, const std::string &boot_osflags); 8511983Sgabeblack@google.com 866143Snate@binkert.org ~System(); 878233Snate@binkert.org 888233Snate@binkert.org const SymbolTable *getKernelSymtab() const { return kernelSymtab; } 898233Snate@binkert.org const SymbolTable *getConsoleSymtab() const { return consoleSymtab; } 906143Snate@binkert.org 916143Snate@binkert.org Addr getKernelStart() const { return kernelStart; } 926143Snate@binkert.org Addr getKernelEnd() const { return kernelEnd; } 9311308Santhony.gutierrez@amd.com Addr getKernelEntry() const { return kernelEntry; } 948233Snate@binkert.org 958233Snate@binkert.org void initBootContext(ExecContext *xc); 968233Snate@binkert.org void registerExecContext(ExecContext *xc); 9711983Sgabeblack@google.com 9811983Sgabeblack@google.com //////////////////////////////////////////// 994762Snate@binkert.org // 1006143Snate@binkert.org // STATIC GLOBAL SYSTEM LIST 1018233Snate@binkert.org // 1028233Snate@binkert.org //////////////////////////////////////////// 1038233Snate@binkert.org 1048233Snate@binkert.org public: 1058233Snate@binkert.org 1066143Snate@binkert.org static std::vector<System *> systemList; 1078233Snate@binkert.org 1088233Snate@binkert.org static int numSystemsRunning; 1098233Snate@binkert.org 1108233Snate@binkert.org static void printSystems(); 1116143Snate@binkert.org}; 1126143Snate@binkert.org 1136143Snate@binkert.org#endif // __SYSTEM_HH__ 1146143Snate@binkert.org