arch,sim: Merge Process::syscall and Process::getDesc.
authorGabe Black <gabeblack@google.com>
Wed, 1 Jan 2020 11:07:22 +0000 (03:07 -0800)
committerGabe Black <gabeblack@google.com>
Fri, 20 Mar 2020 10:04:18 +0000 (10:04 +0000)
commitcd69bb50414450c3bb5ef41dce676b75fd42c0ee
treeb30c4ad6ae1b33822891d2ebb5640270fc8f5a32
parenta63b853320abb1fef03381b474cb072265479caa
arch,sim: Merge Process::syscall and Process::getDesc.

When handling a system call, external code would call Process::syscall
which would extract the syscall number, that would call the base
class' doSyscall method, that would call into the subclass' getDesc
to get the appropriate descriptor, and then doSyscall would check
that a syscall was found and call into it.

Instead, we can just make the SyscallDescTable optionally check for
missing syscalls (in case we want to check multiple tables), and
make syscall look up the appropriate descriptor and call it. The base
implementation of syscall would then do the only bit of doSyscall that
is no longer being handled, incrementing the numSyscalls stat.

Change-Id: If102c156830ed2997d177dc6937cc85dddadf3f9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24119
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
19 files changed:
src/arch/arm/freebsd/process.cc
src/arch/arm/freebsd/process.hh
src/arch/arm/linux/process.cc
src/arch/arm/linux/process.hh
src/arch/mips/linux/process.cc
src/arch/mips/linux/process.hh
src/arch/power/linux/process.cc
src/arch/power/linux/process.hh
src/arch/riscv/linux/process.cc
src/arch/riscv/linux/process.hh
src/arch/sparc/linux/process.cc
src/arch/sparc/linux/process.hh
src/arch/sparc/solaris/process.cc
src/arch/sparc/solaris/process.hh
src/arch/x86/linux/process.cc
src/arch/x86/linux/process.hh
src/sim/process.cc
src/sim/process.hh
src/sim/syscall_desc.hh