summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2016-12-15 13:16:03 -0500
committerBrandon Potter <brandon.potter@amd.com>2016-12-15 13:16:03 -0500
commit68e9c0e73b1466b7e43c77a75cd38913afcfcafe (patch)
tree7be99d46777d396d8706620ee9d4c7791712eac1 /src/arch
parent4ff1b165d007c50c0c4700eb8ecafa1e700bc7aa (diff)
downloadgem5-68e9c0e73b1466b7e43c77a75cd38913afcfcafe.tar.xz
syscall_emul: add support for x86 statfs system calls
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/linux/linux.hh18
-rw-r--r--src/arch/x86/linux/process.cc2
2 files changed, 19 insertions, 1 deletions
diff --git a/src/arch/x86/linux/linux.hh b/src/arch/x86/linux/linux.hh
index fb8e611cb..ef0715fd6 100644
--- a/src/arch/x86/linux/linux.hh
+++ b/src/arch/x86/linux/linux.hh
@@ -67,6 +67,24 @@ class X86Linux64 : public Linux
int64_t unused0[3];
} tgt_stat64;
+ typedef struct {
+ long val[2];
+ } tgt_fsid;
+
+ typedef struct {
+ long f_type;
+ long f_bsize;
+ long f_blocks;
+ long f_bfree;
+ long f_bavail;
+ long f_files;
+ long f_ffree;
+ tgt_fsid f_fsid;
+ long f_namelen;
+ long f_frsize;
+ long f_spare[5];
+ } tgt_statfs;
+
static const int TGT_SIGHUP = 0x000001;
static const int TGT_SIGINT = 0x000002;
static const int TGT_SIGQUIT = 0x000003;
diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc
index f68f1c4c8..e5db3cb49 100644
--- a/src/arch/x86/linux/process.cc
+++ b/src/arch/x86/linux/process.cc
@@ -355,7 +355,7 @@ static SyscallDesc syscallDescs64[] = {
/* 134 */ SyscallDesc("uselib", unimplementedFunc),
/* 135 */ SyscallDesc("personality", unimplementedFunc),
/* 136 */ SyscallDesc("ustat", unimplementedFunc),
- /* 137 */ SyscallDesc("statfs", unimplementedFunc),
+ /* 137 */ SyscallDesc("statfs", statfsFunc<X86Linux64>),
/* 138 */ SyscallDesc("fstatfs", unimplementedFunc),
/* 139 */ SyscallDesc("sysfs", unimplementedFunc),
/* 140 */ SyscallDesc("getpriority", unimplementedFunc),