summaryrefslogtreecommitdiff
path: root/kern/freebsd
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2005-09-24 14:20:29 -0400
committerSteve Reinhardt <stever@eecs.umich.edu>2005-09-24 14:20:29 -0400
commitd60de7122da3a90a0204853f633d34d93dcc622f (patch)
treef924b3f340c67c752efd7648b8e1f7ce7958425d /kern/freebsd
parentb15a7aaf5e2099a3d13061c63246bed8378d2e2f (diff)
downloadgem5-d60de7122da3a90a0204853f633d34d93dcc622f.tar.xz
Add functions to System object to set up function-based events,
including automatically fixing up addresses to deal with optionally executed Alpha gp update prolog. SConscript: Remove freebsd_events.cc and linux_events.cc. base/remote_gdb.cc: cpu/pc_event.cc: kern/system_events.cc: kern/system_events.hh: PCEvents now schedule themselves in constructor. cpu/pc_event.hh: PCEvents now schedule themselves in the constructor. Get rid of constructor versions that don't take an address and all the schedule() methods that are now unnecessary. kern/freebsd/freebsd_system.cc: kern/freebsd/freebsd_system.hh: Use new System methods to schedule function-based events. Move FreeBSD-specific function event classes into FreebsdSystem. kern/linux/linux_system.cc: kern/linux/linux_system.hh: Use new System methods to schedule function-based events. Move Linux-specific function event classes into LinuxSystem. kern/tru64/tru64_events.hh: PCEvents now schedule themselves in constructor. Add DebugPrintfrEvent to encapsulate raw setting as new type (to work better with new System function-event method.) kern/tru64/tru64_system.cc: Use new System methods to schedule function-based events. kern/tru64/tru64_system.hh: Add DebugPrintfrEvent to encapsulate raw setting as new type (to work better with new System function-event method.) sim/system.cc: sim/system.hh: Add functions to set up function-based events, including automatically fixing up addresses to deal with optionally executed Alpha gp update prolog. --HG-- extra : convert_revision : c2cf09144297b6602afe755a34a0a2227023783f
Diffstat (limited to 'kern/freebsd')
-rw-r--r--kern/freebsd/freebsd_system.cc21
-rw-r--r--kern/freebsd/freebsd_system.hh13
2 files changed, 23 insertions, 11 deletions
diff --git a/kern/freebsd/freebsd_system.cc b/kern/freebsd/freebsd_system.cc
index 5e0ce113b..283713d40 100644
--- a/kern/freebsd/freebsd_system.cc
+++ b/kern/freebsd/freebsd_system.cc
@@ -48,18 +48,13 @@ using namespace std;
FreebsdSystem::FreebsdSystem(Params *p)
: System(p)
{
- Addr addr = 0;
-
/**
* Any time DELAY is called just skip the function.
+ * Shouldn't we actually emulate the delay?
*/
- skipDelayEvent = new SkipFuncEvent(&pcEventQueue, "DELAY");
- if (kernelSymtab->findAddress("DELAY", addr))
- skipDelayEvent->schedule(addr+sizeof(MachInst));
-
- skipCalibrateClocks = new FreebsdSkipCalibrateClocksEvent(&pcEventQueue, "calibrate_clocks");
- if (kernelSymtab->findAddress("calibrate_clocks", addr))
- skipCalibrateClocks->schedule(addr + sizeof(MachInst) * 2);
+ skipDelayEvent = addKernelFuncEvent<SkipFuncEvent>("DELAY");
+ skipCalibrateClocks =
+ addKernelFuncEvent<SkipCalibrateClocksEvent>("calibrate_clocks");
}
@@ -92,6 +87,14 @@ FreebsdSystem::doCalibrateClocks(ExecContext *xc)
}
+void
+FreebsdSystem::SkipCalibrateClocksEvent::process(ExecContext *xc)
+{
+ SkipFuncEvent::process(xc);
+ ((FreebsdSystem *)xc->system)->doCalibrateClocks(xc);
+}
+
+
BEGIN_DECLARE_SIM_OBJECT_PARAMS(FreebsdSystem)
Param<Tick> boot_cpu_frequency;
diff --git a/kern/freebsd/freebsd_system.hh b/kern/freebsd/freebsd_system.hh
index 6429b5690..ecb842ec6 100644
--- a/kern/freebsd/freebsd_system.hh
+++ b/kern/freebsd/freebsd_system.hh
@@ -29,13 +29,22 @@
#ifndef __KERN_FREEBSD_FREEBSD_SYSTEM_HH__
#define __KERN_FREEBSD_FREEBSD_SYSTEM_HH__
-#include "kern/freebsd/freebsd_events.hh"
+#include "kern/system_events.hh"
class FreebsdSystem : public System
{
private:
+ class SkipCalibrateClocksEvent : public SkipFuncEvent
+ {
+ public:
+ SkipCalibrateClocksEvent(PCEventQueue *q, const std::string &desc,
+ Addr addr)
+ : SkipFuncEvent(q, desc, addr) {}
+ virtual void process(ExecContext *xc);
+ };
+
SkipFuncEvent *skipDelayEvent;
- FreebsdSkipCalibrateClocksEvent *skipCalibrateClocks;
+ SkipCalibrateClocksEvent *skipCalibrateClocks;
public:
FreebsdSystem(Params *p);