summaryrefslogtreecommitdiff
path: root/src/sim/syscall_emul.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/syscall_emul.hh')
-rw-r--r--src/sim/syscall_emul.hh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 5f2ebd428..c00edfdc6 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -59,6 +59,7 @@
#include "cpu/thread_context.hh"
#include "mem/translating_port.hh"
#include "mem/page_table.hh"
+#include "sim/system.hh"
#include "sim/process.hh"
///
@@ -558,6 +559,22 @@ openFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
}
+/// Target sysinfo() handler.
+template <class OS>
+SyscallReturn
+sysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+ ThreadContext *tc)
+{
+
+ TypedBufferArg<typename OS::tgt_sysinfo> sysinfo(process->getSyscallArg(tc, 0));
+
+ sysinfo->uptime=seconds_since_epoch;
+ sysinfo->totalram=process->system->memSize();
+
+ sysinfo.copyOut(tc->getMemPort());
+
+ return 0;
+}
/// Target chmod() handler.
template <class OS>