summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConscript2
-rw-r--r--arch/mips/isa/base.isa7
-rw-r--r--arch/mips/isa/decoder.isa16
-rw-r--r--arch/mips/isa_traits.hh20
-rw-r--r--arch/mips/linux_process.cc705
-rw-r--r--configs/test/test.py5
-rw-r--r--cpu/simple/cpu.cc20
-rw-r--r--cpu/simple/cpu.hh1
-rw-r--r--dev/io_device.cc104
-rw-r--r--dev/io_device.hh129
-rw-r--r--mem/bus.cc127
-rw-r--r--mem/bus.hh26
-rw-r--r--mem/cache/prefetch/tagged_prefetcher_impl.hh73
-rw-r--r--mem/config/prefetch.hh39
-rw-r--r--mem/mem_object.hh2
-rw-r--r--mem/packet.hh6
-rw-r--r--mem/physical.cc19
-rw-r--r--mem/physical.hh6
-rw-r--r--python/m5/objects/BaseCPU.py2
-rw-r--r--python/m5/objects/Bus.py7
-rw-r--r--sim/main.cc4
-rw-r--r--sim/sim_object.cc20
-rw-r--r--sim/sim_object.hh2
-rw-r--r--sim/syscall_emul.cc4
24 files changed, 808 insertions, 538 deletions
diff --git a/SConscript b/SConscript
index ae77cbbc6..d891f0d6d 100644
--- a/SConscript
+++ b/SConscript
@@ -88,11 +88,13 @@ base_sources = Split('''
cpu/static_inst.cc
cpu/sampler/sampler.cc
+ mem/connector.cc
mem/mem_object.cc
mem/page_table.cc
mem/physical.cc
mem/port.cc
mem/translating_port.cc
+ mem/bus.cc
python/pyconfig.cc
python/embedded_py.cc
diff --git a/arch/mips/isa/base.isa b/arch/mips/isa/base.isa
index 89837c136..139a6d876 100644
--- a/arch/mips/isa/base.isa
+++ b/arch/mips/isa/base.isa
@@ -67,12 +67,11 @@ output decoder {{
ccprintf(ss, "%-10s ", mnemonic);
if(_numDestRegs > 0){
- if(_numSrcRegs > 0)
- ss << ",";
printReg(ss, _destRegIdx[0]);
}
if(_numSrcRegs > 0) {
+ ss << ",";
printReg(ss, _srcRegIdx[0]);
}
@@ -82,8 +81,8 @@ output decoder {{
}
- if(mnemonic == "sll"){
- ccprintf(ss," %d",SA);
+ if(mnemonic == "sll" || mnemonic == "sra"){
+ ccprintf(ss,", %d",SA);
}
return ss.str();
diff --git a/arch/mips/isa/decoder.isa b/arch/mips/isa/decoder.isa
index 2e5f8e536..f5dd3d911 100644
--- a/arch/mips/isa/decoder.isa
+++ b/arch/mips/isa/decoder.isa
@@ -88,10 +88,10 @@ decode OPCODE_HI default Unknown::unknown() {
0x3: movn({{ if (Rt != 0) Rd = Rs; }});
}
- format WarnUnimpl {
- 0x4: syscall();//{{ xc->syscall()}},IsNonSpeculative
- 0x5: break();
- 0x7: sync();
+ format BasicOp {
+ 0x4: syscall({{ xc->syscall(); }},IsNonSpeculative);
+ 0x5: break({{ panic("Not implemented break yet"); }},IsNonSpeculative);
+ 0x7: sync({{ panic("Not implemented sync yet"); }},IsNonSpeculative);
}
}
@@ -865,11 +865,11 @@ decode OPCODE_HI default Unknown::unknown() {
format LoadMemory {
0x0: lb({{ Rt.sw = Mem.sb; }});
0x1: lh({{ Rt.sw = Mem.sh; }});
- 0x2: lwl({{ Rt.sw = Mem.sw; }});//, WordAlign);
+ 0x2: lwl({{ uint32_t temp = Mem.uw<31:16> << 16; Rt.uw &= 0x00FF; Rt.uw |= temp;}}, {{ EA = (Rs + disp) & ~3; }});
0x3: lw({{ Rt.sw = Mem.sw; }});
0x4: lbu({{ Rt.uw = Mem.ub; }});
0x5: lhu({{ Rt.uw = Mem.uh; }});
- 0x6: lwr({{ Rt.uw = Mem.uw; }});//, WordAlign);
+ 0x6: lwr({{ uint32_t temp = 0x00FF & Mem.uw<15:0>; Rt.uw &= 0xFF00; Rt.uw |= temp; }}, {{ EA = (Rs + disp) & ~3; }});
}
0x7: FailUnimpl::reserved();
@@ -879,9 +879,9 @@ decode OPCODE_HI default Unknown::unknown() {
format StoreMemory {
0x0: sb({{ Mem.ub = Rt<7:0>; }});
0x1: sh({{ Mem.uh = Rt<15:0>; }});
- 0x2: swl({{ Mem.uw = Rt<31:0>; }});//,WordAlign);
+ 0x2: swl({{ Mem.uh = Rt<31:16>; }}, {{ EA = (Rs + disp) & ~3; }});
0x3: sw({{ Mem.uw = Rt<31:0>; }});
- 0x6: swr({{ Mem.uw = Rt<31:0>; }});//,WordAlign);
+ 0x6: swr({{ Mem.uh = Rt<15:0>; }},{{ EA = ((Rs + disp) & ~3) + 4;}});
}
format WarnUnimpl {
diff --git a/arch/mips/isa_traits.hh b/arch/mips/isa_traits.hh
index 1a982c237..486a5d130 100644
--- a/arch/mips/isa_traits.hh
+++ b/arch/mips/isa_traits.hh
@@ -136,8 +136,8 @@ namespace MipsISA
const int ReturnAddressReg = 31;
const int SyscallNumReg = ReturnValueReg1;
- const int SyscallPseudoReturnReg = ArgumentReg3;
- const int SyscallSuccessReg = 19;
+ const int SyscallPseudoReturnReg = ReturnValueReg1;
+ const int SyscallSuccessReg = ReturnValueReg1;
const int LogVMPageSize = 13; // 8K bytes
const int VMPageSize = (1 << LogVMPageSize);
@@ -589,7 +589,21 @@ extern const Addr PageOffset;
static inline void setSyscallReturn(SyscallReturn return_value, RegFile *regs)
{
- panic("Returning from syscall\n");
+ // check for error condition. Alpha syscall convention is to
+ // indicate success/failure in reg a3 (r19) and put the
+ // return value itself in the standard return value reg (v0).
+ if (return_value.successful()) {
+ // no error
+ regs->intRegFile[ReturnValueReg1] = 0;
+ regs->intRegFile[ReturnValueReg2] = return_value.value();
+ } else {
+ // got an error, return details
+ regs->intRegFile[ReturnValueReg1] = (IntReg) -1;
+ regs->intRegFile[ReturnValueReg2] = -return_value.value();
+ }
+
+ //regs->intRegFile[ReturnValueReg1] = (IntReg)return_value;
+ //panic("Returning from syscall\n");
}
// Machine operations
diff --git a/arch/mips/linux_process.cc b/arch/mips/linux_process.cc
index 93706d8aa..92a79cfd1 100644
--- a/arch/mips/linux_process.cc
+++ b/arch/mips/linux_process.cc
@@ -26,7 +26,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "arch/mips/common_syscall_emul.hh"
#include "arch/mips/linux_process.hh"
#include "arch/mips/isa_traits.hh"
@@ -57,11 +56,11 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process,
return 0;
}
-/// Target osf_getsysyinfo() handler. Even though this call is
+/// Target sys_getsysyinfo() handler. Even though this call is
/// 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,
+sys_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
ExecContext *xc)
{
unsigned op = xc->getSyscallArg(0);
@@ -78,7 +77,7 @@ osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
}
default:
- cerr << "osf_getsysinfo: unknown op " << op << endl;
+ cerr << "sys_getsysinfo: unknown op " << op << endl;
abort();
break;
}
@@ -86,9 +85,9 @@ osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
return 1;
}
-/// Target osf_setsysinfo() handler.
+/// Target sys_setsysinfo() handler.
static SyscallReturn
-osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
+sys_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
ExecContext *xc)
{
unsigned op = xc->getSyscallArg(0);
@@ -100,13 +99,13 @@ osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
TypedBufferArg<uint64_t> fpcr(xc->getSyscallArg(1));
// I don't think this exactly matches the HW FPCR
fpcr.copyIn(xc->getMemPort());
- DPRINTFR(SyscallVerbose, "osf_setsysinfo(SSI_IEEE_FP_CONTROL): "
+ DPRINTFR(SyscallVerbose, "sys_setsysinfo(SSI_IEEE_FP_CONTROL): "
" setting FPCR to 0x%x\n", gtoh(*(uint64_t*)fpcr));
return 0;
}
default:
- cerr << "osf_setsysinfo: unknown op " << op << endl;
+ cerr << "sys_setsysinfo: unknown op " << op << endl;
abort();
break;
}
@@ -116,451 +115,289 @@ osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
SyscallDesc MipsLinuxProcess::syscallDescs[] = {
- /* 0 */ SyscallDesc("osf_syscall", unimplementedFunc),
+ /* 0 */ SyscallDesc("syscall", unimplementedFunc),
/* 1 */ SyscallDesc("exit", exitFunc),
/* 2 */ SyscallDesc("fork", unimplementedFunc),
/* 3 */ SyscallDesc("read", readFunc),
/* 4 */ SyscallDesc("write", writeFunc),
- /* 5 */ SyscallDesc("osf_old_open", unimplementedFunc),
+ /* 5 */ SyscallDesc("open", openFunc<Linux>),
/* 6 */ SyscallDesc("close", closeFunc),
- /* 7 */ SyscallDesc("osf_wait4", unimplementedFunc),
- /* 8 */ SyscallDesc("osf_old_creat", unimplementedFunc),
+ /* 7 */ SyscallDesc("waitpid", unimplementedFunc),
+ /* 8 */ SyscallDesc("creat", unimplementedFunc),
/* 9 */ SyscallDesc("link", unimplementedFunc),
/* 10 */ SyscallDesc("unlink", unlinkFunc),
- /* 11 */ SyscallDesc("osf_execve", unimplementedFunc),
+ /* 11 */ SyscallDesc("execve", unimplementedFunc),
/* 12 */ SyscallDesc("chdir", unimplementedFunc),
- /* 13 */ SyscallDesc("fchdir", unimplementedFunc),
+ /* 13 */ SyscallDesc("time", unimplementedFunc),
/* 14 */ SyscallDesc("mknod", unimplementedFunc),
/* 15 */ SyscallDesc("chmod", chmodFunc<Linux>),
- /* 16 */ SyscallDesc("chown", chownFunc),
- /* 17 */ SyscallDesc("brk", obreakFunc),
- /* 18 */ SyscallDesc("osf_getfsstat", unimplementedFunc),
+ /* 16 */ SyscallDesc("lchown", chownFunc),
+ /* 17 */ SyscallDesc("break", unimplementedFunc), /*obreak*/
+ /* 18 */ SyscallDesc("unused#18", unimplementedFunc),
/* 19 */ SyscallDesc("lseek", lseekFunc),
- /* 20 */ SyscallDesc("getxpid", getpidFunc),
- /* 21 */ SyscallDesc("osf_mount", unimplementedFunc),
+ /* 20 */ SyscallDesc("getpid", getpidFunc),
+ /* 21 */ SyscallDesc("mount", unimplementedFunc),
/* 22 */ SyscallDesc("umount", unimplementedFunc),
/* 23 */ SyscallDesc("setuid", setuidFunc),
- /* 24 */ SyscallDesc("getxuid", getuidFunc),
- /* 25 */ SyscallDesc("exec_with_loader", unimplementedFunc),
- /* 26 */ SyscallDesc("osf_ptrace", unimplementedFunc),
- /* 27 */ SyscallDesc("osf_nrecvmsg", unimplementedFunc),
- /* 28 */ SyscallDesc("osf_nsendmsg", unimplementedFunc),
- /* 29 */ SyscallDesc("osf_nrecvfrom", unimplementedFunc),
- /* 30 */ SyscallDesc("osf_naccept", unimplementedFunc),
- /* 31 */ SyscallDesc("osf_ngetpeername", unimplementedFunc),
- /* 32 */ SyscallDesc("osf_ngetsockname", unimplementedFunc),
+ /* 24 */ SyscallDesc("getuid", getuidFunc),
+ /* 25 */ SyscallDesc("stime", unimplementedFunc),
+ /* 26 */ SyscallDesc("ptrace", unimplementedFunc),
+ /* 27 */ SyscallDesc("alarm", unimplementedFunc),
+ /* 28 */ SyscallDesc("unused#28", unimplementedFunc),
+ /* 29 */ SyscallDesc("pause", unimplementedFunc),
+ /* 30 */ SyscallDesc("utime", unimplementedFunc),
+ /* 31 */ SyscallDesc("stty", unimplementedFunc),
+ /* 32 */ SyscallDesc("gtty", unimplementedFunc),
/* 33 */ SyscallDesc("access", unimplementedFunc),
- /* 34 */ SyscallDesc("osf_chflags", unimplementedFunc),
- /* 35 */ SyscallDesc("osf_fchflags", unimplementedFunc),
+ /* 34 */ SyscallDesc("nice", unimplementedFunc),
+ /* 35 */ SyscallDesc("ftime", unimplementedFunc),
/* 36 */ SyscallDesc("sync", unimplementedFunc),
- /* 37 */ SyscallDesc("kill", unimplementedFunc),
- /* 38 */ SyscallDesc("osf_old_stat", unimplementedFunc),
- /* 39 */ SyscallDesc("setpgid", unimplementedFunc),
- /* 40 */ SyscallDesc("osf_old_lstat", unimplementedFunc),
+ /* 37 */ SyscallDesc("kill", ignoreFunc),
+ /* 38 */ SyscallDesc("rename", unimplementedFunc),
+ /* 39 */ SyscallDesc("mkdir", unimplementedFunc),
+ /* 40 */ SyscallDesc("rmdir", unimplementedFunc),
/* 41 */ SyscallDesc("dup", unimplementedFunc),
/* 42 */ SyscallDesc("pipe", unimplementedFunc),
- /* 43 */ SyscallDesc("osf_set_program_attributes", unimplementedFunc),
- /* 44 */ SyscallDesc("osf_profil", unimplementedFunc),
- /* 45 */ SyscallDesc("open", openFunc<Linux>),
- /* 46 */ SyscallDesc("osf_old_sigaction", unimplementedFunc),
- /* 47 */ SyscallDesc("getxgid", getgidFunc),
- /* 48 */ SyscallDesc("osf_sigprocmask", ignoreFunc),
- /* 49 */ SyscallDesc("osf_getlogin", unimplementedFunc),
- /* 50 */ SyscallDesc("osf_setlogin", unimplementedFunc),
+ /* 43 */ SyscallDesc("times", unimplementedFunc),
+ /* 44 */ SyscallDesc("prof", unimplementedFunc),
+ /* 45 */ SyscallDesc("brk", unimplementedFunc),/*openFunc<Linux>*/
+ /* 46 */ SyscallDesc("setgid", unimplementedFunc),
+ /* 47 */ SyscallDesc("getgid", getgidFunc),
+ /* 48 */ SyscallDesc("signal", ignoreFunc),
+ /* 49 */ SyscallDesc("geteuid", geteuidFunc),
+ /* 50 */ SyscallDesc("getegid", getegidFunc),
/* 51 */ SyscallDesc("acct", unimplementedFunc),
- /* 52 */ SyscallDesc("sigpending", unimplementedFunc),
- /* 53 */ SyscallDesc("osf_classcntl", unimplementedFunc),
+ /* 52 */ SyscallDesc("umount2", unimplementedFunc),
+ /* 53 */ SyscallDesc("lock", unimplementedFunc),
/* 54 */ SyscallDesc("ioctl", ioctlFunc<Linux>),
- /* 55 */ SyscallDesc("osf_reboot", unimplementedFunc),
- /* 56 */ SyscallDesc("osf_revoke", unimplementedFunc),
- /* 57 */ SyscallDesc("symlink", unimplementedFunc),
- /* 58 */ SyscallDesc("readlink", unimplementedFunc),
- /* 59 */ SyscallDesc("execve", unimplementedFunc),
+ /* 55 */ SyscallDesc("fcntl", unimplementedFunc),
+ /* 56 */ SyscallDesc("mpx", unimplementedFunc),
+ /* 57 */ SyscallDesc("setpgid", unimplementedFunc),
+ /* 58 */ SyscallDesc("ulimit", unimplementedFunc),
+ /* 59 */ SyscallDesc("unused#59", unimplementedFunc),
/* 60 */ SyscallDesc("umask", unimplementedFunc),
/* 61 */ SyscallDesc("chroot", unimplementedFunc),
- /* 62 */ SyscallDesc("osf_old_fstat", unimplementedFunc),
- /* 63 */ SyscallDesc("getpgrp", unimplementedFunc),
- /* 64 */ SyscallDesc("getpagesize", getpagesizeFunc),
- /* 65 */ SyscallDesc("osf_mremap", unimplementedFunc),
- /* 66 */ SyscallDesc("vfork", unimplementedFunc),
- /* 67 */ SyscallDesc("stat", statFunc<Linux>),
- /* 68 */ SyscallDesc("lstat", lstatFunc<Linux>),
- /* 69 */ SyscallDesc("osf_sbrk", unimplementedFunc),
- /* 70 */ SyscallDesc("osf_sstk", unimplementedFunc),
- /* 71 */ SyscallDesc("mmap", mmapFunc<Linux>),
- /* 72 */ SyscallDesc("osf_old_vadvise", unimplementedFunc),
- /* 73 */ SyscallDesc("munmap", munmapFunc),
- /* 74 */ SyscallDesc("mprotect", ignoreFunc),
- /* 75 */ SyscallDesc("madvise", unimplementedFunc),
- /* 76 */ SyscallDesc("vhangup", unimplementedFunc),
- /* 77 */ SyscallDesc("osf_kmodcall", unimplementedFunc),
- /* 78 */ SyscallDesc("osf_mincore", unimplementedFunc),
- /* 79 */ SyscallDesc("getgroups", unimplementedFunc),
- /* 80 */ SyscallDesc("setgroups", unimplementedFunc),
- /* 81 */ SyscallDesc("osf_old_getpgrp", unimplementedFunc),
- /* 82 */ SyscallDesc("setpgrp", unimplementedFunc),
- /* 83 */ SyscallDesc("osf_setitimer", unimplementedFunc),
- /* 84 */ SyscallDesc("osf_old_wait", unimplementedFunc),
- /* 85 */ SyscallDesc("osf_table", unimplementedFunc),
- /* 86 */ SyscallDesc("osf_getitimer", unimplementedFunc),
- /* 87 */ SyscallDesc("gethostname", gethostnameFunc),
- /* 88 */ SyscallDesc("sethostname", unimplementedFunc),
- /* 89 */ SyscallDesc("getdtablesize", unimplementedFunc),
- /* 90 */ SyscallDesc("dup2", unimplementedFunc),
- /* 91 */ SyscallDesc("fstat", fstatFunc<Linux>),
- /* 92 */ SyscallDesc("fcntl", fcntlFunc),
- /* 93 */ SyscallDesc("osf_select", unimplementedFunc),
- /* 94 */ SyscallDesc("poll", unimplementedFunc),
- /* 95 */ SyscallDesc("fsync", unimplementedFunc),
- /* 96 */ SyscallDesc("setpriority", unimplementedFunc),
- /* 97 */ SyscallDesc("socket", unimplementedFunc),
- /* 98 */ SyscallDesc("connect", unimplementedFunc),
- /* 99 */ SyscallDesc("accept", unimplementedFunc),
- /* 100 */ SyscallDesc("getpriority", unimplementedFunc),
- /* 101 */ SyscallDesc("send", unimplementedFunc),
- /* 102 */ SyscallDesc("recv", unimplementedFunc),
- /* 103 */ SyscallDesc("sigreturn", unimplementedFunc),
- /* 104 */ SyscallDesc("bind", unimplementedFunc),
- /* 105 */ SyscallDesc("setsockopt", unimplementedFunc),
- /* 106 */ SyscallDesc("listen", unimplementedFunc),
- /* 107 */ SyscallDesc("osf_plock", unimplementedFunc),
- /* 108 */ SyscallDesc("osf_old_sigvec", unimplementedFunc),
- /* 109 */ SyscallDesc("osf_old_sigblock", unimplementedFunc),
- /* 110 */ SyscallDesc("osf_old_sigsetmask", unimplementedFunc),
- /* 111 */ SyscallDesc("sigsuspend", unimplementedFunc),
- /* 112 */ SyscallDesc("osf_sigstack", ignoreFunc),
- /* 113 */ SyscallDesc("recvmsg", unimplementedFunc),
- /* 114 */ SyscallDesc("sendmsg", unimplementedFunc),
- /* 115 */ SyscallDesc("osf_old_vtrace", unimplementedFunc),
- /* 116 */ SyscallDesc("osf_gettimeofday", unimplementedFunc),
- /* 117 */ SyscallDesc("osf_getrusage", unimplementedFunc),
- /* 118 */ SyscallDesc("getsockopt", unimplementedFunc),
- /* 119 */ SyscallDesc("numa_syscalls", unimplementedFunc),
- /* 120 */ SyscallDesc("readv", unimplementedFunc),
- /* 121 */ SyscallDesc("writev", writevFunc<Linux>),
- /* 122 */ SyscallDesc("osf_settimeofday", unimplementedFunc),
- /* 123 */ SyscallDesc("fchown", fchownFunc),
- /* 124 */ SyscallDesc("fchmod", fchmodFunc<Linux>),
- /* 125 */ SyscallDesc("recvfrom", unimplementedFunc),
- /* 126 */ SyscallDesc("setreuid", unimplementedFunc),
- /* 127 */ SyscallDesc("setregid", unimplementedFunc),
- /* 128 */ SyscallDesc("rename", renameFunc),
- /* 129 */ SyscallDesc("truncate", unimplementedFunc),
- /* 130 */ SyscallDesc("ftruncate", unimplementedFunc),
- /* 131 */ SyscallDesc("flock", unimplementedFunc),
- /* 132 */ SyscallDesc("setgid", unimplementedFunc),
- /* 133 */ SyscallDesc("sendto", unimplementedFunc),
- /* 134 */ SyscallDesc("shutdown", unimplementedFunc),
- /* 135 */ SyscallDesc("socketpair", unimplementedFunc),
- /* 136 */ SyscallDesc("mkdir", unimplementedFunc),
- /* 137 */ SyscallDesc("rmdir", unimplementedFunc),
- /* 138 */ SyscallDesc("osf_utimes", unimplementedFunc),
- /* 139 */ SyscallDesc("osf_old_sigreturn", unimplementedFunc),
- /* 140 */ SyscallDesc("osf_adjtime", unimplementedFunc),
- /* 141 */ SyscallDesc("getpeername", unimplementedFunc),
- /* 142 */ SyscallDesc("osf_gethostid", unimplementedFunc),
- /* 143 */ SyscallDesc("osf_sethostid", unimplementedFunc),
- /* 144 */ SyscallDesc("getrlimit", getrlimitFunc<Linux>),
- /* 145 */ SyscallDesc("setrlimit", ignoreFunc),
- /* 146 */ SyscallDesc("osf_old_killpg", unimplementedFunc),
- /* 147 */ SyscallDesc("setsid", unimplementedFunc),
- /* 148 */ SyscallDesc("quotactl", unimplementedFunc),
- /* 149 */ SyscallDesc("osf_oldquota", unimplementedFunc),
- /* 150 */ SyscallDesc("getsockname", unimplementedFunc),
- /* 151 */ SyscallDesc("osf_pread", unimplementedFunc),
- /* 152 */ SyscallDesc("osf_pwrite", unimplementedFunc),
- /* 153 */ SyscallDesc("osf_pid_block", unimplementedFunc),
- /* 154 */ SyscallDesc("osf_pid_unblock", unimplementedFunc),
- /* 155 */ SyscallDesc("osf_signal_urti", unimplementedFunc),
- /* 156 */ SyscallDesc("sigaction", ignoreFunc),
- /* 157 */ SyscallDesc("osf_sigwaitprim", unimplementedFunc),
- /* 158 */ SyscallDesc("osf_nfssvc", unimplementedFunc),
- /* 159 */ SyscallDesc("osf_getdirentries", unimplementedFunc),
- /* 160 */ SyscallDesc("osf_statfs", unimplementedFunc),
- /* 161 */ SyscallDesc("osf_fstatfs", unimplementedFunc),
- /* 162 */ SyscallDesc("unknown #162", unimplementedFunc),
- /* 163 */ SyscallDesc("osf_async_daemon", unimplementedFunc),
- /* 164 */ SyscallDesc("osf_getfh", unimplementedFunc),
- /* 165 */ SyscallDesc("osf_getdomainname", unimplementedFunc),
- /* 166 */ SyscallDesc("setdomainname", unimplementedFunc),
- /* 167 */ SyscallDesc("unknown #167", unimplementedFunc),
- /* 168 */ SyscallDesc("unknown #168", unimplementedFunc),
- /* 169 */ SyscallDesc("osf_exportfs", unimplementedFunc),
- /* 170 */ SyscallDesc("unknown #170", unimplementedFunc),
- /* 171 */ SyscallDesc("unknown #171", unimplementedFunc),
- /* 172 */ SyscallDesc("unknown #172", unimplementedFunc),
- /* 173 */ SyscallDesc("unknown #173", unimplementedFunc),
- /* 174 */ SyscallDesc("unknown #174", unimplementedFunc),
- /* 175 */ SyscallDesc("unknown #175", unimplementedFunc),
- /* 176 */ SyscallDesc("unknown #176", unimplementedFunc),
- /* 177 */ SyscallDesc("unknown #177", unimplementedFunc),
- /* 178 */ SyscallDesc("unknown #178", unimplementedFunc),
- /* 179 */ SyscallDesc("unknown #179", unimplementedFunc),
- /* 180 */ SyscallDesc("unknown #180", unimplementedFunc),
- /* 181 */ SyscallDesc("osf_alt_plock", unimplementedFunc),
+ /* 62 */ SyscallDesc("ustat", unimplementedFunc),
+ /* 63 */ SyscallDesc("dup2", unimplementedFunc),
+ /* 64 */ SyscallDesc("getppid", getpagesizeFunc),
+ /* 65 */ SyscallDesc("getpgrp", unimplementedFunc),
+ /* 66 */ SyscallDesc("setsid", unimplementedFunc),
+ /* 67 */ SyscallDesc("sigaction", statFunc<Linux>),
+ /* 68 */ SyscallDesc("sgetmask", lstatFunc<Linux>),
+ /* 69 */ SyscallDesc("ssetmask", unimplementedFunc),
+ /* 70 */ SyscallDesc("setreuid", unimplementedFunc),
+ /* 71 */ SyscallDesc("setregid", mmapFunc<Linux>),
+ /* 72 */ SyscallDesc("sigsuspend", unimplementedFunc),
+ /* 73 */ SyscallDesc("sigpending", munmapFunc),
+ /* 74 */ SyscallDesc("sethostname", ignoreFunc),
+ /* 75 */ SyscallDesc("setrlimit", unimplementedFunc),
+ /* 76 */ SyscallDesc("getrlimit", unimplementedFunc),
+ /* 77 */ SyscallDesc("getrusage", unimplementedFunc),
+ /* 78 */ SyscallDesc("gettimeofday", unimplementedFunc),
+ /* 79 */ SyscallDesc("settimeofday", unimplementedFunc),
+ /* 80 */ SyscallDesc("getgroups", unimplementedFunc),
+ /* 81 */ SyscallDesc("setgroups", unimplementedFunc),
+ /* 82 */ SyscallDesc("reserved#82", unimplementedFunc),
+ /* 83 */ SyscallDesc("symlink", unimplementedFunc),
+ /* 84 */ SyscallDesc("unused#84", unimplementedFunc),
+ /* 85 */ SyscallDesc("readlink", unimplementedFunc),
+ /* 86 */ SyscallDesc("uselib", unimplementedFunc),
+ /* 87 */ SyscallDesc("swapon", gethostnameFunc),
+ /* 88 */ SyscallDesc("reboot", unimplementedFunc),
+ /* 89 */ SyscallDesc("readdir", unimplementedFunc),
+ /* 90 */ SyscallDesc("mmap", mmapFunc<Linux>),
+ /* 91 */ SyscallDesc("munmap",unimplementedFunc),/*fstatFunc<Linux>*/
+ /* 92 */ SyscallDesc("truncate", fcntlFunc),
+ /* 93 */ SyscallDesc("ftruncate", unimplementedFunc),
+ /* 94 */ SyscallDesc("fchmod", unimplementedFunc),
+ /* 95 */ SyscallDesc("fchown", unimplementedFunc),
+ /* 96 */ SyscallDesc("getpriority", unimplementedFunc),
+ /* 97 */ SyscallDesc("setpriority", unimplementedFunc),
+ /* 98 */ SyscallDesc("profil", unimplementedFunc),
+ /* 99 */ SyscallDesc("statfs", unimplementedFunc),
+ /* 100 */ SyscallDesc("fstatfs", unimplementedFunc),
+ /* 101 */ SyscallDesc("ioperm", unimplementedFunc),
+ /* 102 */ SyscallDesc("socketcall", unimplementedFunc),
+ /* 103 */ SyscallDesc("syslog", unimplementedFunc),
+ /* 104 */ SyscallDesc("setitimer", unimplementedFunc),
+ /* 105 */ SyscallDesc("getitimer", unimplementedFunc),
+ /* 106 */ SyscallDesc("stat", unimplementedFunc),
+ /* 107 */ SyscallDesc("lstat", unimplementedFunc),
+ /* 108 */ SyscallDesc("fstat", unimplementedFunc),
+ /* 109 */ SyscallDesc("unused#109", unimplementedFunc),
+ /* 110 */ SyscallDesc("iopl", unimplementedFunc),
+ /* 111 */ SyscallDesc("vhangup", unimplementedFunc),
+ /* 112 */ SyscallDesc("idle", ignoreFunc),
+ /* 113 */ SyscallDesc("vm86", unimplementedFunc),
+ /* 114 */ SyscallDesc("wait4", unimplementedFunc),
+ /* 115 */ SyscallDesc("swapoff", unimplementedFunc),
+ /* 116 */ SyscallDesc("sysinfo", unimplementedFunc),
+ /* 117 */ SyscallDesc("ipc", unimplementedFunc),
+ /* 118 */ SyscallDesc("fsync", unimplementedFunc),
+ /* 119 */ SyscallDesc("sigreturn", unimplementedFunc),
+ /* 120 */ SyscallDesc("clone", unimplementedFunc),
+ /* 121 */ SyscallDesc("setdomainname", unimplementedFunc),
+ /* 122 */ SyscallDesc("uname", unameFunc),
+ /* 123 */ SyscallDesc("modify_ldt", unimplementedFunc),
+ /* 124 */ SyscallDesc("adjtimex", unimplementedFunc),
+ /* 125 */ SyscallDesc("mprotect", unimplementedFunc),
+ /* 126 */ SyscallDesc("sigprocmask", unimplementedFunc),
+ /* 127 */ SyscallDesc("create_module", unimplementedFunc),
+ /* 128 */ SyscallDesc("init_module", unimplementedFunc),
+ /* 129 */ SyscallDesc("delete_module", unimplementedFunc),
+ /* 130 */ SyscallDesc("get_kernel_syms", unimplementedFunc),
+ /* 131 */ SyscallDesc("quotactl", unimplementedFunc),
+ /* 132 */ SyscallDesc("getpgid", unimplementedFunc),
+ /* 133 */ SyscallDesc("fchdir", unimplementedFunc),
+ /* 134 */ SyscallDesc("bdflush", unimplementedFunc),
+ /* 135 */ SyscallDesc("sysfs", unimplementedFunc),
+ /* 136 */ SyscallDesc("personality", unimplementedFunc),
+ /* 137 */ SyscallDesc("afs_syscall", unimplementedFunc),
+ /* 138 */ SyscallDesc("setfsuid", unimplementedFunc),
+ /* 139 */ SyscallDesc("setfsgid", unimplementedFunc),
+ /* 140 */ SyscallDesc("llseek", unimplementedFunc),
+ /* 141 */ SyscallDesc("getdents", unimplementedFunc),
+ /* 142 */ SyscallDesc("newselect", unimplementedFunc),
+ /* 143 */ SyscallDesc("flock", unimplementedFunc),
+ /* 144 */ SyscallDesc("msync", unimplementedFunc),/*getrlimitFunc<Linux>*/
+ /* 145 */ SyscallDesc("readv", unimplementedFunc),
+ /* 146 */ SyscallDesc("writev", writevFunc<Linux>),
+ /* 147 */ SyscallDesc("cacheflush", unimplementedFunc),
+ /* 148 */ SyscallDesc("cachectl", unimplementedFunc),
+ /* 149 */ SyscallDesc("sysmips", unimplementedFunc),
+ /* 150 */ SyscallDesc("unused#150", unimplementedFunc),
+ /* 151 */ SyscallDesc("getsid", unimplementedFunc),
+ /* 152 */ SyscallDesc("fdatasync", unimplementedFunc),
+ /* 153 */ SyscallDesc("sysctl", unimplementedFunc),
+ /* 154 */ SyscallDesc("mlock", unimplementedFunc),
+ /* 155 */ SyscallDesc("munlock", unimplementedFunc),
+ /* 156 */ SyscallDesc("mlockall", unimplementedFunc),
+ /* 157 */ SyscallDesc("munlockall", unimplementedFunc),
+ /* 158 */ SyscallDesc("sched_setparam", unimplementedFunc),
+ /* 159 */ SyscallDesc("sched_getparam", unimplementedFunc),
+ /* 160 */ SyscallDesc("sched_setscheduler", unimplementedFunc),
+ /* 161 */ SyscallDesc("sched_getscheduler", unimplementedFunc),
+ /* 162 */ SyscallDesc("sched_yield", unimplementedFunc),
+ /* 163 */ SyscallDesc("sched_get_prioritymax", unimplementedFunc),
+ /* 164 */ SyscallDesc("sched_get_priority_min", unimplementedFunc),
+ /* 165 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc),
+ /* 166 */ SyscallDesc("nanosleep", unimplementedFunc),
+ /* 167 */ SyscallDesc("mremap", unimplementedFunc),
+ /* 168 */ SyscallDesc("accept", unimplementedFunc),
+ /* 169 */ SyscallDesc("bind", unimplementedFunc),
+ /* 170 */ SyscallDesc("connect", unimplementedFunc),
+ /* 171 */ SyscallDesc("getpeername", unimplementedFunc),
+ /* 172 */ SyscallDesc("getsockname", unimplementedFunc),
+ /* 173 */ SyscallDesc("getsockopt", unimplementedFunc),
+ /* 174 */ SyscallDesc("listen", unimplementedFunc),
+ /* 175 */ SyscallDesc("recv", unimplementedFunc),
+ /* 176 */ SyscallDesc("recvmsg", unimplementedFunc),
+ /* 177 */ SyscallDesc("send", unimplementedFunc),
+ /* 178 */ SyscallDesc("sendmsg", ignoreFunc),
+ /* 179 */ SyscallDesc("sendto", unimplementedFunc),
+ /* 180 */ SyscallDesc("setsockopt", unimplementedFunc),
+ /* 181 */ SyscallDesc("shutdown", unimplementedFunc),
/* 182 */ SyscallDesc("unknown #182", unimplementedFunc),
- /* 183 */ SyscallDesc("unknown #183", unimplementedFunc),
- /* 184 */ SyscallDesc("osf_getmnt", unimplementedFunc),
- /* 185 */ SyscallDesc("unknown #185", unimplementedFunc),
- /* 186 */ SyscallDesc("unknown #186", unimplementedFunc),
- /* 187 */ SyscallDesc("osf_alt_sigpending", unimplementedFunc),
- /* 188 */ SyscallDesc("osf_alt_setsid", unimplementedFunc),
- /* 189 */ SyscallDesc("unknown #189", unimplementedFunc),
- /* 190 */ SyscallDesc("unknown #190", unimplementedFunc),
- /* 191 */ SyscallDesc("unknown #191", unimplementedFunc),
- /* 192 */ SyscallDesc("unknown #192", unimplementedFunc),
- /* 193 */ SyscallDesc("unknown #193", unimplementedFunc),
- /* 194 */ SyscallDesc("unknown #194", unimplementedFunc),
- /* 195 */ SyscallDesc("unknown #195", unimplementedFunc),
- /* 196 */ SyscallDesc("unknown #196", unimplementedFunc),
- /* 197 */ SyscallDesc("unknown #197", unimplementedFunc),
- /* 198 */ SyscallDesc("unknown #198", unimplementedFunc),
- /* 199 */ SyscallDesc("osf_swapon", unimplementedFunc),
- /* 200 */ SyscallDesc("msgctl", unimplementedFunc),
- /* 201 */ SyscallDesc("msgget", unimplementedFunc),
- /* 202 */ SyscallDesc("msgrcv", unimplementedFunc),
- /* 203 */ SyscallDesc("msgsnd", unimplementedFunc),
- /* 204 */ SyscallDesc("semctl", unimplementedFunc),
- /* 205 */ SyscallDesc("semget", unimplementedFunc),
- /* 206 */ SyscallDesc("semop", unimplementedFunc),
- /* 207 */ SyscallDesc("osf_utsname", unimplementedFunc),
- /* 208 */ SyscallDesc("lchown", unimplementedFunc),
- /* 209 */ SyscallDesc("osf_shmat", unimplementedFunc),
- /* 210 */ SyscallDesc("shmctl", unimplementedFunc),
- /* 211 */ SyscallDesc("shmdt", unimplementedFunc),
- /* 212 */ SyscallDesc("shmget", unimplementedFunc),
- /* 213 */ SyscallDesc("osf_mvalid", unimplementedFunc),
- /* 214 */ SyscallDesc("osf_getaddressconf", unimplementedFunc),
- /* 215 */ SyscallDesc("osf_msleep", unimplementedFunc),
- /* 216 */ SyscallDesc("osf_mwakeup", unimplementedFunc),
- /* 217 */ SyscallDesc("msync", unimplementedFunc),
- /* 218 */ SyscallDesc("osf_signal", unimplementedFunc),
- /* 219 */ SyscallDesc("osf_utc_gettime", unimplementedFunc),
- /* 220 */ SyscallDesc("osf_utc_adjtime", unimplementedFunc),
- /* 221 */ SyscallDesc("unknown #221", unimplementedFunc),
- /* 222 */ SyscallDesc("osf_security", unimplementedFunc),
- /* 223 */ SyscallDesc("osf_kloadcall", unimplementedFunc),
- /* 224 */ SyscallDesc("unknown #224", unimplementedFunc),
- /* 225 */ SyscallDesc("unknown #225", unimplementedFunc),
- /* 226 */ SyscallDesc("unknown #226", unimplementedFunc),
- /* 227 */ SyscallDesc("unknown #227", unimplementedFunc),
- /* 228 */ SyscallDesc("unknown #228", unimplementedFunc),
- /* 229 */ SyscallDesc("unknown #229", unimplementedFunc),
- /* 230 */ SyscallDesc("unknown #230", unimplementedFunc),
- /* 231 */ SyscallDesc("unknown #231", unimplementedFunc),
- /* 232 */ SyscallDesc("unknown #232", unimplementedFunc),
- /* 233 */ SyscallDesc("getpgid", unimplementedFunc),
- /* 234 */ SyscallDesc("getsid", unimplementedFunc),
- /* 235 */ SyscallDesc("sigaltstack", ignoreFunc),
- /* 236 */ SyscallDesc("osf_waitid", unimplementedFunc),
- /* 237 */ SyscallDesc("osf_priocntlset", unimplementedFunc),
- /* 238 */ SyscallDesc("osf_sigsendset", unimplementedFunc),
- /* 239 */ SyscallDesc("osf_set_speculative", unimplementedFunc),
- /* 240 */ SyscallDesc("osf_msfs_syscall", unimplementedFunc),
- /* 241 */ SyscallDesc("osf_sysinfo", unimplementedFunc),
- /* 242 */ SyscallDesc("osf_uadmin", unimplementedFunc),
- /* 243 */ SyscallDesc("osf_fuser", unimplementedFunc),
- /* 244 */ SyscallDesc("osf_proplist_syscall", unimplementedFunc),
- /* 245 */ SyscallDesc("osf_ntp_adjtime", unimplementedFunc),
- /* 246 */ SyscallDesc("osf_ntp_gettime", unimplementedFunc),
- /* 247 */ SyscallDesc("osf_pathconf", unimplementedFunc),
- /* 248 */ SyscallDesc("osf_fpathconf", unimplementedFunc),
- /* 249 */ SyscallDesc("unknown #249", unimplementedFunc),
- /* 250 */ SyscallDesc("osf_uswitch", unimplementedFunc),
- /* 251 */ SyscallDesc("osf_usleep_thread", unimplementedFunc),
- /* 252 */ SyscallDesc("osf_audcntl", unimplementedFunc),
- /* 253 */ SyscallDesc("osf_audgen", unimplementedFunc),
- /* 254 */ SyscallDesc("sysfs", unimplementedFunc),
- /* 255 */ SyscallDesc("osf_subsys_info", unimplementedFunc),
- /* 256 */ SyscallDesc("osf_getsysinfo", osf_getsysinfoFunc),
- /* 257 */ SyscallDesc("osf_setsysinfo", osf_setsysinfoFunc),
- /* 258 */ SyscallDesc("osf_afs_syscall", unimplementedFunc),
- /* 259 */ SyscallDesc("osf_swapctl", unimplementedFunc),
- /* 260 */ SyscallDesc("osf_memcntl", unimplementedFunc),
- /* 261 */ SyscallDesc("osf_fdatasync", unimplementedFunc),
- /* 262 */ SyscallDesc("unknown #262", unimplementedFunc),
- /* 263 */ SyscallDesc("unknown #263", unimplementedFunc),
- /* 264 */ SyscallDesc("unknown #264", unimplementedFunc),
- /* 265 */ SyscallDesc("unknown #265", unimplementedFunc),
- /* 266 */ SyscallDesc("unknown #266", unimplementedFunc),
- /* 267 */ SyscallDesc("unknown #267", unimplementedFunc),
- /* 268 */ SyscallDesc("unknown #268", unimplementedFunc),
- /* 269 */ SyscallDesc("unknown #269", unimplementedFunc),
- /* 270 */ SyscallDesc("unknown #270", unimplementedFunc),
- /* 271 */ SyscallDesc("unknown #271", unimplementedFunc),
- /* 272 */ SyscallDesc("unknown #272", unimplementedFunc),
- /* 273 */ SyscallDesc("unknown #273", unimplementedFunc),
- /* 274 */ SyscallDesc("unknown #274", unimplementedFunc),
- /* 275 */ SyscallDesc("unknown #275", unimplementedFunc),
- /* 276 */ SyscallDesc("unknown #276", unimplementedFunc),
- /* 277 */ SyscallDesc("unknown #277", unimplementedFunc),
- /* 278 */ SyscallDesc("unknown #278", unimplementedFunc),
+ /* 183 */ SyscallDesc("socket", ignoreFunc),
+ /* 184 */ SyscallDesc("socketpair", unimplementedFunc),
+ /* 185 */ SyscallDesc("setresuid", unimplementedFunc),
+ /* 186 */ SyscallDesc("getresuid", unimplementedFunc),
+ /* 187 */ SyscallDesc("query_module", unimplementedFunc),
+ /* 188 */ SyscallDesc("poll", unimplementedFunc),
+ /* 189 */ SyscallDesc("nfsservctl", unimplementedFunc),
+ /* 190 */ SyscallDesc("setresgid", unimplementedFunc),
+ /* 191 */ SyscallDesc("getresgid", unimplementedFunc),
+ /* 192 */ SyscallDesc("prctl", unimplementedFunc),
+ /* 193 */ SyscallDesc("rt_sigreturn", unimplementedFunc),
+ /* 194 */ SyscallDesc("rt_sigaction", ignoreFunc),
+ /* 195 */ SyscallDesc("rt_sigprocmask", ignoreFunc),
+ /* 196 */ SyscallDesc("rt_sigpending", unimplementedFunc),
+ /* 197 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc),
+ /* 198 */ SyscallDesc("rt_sigqueueinfo", ignoreFunc),
+ /* 199 */ SyscallDesc("rt_sigsuspend", unimplementedFunc),
+ /* 200 */ SyscallDesc("pread64", unimplementedFunc),
+ /* 201 */ SyscallDesc("pwrite64", unimplementedFunc),
+ /* 202 */ SyscallDesc("chown", unimplementedFunc),
+ /* 203 */ SyscallDesc("getcwd", unimplementedFunc),
+ /* 204 */ SyscallDesc("capget", unimplementedFunc),
+ /* 205 */ SyscallDesc("capset", unimplementedFunc),
+ /* 206 */ SyscallDesc("sigalstack", unimplementedFunc),
+ /* 207 */ SyscallDesc("sendfile", unimplementedFunc),
+ /* 208 */ SyscallDesc("getpmsg", unimplementedFunc),
+ /* 209 */ SyscallDesc("putpmsg", unimplementedFunc),
+ /* 210 */ SyscallDesc("mmap2", unimplementedFunc),
+ /* 211 */ SyscallDesc("truncate64", unimplementedFunc),
+ /* 212 */ SyscallDesc("ftruncate64", unimplementedFunc),
+ /* 213 */ SyscallDesc("stat64", unimplementedFunc),
+ /* 214 */ SyscallDesc("lstat64", unimplementedFunc),
+ /* 215 */ SyscallDesc("fstat64", unimplementedFunc),
+ /* 216 */ SyscallDesc("pivot_root", unimplementedFunc),
+ /* 217 */ SyscallDesc("mincore", unimplementedFunc),
+ /* 218 */ SyscallDesc("madvise", unimplementedFunc),
+ /* 219 */ SyscallDesc("getdents64", unimplementedFunc),
+ /* 220 */ SyscallDesc("fcntl64", fcntlFunc),
+ /* 221 */ SyscallDesc("reserved#221", unimplementedFunc),
+ /* 222 */ SyscallDesc("gettid", unimplementedFunc),
+ /* 223 */ SyscallDesc("readahead", unimplementedFunc),
+ /* 224 */ SyscallDesc("setxattr", unimplementedFunc),
+ /* 225 */ SyscallDesc("lsetxattr", unimplementedFunc),
+ /* 226 */ SyscallDesc("fsetxattr", unimplementedFunc),
+ /* 227 */ SyscallDesc("getxattr", unimplementedFunc),
+ /* 228 */ SyscallDesc("lgetxattr", unimplementedFunc),
+ /* 229 */ SyscallDesc("fgetxattr", unimplementedFunc),
+ /* 230 */ SyscallDesc("listxattr", unimplementedFunc),
+ /* 231 */ SyscallDesc("llistxattr", unimplementedFunc),
+ /* 232 */ SyscallDesc("flistxattr", unimplementedFunc),
+ /* 233 */ SyscallDesc("removexattr", unimplementedFunc),
+ /* 234 */ SyscallDesc("lremovexattr", unimplementedFunc),
+ /* 235 */ SyscallDesc("fremovexattr", ignoreFunc),
+ /* 236 */ SyscallDesc("tkill", unimplementedFunc),
+ /* 237 */ SyscallDesc("sendfile64", unimplementedFunc),
+ /* 238 */ SyscallDesc("futex", unimplementedFunc),
+ /* 239 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
+ /* 240 */ SyscallDesc("sched_getaffinity", unimplementedFunc),
+ /* 241 */ SyscallDesc("io_setup", unimplementedFunc),
+ /* 242 */ SyscallDesc("io_destroy", unimplementedFunc),
+ /* 243 */ SyscallDesc("io_getevents", unimplementedFunc),
+ /* 244 */ SyscallDesc("io_submit", unimplementedFunc),
+ /* 245 */ SyscallDesc("io_cancel", unimplementedFunc),
+ /* 246 */ SyscallDesc("exit_group", unimplementedFunc),
+ /* 247 */ SyscallDesc("lookup_dcookie", unimplementedFunc),
+ /* 248 */ SyscallDesc("epoll_create", unimplementedFunc),
+ /* 249 */ SyscallDesc("epoll_ctl", unimplementedFunc),
+ /* 250 */ SyscallDesc("epoll_wait", unimplementedFunc),
+ /* 251 */ SyscallDesc("remap_file_pages", unimplementedFunc),
+ /* 252 */ SyscallDesc("set_tid_address", unimplementedFunc),
+ /* 253 */ SyscallDesc("restart_syscall", unimplementedFunc),
+ /* 254 */ SyscallDesc("fadvise64", unimplementedFunc),
+ /* 255 */ SyscallDesc("statfs64", unimplementedFunc),
+ /* 256 */ SyscallDesc("fstafs64", unimplementedFunc),
+ /* 257 */ SyscallDesc("timer_create", sys_getsysinfoFunc),
+ /* 258 */ SyscallDesc("timer_settime", sys_setsysinfoFunc),
+ /* 259 */ SyscallDesc("timer_gettime", unimplementedFunc),
+ /* 260 */ SyscallDesc("timer_getoverrun", unimplementedFunc),
+ /* 261 */ SyscallDesc("timer_delete", unimplementedFunc),
+ /* 262 */ SyscallDesc("clock_settime", unimplementedFunc),
+ /* 263 */ SyscallDesc("clock_gettime", unimplementedFunc),
+ /* 264 */ SyscallDesc("clock_getres", unimplementedFunc),
+ /* 265 */ SyscallDesc("clock_nanosleep", unimplementedFunc),
+ /* 266 */ SyscallDesc("tgkill", unimplementedFunc),
+ /* 267 */ SyscallDesc("utimes", unimplementedFunc),
+ /* 268 */ SyscallDesc("mbind", unimplementedFunc),
+ /* 269 */ SyscallDesc("get_mempolicy", unimplementedFunc),
+ /* 270 */ SyscallDesc("set_mempolicy", unimplementedFunc),
+ /* 271 */ SyscallDesc("mq_open", unimplementedFunc),
+ /* 272 */ SyscallDesc("mq_unlink", unimplementedFunc),
+ /* 273 */ SyscallDesc("mq_timedsend", unimplementedFunc),
+ /* 274 */ SyscallDesc("mq_timedreceive", unimplementedFunc),
+ /* 275 */ SyscallDesc("mq_notify", unimplementedFunc),
+ /* 276 */ SyscallDesc("mq_getsetattr", unimplementedFunc),
+ /* 277 */ SyscallDesc("vserver", unimplementedFunc),
+ /* 278 */ SyscallDesc("waitid", unimplementedFunc),
/* 279 */ SyscallDesc("unknown #279", unimplementedFunc),
- /* 280 */ SyscallDesc("unknown #280", unimplementedFunc),
- /* 281 */ SyscallDesc("unknown #281", unimplementedFunc),
- /* 282 */ SyscallDesc("unknown #282", unimplementedFunc),
- /* 283 */ SyscallDesc("unknown #283", unimplementedFunc),
- /* 284 */ SyscallDesc("unknown #284", unimplementedFunc),
- /* 285 */ SyscallDesc("unknown #285", unimplementedFunc),
- /* 286 */ SyscallDesc("unknown #286", unimplementedFunc),
- /* 287 */ SyscallDesc("unknown #287", unimplementedFunc),
- /* 288 */ SyscallDesc("unknown #288", unimplementedFunc),
- /* 289 */ SyscallDesc("unknown #289", unimplementedFunc),
- /* 290 */ SyscallDesc("unknown #290", unimplementedFunc),
- /* 291 */ SyscallDesc("unknown #291", unimplementedFunc),
- /* 292 */ SyscallDesc("unknown #292", unimplementedFunc),
- /* 293 */ SyscallDesc("unknown #293", unimplementedFunc),
- /* 294 */ SyscallDesc("unknown #294", unimplementedFunc),
- /* 295 */ SyscallDesc("unknown #295", unimplementedFunc),
- /* 296 */ SyscallDesc("unknown #296", unimplementedFunc),
- /* 297 */ SyscallDesc("unknown #297", unimplementedFunc),
- /* 298 */ SyscallDesc("unknown #298", unimplementedFunc),
- /* 299 */ SyscallDesc("unknown #299", unimplementedFunc),
-/*
- * Linux-specific system calls begin at 300
- */
- /* 300 */ SyscallDesc("bdflush", unimplementedFunc),
- /* 301 */ SyscallDesc("sethae", unimplementedFunc),
- /* 302 */ SyscallDesc("mount", unimplementedFunc),
- /* 303 */ SyscallDesc("old_adjtimex", unimplementedFunc),
- /* 304 */ SyscallDesc("swapoff", unimplementedFunc),
- /* 305 */ SyscallDesc("getdents", unimplementedFunc),
- /* 306 */ SyscallDesc("create_module", unimplementedFunc),
- /* 307 */ SyscallDesc("init_module", unimplementedFunc),
- /* 308 */ SyscallDesc("delete_module", unimplementedFunc),
- /* 309 */ SyscallDesc("get_kernel_syms", unimplementedFunc),
- /* 310 */ SyscallDesc("syslog", unimplementedFunc),
- /* 311 */ SyscallDesc("reboot", unimplementedFunc),
- /* 312 */ SyscallDesc("clone", unimplementedFunc),
- /* 313 */ SyscallDesc("uselib", unimplementedFunc),
- /* 314 */ SyscallDesc("mlock", unimplementedFunc),
- /* 315 */ SyscallDesc("munlock", unimplementedFunc),
- /* 316 */ SyscallDesc("mlockall", unimplementedFunc),
- /* 317 */ SyscallDesc("munlockall", unimplementedFunc),
- /* 318 */ SyscallDesc("sysinfo", unimplementedFunc),
- /* 319 */ SyscallDesc("_sysctl", unimplementedFunc),
- /* 320 */ SyscallDesc("was sys_idle", unimplementedFunc),
- /* 321 */ SyscallDesc("oldumount", unimplementedFunc),
- /* 322 */ SyscallDesc("swapon", unimplementedFunc),
- /* 323 */ SyscallDesc("times", ignoreFunc),
- /* 324 */ SyscallDesc("personality", unimplementedFunc),
- /* 325 */ SyscallDesc("setfsuid", unimplementedFunc),
- /* 326 */ SyscallDesc("setfsgid", unimplementedFunc),
- /* 327 */ SyscallDesc("ustat", unimplementedFunc),
- /* 328 */ SyscallDesc("statfs", unimplementedFunc),
- /* 329 */ SyscallDesc("fstatfs", unimplementedFunc),
- /* 330 */ SyscallDesc("sched_setparam", unimplementedFunc),
- /* 331 */ SyscallDesc("sched_getparam", unimplementedFunc),
- /* 332 */ SyscallDesc("sched_setscheduler", unimplementedFunc),
- /* 333 */ SyscallDesc("sched_getscheduler", unimplementedFunc),
- /* 334 */ SyscallDesc("sched_yield", unimplementedFunc),
- /* 335 */ SyscallDesc("sched_get_priority_max", unimplementedFunc),
- /* 336 */ SyscallDesc("sched_get_priority_min", unimplementedFunc),
- /* 337 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc),
- /* 338 */ SyscallDesc("afs_syscall", unimplementedFunc),
- /* 339 */ SyscallDesc("uname", unameFunc),
- /* 340 */ SyscallDesc("nanosleep", unimplementedFunc),
- /* 341 */ SyscallDesc("mremap", unimplementedFunc),
- /* 342 */ SyscallDesc("nfsservctl", unimplementedFunc),
- /* 343 */ SyscallDesc("setresuid", unimplementedFunc),
- /* 344 */ SyscallDesc("getresuid", unimplementedFunc),
- /* 345 */ SyscallDesc("pciconfig_read", unimplementedFunc),
- /* 346 */ SyscallDesc("pciconfig_write", unimplementedFunc),
- /* 347 */ SyscallDesc("query_module", unimplementedFunc),
- /* 348 */ SyscallDesc("prctl", unimplementedFunc),
- /* 349 */ SyscallDesc("pread", unimplementedFunc),
- /* 350 */ SyscallDesc("pwrite", unimplementedFunc),
- /* 351 */ SyscallDesc("rt_sigreturn", unimplementedFunc),
- /* 352 */ SyscallDesc("rt_sigaction", ignoreFunc),
- /* 353 */ SyscallDesc("rt_sigprocmask", unimplementedFunc),
- /* 354 */ SyscallDesc("rt_sigpending", unimplementedFunc),
- /* 355 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc),
- /* 356 */ SyscallDesc("rt_sigqueueinfo", unimplementedFunc),
- /* 357 */ SyscallDesc("rt_sigsuspend", unimplementedFunc),
- /* 358 */ SyscallDesc("select", unimplementedFunc),
- /* 359 */ SyscallDesc("gettimeofday", gettimeofdayFunc<Linux>),
- /* 360 */ SyscallDesc("settimeofday", unimplementedFunc),
- /* 361 */ SyscallDesc("getitimer", unimplementedFunc),
- /* 362 */ SyscallDesc("setitimer", unimplementedFunc),
- /* 363 */ SyscallDesc("utimes", utimesFunc<Linux>),
- /* 364 */ SyscallDesc("getrusage", getrusageFunc<Linux>),
- /* 365 */ SyscallDesc("wait4", unimplementedFunc),
- /* 366 */ SyscallDesc("adjtimex", unimplementedFunc),
- /* 367 */ SyscallDesc("getcwd", unimplementedFunc),
- /* 368 */ SyscallDesc("capget", unimplementedFunc),
- /* 369 */ SyscallDesc("capset", unimplementedFunc),
- /* 370 */ SyscallDesc("sendfile", unimplementedFunc),
- /* 371 */ SyscallDesc("setresgid", unimplementedFunc),
- /* 372 */ SyscallDesc("getresgid", unimplementedFunc),
- /* 373 */ SyscallDesc("dipc", unimplementedFunc),
- /* 374 */ SyscallDesc("pivot_root", unimplementedFunc),
- /* 375 */ SyscallDesc("mincore", unimplementedFunc),
- /* 376 */ SyscallDesc("pciconfig_iobase", unimplementedFunc),
- /* 377 */ SyscallDesc("getdents64", unimplementedFunc),
- /* 378 */ SyscallDesc("gettid", unimplementedFunc),
- /* 379 */ SyscallDesc("readahead", unimplementedFunc),
- /* 380 */ SyscallDesc("security", unimplementedFunc),
- /* 381 */ SyscallDesc("tkill", unimplementedFunc),
- /* 382 */ SyscallDesc("setxattr", unimplementedFunc),
- /* 383 */ SyscallDesc("lsetxattr", unimplementedFunc),
- /* 384 */ SyscallDesc("fsetxattr", unimplementedFunc),
- /* 385 */ SyscallDesc("getxattr", unimplementedFunc),
- /* 386 */ SyscallDesc("lgetxattr", unimplementedFunc),
- /* 387 */ SyscallDesc("fgetxattr", unimplementedFunc),
- /* 388 */ SyscallDesc("listxattr", unimplementedFunc),
- /* 389 */ SyscallDesc("llistxattr", unimplementedFunc),
- /* 390 */ SyscallDesc("flistxattr", unimplementedFunc),
- /* 391 */ SyscallDesc("removexattr", unimplementedFunc),
- /* 392 */ SyscallDesc("lremovexattr", unimplementedFunc),
- /* 393 */ SyscallDesc("fremovexattr", unimplementedFunc),
- /* 394 */ SyscallDesc("futex", unimplementedFunc),
- /* 395 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
- /* 396 */ SyscallDesc("sched_getaffinity", unimplementedFunc),
- /* 397 */ SyscallDesc("tuxcall", unimplementedFunc),
- /* 398 */ SyscallDesc("io_setup", unimplementedFunc),
- /* 399 */ SyscallDesc("io_destroy", unimplementedFunc),
- /* 400 */ SyscallDesc("io_getevents", unimplementedFunc),
- /* 401 */ SyscallDesc("io_submit", unimplementedFunc),
- /* 402 */ SyscallDesc("io_cancel", unimplementedFunc),
- /* 403 */ SyscallDesc("unknown #403", unimplementedFunc),
- /* 404 */ SyscallDesc("unknown #404", unimplementedFunc),
- /* 405 */ SyscallDesc("exit_group", exitFunc), // exit all threads...
- /* 406 */ SyscallDesc("lookup_dcookie", unimplementedFunc),
- /* 407 */ SyscallDesc("sys_epoll_create", unimplementedFunc),
- /* 408 */ SyscallDesc("sys_epoll_ctl", unimplementedFunc),
- /* 409 */ SyscallDesc("sys_epoll_wait", unimplementedFunc),
- /* 410 */ SyscallDesc("remap_file_pages", unimplementedFunc),
- /* 411 */ SyscallDesc("set_tid_address", unimplementedFunc),
- /* 412 */ SyscallDesc("restart_syscall", unimplementedFunc),
- /* 413 */ SyscallDesc("fadvise64", unimplementedFunc),
- /* 414 */ SyscallDesc("timer_create", unimplementedFunc),
- /* 415 */ SyscallDesc("timer_settime", unimplementedFunc),
- /* 416 */ SyscallDesc("timer_gettime", unimplementedFunc),
- /* 417 */ SyscallDesc("timer_getoverrun", unimplementedFunc),
- /* 418 */ SyscallDesc("timer_delete", unimplementedFunc),
- /* 419 */ SyscallDesc("clock_settime", unimplementedFunc),
- /* 420 */ SyscallDesc("clock_gettime", unimplementedFunc),
- /* 421 */ SyscallDesc("clock_getres", unimplementedFunc),
- /* 422 */ SyscallDesc("clock_nanosleep", unimplementedFunc),
- /* 423 */ SyscallDesc("semtimedop", unimplementedFunc),
- /* 424 */ SyscallDesc("tgkill", unimplementedFunc),
- /* 425 */ SyscallDesc("stat64", unimplementedFunc),
- /* 426 */ SyscallDesc("lstat64", lstat64Func<Linux>),
- /* 427 */ SyscallDesc("fstat64", fstat64Func<Linux>),
- /* 428 */ SyscallDesc("vserver", unimplementedFunc),
- /* 429 */ SyscallDesc("mbind", unimplementedFunc),
- /* 430 */ SyscallDesc("get_mempolicy", unimplementedFunc),
- /* 431 */ SyscallDesc("set_mempolicy", unimplementedFunc),
- /* 432 */ SyscallDesc("mq_open", unimplementedFunc),
- /* 433 */ SyscallDesc("mq_unlink", unimplementedFunc),
- /* 434 */ SyscallDesc("mq_timedsend", unimplementedFunc),
- /* 435 */ SyscallDesc("mq_timedreceive", unimplementedFunc),
- /* 436 */ SyscallDesc("mq_notify", unimplementedFunc),
- /* 437 */ SyscallDesc("mq_getsetattr", unimplementedFunc),
- /* 438 */ SyscallDesc("waitid", unimplementedFunc),
- /* 439 */ SyscallDesc("add_key", unimplementedFunc),
- /* 440 */ SyscallDesc("request_key", unimplementedFunc),
- /* 441 */ SyscallDesc("keyctl", unimplementedFunc)
+ /* 280 */ SyscallDesc("add_key", unimplementedFunc),
+ /* 281 */ SyscallDesc("request_key", unimplementedFunc),
+ /* 282 */ SyscallDesc("keyctl", unimplementedFunc),
};
MipsLinuxProcess::MipsLinuxProcess(const std::string &name,
@@ -583,7 +420,11 @@ MipsLinuxProcess::MipsLinuxProcess(const std::string &name,
SyscallDesc*
MipsLinuxProcess::getDesc(int callnum)
{
- if (callnum < 0 || callnum > Num_Syscall_Descs)
+ //MIPS32 syscalls are in the range of 4000 - 4999
+ int m5_sys_idx = callnum - 4000;
+
+ if (m5_sys_idx < 0 || m5_sys_idx > Num_Syscall_Descs)
return NULL;
- return &syscallDescs[callnum];
+
+ return &syscallDescs[m5_sys_idx];
}
diff --git a/configs/test/test.py b/configs/test/test.py
index 86a44313a..098bf017d 100644
--- a/configs/test/test.py
+++ b/configs/test/test.py
@@ -4,7 +4,8 @@ class HelloWorld(AlphaLiveProcess):
executable = '../configs/test/hello'
cmd = 'hello'
-mem = PhysicalMemory()
-cpu = SimpleCPU(workload=HelloWorld(), mem=mem)
+magicbus = Bus()
+mem = PhysicalMemory(bus=magicbus)
+cpu = SimpleCPU(workload=HelloWorld(), mem=magicbus)
system = System(physmem=mem, cpu=cpu)
root = Root(system=system)
diff --git a/cpu/simple/cpu.cc b/cpu/simple/cpu.cc
index d188074d4..8a9e41d53 100644
--- a/cpu/simple/cpu.cc
+++ b/cpu/simple/cpu.cc
@@ -86,6 +86,15 @@ SimpleCPU::TickEvent::TickEvent(SimpleCPU *c, int w)
void
SimpleCPU::init()
{
+ //Create Memory Ports (conect them up)
+ Port *mem_dport = mem->getPort("");
+ dcachePort.setPeer(mem_dport);
+ mem_dport->setPeer(&dcachePort);
+
+ Port *mem_iport = mem->getPort("");
+ icachePort.setPeer(mem_iport);
+ mem_iport->setPeer(&icachePort);
+
BaseCPU::init();
#if FULL_SYSTEM
for (int i = 0; i < execContexts.size(); ++i) {
@@ -146,20 +155,11 @@ SimpleCPU::CpuPort::recvRetry()
}
SimpleCPU::SimpleCPU(Params *p)
- : BaseCPU(p), icachePort(this),
+ : BaseCPU(p), mem(p->mem), icachePort(this),
dcachePort(this), tickEvent(this, p->width), cpuXC(NULL)
{
_status = Idle;
- //Create Memory Ports (conect them up)
- Port *mem_dport = p->mem->getPort();
- dcachePort.setPeer(mem_dport);
- mem_dport->setPeer(&dcachePort);
-
- Port *mem_iport = p->mem->getPort();
- icachePort.setPeer(mem_iport);
- mem_iport->setPeer(&icachePort);
-
#if FULL_SYSTEM
cpuXC = new CPUExecContext(this, 0, p->system, p->itb, p->dtb, p->mem);
#else
diff --git a/cpu/simple/cpu.hh b/cpu/simple/cpu.hh
index dc07027f9..43287a33b 100644
--- a/cpu/simple/cpu.hh
+++ b/cpu/simple/cpu.hh
@@ -105,6 +105,7 @@ class SimpleCPU : public BaseCPU
virtual Packet *recvRetry();
};
+ MemObject *mem;
CpuPort icachePort;
CpuPort dcachePort;
diff --git a/dev/io_device.cc b/dev/io_device.cc
index b580c2805..5f5f9a09d 100644
--- a/dev/io_device.cc
+++ b/dev/io_device.cc
@@ -29,10 +29,44 @@
#include "dev/io_device.hh"
#include "sim/builder.hh"
+
+PioPort::PioPort(PioDevice *dev, Platform *p)
+ : device(dev), platform(p)
+{ }
+
+
+Tick
+PioPort::recvAtomic(Packet &pkt)
+{
+ return device->recvAtomic(pkt);
+}
+
+void
+PioPort::recvFunctional(Packet &pkt)
+{
+ device->recvAtomic(pkt);
+}
+
+void
+PioPort::getDeviceAddressRanges(AddrRangeList &range_list, bool &owner)
+{
+ device->addressRanges(range_list, owner);
+}
+
+
+Packet *
+PioPort::recvRetry()
+{
+ Packet* pkt = transmitList.front();
+ transmitList.pop_front();
+ return pkt;
+}
+
+
void
PioPort::SendEvent::process()
{
- if (port->sendTiming(packet) == Success)
+ if (port->Port::sendTiming(packet) == Success)
return;
port->transmitList.push_back(&packet);
@@ -41,42 +75,62 @@ PioPort::SendEvent::process()
PioDevice::PioDevice(const std::string &name, Platform *p)
: SimObject(name), platform(p)
{
- pioPort = new PioPort(this);
+ pioPort = new PioPort(this, p);
}
bool
-PioDevice::recvTiming(Packet &pkt)
+PioPort::recvTiming(Packet &pkt)
{
device->recvAtomic(pkt);
- sendTiming(pkt, pkt.responseTime-pkt.requestTime);
+ sendTiming(pkt, pkt.time-pkt.req->time);
return Success;
}
PioDevice::~PioDevice()
{
if (pioPort)
- delete pioInterface;
+ delete pioPort;
}
-void
-DmaPort::sendDma(Packet &pkt)
+
+DmaPort::DmaPort(DmaDevice *dev)
+ : device(dev)
+{ }
+
+bool
+DmaPort::recvTiming(Packet &pkt)
{
- device->platform->system->memoryMode()
- {
- case MemAtomic:
- }
+ completionEvent->schedule(curTick+1);
+ completionEvent = NULL;
+ return Success;
}
DmaDevice::DmaDevice(const std::string &name, Platform *p)
: PioDevice(name, p)
{
- dmaPort = new dmaPort(this);
+ dmaPort = new DmaPort(this);
}
void
-DmaPort::dmaAction(Memory::Command cmd, DmaPort port, Addr addr, int size,
- Event *event, uint8_t *data = NULL)
+DmaPort::SendEvent::process()
+{
+ if (port->Port::sendTiming(packet) == Success)
+ return;
+
+ port->transmitList.push_back(&packet);
+}
+
+Packet *
+DmaPort::recvRetry()
+{
+ Packet* pkt = transmitList.front();
+ transmitList.pop_front();
+ return pkt;
+}
+void
+DmaPort::dmaAction(Command cmd, DmaPort port, Addr addr, int size,
+ Event *event, uint8_t *data)
{
assert(event);
@@ -92,7 +146,7 @@ DmaPort::dmaAction(Memory::Command cmd, DmaPort port, Addr addr, int size,
basePkt.dest = 0;
basePkt.cmd = cmd;
basePkt.result = Unknown;
- basePkt.request = NULL;
+ basePkt.req = NULL;
baseReq.nicReq = true;
baseReq.time = curTick;
@@ -109,7 +163,7 @@ DmaPort::dmaAction(Memory::Command cmd, DmaPort port, Addr addr, int size,
pkt->req->size = pkt->size;
// Increment the data pointer on a write
pkt->data = data ? data + prevSize : NULL ;
- prevSize = pkt->size;
+ prevSize += pkt->size;
sendDma(*pkt);
}
@@ -122,29 +176,29 @@ DmaPort::sendDma(Packet &pkt)
// some kind of selction between access methods
// more work is going to have to be done to make
// switching actually work
- MemState state = device->platform->system->memState;
+ /* MemState state = device->platform->system->memState;
if (state == Timing) {
if (sendTiming(pkt) == Failure)
transmitList.push_back(&packet);
- } else if (state == Atomic) {
+ } else if (state == Atomic) {*/
sendAtomic(pkt);
- completionEvent->schedule(pkt.responseTime - pkt.requestTime);
- completionEvent == NULL;
- } else if (state == Functional) {
+ completionEvent->schedule(pkt.time - pkt.req->time);
+ completionEvent = NULL;
+/* } else if (state == Functional) {
sendFunctional(pkt);
// Is this correct???
- completionEvent->schedule(pkt.responseTime - pkt.requestTime);
+ completionEvent->schedule(pkt.req->responseTime - pkt.req->requestTime);
completionEvent == NULL;
} else
panic("Unknown memory command state.");
-
+ */
}
DmaDevice::~DmaDevice()
{
- if (dmaInterface)
- delete dmaInterface;
+ if (dmaPort)
+ delete dmaPort;
}
diff --git a/dev/io_device.hh b/dev/io_device.hh
index a79c3f20a..ba16372cc 100644
--- a/dev/io_device.hh
+++ b/dev/io_device.hh
@@ -32,30 +32,56 @@
#include "base/chunk_generator.hh"
#include "mem/port.hh"
#include "sim/eventq.hh"
+#include "sim/sim_object.hh"
-class Bus;
class Platform;
class PioDevice;
-
+class DmaDevice;
+
+/**
+ * The PioPort class is a programmed i/o port that all devices that are
+ * sensitive to an address range use. The port takes all the memory
+ * access types and roles them into one read() and write() call that the device
+ * must respond to. The device must also provide the addressRanges() function
+ * with which it returns the address ranges it is interested in. An extra
+ * sendTiming() function is implemented which takes an delay. In this way the
+ * device can immediatly call sendTiming(pkt, time) after processing a request
+ * and the request will be handled by the port even if the port bus the device
+ * connects to is blocked.
+ */
class PioPort : public Port
{
protected:
+ /** The device that this port serves. */
PioDevice *device;
+ /** The platform that device/port are in. This is used to select which mode
+ * we are currently operating in. */
+ Platform *platform;
+
+ /** A list of outgoing timing response packets that haven't been serviced
+ * yet. */
+ std::list<Packet*> transmitList;
+
+ /** The current status of the peer(bus) that we are connected to. */
+ Status peerStatus;
+
virtual bool recvTiming(Packet &pkt);
- virtual Tick recvAtomic(Packet &pkt)
- { return device->recvAtomic(pkt) };
+ virtual Tick recvAtomic(Packet &pkt);
- virtual void recvFunctional(Packet &pkt)
- { device->recvAtomic(pkt) };
+ virtual void recvFunctional(Packet &pkt) ;
- virtual void getDeviceAddressRanges(AddrRangeList &range_list, bool &owner)
- { device->addressRanges(range_list, owner); }
+ virtual void recvStatusChange(Status status)
+ { peerStatus = status; }
- void sendTiming(Packet &pkt, Tick time)
- { new SendEvent(this, pkt, time); }
+ virtual void getDeviceAddressRanges(AddrRangeList &range_list, bool &owner);
+ /**
+ * This class is used to implemented sendTiming() with a delay. When a delay
+ * is requested a new event is created. When the event time expires it
+ * attempts to send the packet. If it cannot, the packet is pushed onto the
+ * transmit list to be sent when recvRetry() is called. */
class SendEvent : public Event
{
PioPort *port;
@@ -71,13 +97,19 @@ class PioPort : public Port
{ return "Future scheduled sendTiming event"; }
friend class PioPort;
- }
+ };
+
+ /** Schedule a sendTiming() event to be called in the future. */
+ void sendTiming(Packet &pkt, Tick time)
+ { new PioPort::SendEvent(this, pkt, time); }
+
+ /** This function pops the last element off the transmit list and sends it.*/
+ virtual Packet *recvRetry();
public:
- PioPort(PioDevice *dev)
- : device(dev)
- { }
+ PioPort(PioDevice *dev, Platform *p);
+ friend class PioPort::SendEvent;
};
class DmaPort : public Port
@@ -85,10 +117,10 @@ class DmaPort : public Port
protected:
PioDevice *device;
std::list<Packet*> transmitList;
+ Event *completionEvent;
- virtual bool recvTiming(Packet &pkt)
- { completionEvent->schedule(curTick+1); completionEvent = NULL; }
+ virtual bool recvTiming(Packet &pkt);
virtual Tick recvAtomic(Packet &pkt)
{ panic("dma port shouldn't be used for pio access."); }
virtual void recvFunctional(Packet &pkt)
@@ -97,23 +129,14 @@ class DmaPort : public Port
virtual void recvStatusChange(Status status)
{ ; }
- virtual Packet *recvRetry()
- { return transmitList.pop_front(); }
+ virtual Packet *recvRetry() ;
virtual void getDeviceAddressRanges(AddrRangeList &range_list, bool &owner)
{ range_list.clear(); owner = true; }
- void dmaAction(Memory::Command cmd, DmaPort port, Addr addr, int size,
- Event *event, uint8_t *data = NULL);
-
- void sendDma(Packet &pkt);
-
- virtual Packet *recvRetry()
- { return transmitList.pop_front(); }
-
class SendEvent : public Event
{
- PioPort *port;
+ DmaPort *port;
Packet packet;
SendEvent(PioPort *p, Packet &pkt, Tick t)
@@ -125,46 +148,70 @@ class DmaPort : public Port
virtual const char *description()
{ return "Future scheduled sendTiming event"; }
- friend class PioPort;
- }
+ friend class DmaPort;
+ };
+
+ void dmaAction(Command cmd, DmaPort port, Addr addr, int size,
+ Event *event, uint8_t *data = NULL);
+
+ void sendDma(Packet &pkt);
+
public:
- DmaPort(DmaDevice *dev)
- : device(dev)
- { }
+ DmaPort(DmaDevice *dev);
+ friend class DmaPort::SendEvent;
};
+/**
+ * This device is the base class which all devices senstive to an address range
+ * inherit from. There are three pure virtual functions which all devices must
+ * implement addressRanges(), read(), and write(). The magic do choose which
+ * mode we are in, etc is handled by the PioPort so the device doesn't have to
+ * bother.
+ */
class PioDevice : public SimObject
{
protected:
+ /** The platform we are in. This is used to decide what type of memory
+ * transaction we should perform. */
Platform *platform;
+ /** The pioPort that handles the requests for us and provides us requests
+ * that it sees. */
PioPort *pioPort;
virtual void addressRanges(AddrRangeList &range_list, bool &owner) = 0;
- virtual read(Packet &pkt) = 0;
+ /** As far as the devices are concerned they only accept atomic transactions
+ * which are converted to either a write or a read. */
+ Tick recvAtomic(Packet &pkt)
+ { return pkt.cmd == Read ? this->read(pkt) : this->write(pkt); }
- virtual write(Packet &pkt) = 0;
+ /** Pure virtual function that the device must implement. Called when a read
+ * command is recieved by the port. */
+ virtual bool read(Packet &pkt) = 0;
- Tick recvAtomic(Packet &pkt)
- { return pkt->cmd == Read ? this->read(pkt) : this->write(pkt); }
+ /** Pure virtual function that the device must implement. Called when a
+ * write command is recieved by the port. */
+ virtual bool write(Packet &pkt) = 0;
public:
PioDevice(const std::string &name, Platform *p);
virtual ~PioDevice();
- virtual Port *getPort(std::string if_name)
+ virtual Port *getPort(const std::string &if_name)
{
if (if_name == "pio")
return pioPort;
else
return NULL;
}
+ friend class PioPort;
+
};
class DmaDevice : public PioDevice
@@ -176,18 +223,18 @@ class DmaDevice : public PioDevice
DmaDevice(const std::string &name, Platform *p);
virtual ~DmaDevice();
- virtual Port *getPort(std::string if_name)
+ virtual Port *getPort(const std::string &if_name)
{
if (if_name == "pio")
return pioPort;
- else if (if_name = "dma")
+ else if (if_name == "dma")
return dmaPort;
else
return NULL;
}
-};
-
+ friend class DmaPort;
+};
#endif // __DEV_IO_DEVICE_HH__
diff --git a/mem/bus.cc b/mem/bus.cc
new file mode 100644
index 000000000..dd72ad3b9
--- /dev/null
+++ b/mem/bus.cc
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2006 The Regents of The University of Michigan
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file Definition of a bus object.
+ */
+
+
+#include "bus.hh"
+#include "sim/builder.hh"
+
+/** Function called by the port when the bus is recieving a Timing
+ * transaction.*/
+bool
+Bus::recvTiming(Packet &pkt, int id)
+{
+
+ panic("I need to be implemented, but not right now.");
+}
+
+Port *
+Bus::findPort(Addr addr, int id)
+{
+ /* An interval tree would be a better way to do this. --ali. */
+ int dest_id = -1;
+ int i = 0;
+ bool found = false;
+
+ while (i < portList.size() && !found)
+ {
+ if (portList[i].range == addr) {
+ dest_id = portList[i].portId;
+ found = true;
+ }
+ }
+ assert(dest_id != -1 && "Unable to find destination");
+ // we shouldn't be sending this back to where it came from
+ assert(dest_id != id);
+
+ return interfaces[dest_id];
+}
+
+/** Function called by the port when the bus is recieving a Atomic
+ * transaction.*/
+Tick
+Bus::recvAtomic(Packet &pkt, int id)
+{
+ return findPort(pkt.addr, id)->sendAtomic(pkt);
+}
+
+/** Function called by the port when the bus is recieving a Functional
+ * transaction.*/
+void
+Bus::recvFunctional(Packet &pkt, int id)
+{
+ findPort(pkt.addr, id)->sendFunctional(pkt);
+}
+
+/** Function called by the port when the bus is recieving a status change.*/
+void
+Bus::recvStatusChange(Port::Status status, int id)
+{
+ assert(status == Port:: RangeChange &&
+ "The other statuses need to be implemented.");
+ Port *port = interfaces[id];
+ AddrRangeList ranges;
+ bool owner;
+
+ port->getPeerAddressRanges(ranges, owner);
+ // not dealing with snooping yet either
+ assert(owner == true);
+ // or multiple ranges
+ assert(ranges.size() == 1);
+ DevMap dm;
+ dm.portId = id;
+ dm.range = ranges.front();
+
+ portList.push_back(dm);
+}
+
+void
+Bus::BusPort::addressRanges(AddrRangeList &range_list, bool &owner)
+{
+ panic("I'm not implemented.\n");
+}
+
+BEGIN_DECLARE_SIM_OBJECT_PARAMS(Bus)
+
+ Param<int> bus_id;
+
+END_DECLARE_SIM_OBJECT_PARAMS(Bus)
+
+BEGIN_INIT_SIM_OBJECT_PARAMS(Bus)
+ INIT_PARAM(bus_id, "junk bus id")
+END_INIT_SIM_OBJECT_PARAMS(PhysicalMemory)
+
+CREATE_SIM_OBJECT(Bus)
+{
+ return new Bus(getInstanceName());
+}
+
+REGISTER_SIM_OBJECT("Bus", Bus)
diff --git a/mem/bus.hh b/mem/bus.hh
index e26065295..54de8aa1e 100644
--- a/mem/bus.hh
+++ b/mem/bus.hh
@@ -45,6 +45,13 @@
class Bus : public MemObject
{
+ struct DevMap {
+ int portId;
+ Range<Addr> range;
+ };
+ std::vector<DevMap> portList;
+
+
/** Function called by the port when the bus is recieving a Timing
transaction.*/
bool recvTiming(Packet &pkt, int id);
@@ -60,6 +67,16 @@ class Bus : public MemObject
/** Function called by the port when the bus is recieving a status change.*/
void recvStatusChange(Port::Status status, int id);
+ /** Find which port connected to this bus (if any) should be given a packet
+ * with this address.
+ * @param addr Address to find port for.
+ * @param id Id of the port this packet was received from (to prevent
+ * loops)
+ * @return pointer to port that the packet should be sent out of.
+ */
+ Port *
+ Bus::findPort(Addr addr, int id);
+
/** Decleration of the buses port type, one will be instantiated for each
of the interfaces connecting to the bus. */
class BusPort : public Port
@@ -104,6 +121,10 @@ class Bus : public MemObject
// the 'owned' address ranges of all the other interfaces on
// this bus...
virtual void addressRanges(AddrRangeList &range_list, bool &owner);
+
+ // Hack to make translating port work without changes
+ virtual int deviceBlockSize() { return 32; }
+
};
/** A count of the number of interfaces connected to this bus. */
@@ -116,13 +137,16 @@ class Bus : public MemObject
public:
/** A function used to return the port associated with this bus object. */
- virtual Port *getPort(const char *if_name)
+ virtual Port *getPort(const std::string &if_name)
{
// if_name ignored? forced to be empty?
int id = num_interfaces++;
interfaces[id] = new BusPort(this, id);
return interfaces[id];
}
+ Bus(const std::string &n)
+ : MemObject(n), num_interfaces(0) {}
+
};
#endif //__MEM_BUS_HH__
diff --git a/mem/cache/prefetch/tagged_prefetcher_impl.hh b/mem/cache/prefetch/tagged_prefetcher_impl.hh
new file mode 100644
index 000000000..6c27256a9
--- /dev/null
+++ b/mem/cache/prefetch/tagged_prefetcher_impl.hh
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005 The Regents of The University of Michigan
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file
+ * Describes a tagged prefetcher based on template policies.
+ */
+
+#include "mem/cache/prefetch/tagged_prefetcher.hh"
+
+template <class TagStore, class Buffering>
+TaggedPrefetcher<TagStore, Buffering>::
+TaggedPrefetcher(int size, bool pageStop, bool serialSquash,
+ bool cacheCheckPush, bool onlyData,
+ Tick latency, int degree)
+ :Prefetcher<TagStore, Buffering>(size, pageStop, serialSquash,
+ cacheCheckPush, onlyData),
+ latency(latency), degree(degree)
+{
+}
+
+template <class TagStore, class Buffering>
+void
+TaggedPrefetcher<TagStore, Buffering>::
+calculatePrefetch(MemReqPtr &req, std::list<Addr> &addresses,
+ std::list<Tick> &delays)
+{
+ Addr blkAddr = req->paddr & ~(Addr)(this->blkSize-1);
+
+ for (int d=1; d <= degree; d++) {
+ Addr newAddr = blkAddr + d*(this->blkSize);
+ if (this->pageStop &&
+ (blkAddr & ~(TheISA::VMPageSize - 1)) !=
+ (newAddr & ~(TheISA::VMPageSize - 1)))
+ {
+ //Spanned the page, so now stop
+ this->pfSpanPage += degree - d + 1;
+ return;
+ }
+ else
+ {
+ addresses.push_back(newAddr);
+ delays.push_back(latency);
+ }
+ }
+}
+
+
diff --git a/mem/config/prefetch.hh b/mem/config/prefetch.hh
new file mode 100644
index 000000000..03eb570f0
--- /dev/null
+++ b/mem/config/prefetch.hh
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2004-2005 The Regents of The University of Michigan
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file
+ * Central location to configure which prefetch types we want to build
+ * into the simulator. In the future, this should probably be
+ * autogenerated by some sort of configuration script.
+ */
+#define USE_TAGGED 1 //Be sure not to turn this off, it is also used for no
+ //prefetching case unless you always want to use a
+ //different prefetcher
+//#define USE_STRIDED 1
+//#define USE_GHB 1
diff --git a/mem/mem_object.hh b/mem/mem_object.hh
index 7b3d942a4..58930eccc 100644
--- a/mem/mem_object.hh
+++ b/mem/mem_object.hh
@@ -48,7 +48,7 @@ class MemObject : public SimObject
public:
/** Additional function to return the Port of a memory object. */
- virtual Port *getPort(const char *if_name = NULL) = 0;
+ virtual Port *getPort(const std::string &if_name) = 0;
};
#endif //__MEM_MEM_OBJECT_HH__
diff --git a/mem/packet.hh b/mem/packet.hh
index 260fc60f7..ef28a7c9e 100644
--- a/mem/packet.hh
+++ b/mem/packet.hh
@@ -54,7 +54,8 @@ enum Command
enum PacketResult
{
Success,
- BadAddress
+ BadAddress,
+ Unknown
};
class SenderState{};
@@ -111,6 +112,9 @@ struct Packet
/** The command of the transaction. */
Command cmd;
+ /** The time this request was responded to. Used to calculate latencies. */
+ Tick time;
+
/** The result of the packet transaction. */
PacketResult result;
diff --git a/mem/physical.cc b/mem/physical.cc
index c1e83fb9e..f16b79a8d 100644
--- a/mem/physical.cc
+++ b/mem/physical.cc
@@ -152,10 +152,13 @@ PhysicalMemory::doFunctionalAccess(Packet &pkt)
}
Port *
-PhysicalMemory::getPort(const char *if_name)
+PhysicalMemory::getPort(const std::string &if_name)
{
- if (if_name == NULL) {
- return new MemoryPort(this);
+ if (if_name == "") {
+ if (port != NULL)
+ panic("PhysicalMemory::getPort: additional port requested to memory!");
+ port = new MemoryPort(this);
+ return port;
} else {
panic("PhysicalMemory::getPort: unknown port %s requested", if_name);
}
@@ -181,7 +184,15 @@ void
PhysicalMemory::MemoryPort::getDeviceAddressRanges(AddrRangeList &range_list,
bool &owner)
{
- panic("??");
+ memory->getAddressRanges(range_list, owner);
+}
+
+void
+PhysicalMemory::getAddressRanges(AddrRangeList &range_list, bool &owner)
+{
+ owner = true;
+ range_list.clear();
+ range_list.push_back(RangeSize(base_addr, pmem_size));
}
int
diff --git a/mem/physical.hh b/mem/physical.hh
index b066d3dfc..6d7d809a1 100644
--- a/mem/physical.hh
+++ b/mem/physical.hh
@@ -69,7 +69,7 @@ class PhysicalMemory : public MemObject
virtual int deviceBlockSize();
};
- virtual Port * getPort(const char *if_name);
+ virtual Port *getPort(const std::string &if_name);
int numPorts;
@@ -94,6 +94,7 @@ class PhysicalMemory : public MemObject
Addr base_addr;
Addr pmem_size;
uint8_t *pmem_addr;
+ MemoryPort *port;
int page_ptr;
public:
@@ -106,6 +107,8 @@ class PhysicalMemory : public MemObject
public:
int deviceBlockSize();
+ void getAddressRanges(AddrRangeList &rangeList, bool &owner);
+ void virtual init() { port->sendStatusChange(Port::RangeChange); }
// fast back-door memory access for vtophys(), remote gdb, etc.
// uint64_t phys_read_qword(Addr addr) const;
@@ -119,6 +122,7 @@ class PhysicalMemory : public MemObject
public:
virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string &section);
+
};
/*uint64_t
diff --git a/python/m5/objects/BaseCPU.py b/python/m5/objects/BaseCPU.py
index 07cb850f1..fccddb1ec 100644
--- a/python/m5/objects/BaseCPU.py
+++ b/python/m5/objects/BaseCPU.py
@@ -9,7 +9,7 @@ class BaseCPU(SimObject):
system = Param.System(Parent.any, "system object")
cpu_id = Param.Int(-1, "CPU identifier")
else:
- mem = Param.Memory(Parent.any, "memory")
+ mem = Param.MemObject("memory")
workload = VectorParam.Process("processes to run")
max_insts_all_threads = Param.Counter(0,
diff --git a/python/m5/objects/Bus.py b/python/m5/objects/Bus.py
index 26509d7d2..8c5397281 100644
--- a/python/m5/objects/Bus.py
+++ b/python/m5/objects/Bus.py
@@ -1,7 +1,6 @@
from m5 import *
-from BaseHier import BaseHier
+from MemObject import MemObject
-class Bus(BaseHier):
+class Bus(MemObject):
type = 'Bus'
- clock = Param.Clock("bus frequency")
- width = Param.Int("bus width in bytes")
+ bus_id = Param.Int(0, "blah")
diff --git a/sim/main.cc b/sim/main.cc
index 6f6143506..aecc171ed 100644
--- a/sim/main.cc
+++ b/sim/main.cc
@@ -355,6 +355,10 @@ main(int argc, char **argv)
echoCommandLine(argc, argv, *outputStream);
ParamContext::showAllContexts(*configStream);
+ // Any objects that can't connect themselves until after construction should
+ // do so now
+ SimObject::connectAll();
+
// Do a second pass to finish initializing the sim objects
SimObject::initAll();
diff --git a/sim/sim_object.cc b/sim/sim_object.cc
index f34e17fe6..151ba68a7 100644
--- a/sim/sim_object.cc
+++ b/sim/sim_object.cc
@@ -88,6 +88,11 @@ SimObject::SimObject(const string &_name)
}
void
+SimObject::connect()
+{
+}
+
+void
SimObject::init()
{
}
@@ -151,6 +156,21 @@ SimObject::regAllStats()
}
//
+// static function: call connect() on all SimObjects.
+//
+void
+SimObject::connectAll()
+{
+ SimObjectList::iterator i = simObjectList.begin();
+ SimObjectList::iterator end = simObjectList.end();
+
+ for (; i != end; ++i) {
+ SimObject *obj = *i;
+ obj->connect();
+ }
+}
+
+//
// static function: call init() on all SimObjects.
//
void
diff --git a/sim/sim_object.hh b/sim/sim_object.hh
index 59d9daf45..5db62dd51 100644
--- a/sim/sim_object.hh
+++ b/sim/sim_object.hh
@@ -78,7 +78,9 @@ class SimObject : public Serializable, protected StartupCallback
// initialization pass of all objects.
// Gets invoked after construction, before unserialize.
virtual void init();
+ virtual void connect();
static void initAll();
+ static void connectAll();
// register statistics for this object
virtual void regStats();
diff --git a/sim/syscall_emul.cc b/sim/syscall_emul.cc
index d13591c06..9e49c6a5e 100644
--- a/sim/syscall_emul.cc
+++ b/sim/syscall_emul.cc
@@ -65,7 +65,11 @@ SyscallReturn
unimplementedFunc(SyscallDesc *desc, int callnum, Process *process,
ExecContext *xc)
{
+ //warn("ignoring syscall %s(%d, %d, ...)", desc->name,
+ // xc->getSyscallArg(0), xc->getSyscallArg(1));
fatal("syscall %s (#%d) unimplemented.", desc->name, callnum);
+
+ return 1;
}