system.hh revision 1070
110355SGeoffrey.Blake@arm.com/*
28839Sandreas.hansson@arm.com * Copyright (c) 2004 The Regents of The University of Michigan
38839Sandreas.hansson@arm.com * All rights reserved.
48839Sandreas.hansson@arm.com *
58839Sandreas.hansson@arm.com * Redistribution and use in source and binary forms, with or without
68839Sandreas.hansson@arm.com * modification, are permitted provided that the following conditions are
78839Sandreas.hansson@arm.com * met: redistributions of source code must retain the above copyright
88839Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer;
98839Sandreas.hansson@arm.com * redistributions in binary form must reproduce the above copyright
108839Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer in the
118839Sandreas.hansson@arm.com * documentation and/or other materials provided with the distribution;
128839Sandreas.hansson@arm.com * neither the name of the copyright holders nor the names of its
133101Sstever@eecs.umich.edu * contributors may be used to endorse or promote products derived from
148579Ssteve.reinhardt@amd.com * this software without specific prior written permission.
153101Sstever@eecs.umich.edu *
163101Sstever@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
173101Sstever@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
183101Sstever@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
193101Sstever@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
203101Sstever@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
213101Sstever@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
223101Sstever@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
233101Sstever@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
243101Sstever@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
253101Sstever@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
263101Sstever@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
273101Sstever@eecs.umich.edu */
283101Sstever@eecs.umich.edu
293101Sstever@eecs.umich.edu#ifndef __KERN_LINUX_LINUX_SYSTEM_HH__
303101Sstever@eecs.umich.edu#define __KERN_LINUX_LINUX_SYSTEM_HH__
313101Sstever@eecs.umich.edu
323101Sstever@eecs.umich.edu#include "sim/host.hh"
333101Sstever@eecs.umich.edu#include "sim/system.hh"
343101Sstever@eecs.umich.edu#include "targetarch/isa_traits.hh"
353101Sstever@eecs.umich.edu
363101Sstever@eecs.umich.edu/**
373101Sstever@eecs.umich.edu * MAGIC address where the kernel arguments should go. Defined as
383101Sstever@eecs.umich.edu * PARAM in linux kernel alpha-asm.
393101Sstever@eecs.umich.edu */
403101Sstever@eecs.umich.educonst Addr PARAM_ADDR = ULL(0xfffffc000030a000);
413101Sstever@eecs.umich.edu
427778Sgblack@eecs.umich.educlass ExecContext;
438839Sandreas.hansson@arm.com
443101Sstever@eecs.umich.educlass BreakPCEvent;
453101Sstever@eecs.umich.educlass DebugPrintkEvent;
463101Sstever@eecs.umich.educlass BreakPCEvent;
473101Sstever@eecs.umich.educlass LinuxSkipDelayLoopEvent;
483101Sstever@eecs.umich.educlass SkipFuncEvent;
493101Sstever@eecs.umich.educlass IdleStartEvent;
503101Sstever@eecs.umich.educlass PrintThreadInfo;
513101Sstever@eecs.umich.edu
523101Sstever@eecs.umich.edu/**
533101Sstever@eecs.umich.edu * This class contains linux specific system code (Loading, Events, Binning).
543101Sstever@eecs.umich.edu * It points to objects that are the system binaries to load and patches them
553101Sstever@eecs.umich.edu * appropriately to work in simulator.
563101Sstever@eecs.umich.edu */
573101Sstever@eecs.umich.educlass LinuxSystem : public System
583101Sstever@eecs.umich.edu{
593101Sstever@eecs.umich.edu  private:
603101Sstever@eecs.umich.edu#ifdef DEBUG
613101Sstever@eecs.umich.edu    /** Event to halt the simulator if the kernel calls panic()  */
623885Sbinkertn@umich.edu    BreakPCEvent *kernelPanicEvent;
633885Sbinkertn@umich.edu#endif
644762Snate@binkert.org
653885Sbinkertn@umich.edu    /**
663885Sbinkertn@umich.edu     * Event to skip determine_cpu_caches() because we don't support
677528Ssteve.reinhardt@amd.com     * the IPRs that the code can access to figure out cache sizes
683885Sbinkertn@umich.edu     */
694380Sbinkertn@umich.edu    SkipFuncEvent *skipCacheProbeEvent;
704167Sbinkertn@umich.edu
713102Sstever@eecs.umich.edu    /** PC based event to skip the ide_delay_50ms() call */
723101Sstever@eecs.umich.edu    SkipFuncEvent *skipIdeDelay50msEvent;
734762Snate@binkert.org
744762Snate@binkert.org    /**
754762Snate@binkert.org     * PC based event to skip the dprink() call and emulate its
764762Snate@binkert.org     * functionality
774762Snate@binkert.org     */
784762Snate@binkert.org    DebugPrintkEvent *debugPrintkEvent;
794762Snate@binkert.org
804762Snate@binkert.org    /**
814762Snate@binkert.org     * Skip calculate_delay_loop() rather than waiting for this to be
825033Smilesck@eecs.umich.edu     * calculated
835033Smilesck@eecs.umich.edu     */
845033Smilesck@eecs.umich.edu    LinuxSkipDelayLoopEvent *skipDelayLoopEvent;
855033Smilesck@eecs.umich.edu
865033Smilesck@eecs.umich.edu    PrintThreadInfo *printThreadEvent;
875033Smilesck@eecs.umich.edu
885033Smilesck@eecs.umich.edu    /** Grab the PCBB of the idle process when it starts */
895033Smilesck@eecs.umich.edu    IdleStartEvent *idleStartEvent;
905033Smilesck@eecs.umich.edu
915033Smilesck@eecs.umich.edu  public:
923101Sstever@eecs.umich.edu    LinuxSystem(Params *p);
933101Sstever@eecs.umich.edu    ~LinuxSystem();
943101Sstever@eecs.umich.edu
955033Smilesck@eecs.umich.edu    void setDelayLoop(ExecContext *xc);
9610267SGeoffrey.Blake@arm.com};
978596Ssteve.reinhardt@amd.com
988596Ssteve.reinhardt@amd.com#endif // __KERN_LINUX_LINUX_SYSTEM_HH__
998596Ssteve.reinhardt@amd.com