diff options
author | Derek Hower <drh5@cs.wisc.edu> | 2010-01-19 15:48:12 -0600 |
---|---|---|
committer | Derek Hower <drh5@cs.wisc.edu> | 2010-01-19 15:48:12 -0600 |
commit | 279f179babc9e5663156777c533c06edc91bce9a (patch) | |
tree | e6718ee514cc81678491b50562ce8c463c0b20fd /src/kern | |
parent | 5aa104e072eb20f6aca49b169521b0c2da33c844 (diff) | |
parent | 295516a590b6e47c9a881f193027447e500c749c (diff) | |
download | gem5-279f179babc9e5663156777c533c06edc91bce9a.tar.xz |
merge
Diffstat (limited to 'src/kern')
-rw-r--r-- | src/kern/linux/linux.cc | 1 | ||||
-rw-r--r-- | src/kern/linux/linux.hh | 12 | ||||
-rw-r--r-- | src/kern/linux/printk.hh | 2 | ||||
-rw-r--r-- | src/kern/operatingsystem.hh | 4 | ||||
-rw-r--r-- | src/kern/system_events.cc | 2 | ||||
-rw-r--r-- | src/kern/tru64/dump_mbuf.cc | 1 | ||||
-rw-r--r-- | src/kern/tru64/tru64.hh | 79 | ||||
-rw-r--r-- | src/kern/tru64/tru64_events.cc | 1 |
8 files changed, 68 insertions, 34 deletions
diff --git a/src/kern/linux/linux.cc b/src/kern/linux/linux.cc index abe7c0b75..72f1832b8 100644 --- a/src/kern/linux/linux.cc +++ b/src/kern/linux/linux.cc @@ -28,6 +28,7 @@ * Authors: Ali Saidi */ +#include <cstdio> #include <string> #include "cpu/thread_context.hh" diff --git a/src/kern/linux/linux.hh b/src/kern/linux/linux.hh index 7c16228ea..7fe107139 100644 --- a/src/kern/linux/linux.hh +++ b/src/kern/linux/linux.hh @@ -62,6 +62,7 @@ class Linux : public OperatingSystem typedef uint64_t size_t; typedef uint64_t off_t; typedef int64_t time_t; + typedef int64_t clock_t; typedef uint32_t uid_t; typedef uint32_t gid_t; //@} @@ -136,6 +137,17 @@ class Linux : public OperatingSystem int64_t tv_usec; //!< microseconds }; + /// Clock ticks per second, for times(). + static const int M5_SC_CLK_TCK = 100; + + /// For times(). + struct tms { + int64_t tms_utime; //!< user time + int64_t tms_stime; //!< system time + int64_t tms_cutime; //!< user time of children + int64_t tms_cstime; //!< system time of children + }; + // For writev/readv struct tgt_iovec { uint64_t iov_base; // void * diff --git a/src/kern/linux/printk.hh b/src/kern/linux/printk.hh index da9564b7e..5c6ee073d 100644 --- a/src/kern/linux/printk.hh +++ b/src/kern/linux/printk.hh @@ -32,8 +32,6 @@ #ifndef __PRINTK_HH__ #define __PRINTK_HH__ -#include "arch/isa_specific.hh" - #include <sstream> class Arguments; diff --git a/src/kern/operatingsystem.hh b/src/kern/operatingsystem.hh index 47e64ffd9..6574e3c6b 100644 --- a/src/kern/operatingsystem.hh +++ b/src/kern/operatingsystem.hh @@ -122,6 +122,10 @@ class OperatingSystem { static int openSpecialFile(std::string path, LiveProcess *process, ThreadContext *tc); + static const bool mmapGrowsUp = true; + + static bool mmapGrowsDown() { return false; } + }; // class OperatingSystem diff --git a/src/kern/system_events.cc b/src/kern/system_events.cc index 6fd9e1563..bd01ed9ed 100644 --- a/src/kern/system_events.cc +++ b/src/kern/system_events.cc @@ -29,9 +29,9 @@ * Nathan Binkert */ -//For ISA_HAS_DELAY_SLOT #include "arch/isa_traits.hh" #include "base/trace.hh" +#include "config/the_isa.hh" #include "cpu/thread_context.hh" #include "kern/system_events.hh" diff --git a/src/kern/tru64/dump_mbuf.cc b/src/kern/tru64/dump_mbuf.cc index 517aad6fa..207d30792 100644 --- a/src/kern/tru64/dump_mbuf.cc +++ b/src/kern/tru64/dump_mbuf.cc @@ -37,6 +37,7 @@ #include "base/loader/symtab.hh" #include "base/trace.hh" #include "base/types.hh" +#include "config/the_isa.hh" #include "cpu/thread_context.hh" #include "kern/tru64/mbuf.hh" #include "sim/arguments.hh" diff --git a/src/kern/tru64/tru64.hh b/src/kern/tru64/tru64.hh index bf46e0de4..033f30946 100644 --- a/src/kern/tru64/tru64.hh +++ b/src/kern/tru64/tru64.hh @@ -31,6 +31,7 @@ #ifndef __TRU64_HH__ #define __TRU64_HH__ + #include "config/full_system.hh" #include "kern/operatingsystem.hh" @@ -55,6 +56,7 @@ class Tru64 {}; #include <string.h> // for memset() #include <unistd.h> +#include "config/the_isa.hh" #include "arch/alpha/registers.hh" #include "cpu/base.hh" #include "sim/core.hh" @@ -438,10 +440,11 @@ class Tru64 : public OperatingSystem #ifdef __CYGWIN__ panic("getdirent not implemented on cygwin!"); #else - int fd = process->sim_fd(process->getSyscallArg(tc, 0)); - Addr tgt_buf = process->getSyscallArg(tc, 1); - int tgt_nbytes = process->getSyscallArg(tc, 2); - Addr tgt_basep = process->getSyscallArg(tc, 3); + int index = 0; + int fd = process->sim_fd(process->getSyscallArg(tc, index)); + Addr tgt_buf = process->getSyscallArg(tc, index); + int tgt_nbytes = process->getSyscallArg(tc, index); + Addr tgt_basep = process->getSyscallArg(tc, index); char * const host_buf = new char[tgt_nbytes]; @@ -496,7 +499,8 @@ class Tru64 : public OperatingSystem { using namespace TheISA; - TypedBufferArg<Tru64::sigcontext> sc(process->getSyscallArg(tc, 0)); + int index = 0; + TypedBufferArg<Tru64::sigcontext> sc(process->getSyscallArg(tc, index)); sc.copyIn(tc->getMemPort()); @@ -528,7 +532,8 @@ class Tru64 : public OperatingSystem { using namespace TheISA; - TypedBufferArg<Tru64::vm_stack> argp(process->getSyscallArg(tc, 0)); + int index = 0; + TypedBufferArg<Tru64::vm_stack> argp(process->getSyscallArg(tc, index)); argp.copyIn(tc->getMemPort()); @@ -576,9 +581,10 @@ class Tru64 : public OperatingSystem using namespace std; using namespace TheISA; + int index = 0; TypedBufferArg<Tru64::nxm_task_attr> - attrp(process->getSyscallArg(tc, 0)); - TypedBufferArg<Addr> configptr_ptr(process->getSyscallArg(tc, 1)); + attrp(process->getSyscallArg(tc, index)); + TypedBufferArg<Addr> configptr_ptr(process->getSyscallArg(tc, index)); attrp.copyIn(tc->getMemPort()); @@ -710,10 +716,11 @@ class Tru64 : public OperatingSystem using namespace std; using namespace TheISA; + int index = 0; TypedBufferArg<Tru64::nxm_thread_attr> - attrp(process->getSyscallArg(tc, 0)); - TypedBufferArg<uint64_t> kidp(process->getSyscallArg(tc, 1)); - int thread_index = process->getSyscallArg(tc, 2); + attrp(process->getSyscallArg(tc, index)); + TypedBufferArg<uint64_t> kidp(process->getSyscallArg(tc, index)); + int thread_index = process->getSyscallArg(tc, index); // get attribute args attrp.copyIn(tc->getMemPort()); @@ -832,11 +839,12 @@ class Tru64 : public OperatingSystem { using namespace std; - uint64_t tid = process->getSyscallArg(tc, 0); - uint64_t secs = process->getSyscallArg(tc, 1); - uint64_t flags = process->getSyscallArg(tc, 2); - uint64_t action = process->getSyscallArg(tc, 3); - uint64_t usecs = process->getSyscallArg(tc, 4); + int index = 0; + uint64_t tid = process->getSyscallArg(tc, index); + uint64_t secs = process->getSyscallArg(tc, index); + uint64_t flags = process->getSyscallArg(tc, index); + uint64_t action = process->getSyscallArg(tc, index); + uint64_t usecs = process->getSyscallArg(tc, index); cout << tc->getCpuPtr()->name() << ": nxm_thread_block " << tid << " " << secs << " " << flags << " " << action << " " << usecs << endl; @@ -851,11 +859,12 @@ class Tru64 : public OperatingSystem { using namespace std; - Addr uaddr = process->getSyscallArg(tc, 0); - uint64_t val = process->getSyscallArg(tc, 1); - uint64_t secs = process->getSyscallArg(tc, 2); - uint64_t usecs = process->getSyscallArg(tc, 3); - uint64_t flags = process->getSyscallArg(tc, 4); + int index = 0; + Addr uaddr = process->getSyscallArg(tc, index); + uint64_t val = process->getSyscallArg(tc, index); + uint64_t secs = process->getSyscallArg(tc, index); + uint64_t usecs = process->getSyscallArg(tc, index); + uint64_t flags = process->getSyscallArg(tc, index); BaseCPU *cpu = tc->getCpuPtr(); @@ -874,7 +883,8 @@ class Tru64 : public OperatingSystem { using namespace std; - Addr uaddr = process->getSyscallArg(tc, 0); + int index = 0; + Addr uaddr = process->getSyscallArg(tc, index); cout << tc->getCpuPtr()->name() << ": nxm_unblock " << hex << uaddr << dec << endl; @@ -975,7 +985,8 @@ class Tru64 : public OperatingSystem m5_mutex_lockFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *tc) { - Addr uaddr = process->getSyscallArg(tc, 0); + int index = 0; + Addr uaddr = process->getSyscallArg(tc, index); m5_lock_mutex(uaddr, process, tc); @@ -992,7 +1003,8 @@ class Tru64 : public OperatingSystem { using namespace TheISA; - Addr uaddr = process->getSyscallArg(tc, 0); + int index = 0; + Addr uaddr = process->getSyscallArg(tc, index); TypedBufferArg<uint64_t> lockp(uaddr); lockp.copyIn(tc->getMemPort()); @@ -1012,7 +1024,8 @@ class Tru64 : public OperatingSystem m5_mutex_unlockFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *tc) { - Addr uaddr = process->getSyscallArg(tc, 0); + int index = 0; + Addr uaddr = process->getSyscallArg(tc, index); m5_unlock_mutex(uaddr, process, tc); @@ -1024,7 +1037,8 @@ class Tru64 : public OperatingSystem m5_cond_signalFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *tc) { - Addr cond_addr = process->getSyscallArg(tc, 0); + int index = 0; + Addr cond_addr = process->getSyscallArg(tc, index); // Wake up one process waiting on the condition variable. activate_waiting_context(cond_addr, process); @@ -1037,7 +1051,8 @@ class Tru64 : public OperatingSystem m5_cond_broadcastFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *tc) { - Addr cond_addr = process->getSyscallArg(tc, 0); + int index = 0; + Addr cond_addr = process->getSyscallArg(tc, index); activate_waiting_context(cond_addr, process, true); @@ -1051,8 +1066,9 @@ class Tru64 : public OperatingSystem { using namespace TheISA; - Addr cond_addr = process->getSyscallArg(tc, 0); - Addr lock_addr = process->getSyscallArg(tc, 1); + int index = 0; + Addr cond_addr = process->getSyscallArg(tc, index); + Addr lock_addr = process->getSyscallArg(tc, index); TypedBufferArg<uint64_t> condp(cond_addr); TypedBufferArg<uint64_t> lockp(lock_addr); @@ -1084,10 +1100,11 @@ class Tru64 : public OperatingSystem indirectSyscallFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *tc) { - int new_callnum = process->getSyscallArg(tc, 0); + int index = 0; + int new_callnum = process->getSyscallArg(tc, index); for (int i = 0; i < 5; ++i) - process->setSyscallArg(tc, i, process->getSyscallArg(tc, i+1)); + process->setSyscallArg(tc, i, process->getSyscallArg(tc, index)); SyscallDesc *new_desc = process->getDesc(new_callnum); diff --git a/src/kern/tru64/tru64_events.cc b/src/kern/tru64/tru64_events.cc index 4867df559..460f75dea 100644 --- a/src/kern/tru64/tru64_events.cc +++ b/src/kern/tru64/tru64_events.cc @@ -31,6 +31,7 @@ #include "arch/alpha/ev5.hh" #include "arch/isa_traits.hh" +#include "config/the_isa.hh" #include "cpu/thread_context.hh" #include "cpu/base.hh" #include "kern/system_events.hh" |