diff options
author | Ron Dreslinski <rdreslin@umich.edu> | 2006-03-10 16:59:02 -0500 |
---|---|---|
committer | Ron Dreslinski <rdreslin@umich.edu> | 2006-03-10 16:59:02 -0500 |
commit | 5ba4c8e96ef694431ff1715fbea7cd0e70e6b072 (patch) | |
tree | 4847c6c99043470e678ccafcdb5a0039f3ede3c6 | |
parent | d07115f97266185fea006854f6e5eea8bf992c4b (diff) | |
download | gem5-5ba4c8e96ef694431ff1715fbea7cd0e70e6b072.tar.xz |
It now runs hello world binary.
Fixed the exec context proxy class to have a getMemPort function.
arch/alpha/linux/process.cc:
arch/alpha/tru64/process.cc:
kern/tru64/tru64.hh:
sim/syscall_emul.cc:
sim/syscall_emul.hh:
Fix to use new exec context proxy
--HG--
extra : convert_revision : eaa05dfab3fdb77627f6cf404a2569a44232f604
-rw-r--r-- | arch/alpha/linux/process.cc | 6 | ||||
-rw-r--r-- | arch/alpha/tru64/process.cc | 16 | ||||
-rw-r--r-- | kern/tru64/tru64.hh | 52 | ||||
-rw-r--r-- | sim/syscall_emul.cc | 16 | ||||
-rw-r--r-- | sim/syscall_emul.hh | 40 |
5 files changed, 65 insertions, 65 deletions
diff --git a/arch/alpha/linux/process.cc b/arch/alpha/linux/process.cc index d40895921..704773fdf 100644 --- a/arch/alpha/linux/process.cc +++ b/arch/alpha/linux/process.cc @@ -54,7 +54,7 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process, strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003"); strcpy(name->machine, "alpha"); - name.copyOut(xc->port); + name.copyOut(xc->getMemPort()); return 0; } @@ -74,7 +74,7 @@ osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, TypedBufferArg<uint64_t> fpcr(xc->getSyscallArg(1)); // I don't think this exactly matches the HW FPCR *fpcr = 0; - fpcr.copyOut(xc->port); + fpcr.copyOut(xc->getMemPort()); return 0; } @@ -100,7 +100,7 @@ osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, case 14: { // SSI_IEEE_FP_CONTROL TypedBufferArg<uint64_t> fpcr(xc->getSyscallArg(1)); // I don't think this exactly matches the HW FPCR - fpcr.copyIn(xc->port); + fpcr.copyIn(xc->getMemPort()); DPRINTFR(SyscallVerbose, "osf_setsysinfo(SSI_IEEE_FP_CONTROL): " " setting FPCR to 0x%x\n", gtoh(*(uint64_t*)fpcr)); return 0; diff --git a/arch/alpha/tru64/process.cc b/arch/alpha/tru64/process.cc index 55de67ace..d77e7f9e9 100644 --- a/arch/alpha/tru64/process.cc +++ b/arch/alpha/tru64/process.cc @@ -50,7 +50,7 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process, strcpy(name->version, "732"); strcpy(name->machine, "alpha"); - name.copyOut(xc->port); + name.copyOut(xc->getMemPort()); return 0; } @@ -67,21 +67,21 @@ getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, case Tru64::GSI_MAX_CPU: { TypedBufferArg<uint32_t> max_cpu(xc->getSyscallArg(1)); *max_cpu = htog((uint32_t)process->numCpus()); - max_cpu.copyOut(xc->port); + max_cpu.copyOut(xc->getMemPort()); return 1; } case Tru64::GSI_CPUS_IN_BOX: { TypedBufferArg<uint32_t> cpus_in_box(xc->getSyscallArg(1)); *cpus_in_box = htog((uint32_t)process->numCpus()); - cpus_in_box.copyOut(xc->port); + cpus_in_box.copyOut(xc->getMemPort()); return 1; } case Tru64::GSI_PHYSMEM: { TypedBufferArg<uint64_t> physmem(xc->getSyscallArg(1)); *physmem = htog((uint64_t)1024 * 1024); // physical memory in KB - physmem.copyOut(xc->port); + physmem.copyOut(xc->getMemPort()); return 1; } @@ -98,14 +98,14 @@ getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, infop->cpu_ex_binding = htog(0); infop->mhz = htog(667); - infop.copyOut(xc->port); + infop.copyOut(xc->getMemPort()); return 1; } case Tru64::GSI_PROC_TYPE: { TypedBufferArg<uint64_t> proc_type(xc->getSyscallArg(1)); *proc_type = htog((uint64_t)11); - proc_type.copyOut(xc->port); + proc_type.copyOut(xc->getMemPort()); return 1; } @@ -114,14 +114,14 @@ getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, strncpy((char *)bufArg.bufferPtr(), "COMPAQ Professional Workstation XP1000", nbytes); - bufArg.copyOut(xc->port); + bufArg.copyOut(xc->getMemPort()); return 1; } case Tru64::GSI_CLK_TCK: { TypedBufferArg<uint64_t> clk_hz(xc->getSyscallArg(1)); *clk_hz = htog((uint64_t)1024); - clk_hz.copyOut(xc->port); + clk_hz.copyOut(xc->getMemPort()); return 1; } diff --git a/kern/tru64/tru64.hh b/kern/tru64/tru64.hh index 11d331765..fcce99879 100644 --- a/kern/tru64/tru64.hh +++ b/kern/tru64/tru64.hh @@ -668,7 +668,7 @@ class Tru64 { // just pass basep through uninterpreted. TypedBufferArg<int64_t> basep(tgt_basep); - basep.copyIn(xc->port); + basep.copyIn(xc->getMemPort()); long host_basep = (off_t)htog((int64_t)*basep); int host_result = getdirentries(fd, host_buf, tgt_nbytes, &host_basep); @@ -695,7 +695,7 @@ class Tru64 { tgt_dp->d_reclen = tgt_bufsize; tgt_dp->d_namlen = namelen; strcpy(tgt_dp->d_name, host_dp->d_name); - tgt_dp.copyOut(xc->port); + tgt_dp.copyOut(xc->getMemPort()); tgt_buf_ptr += tgt_bufsize; host_buf_ptr += host_dp->d_reclen; @@ -704,7 +704,7 @@ class Tru64 { delete [] host_buf; *basep = htog((int64_t)host_basep); - basep.copyOut(xc->port); + basep.copyOut(xc->getMemPort()); return tgt_buf_ptr - tgt_buf; #endif @@ -718,7 +718,7 @@ class Tru64 { using TheISA::RegFile; TypedBufferArg<Tru64::sigcontext> sc(xc->getSyscallArg(0)); - sc.copyIn(xc->port); + sc.copyIn(xc->getMemPort()); // Restore state from sigcontext structure. // Note that we'll advance PC <- NPC before the end of the cycle, @@ -763,7 +763,7 @@ class Tru64 { elp->si_phz = htog(clk_hz); elp->si_boottime = htog(seconds_since_epoch); // seconds since epoch? elp->si_max_procs = htog(process->numCpus()); - elp.copyOut(xc->port); + elp.copyOut(xc->getMemPort()); return 0; } @@ -784,7 +784,7 @@ class Tru64 { { TypedBufferArg<Tru64::vm_stack> argp(xc->getSyscallArg(0)); - argp.copyIn(xc->port); + argp.copyIn(xc->getMemPort()); // if the user chose an address, just let them have it. Otherwise // pick one for them. @@ -793,7 +793,7 @@ class Tru64 { int stack_size = (htog(argp->rsize) + htog(argp->ysize) + htog(argp->gsize)); process->next_thread_stack_base -= stack_size; - argp.copyOut(xc->port); + argp.copyOut(xc->getMemPort()); } return 0; @@ -813,7 +813,7 @@ class Tru64 { TypedBufferArg<Tru64::nxm_task_attr> attrp(xc->getSyscallArg(0)); TypedBufferArg<Addr> configptr_ptr(xc->getSyscallArg(1)); - attrp.copyIn(xc->port); + attrp.copyIn(xc->getMemPort()); if (gtoh(attrp->nxm_version) != NXM_LIB_VERSION) { cerr << "nxm_task_init: thread library version mismatch! " @@ -854,7 +854,7 @@ class Tru64 { config->nxm_slot_state = htog(slot_state_addr); config->nxm_rad[0] = htog(rad_state_addr); - config.copyOut(xc->port); + config.copyOut(xc->getMemPort()); // initialize the slot_state array and copy it out TypedBufferArg<Tru64::nxm_slot_state_t> slot_state(slot_state_addr, @@ -867,7 +867,7 @@ class Tru64 { (i == 0) ? Tru64::NXM_SLOT_BOUND : Tru64::NXM_SLOT_AVAIL; } - slot_state.copyOut(xc->port); + slot_state.copyOut(xc->getMemPort()); // same for the per-RAD "shared" struct. Note that we need to // allocate extra bytes for the per-VP array which is embedded at @@ -901,13 +901,13 @@ class Tru64 { } } - rad_state.copyOut(xc->port); + rad_state.copyOut(xc->getMemPort()); // // copy pointer to shared config area out to user // *configptr_ptr = htog(config_addr); - configptr_ptr.copyOut(xc->port); + configptr_ptr.copyOut(xc->getMemPort()); // Register this as a valid address range with the process process->nxm_start = base_addr; @@ -944,7 +944,7 @@ class Tru64 { int thread_index = xc->getSyscallArg(2); // get attribute args - attrp.copyIn(xc->port); + attrp.copyIn(xc->getMemPort()); if (gtoh(attrp->version) != NXM_LIB_VERSION) { cerr << "nxm_thread_create: thread library version mismatch! " @@ -969,7 +969,7 @@ class Tru64 { TypedBufferArg<Tru64::nxm_shared> rad_state(0x14000, rad_state_size); - rad_state.copyIn(xc->port); + rad_state.copyIn(xc->getMemPort()); uint64_t uniq_val = gtoh(attrp->pthid) - gtoh(rad_state->nxm_uniq_offset); @@ -980,7 +980,7 @@ class Tru64 { // This is supposed to be a port number. Make something up. *kidp = htog(99); - kidp.copyOut(xc->port); + kidp.copyOut(xc->getMemPort()); return 0; } else if (gtoh(attrp->type) == Tru64::NXM_TYPE_VP) { @@ -994,7 +994,7 @@ class Tru64 { ssp->nxm_u.pth_id = attrp->pthid; ssp->nxm_u.nxm_active = htog(uniq_val | 1); - rad_state.copyOut(xc->port); + rad_state.copyOut(xc->getMemPort()); Addr slot_state_addr = 0x12000 + sizeof(Tru64::nxm_config_info); int slot_state_size = @@ -1004,7 +1004,7 @@ class Tru64 { slot_state(slot_state_addr, slot_state_size); - slot_state.copyIn(xc->port); + slot_state.copyIn(xc->getMemPort()); if (slot_state[thread_index] != Tru64::NXM_SLOT_AVAIL) { cerr << "nxm_thread_createFunc: requested VP slot " @@ -1016,7 +1016,7 @@ class Tru64 { // doesn't work anyway slot_state[thread_index] = Tru64::NXM_SLOT_BOUND; - slot_state.copyOut(xc->port); + slot_state.copyOut(xc->getMemPort()); // Find a free simulator execution context. for (int i = 0; i < process->numCpus(); ++i) { @@ -1030,7 +1030,7 @@ class Tru64 { // and get away with just sticking the thread index // here. *kidp = htog(thread_index); - kidp.copyOut(xc->port); + kidp.copyOut(xc->getMemPort()); return 0; } @@ -1159,12 +1159,12 @@ class Tru64 { { TypedBufferArg<uint64_t> lockp(uaddr); - lockp.copyIn(xc->port); + lockp.copyIn(xc->getMemPort()); if (gtoh(*lockp) == 0) { // lock is free: grab it *lockp = htog(1); - lockp.copyOut(xc->port); + lockp.copyOut(xc->getMemPort()); } else { // lock is busy: disable until free process->waitList.push_back(Process::WaitRec(uaddr, xc)); @@ -1178,7 +1178,7 @@ class Tru64 { { TypedBufferArg<uint64_t> lockp(uaddr); - lockp.copyIn(xc->port); + lockp.copyIn(xc->getMemPort()); assert(*lockp != 0); // Check for a process waiting on the lock. @@ -1187,7 +1187,7 @@ class Tru64 { // clear lock field if no waiting context is taking over the lock if (num_waiting == 0) { *lockp = 0; - lockp.copyOut(xc->port); + lockp.copyOut(xc->getMemPort()); } } @@ -1214,12 +1214,12 @@ class Tru64 { Addr uaddr = xc->getSyscallArg(0); TypedBufferArg<uint64_t> lockp(uaddr); - lockp.copyIn(xc->port); + lockp.copyIn(xc->getMemPort()); if (gtoh(*lockp) == 0) { // lock is free: grab it *lockp = htog(1); - lockp.copyOut(xc->port); + lockp.copyOut(xc->getMemPort()); return 0; } else { return 1; @@ -1274,7 +1274,7 @@ class Tru64 { TypedBufferArg<uint64_t> lockp(lock_addr); // user is supposed to acquire lock before entering - lockp.copyIn(xc->port); + lockp.copyIn(xc->getMemPort()); assert(gtoh(*lockp) != 0); m5_unlock_mutex(lock_addr, process, xc); diff --git a/sim/syscall_emul.cc b/sim/syscall_emul.cc index 1d0b3a375..faad733a8 100644 --- a/sim/syscall_emul.cc +++ b/sim/syscall_emul.cc @@ -130,7 +130,7 @@ readFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) int bytes_read = read(fd, bufArg.bufferPtr(), nbytes); if (bytes_read != -1) - bufArg.copyOut(xc->port); + bufArg.copyOut(xc->getMemPort()); return bytes_read; } @@ -142,7 +142,7 @@ writeFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) int nbytes = xc->getSyscallArg(2); BufferArg bufArg(xc->getSyscallArg(1), nbytes); - bufArg.copyIn(xc->port); + bufArg.copyIn(xc->getMemPort()); int bytes_written = write(fd, bufArg.bufferPtr(), nbytes); @@ -183,7 +183,7 @@ gethostnameFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) strncpy((char *)name.bufferPtr(), hostname, name_len); - name.copyOut(xc->port); + name.copyOut(xc->getMemPort()); return 0; } @@ -193,7 +193,7 @@ unlinkFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) { string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return (TheISA::IntReg)-EFAULT; int result = unlink(path.c_str()); @@ -205,12 +205,12 @@ renameFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) { string old_name; - if (xc->port->readStringFunctional(old_name, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(old_name, xc->getSyscallArg(0)) != NoFault) return -EFAULT; string new_name; - if (xc->port->readStringFunctional(new_name, xc->getSyscallArg(1)) != NoFault) + if (xc->getMemPort()->readStringFunctional(new_name, xc->getSyscallArg(1)) != NoFault) return -EFAULT; int64_t result = rename(old_name.c_str(), new_name.c_str()); @@ -222,7 +222,7 @@ truncateFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) { string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return -EFAULT; off_t length = xc->getSyscallArg(1); @@ -250,7 +250,7 @@ chownFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) { string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return -EFAULT; /* XXX endianess */ diff --git a/sim/syscall_emul.hh b/sim/syscall_emul.hh index 25f8c6cb8..8eacf9200 100644 --- a/sim/syscall_emul.hh +++ b/sim/syscall_emul.hh @@ -370,7 +370,7 @@ openFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return -EFAULT; if (path == "/dev/sysdev0") { @@ -417,7 +417,7 @@ chmodFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return -EFAULT; uint32_t mode = xc->getSyscallArg(1); @@ -470,7 +470,7 @@ statFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return -EFAULT; struct stat hostBuf; @@ -479,7 +479,7 @@ statFunc(SyscallDesc *desc, int callnum, Process *process, if (result < 0) return -errno; - OS::copyOutStatBuf(xc->port, xc->getSyscallArg(1), &hostBuf); + OS::copyOutStatBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf); return 0; } @@ -508,7 +508,7 @@ fstat64Func(SyscallDesc *desc, int callnum, Process *process, if (result < 0) return -errno; - OS::copyOutStat64Buf(xc->port, fd, xc->getSyscallArg(1), &hostBuf); + OS::copyOutStat64Buf(xc->getMemPort(), fd, xc->getSyscallArg(1), &hostBuf); return 0; } @@ -522,7 +522,7 @@ lstatFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return -EFAULT; struct stat hostBuf; @@ -531,7 +531,7 @@ lstatFunc(SyscallDesc *desc, int callnum, Process *process, if (result < 0) return -errno; - OS::copyOutStatBuf(xc->port, xc->getSyscallArg(1), &hostBuf); + OS::copyOutStatBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf); return 0; } @@ -544,7 +544,7 @@ lstat64Func(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return -EFAULT; #if BSD_HOST @@ -558,7 +558,7 @@ lstat64Func(SyscallDesc *desc, int callnum, Process *process, if (result < 0) return -errno; - OS::copyOutStat64Buf(xc->port, -1, xc->getSyscallArg(1), &hostBuf); + OS::copyOutStat64Buf(xc->getMemPort(), -1, xc->getSyscallArg(1), &hostBuf); return 0; } @@ -582,7 +582,7 @@ fstatFunc(SyscallDesc *desc, int callnum, Process *process, if (result < 0) return -errno; - OS::copyOutStatBuf(xc->port, xc->getSyscallArg(1), &hostBuf); + OS::copyOutStatBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf); return 0; } @@ -596,7 +596,7 @@ statfsFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return -EFAULT; struct statfs hostBuf; @@ -605,7 +605,7 @@ statfsFunc(SyscallDesc *desc, int callnum, Process *process, if (result < 0) return -errno; - OS::copyOutStatfsBuf(xc->port, xc->getSyscallArg(1), &hostBuf); + OS::copyOutStatfsBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf); return 0; } @@ -628,7 +628,7 @@ fstatfsFunc(SyscallDesc *desc, int callnum, Process *process, if (result < 0) return -errno; - OS::copyOutStatfsBuf(xc->port, xc->getSyscallArg(1), &hostBuf); + OS::copyOutStatfsBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf); return 0; } @@ -652,11 +652,11 @@ writevFunc(SyscallDesc *desc, int callnum, Process *process, for (int i = 0; i < count; ++i) { typename OS::tgt_iovec tiov; - xc->port->readBlobFunctional(tiov_base + i*sizeof(typename OS::tgt_iovec),(uint8_t*) + xc->getMemPort()->readBlobFunctional(tiov_base + i*sizeof(typename OS::tgt_iovec),(uint8_t*) &tiov, sizeof(typename OS::tgt_iovec)); hiov[i].iov_len = gtoh(tiov.iov_len); hiov[i].iov_base = new char [hiov[i].iov_len]; - xc->port->readBlobFunctional(gtoh(tiov.iov_base), + xc->getMemPort()->readBlobFunctional(gtoh(tiov.iov_base), (uint8_t *)hiov[i].iov_base, hiov[i].iov_len); } @@ -739,7 +739,7 @@ getrlimitFunc(SyscallDesc *desc, int callnum, Process *process, break; } - rlp.copyOut(xc->port); + rlp.copyOut(xc->getMemPort()); return 0; } @@ -756,7 +756,7 @@ gettimeofdayFunc(SyscallDesc *desc, int callnum, Process *process, tp->tv_sec = htog(tp->tv_sec); tp->tv_usec = htog(tp->tv_usec); - tp.copyOut(xc->port); + tp.copyOut(xc->getMemPort()); return 0; } @@ -770,11 +770,11 @@ utimesFunc(SyscallDesc *desc, int callnum, Process *process, { std::string path; - if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) + if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault) return -EFAULT; TypedBufferArg<typename OS::timeval [2]> tp(xc->getSyscallArg(1)); - tp.copyIn(xc->port); + tp.copyIn(xc->getMemPort()); struct timeval hostTimeval[2]; for (int i = 0; i < 2; ++i) @@ -826,7 +826,7 @@ getrusageFunc(SyscallDesc *desc, int callnum, Process *process, rup->ru_nvcsw = 0; rup->ru_nivcsw = 0; - rup.copyOut(xc->port); + rup.copyOut(xc->getMemPort()); return 0; } |