diff options
author | Brandon Potter <brandon.potter@amd.com> | 2018-08-28 10:13:04 -0400 |
---|---|---|
committer | Brandon Potter <Brandon.Potter@amd.com> | 2019-05-21 20:42:38 +0000 |
commit | dd8a7694806e3f816ba688d2094106db68b46b53 (patch) | |
tree | 8fc6bcc3e474ae3843779f6d019b296e28a8848b /src/sim/emul_driver.hh | |
parent | dd2d44547ddc08ccee9e1465104eff2f43efdec0 (diff) | |
download | gem5-dd8a7694806e3f816ba688d2094106db68b46b53.tar.xz |
sim-se: change syscall function signature
The system calls had four parameters. One of the parameters
is ThreadContext and another is Process. The ThreadContext
holds the value of the current process so the Process parameter
is redundant since the system call functions already have
indirect access.
With the old API, it is possible to call into the functions with
the wrong supplied Process which could end up being a confusing
error.
This patch removes the redundancy by forcing access through the
ThreadContext field within each system call.
Change-Id: Ib43d3f65824f6d425260dfd9f67de1892b6e8b7c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12299
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/sim/emul_driver.hh')
-rw-r--r-- | src/sim/emul_driver.hh | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/sim/emul_driver.hh b/src/sim/emul_driver.hh index 97ba57224..fe13d9077 100644 --- a/src/sim/emul_driver.hh +++ b/src/sim/emul_driver.hh @@ -74,8 +74,7 @@ class EmulatedDriver : public SimObject * to openFunc() (q.v.). * @return A newly allocated target fd, or -1 on error. */ - virtual int open(Process *p, ThreadContext *tc, - int mode, int flags) = 0; + virtual int open(ThreadContext *tc, int mode, int flags) = 0; /** * Abstract method, invoked when the user program calls ioctl() on @@ -84,7 +83,7 @@ class EmulatedDriver : public SimObject * @return The return code for the ioctl, or the negation of the errno * (see the SyscallReturn class). */ - virtual int ioctl(Process *p, ThreadContext *tc, unsigned req) = 0; + virtual int ioctl(ThreadContext *tc, unsigned req) = 0; /** * Virtual method, invoked when the user program calls mmap() on @@ -93,9 +92,9 @@ class EmulatedDriver : public SimObject * @return The return ptr for the mmap, or the negation of the errno * (see the SyscallReturn class). */ - virtual Addr mmap(Process *p, ThreadContext *tc, Addr start, - uint64_t length, int prot, int tgtFlags, int tgtFd, - int offset) { return -EBADF; } + virtual Addr mmap(ThreadContext *tc, Addr start, uint64_t length, + int prot, int tgtFlags, int tgtFd, int offset) + { return -EBADF; } }; #endif // __SIM_EMUL_DRIVER_HH |