From 7ca61b7ddf735520172abacbd893ee65fe4bc840 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 28 Nov 2019 00:05:34 -0800 Subject: [PATCH] mips: Convert MIPS specific syscalls to Guest ABI. Jira Issue: https://gem5.atlassian.net/browse/GEM5-187 Change-Id: I7e7c49e885a8c3395f2e6ca361c228bce3691dbe Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23205 Reviewed-by: Bobby R. Bruce Maintainer: Gabe Black Tested-by: kokoro --- src/arch/mips/linux/process.cc | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/src/arch/mips/linux/process.cc b/src/arch/mips/linux/process.cc index ea362629a..03fcc87ab 100644 --- a/src/arch/mips/linux/process.cc +++ b/src/arch/mips/linux/process.cc @@ -77,11 +77,10 @@ MipsLinuxObjectFileLoader loader; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) +unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, Addr utsname) { - int index = 0; auto process = tc->getProcessPtr(); - TypedBufferArg name(process->getSyscallArg(tc, index)); + TypedBufferArg name(utsname); strcpy(name->sysname, "Linux"); strcpy(name->nodename,"sim.gem5.org"); @@ -97,14 +96,9 @@ unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) /// borrowed from Tru64, the subcases that get used appear to be /// different in practice from those used by Tru64 processes. static SyscallReturn -sys_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) +sys_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, + unsigned op, unsigned bufPtr, unsigned nbytes) { - int index = 0; - auto process = tc->getProcessPtr(); - unsigned op = process->getSyscallArg(tc, index); - unsigned bufPtr = process->getSyscallArg(tc, index); - // unsigned nbytes = process->getSyscallArg(tc, index); - switch (op) { case 45: { @@ -126,14 +120,9 @@ sys_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) /// Target sys_setsysinfo() handler. static SyscallReturn -sys_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) +sys_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, + unsigned op, Addr bufPtr, unsigned nbytes) { - int index = 0; - auto process = tc->getProcessPtr(); - unsigned op = process->getSyscallArg(tc, index); - Addr bufPtr = process->getSyscallArg(tc, index); - // unsigned nbytes = process->getSyscallArg(tc, index); - switch (op) { case 14: @@ -156,11 +145,8 @@ sys_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) } static SyscallReturn -setThreadAreaFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) +setThreadAreaFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, Addr addr) { - int index = 0; - auto process = tc->getProcessPtr(); - Addr addr = process->getSyscallArg(tc, index); tc->setMiscRegNoEffect(MISCREG_TP_VALUE, addr); return 0; } -- 2.30.2