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;
}
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;
}
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;
strcpy(name->version, "732");
strcpy(name->machine, "alpha");
- name.copyOut(xc->port);
+ name.copyOut(xc->getMemPort());
return 0;
}
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;
}
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;
}
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;
}
// 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);
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;
delete [] host_buf;
*basep = htog((int64_t)host_basep);
- basep.copyOut(xc->port);
+ basep.copyOut(xc->getMemPort());
return tgt_buf_ptr - tgt_buf;
#endif
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,
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;
}
{
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.
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;
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! "
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,
(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
}
}
- 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;
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! "
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);
// 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) {
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 =
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 "
// 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) {
// and get away with just sticking the thread index
// here.
*kidp = htog(thread_index);
- kidp.copyOut(xc->port);
+ kidp.copyOut(xc->getMemPort());
return 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());
} else {
// lock is busy: disable until free
process->waitList.push_back(Process::WaitRec(uaddr, xc));
{
TypedBufferArg<uint64_t> lockp(uaddr);
- lockp.copyIn(xc->port);
+ lockp.copyIn(xc->getMemPort());
assert(*lockp != 0);
// Check for a process waiting on the lock.
// 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());
}
}
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;
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);
int bytes_read = read(fd, bufArg.bufferPtr(), nbytes);
if (bytes_read != -1)
- bufArg.copyOut(xc->port);
+ bufArg.copyOut(xc->getMemPort());
return bytes_read;
}
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);
strncpy((char *)name.bufferPtr(), hostname, name_len);
- name.copyOut(xc->port);
+ name.copyOut(xc->getMemPort());
return 0;
}
{
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());
{
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());
{
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);
{
string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
/* XXX endianess */
{
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") {
{
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);
{
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;
if (result < 0)
return -errno;
- OS::copyOutStatBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
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;
}
{
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;
if (result < 0)
return -errno;
- OS::copyOutStatBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
{
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
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;
}
if (result < 0)
return -errno;
- OS::copyOutStatBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
{
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;
if (result < 0)
return -errno;
- OS::copyOutStatfsBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatfsBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
if (result < 0)
return -errno;
- OS::copyOutStatfsBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatfsBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
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);
}
break;
}
- rlp.copyOut(xc->port);
+ rlp.copyOut(xc->getMemPort());
return 0;
}
tp->tv_sec = htog(tp->tv_sec);
tp->tv_usec = htog(tp->tv_usec);
- tp.copyOut(xc->port);
+ tp.copyOut(xc->getMemPort());
return 0;
}
{
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)
rup->ru_nvcsw = 0;
rup->ru_nivcsw = 0;
- rup.copyOut(xc->port);
+ rup.copyOut(xc->getMemPort());
return 0;
}