diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/alpha/linux/process.cc | 12 | ||||
-rw-r--r-- | src/arch/arm/freebsd/process.cc | 8 | ||||
-rw-r--r-- | src/arch/arm/linux/process.cc | 16 | ||||
-rw-r--r-- | src/arch/mips/linux/process.cc | 16 | ||||
-rw-r--r-- | src/arch/power/linux/process.cc | 4 | ||||
-rw-r--r-- | src/arch/riscv/linux/process.cc | 8 | ||||
-rw-r--r-- | src/arch/sparc/linux/syscalls.cc | 7 | ||||
-rw-r--r-- | src/arch/sparc/solaris/process.cc | 4 | ||||
-rw-r--r-- | src/arch/x86/linux/process.cc | 13 |
9 files changed, 44 insertions, 44 deletions
diff --git a/src/arch/alpha/linux/process.cc b/src/arch/alpha/linux/process.cc index cbf45f16c..de89410ac 100644 --- a/src/arch/alpha/linux/process.cc +++ b/src/arch/alpha/linux/process.cc @@ -77,10 +77,10 @@ AlphaLinuxObjectFileLoader loader; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); @@ -97,10 +97,10 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process, /// borrowed from Tru64, the subcases that get used appear to be /// different in practice from those used by Tru64 processes. static SyscallReturn -osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +osf_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); unsigned op = process->getSyscallArg(tc, index); Addr bufPtr = process->getSyscallArg(tc, index); // unsigned nbytes = process->getSyscallArg(tc, 2); @@ -126,10 +126,10 @@ osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, /// Target osf_setsysinfo() handler. static SyscallReturn -osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +osf_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); unsigned op = process->getSyscallArg(tc, index); Addr bufPtr = process->getSyscallArg(tc, index); // unsigned nbytes = process->getSyscallArg(tc, 2); diff --git a/src/arch/arm/freebsd/process.cc b/src/arch/arm/freebsd/process.cc index ba79eb18b..41549eaab 100644 --- a/src/arch/arm/freebsd/process.cc +++ b/src/arch/arm/freebsd/process.cc @@ -85,20 +85,18 @@ ArmFreebsdObjectFileLoader loader; } // anonymous namespace static SyscallReturn -issetugidFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +issetugidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { - return 0; } static SyscallReturn -sysctlFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +sysctlFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; uint64_t ret; + auto process = tc->getProcessPtr(); Addr namep = process->getSyscallArg(tc, index); size_t namelen = process->getSyscallArg(tc, index); Addr oldp = process->getSyscallArg(tc, index); diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc index cd37c770a..1bb754870 100644 --- a/src/arch/arm/linux/process.cc +++ b/src/arch/arm/linux/process.cc @@ -105,10 +105,10 @@ ArmLinuxObjectFileLoader loader; /// Target uname() handler. static SyscallReturn -unameFunc32(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc32(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); @@ -123,10 +123,10 @@ unameFunc32(SyscallDesc *desc, int callnum, Process *process, /// Target uname() handler. static SyscallReturn -unameFunc64(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc64(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); @@ -141,10 +141,10 @@ unameFunc64(SyscallDesc *desc, int callnum, Process *process, /// Target set_tls() handler. static SyscallReturn -setTLSFunc32(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +setTLSFunc32(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); uint32_t tlsPtr = process->getSyscallArg(tc, index); tc->getMemProxy().writeBlob(ArmLinuxProcess32::commPage + 0x0ff0, @@ -154,10 +154,10 @@ setTLSFunc32(SyscallDesc *desc, int callnum, Process *process, } static SyscallReturn -setTLSFunc64(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +setTLSFunc64(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); uint32_t tlsPtr = process->getSyscallArg(tc, index); tc->setMiscReg(MISCREG_TPIDRRO_EL0, tlsPtr); diff --git a/src/arch/mips/linux/process.cc b/src/arch/mips/linux/process.cc index 71d20eaae..8a4811a04 100644 --- a/src/arch/mips/linux/process.cc +++ b/src/arch/mips/linux/process.cc @@ -80,10 +80,10 @@ MipsLinuxObjectFileLoader loader; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); @@ -100,10 +100,10 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process, /// 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, Process *process, - ThreadContext *tc) +sys_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { 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); @@ -129,10 +129,10 @@ sys_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, /// Target sys_setsysinfo() handler. static SyscallReturn -sys_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +sys_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { 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); @@ -159,10 +159,10 @@ sys_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, } static SyscallReturn -setThreadAreaFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +setThreadAreaFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); Addr addr = process->getSyscallArg(tc, index); tc->setMiscRegNoEffect(MISCREG_TP_VALUE, addr); return 0; diff --git a/src/arch/power/linux/process.cc b/src/arch/power/linux/process.cc index ea0fc9021..58e7eb507 100644 --- a/src/arch/power/linux/process.cc +++ b/src/arch/power/linux/process.cc @@ -80,10 +80,10 @@ PowerLinuxObjectFileLoader loader; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); diff --git a/src/arch/riscv/linux/process.cc b/src/arch/riscv/linux/process.cc index b2d030523..f3f328e48 100644 --- a/src/arch/riscv/linux/process.cc +++ b/src/arch/riscv/linux/process.cc @@ -88,10 +88,10 @@ RiscvLinuxObjectFileLoader loader; /// Target uname() handler. static SyscallReturn -unameFunc64(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc64(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); @@ -106,10 +106,10 @@ unameFunc64(SyscallDesc *desc, int callnum, Process *process, /// Target uname() handler. static SyscallReturn -unameFunc32(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc32(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); diff --git a/src/arch/sparc/linux/syscalls.cc b/src/arch/sparc/linux/syscalls.cc index 773982a50..9cf08b7b3 100644 --- a/src/arch/sparc/linux/syscalls.cc +++ b/src/arch/sparc/linux/syscalls.cc @@ -39,10 +39,10 @@ namespace SparcISA { /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); @@ -58,10 +58,11 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process, SyscallReturn -getresuidFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc) +getresuidFunc(SyscallDesc *desc, int num, ThreadContext *tc) { const uint64_t id = htog(100); int index = 0; + auto p = tc->getProcessPtr(); Addr ruid = p->getSyscallArg(tc, index); Addr euid = p->getSyscallArg(tc, index); Addr suid = p->getSyscallArg(tc, index); diff --git a/src/arch/sparc/solaris/process.cc b/src/arch/sparc/solaris/process.cc index 70381c5d8..0b67f53d3 100644 --- a/src/arch/sparc/solaris/process.cc +++ b/src/arch/sparc/solaris/process.cc @@ -72,10 +72,10 @@ SparcSolarisObjectFileLoader loader; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Solaris::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "SunOS"); diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc index 95f4ee91d..98a68b409 100644 --- a/src/arch/x86/linux/process.cc +++ b/src/arch/x86/linux/process.cc @@ -91,10 +91,10 @@ X86LinuxObjectFileLoader loader; /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; + auto process = tc->getProcessPtr(); TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); @@ -109,8 +109,7 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process, } static SyscallReturn -archPrctlFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +archPrctlFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { enum ArchPrctlCodes { @@ -122,6 +121,7 @@ archPrctlFunc(SyscallDesc *desc, int callnum, Process *process, // First argument is the code, second is the address int index = 0; + auto process = tc->getProcessPtr(); int code = process->getSyscallArg(tc, index); uint64_t addr = process->getSyscallArg(tc, index); uint64_t fsBase, gsBase; @@ -175,13 +175,14 @@ struct UserDesc64 { }; static SyscallReturn -setThreadArea32Func(SyscallDesc *desc, int callnum, - Process *process, ThreadContext *tc) +setThreadArea32Func(SyscallDesc *desc, int callnum, ThreadContext *tc) { const int minTLSEntry = 6; const int numTLSEntries = 3; const int maxTLSEntry = minTLSEntry + numTLSEntries - 1; + auto process = tc->getProcessPtr(); + X86Process *x86p = dynamic_cast<X86Process *>(process); assert(x86p); |