diff options
author | Marc Orr <marc.orr@gmail.com> | 2012-08-06 16:52:40 -0700 |
---|---|---|
committer | Marc Orr <marc.orr@gmail.com> | 2012-08-06 16:52:40 -0700 |
commit | d55115936e0711422c6d708572b391e15432bec1 (patch) | |
tree | 13c179e67d6aff1273a56edc8bcc20cddef6b380 /src/arch/sparc | |
parent | 62425b7a0724033bbd50170400ad2ff83ad57429 (diff) | |
download | gem5-d55115936e0711422c6d708572b391e15432bec1.tar.xz |
syscall emulation: Clean up ioctl handling, and implement for x86.
Enable different whitelists for different OS/arch combinations,
since some use the generic Linux definitions only, and others
use definitions inherited from earlier Unix flavors on those
architectures.
Also update x86 function pointers so ioctl is no longer
unimplemented on that platform.
This patch is a revised version of Vince Weaver's earlier patch.
Diffstat (limited to 'src/arch/sparc')
-rw-r--r-- | src/arch/sparc/linux/linux.hh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/arch/sparc/linux/linux.hh b/src/arch/sparc/linux/linux.hh index 8ac408812..7b708cbcb 100644 --- a/src/arch/sparc/linux/linux.hh +++ b/src/arch/sparc/linux/linux.hh @@ -94,6 +94,35 @@ class SparcLinux : public Linux uint64_t mem_unit; /* Memory unit size in bytes */ } tgt_sysinfo; + //@{ + /// ioctl() command codes. + /// These were calculated using the SPARC Linux headers on an x86 + /// machine and thus may not be correct. It would be good to + /// verify/update these values on an actual SPARC Linux machine. + static const unsigned TGT_TCGETA = 0x40125401; + static const unsigned TGT_TCSETAW = 0x80125403; + static const unsigned TGT_TCGETS = 0x40385408; + static const unsigned TGT_FIONREAD = 0x4004667f; + static const unsigned TGT_TIOCGETP = 0x40067408; + static const unsigned TGT_TIOCSETP = 0x80067409; + static const unsigned TGT_TIOCSETN = 0x8006740a; + //@} + + static bool + isTtyReq(unsigned req) + { + switch (req) { + case TGT_TIOCGETP: + case TGT_TIOCSETP: + case TGT_TIOCSETN: + case TGT_TCGETS: + case TGT_TCGETA: + case TGT_TCSETAW: + return true; + default: + return false; + } + } }; class Sparc32Linux : public SparcLinux |