diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/linux/linux_syscalls.hh | 7 | ||||
-rw-r--r-- | kern/linux/linux_system.cc | 35 | ||||
-rw-r--r-- | kern/linux/linux_system.hh | 5 | ||||
-rw-r--r-- | kern/tru64/tru64_syscalls.hh | 7 | ||||
-rw-r--r-- | kern/tru64/tru64_system.cc | 24 |
5 files changed, 45 insertions, 33 deletions
diff --git a/kern/linux/linux_syscalls.hh b/kern/linux/linux_syscalls.hh index dee7c5fcd..44a038def 100644 --- a/kern/linux/linux_syscalls.hh +++ b/kern/linux/linux_syscalls.hh @@ -26,14 +26,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __LINUX_SYSCALLS_HH__ -#define __LINUX_SYSCALLS_HH__ +#ifndef __KERN_LINUX_LINUX_SYSCALLS_HH__ +#define __KERN_LINUX_LINUX_SYSCALLS_HH__ #include "kern/linux/linux.hh" template <class OS> class SystemCalls; +template <> class SystemCalls<Linux> { public: @@ -322,4 +323,4 @@ class SystemCalls<Linux> }; -#endif // __LINUX_SYSCALLS_HH__ +#endif // __KERN_LINUX_LINUX_SYSCALLS_HH__ diff --git a/kern/linux/linux_system.cc b/kern/linux/linux_system.cc index 4342463c3..4ac03143e 100644 --- a/kern/linux/linux_system.cc +++ b/kern/linux/linux_system.cc @@ -102,12 +102,19 @@ LinuxSystem::LinuxSystem(Params *p) } else panic("could not find dp264_mv\n"); -#ifdef DEBUG +#ifndef NDEBUG kernelPanicEvent = new BreakPCEvent(&pcEventQueue, "kernel panic"); if (kernelSymtab->findAddress("panic", addr)) kernelPanicEvent->schedule(addr); else panic("could not find kernel symbol \'panic\'"); + + kernelDieEvent = new BreakPCEvent(&pcEventQueue, "die if kernel"); + if (kernelSymtab->findAddress("die_if_kernel", addr)) + kernelDieEvent->schedule(addr); + else + panic("could not find kernel symbol \'die_if_kernel\'"); + #endif /** @@ -174,7 +181,7 @@ LinuxSystem::LinuxSystem(Params *p) LinuxSystem::~LinuxSystem() { -#ifdef DEBUG +#ifndef NDEBUG delete kernelPanicEvent; #endif delete skipIdeDelay50msEvent; @@ -208,12 +215,12 @@ LinuxSystem::setDelayLoop(ExecContext *xc) BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) - SimObjectParam<MemoryController *> mem_ctl; + SimObjectParam<MemoryController *> memctrl; SimObjectParam<PhysicalMemory *> physmem; - Param<string> kernel_code; - Param<string> console_code; - Param<string> pal_code; + Param<string> kernel; + Param<string> console; + Param<string> pal; Param<string> boot_osflags; Param<string> readfile; @@ -230,11 +237,11 @@ END_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxSystem) - INIT_PARAM(mem_ctl, "memory controller"), + INIT_PARAM(memctrl, "memory controller"), INIT_PARAM(physmem, "phsyical memory"), - INIT_PARAM(kernel_code, "file that contains the kernel code"), - INIT_PARAM(console_code, "file that contains the console code"), - INIT_PARAM(pal_code, "file that contains palcode"), + INIT_PARAM(kernel, "file that contains the kernel code"), + INIT_PARAM(console, "file that contains the console code"), + INIT_PARAM(pal, "file that contains palcode"), INIT_PARAM_DFLT(boot_osflags, "flags to pass to the kernel during boot", "a"), INIT_PARAM_DFLT(readfile, "file to read startup script from", ""), @@ -251,11 +258,11 @@ CREATE_SIM_OBJECT(LinuxSystem) { System::Params *p = new System::Params; p->name = getInstanceName(); - p->memctrl = mem_ctl; + p->memctrl = memctrl; p->physmem = physmem; - p->kernel_path = kernel_code; - p->console_path = console_code; - p->palcode = pal_code; + p->kernel_path = kernel; + p->console_path = console; + p->palcode = pal; p->boot_osflags = boot_osflags; p->init_param = init_param; p->readfile = readfile; diff --git a/kern/linux/linux_system.hh b/kern/linux/linux_system.hh index 5e3cba9b3..905b0ee70 100644 --- a/kern/linux/linux_system.hh +++ b/kern/linux/linux_system.hh @@ -57,9 +57,12 @@ class PrintThreadInfo; class LinuxSystem : public System { private: -#ifdef DEBUG +#ifndef NDEBUG /** Event to halt the simulator if the kernel calls panic() */ BreakPCEvent *kernelPanicEvent; + + /** Event to halt the simulator if the kernel calls die_if_kernel */ + BreakPCEvent *kernelDieEvent; #endif /** diff --git a/kern/tru64/tru64_syscalls.hh b/kern/tru64/tru64_syscalls.hh index 7ddc699b1..44e5de250 100644 --- a/kern/tru64/tru64_syscalls.hh +++ b/kern/tru64/tru64_syscalls.hh @@ -26,14 +26,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __TRU64_SYSCALLS_HH__ -#define __TRU64_SYSCALLS_HH__ +#ifndef __KERN_TRU64_TRU64_SYSCALLS_HH__ +#define __KERN_TRU64_TRU64_SYSCALLS_HH__ #include "kern/tru64/tru64.hh" template <class OS> class SystemCalls; +template <> class SystemCalls<Tru64> { public: @@ -355,4 +356,4 @@ class SystemCalls<Tru64> } }; -#endif // __TRU64_SYSCALLS_HH__ +#endif // __KERN_TRU64_TRU64_SYSCALLS_HH__ diff --git a/kern/tru64/tru64_system.cc b/kern/tru64/tru64_system.cc index c6435cb18..7a2e033d8 100644 --- a/kern/tru64/tru64_system.cc +++ b/kern/tru64/tru64_system.cc @@ -116,12 +116,12 @@ Tru64System::~Tru64System() BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64System) - SimObjectParam<MemoryController *> mem_ctl; + SimObjectParam<MemoryController *> memctrl; SimObjectParam<PhysicalMemory *> physmem; - Param<string> kernel_code; - Param<string> console_code; - Param<string> pal_code; + Param<string> kernel; + Param<string> console; + Param<string> pal; Param<string> boot_osflags; Param<string> readfile; @@ -137,11 +137,11 @@ END_DECLARE_SIM_OBJECT_PARAMS(Tru64System) BEGIN_INIT_SIM_OBJECT_PARAMS(Tru64System) - INIT_PARAM(mem_ctl, "memory controller"), + INIT_PARAM(memctrl, "memory controller"), INIT_PARAM(physmem, "phsyical memory"), - INIT_PARAM(kernel_code, "file that contains the kernel code"), - INIT_PARAM(console_code, "file that contains the console code"), - INIT_PARAM(pal_code, "file that contains palcode"), + INIT_PARAM(kernel, "file that contains the kernel code"), + INIT_PARAM(console, "file that contains the console code"), + INIT_PARAM(pal, "file that contains palcode"), INIT_PARAM_DFLT(boot_osflags, "flags to pass to the kernel during boot", "a"), INIT_PARAM_DFLT(readfile, "file to read startup script from", ""), @@ -157,11 +157,11 @@ CREATE_SIM_OBJECT(Tru64System) { System::Params *p = new System::Params; p->name = getInstanceName(); - p->memctrl = mem_ctl; + p->memctrl = memctrl; p->physmem = physmem; - p->kernel_path = kernel_code; - p->console_path = console_code; - p->palcode = pal_code; + p->kernel_path = kernel; + p->console_path = console; + p->palcode = pal; p->boot_osflags = boot_osflags; p->init_param = init_param; p->readfile = readfile; |