summaryrefslogtreecommitdiff
path: root/src/arch/alpha/linux
diff options
context:
space:
mode:
authorVince Weaver <vince@csl.cornell.edu>2009-09-15 22:36:47 -0700
committerVince Weaver <vince@csl.cornell.edu>2009-09-15 22:36:47 -0700
commit9b8e61beb38af081454ffd5e06d14458080b98e0 (patch)
tree8855dd8467c3ae14f00eb413478976501ce3f9f3 /src/arch/alpha/linux
parent0f569b4d9dd5b7be253d45c22e9c40f615e90ecd (diff)
downloadgem5-9b8e61beb38af081454ffd5e06d14458080b98e0.tar.xz
Syscalls: Implement sysinfo() syscall.
Diffstat (limited to 'src/arch/alpha/linux')
-rw-r--r--src/arch/alpha/linux/linux.hh15
-rw-r--r--src/arch/alpha/linux/process.cc2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/arch/alpha/linux/linux.hh b/src/arch/alpha/linux/linux.hh
index c622c5ef1..e9947644c 100644
--- a/src/arch/alpha/linux/linux.hh
+++ b/src/arch/alpha/linux/linux.hh
@@ -125,6 +125,21 @@ class AlphaLinux : public Linux
TGT_RLIMIT_MEMLOCK = 9,
TGT_RLIMIT_LOCKS = 10
};
+
+ typedef struct {
+ int64_t uptime; /* Seconds since boot */
+ uint64_t loads[3]; /* 1, 5, and 15 minute load averages */
+ uint64_t totalram; /* Total usable main memory size */
+ uint64_t freeram; /* Available memory size */
+ uint64_t sharedram; /* Amount of shared memory */
+ uint64_t bufferram; /* Memory used by buffers */
+ uint64_t totalswap; /* Total swap space size */
+ uint64_t freeswap; /* swap space still available */
+ uint16_t procs; /* Number of current processes */
+ uint64_t totalhigh; /* Total high memory size */
+ uint64_t freehigh; /* Available high memory size */
+ uint64_t mem_unit; /* Memory unit size in bytes */
+ } tgt_sysinfo;
};
#endif // __ALPHA_ALPHA_LINUX_LINUX_HH__
diff --git a/src/arch/alpha/linux/process.cc b/src/arch/alpha/linux/process.cc
index 9886c7ea7..0f09e472b 100644
--- a/src/arch/alpha/linux/process.cc
+++ b/src/arch/alpha/linux/process.cc
@@ -440,7 +440,7 @@ SyscallDesc AlphaLinuxProcess::syscallDescs[] = {
/* 315 */ SyscallDesc("munlock", unimplementedFunc),
/* 316 */ SyscallDesc("mlockall", unimplementedFunc),
/* 317 */ SyscallDesc("munlockall", unimplementedFunc),
- /* 318 */ SyscallDesc("sysinfo", unimplementedFunc),
+ /* 318 */ SyscallDesc("sysinfo", sysinfoFunc<AlphaLinux>),
/* 319 */ SyscallDesc("_sysctl", unimplementedFunc),
/* 320 */ SyscallDesc("was sys_idle", unimplementedFunc),
/* 321 */ SyscallDesc("oldumount", unimplementedFunc),