From c4be6f1e64a7bdd0c5057e2ab3f6a117444bc8ea Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 26 Jun 2006 16:49:05 -0400 Subject: add syscall emulation page table fault so we can allocate more stack pages src/cpu/simple/base.cc: add syscall emulation page table fault so we can allocate more stack pages FaultBase::invoke will do this, we don't need to do it here src/sim/faults.hh: I have no idea why this #if was there... gone src/sim/process.cc: make stack_min actually be the current minimum --HG-- extra : convert_revision : 9786b39f2747b94654a5d77c74243cd20503add4 --- src/sim/faults.hh | 4 ---- src/sim/process.cc | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src/sim') diff --git a/src/sim/faults.hh b/src/sim/faults.hh index 23385c649..00264d8fc 100644 --- a/src/sim/faults.hh +++ b/src/sim/faults.hh @@ -54,11 +54,7 @@ class FaultBase : public RefCounted { public: virtual FaultName name() = 0; -#if FULL_SYSTEM virtual void invoke(ThreadContext * tc); -#else - virtual void invoke(ThreadContext * tc); -#endif // template // bool isA() {return dynamic_cast(this);} virtual bool isMachineCheckFault() {return false;} diff --git a/src/sim/process.cc b/src/sim/process.cc index 5080c3ac1..9cdc5b9f5 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -326,11 +326,10 @@ LiveProcess::argsInit(int intSize, int pageSize) // set bottom of stack stack_min = stack_base - space_needed; // align it - stack_min &= ~(intSize-1); + stack_min = roundDown(stack_min, pageSize); stack_size = stack_base - stack_min; // map memory - pTable->allocate(roundDown(stack_min, pageSize), - roundUp(stack_size, pageSize)); + pTable->allocate(stack_min, roundUp(stack_size, pageSize)); // map out initial stack contents Addr argv_array_base = stack_min + intSize; // room for argc -- cgit v1.2.3 From b1cfe01b5730af7d9f215466ebe108fc96dc0a27 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 26 Jun 2006 17:49:49 -0400 Subject: remove extern "C" from the functions we all from gdb. This isn't requried and trips up GDB sometimes when i thinks the extern name should be mangled, but it isn't --HG-- extra : convert_revision : 62e2a1989e8fd3d73958d3a3e2d00e378488e642 --- src/sim/debug.cc | 4 ++-- src/sim/sim_object.cc | 1 - src/sim/stat_control.cc | 3 +-- src/sim/system.cc | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/sim') diff --git a/src/sim/debug.cc b/src/sim/debug.cc index b82219f7d..be9566836 100644 --- a/src/sim/debug.cc +++ b/src/sim/debug.cc @@ -127,12 +127,12 @@ DebugContext::checkParams() // handy function to schedule DebugBreakEvent on main event queue // (callable from debugger) // -extern "C" void sched_break_cycle(Tick when) +void sched_break_cycle(Tick when) { new DebugBreakEvent(&mainEventQueue, when); } -extern "C" void eventq_dump() +void eventq_dump() { mainEventQueue.dump(); } diff --git a/src/sim/sim_object.cc b/src/sim/sim_object.cc index 97e6de439..a35c7a88d 100644 --- a/src/sim/sim_object.cc +++ b/src/sim/sim_object.cc @@ -236,7 +236,6 @@ SimObject::debugObjectBreak(const string &objs) } } -extern "C" void debugObjectBreak(const char *objs) { diff --git a/src/sim/stat_control.cc b/src/sim/stat_control.cc index f7fc03d74..041830ab7 100644 --- a/src/sim/stat_control.cc +++ b/src/sim/stat_control.cc @@ -221,8 +221,7 @@ SetupEvent(int flags, Tick when, Tick repeat) /* namespace Stats */ } -extern "C" void -debugDumpStats() +void debugDumpStats() { Stats::DumpNow(); } diff --git a/src/sim/system.cc b/src/sim/system.cc index 91bba85fe..89e7b8542 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -243,7 +243,6 @@ System::printSystems() } } -extern "C" void printSystems() { -- cgit v1.2.3