system.hh revision 2665
1451SN/A/* 22212SN/A * Copyright (c) 2004-2006 The Regents of The University of Michigan 3451SN/A * All rights reserved. 4451SN/A * 5451SN/A * Redistribution and use in source and binary forms, with or without 6451SN/A * modification, are permitted provided that the following conditions are 7451SN/A * met: redistributions of source code must retain the above copyright 8451SN/A * notice, this list of conditions and the following disclaimer; 9451SN/A * redistributions in binary form must reproduce the above copyright 10451SN/A * notice, this list of conditions and the following disclaimer in the 11451SN/A * documentation and/or other materials provided with the distribution; 12451SN/A * neither the name of the copyright holders nor the names of its 13451SN/A * contributors may be used to endorse or promote products derived from 14451SN/A * this software without specific prior written permission. 15451SN/A * 16451SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17451SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18451SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19451SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20451SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21451SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22451SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23451SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24451SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25451SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26451SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Ali Saidi 292665Ssaidi@eecs.umich.edu * Lisa Hsu 302665Ssaidi@eecs.umich.edu * Nathan Binkert 31451SN/A */ 32451SN/A 332212SN/A#ifndef __ARCH_ALPHA_LINUX_SYSTEM_HH__ 342212SN/A#define __ARCH_ALPHA_LINUX_SYSTEM_HH__ 35451SN/A 36451SN/Aclass ExecContext; 371070SN/A 381070SN/Aclass BreakPCEvent; 391070SN/Aclass IdleStartEvent; 402212SN/A 412212SN/A#include "arch/alpha/system.hh" 422212SN/A#include "kern/linux/events.hh" 432212SN/A 442212SN/Ausing namespace AlphaISA; 452212SN/Ausing namespace Linux; 46451SN/A 47885SN/A/** 48885SN/A * This class contains linux specific system code (Loading, Events, Binning). 49885SN/A * It points to objects that are the system binaries to load and patches them 50885SN/A * appropriately to work in simulator. 51885SN/A */ 522212SN/Aclass LinuxAlphaSystem : public AlphaSystem 53451SN/A{ 54451SN/A private: 551885SN/A class SkipDelayLoopEvent : public SkipFuncEvent 561885SN/A { 571885SN/A public: 581885SN/A SkipDelayLoopEvent(PCEventQueue *q, const std::string &desc, Addr addr) 591885SN/A : SkipFuncEvent(q, desc, addr) {} 601885SN/A virtual void process(ExecContext *xc); 611885SN/A }; 621885SN/A 631885SN/A class PrintThreadInfo : public PCEvent 641885SN/A { 651885SN/A public: 661885SN/A PrintThreadInfo(PCEventQueue *q, const std::string &desc, Addr addr) 671885SN/A : PCEvent(q, desc, addr) {} 681885SN/A virtual void process(ExecContext *xc); 691885SN/A }; 701885SN/A 712212SN/A 721855SN/A /** 731855SN/A * Addresses defining where the kernel bootloader places various 741855SN/A * elements. Details found in include/asm-alpha/system.h 751855SN/A */ 761855SN/A Addr KernelStart; // Lookup the symbol swapper_pg_dir 771855SN/A 781855SN/A public: 791855SN/A Addr InitStack() const { return KernelStart + 0x02000; } 801855SN/A Addr EmptyPGT() const { return KernelStart + 0x04000; } 811855SN/A Addr EmptyPGE() const { return KernelStart + 0x08000; } 821855SN/A Addr ZeroPGE() const { return KernelStart + 0x0A000; } 831855SN/A Addr StartAddr() const { return KernelStart + 0x10000; } 841855SN/A 851855SN/A Addr Param() const { return ZeroPGE() + 0x0; } 861855SN/A Addr CommandLine() const { return Param() + 0x0; } 871855SN/A Addr InitrdStart() const { return Param() + 0x100; } 881855SN/A Addr InitrdSize() const { return Param() + 0x108; } 891855SN/A static const int CommandLineSize = 256; 901855SN/A 911855SN/A private: 921492SN/A#ifndef NDEBUG 93887SN/A /** Event to halt the simulator if the kernel calls panic() */ 94451SN/A BreakPCEvent *kernelPanicEvent; 951492SN/A 961492SN/A /** Event to halt the simulator if the kernel calls die_if_kernel */ 971492SN/A BreakPCEvent *kernelDieEvent; 981070SN/A#endif 99887SN/A 1001070SN/A /** 1011070SN/A * Event to skip determine_cpu_caches() because we don't support 1021070SN/A * the IPRs that the code can access to figure out cache sizes 103887SN/A */ 104885SN/A SkipFuncEvent *skipCacheProbeEvent; 105887SN/A 106887SN/A /** PC based event to skip the ide_delay_50ms() call */ 107885SN/A SkipFuncEvent *skipIdeDelay50msEvent; 108887SN/A 1091070SN/A /** 1101070SN/A * PC based event to skip the dprink() call and emulate its 1111070SN/A * functionality 1121070SN/A */ 1131039SN/A DebugPrintkEvent *debugPrintkEvent; 1141039SN/A 1151070SN/A /** 1161070SN/A * Skip calculate_delay_loop() rather than waiting for this to be 117887SN/A * calculated 118887SN/A */ 1191885SN/A SkipDelayLoopEvent *skipDelayLoopEvent; 120841SN/A 1211082SN/A /** 1221082SN/A * Event to print information about thread switches if the trace flag 1231082SN/A * Thread is set 1241082SN/A */ 1251067SN/A PrintThreadInfo *printThreadEvent; 1261067SN/A 1271082SN/A /** 1281082SN/A * Event to bin Interrupts seperately from kernel code 1291082SN/A */ 1301082SN/A InterruptStartEvent *intStartEvent; 1311082SN/A 1321082SN/A /** 1331082SN/A * Event to bin Interrupts seperately from kernel code 1341082SN/A */ 1351082SN/A InterruptEndEvent *intEndEvent; 1361084SN/A InterruptEndEvent *intEndEvent2; 1371084SN/A InterruptEndEvent *intEndEvent3; 1381082SN/A 1391070SN/A /** Grab the PCBB of the idle process when it starts */ 1401070SN/A IdleStartEvent *idleStartEvent; 141451SN/A 142451SN/A public: 1432212SN/A LinuxAlphaSystem(Params *p); 1442212SN/A ~LinuxAlphaSystem(); 145451SN/A 146803SN/A void setDelayLoop(ExecContext *xc); 147451SN/A}; 148451SN/A 1492212SN/A#endif // __ARCH_ALPHA_LINUX_SYSTEM_HH__ 150