From 53d2c9398e8c1631ae3fd5469b187b006d317f88 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Sat, 18 Feb 2006 23:44:22 -0500 Subject: Move Linux/Tru64 architecture independent code into kern/* leaving dependent code making way for solaris linux syscall emu. SConscript: Add two new files for syscall emulation Add getDesc() function arch/alpha/alpha_linux_process.cc: arch/alpha/alpha_tru64_process.cc: move architecture independent code into kern/linux/linux.(hh|cc) arch/alpha/alpha_linux_process.hh: arch/alpha/alpha_tru64_process.hh: Add getDesc function kern/linux/linux.hh: move generi linux syscall emulation code into kern/linux kern/tru64/tru64.hh: move generi tru64 syscall emulation code into kern/tru64 sim/process.cc: sim/process.hh: Push the function determination and calling stuff down to LiveProcess and out of the Linux/Tru64 classes respectively sim/syscall_emul.cc: sim/syscall_emul.hh: fnctl implementation was identical in tru64 and linux so moved to generic --HG-- extra : convert_revision : 103293dbe6fe2f7892de4929d17dc085def77026 --- sim/process.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'sim/process.cc') diff --git a/sim/process.cc b/sim/process.cc index 59d122b48..3ae3abb52 100644 --- a/sim/process.cc +++ b/sim/process.cc @@ -46,6 +46,7 @@ #include "sim/fake_syscall.hh" #include "sim/process.hh" #include "sim/stats.hh" +#include "sim/syscall_emul.hh" #ifdef TARGET_ALPHA #include "arch/alpha/alpha_tru64_process.hh" @@ -350,6 +351,19 @@ LiveProcess::LiveProcess(const string &nm, ObjectFile *objFile, init_regs->npc = prog_entry + sizeof(MachInst); } +void +LiveProcess::syscall(ExecContext *xc) +{ + num_syscalls++; + + int64_t callnum = xc->regs.intRegFile[ReturnValueReg]; + + SyscallDesc *desc = getDesc(callnum); + if (desc == NULL) + fatal("Syscall %d out of range", callnum); + + desc->doSyscall(callnum, this, xc); +} LiveProcess * LiveProcess::create(const string &nm, @@ -394,6 +408,7 @@ LiveProcess::create(const string &nm, } + BEGIN_DECLARE_SIM_OBJECT_PARAMS(LiveProcess) VectorParam cmd; -- cgit v1.2.3