summaryrefslogtreecommitdiff
path: root/src/kern
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2012-01-28 07:24:01 -0800
committerGabe Black <gblack@eecs.umich.edu>2012-01-28 07:24:01 -0800
commitc3d41a2def15cdaf2ac3984315f452dacc6a0884 (patch)
tree5324ebec3add54b934a841eee901983ac3463a7f /src/kern
parentda2a4acc26ba264c3c4a12495776fd6a1c4fb133 (diff)
parent4acca8a0536d4445ed25b67edf571ae460446ab9 (diff)
downloadgem5-c3d41a2def15cdaf2ac3984315f452dacc6a0884.tar.xz
Merge with the main repo.
--HG-- rename : src/mem/vport.hh => src/mem/fs_translating_port_proxy.hh rename : src/mem/translating_port.cc => src/mem/se_translating_port_proxy.cc rename : src/mem/translating_port.hh => src/mem/se_translating_port_proxy.hh
Diffstat (limited to 'src/kern')
-rw-r--r--src/kern/tru64/tru64.hh63
-rw-r--r--src/kern/tru64/tru64_events.cc6
2 files changed, 35 insertions, 34 deletions
diff --git a/src/kern/tru64/tru64.hh b/src/kern/tru64/tru64.hh
index 8b8091f0d..3b9bbd2bf 100644
--- a/src/kern/tru64/tru64.hh
+++ b/src/kern/tru64/tru64.hh
@@ -62,7 +62,7 @@ typedef struct stat global_stat;
typedef struct statfs global_statfs;
typedef struct dirent global_dirent;
-class TranslatingPort;
+class SETranslatingPortProxy;
///
/// This class encapsulates the types, structures, constants,
@@ -397,7 +397,8 @@ class Tru64 : public OperatingSystem
/// memory space. Used by statfs() and fstatfs().
template <class T>
static void
- copyOutStatfsBuf(TranslatingPort *mem, Addr addr, global_statfs *host)
+ copyOutStatfsBuf(SETranslatingPortProxy *mem, Addr addr,
+ global_statfs *host)
{
using namespace TheISA;
@@ -446,7 +447,7 @@ class Tru64 : public OperatingSystem
// just pass basep through uninterpreted.
TypedBufferArg<int64_t> basep(tgt_basep);
- basep.copyIn(tc->getMemPort());
+ basep.copyIn(tc->getMemProxy());
long host_basep = (off_t)htog((int64_t)*basep);
int host_result = getdirentries(fd, host_buf, tgt_nbytes, &host_basep);
@@ -473,7 +474,7 @@ class Tru64 : public OperatingSystem
tgt_dp->d_reclen = tgt_bufsize;
tgt_dp->d_namlen = namelen;
strcpy(tgt_dp->d_name, host_dp->d_name);
- tgt_dp.copyOut(tc->getMemPort());
+ tgt_dp.copyOut(tc->getMemProxy());
tgt_buf_ptr += tgt_bufsize;
host_buf_ptr += host_dp->d_reclen;
@@ -482,7 +483,7 @@ class Tru64 : public OperatingSystem
delete [] host_buf;
*basep = htog((int64_t)host_basep);
- basep.copyOut(tc->getMemPort());
+ basep.copyOut(tc->getMemProxy());
return tgt_buf_ptr - tgt_buf;
#endif
@@ -498,7 +499,7 @@ class Tru64 : public OperatingSystem
int index = 0;
TypedBufferArg<Tru64::sigcontext> sc(process->getSyscallArg(tc, index));
- sc.copyIn(tc->getMemPort());
+ sc.copyIn(tc->getMemProxy());
// Restore state from sigcontext structure.
// Note that we'll advance PC <- NPC before the end of the cycle,
@@ -533,7 +534,7 @@ class Tru64 : public OperatingSystem
int index = 0;
TypedBufferArg<Tru64::vm_stack> argp(process->getSyscallArg(tc, index));
- argp.copyIn(tc->getMemPort());
+ argp.copyIn(tc->getMemProxy());
int stack_size =
gtoh(argp->rsize) + gtoh(argp->ysize) + gtoh(argp->gsize);
@@ -560,7 +561,7 @@ class Tru64 : public OperatingSystem
process->allocateMem(rounded_stack_base, rounded_stack_size);
argp->address = gtoh(rounded_stack_base);
- argp.copyOut(tc->getMemPort());
+ argp.copyOut(tc->getMemProxy());
return 0;
}
@@ -584,7 +585,7 @@ class Tru64 : public OperatingSystem
attrp(process->getSyscallArg(tc, index));
TypedBufferArg<Addr> configptr_ptr(process->getSyscallArg(tc, index));
- attrp.copyIn(tc->getMemPort());
+ attrp.copyIn(tc->getMemProxy());
if (gtoh(attrp->nxm_version) != NXM_LIB_VERSION) {
cerr << "nxm_task_init: thread library version mismatch! "
@@ -678,10 +679,10 @@ class Tru64 : public OperatingSystem
int size = cur_addr - base_addr;
process->allocateMem(base_addr, roundUp(size, VMPageSize));
- config.copyOut(tc->getMemPort());
- slot_state.copyOut(tc->getMemPort());
- rad_state.copyOut(tc->getMemPort());
- configptr_ptr.copyOut(tc->getMemPort());
+ config.copyOut(tc->getMemProxy());
+ slot_state.copyOut(tc->getMemProxy());
+ rad_state.copyOut(tc->getMemProxy());
+ configptr_ptr.copyOut(tc->getMemProxy());
return 0;
}
@@ -720,7 +721,7 @@ class Tru64 : public OperatingSystem
int thread_index = process->getSyscallArg(tc, index);
// get attribute args
- attrp.copyIn(tc->getMemPort());
+ attrp.copyIn(tc->getMemProxy());
if (gtoh(attrp->version) != NXM_LIB_VERSION) {
cerr << "nxm_thread_create: thread library version mismatch! "
@@ -745,7 +746,7 @@ class Tru64 : public OperatingSystem
TypedBufferArg<Tru64::nxm_shared> rad_state(0x14000,
rad_state_size);
- rad_state.copyIn(tc->getMemPort());
+ rad_state.copyIn(tc->getMemProxy());
uint64_t uniq_val = gtoh(attrp->pthid) - gtoh(rad_state->nxm_uniq_offset);
@@ -756,7 +757,7 @@ class Tru64 : public OperatingSystem
// This is supposed to be a port number. Make something up.
*kidp = htog(99);
- kidp.copyOut(tc->getMemPort());
+ kidp.copyOut(tc->getMemProxy());
return 0;
} else if (gtoh(attrp->type) == Tru64::NXM_TYPE_VP) {
@@ -770,7 +771,7 @@ class Tru64 : public OperatingSystem
ssp->nxm_u.pth_id = attrp->pthid;
ssp->nxm_u.nxm_active = htog(uniq_val | 1);
- rad_state.copyOut(tc->getMemPort());
+ rad_state.copyOut(tc->getMemProxy());
Addr slot_state_addr = 0x12000 + sizeof(Tru64::nxm_config_info);
int slot_state_size =
@@ -780,7 +781,7 @@ class Tru64 : public OperatingSystem
slot_state(slot_state_addr,
slot_state_size);
- slot_state.copyIn(tc->getMemPort());
+ slot_state.copyIn(tc->getMemProxy());
if (slot_state[thread_index] != Tru64::NXM_SLOT_AVAIL) {
cerr << "nxm_thread_createFunc: requested VP slot "
@@ -792,7 +793,7 @@ class Tru64 : public OperatingSystem
// doesn't work anyway
slot_state[thread_index] = Tru64::NXM_SLOT_BOUND;
- slot_state.copyOut(tc->getMemPort());
+ slot_state.copyOut(tc->getMemProxy());
// Find a free simulator thread context.
ThreadContext *tc = process->findFreeContext();
@@ -804,7 +805,7 @@ class Tru64 : public OperatingSystem
// and get away with just sticking the thread index
// here.
*kidp = htog(thread_index);
- kidp.copyOut(tc->getMemPort());
+ kidp.copyOut(tc->getMemProxy());
return 0;
}
@@ -945,12 +946,12 @@ class Tru64 : public OperatingSystem
TypedBufferArg<uint64_t> lockp(uaddr);
- lockp.copyIn(tc->getMemPort());
+ lockp.copyIn(tc->getMemProxy());
if (gtoh(*lockp) == 0) {
// lock is free: grab it
*lockp = htog(1);
- lockp.copyOut(tc->getMemPort());
+ lockp.copyOut(tc->getMemProxy());
} else {
// lock is busy: disable until free
process->waitList.push_back(Process::WaitRec(uaddr, tc));
@@ -964,7 +965,7 @@ class Tru64 : public OperatingSystem
{
TypedBufferArg<uint64_t> lockp(uaddr);
- lockp.copyIn(tc->getMemPort());
+ lockp.copyIn(tc->getMemProxy());
assert(*lockp != 0);
// Check for a process waiting on the lock.
@@ -973,7 +974,7 @@ class Tru64 : public OperatingSystem
// clear lock field if no waiting context is taking over the lock
if (num_waiting == 0) {
*lockp = 0;
- lockp.copyOut(tc->getMemPort());
+ lockp.copyOut(tc->getMemProxy());
}
}
@@ -1004,12 +1005,12 @@ class Tru64 : public OperatingSystem
Addr uaddr = process->getSyscallArg(tc, index);
TypedBufferArg<uint64_t> lockp(uaddr);
- lockp.copyIn(tc->getMemPort());
+ lockp.copyIn(tc->getMemProxy());
if (gtoh(*lockp) == 0) {
// lock is free: grab it
*lockp = htog(1);
- lockp.copyOut(tc->getMemPort());
+ lockp.copyOut(tc->getMemProxy());
return 0;
} else {
return 1;
@@ -1070,7 +1071,7 @@ class Tru64 : public OperatingSystem
TypedBufferArg<uint64_t> lockp(lock_addr);
// user is supposed to acquire lock before entering
- lockp.copyIn(tc->getMemPort());
+ lockp.copyIn(tc->getMemProxy());
assert(gtoh(*lockp) != 0);
m5_unlock_mutex(lock_addr, process, tc);
@@ -1159,13 +1160,13 @@ class Tru64_F64 : public Tru64
typedef F64_stat tgt_stat;
/*
- static void copyOutStatBuf(TranslatingPort *mem, Addr addr,
+ static void copyOutStatBuf(SETranslatingPortProxy *mem, Addr addr,
global_stat *host)
{
Tru64::copyOutStatBuf<Tru64::F64_stat>(mem, addr, host);
}*/
- static void copyOutStatfsBuf(TranslatingPort *mem, Addr addr,
+ static void copyOutStatfsBuf(SETranslatingPortProxy *mem, Addr addr,
global_statfs *host)
{
Tru64::copyOutStatfsBuf<Tru64::F64_statfs>(mem, addr, host);
@@ -1205,13 +1206,13 @@ class Tru64_PreF64 : public Tru64
typedef pre_F64_stat tgt_stat;
/*
- static void copyOutStatBuf(TranslatingPort *mem, Addr addr,
+ static void copyOutStatBuf(SETranslatingPortProxy *mem, Addr addr,
global_stat *host)
{
Tru64::copyOutStatBuf<Tru64::pre_F64_stat>(mem, addr, host);
}*/
- static void copyOutStatfsBuf(TranslatingPort *mem, Addr addr,
+ static void copyOutStatfsBuf(SETranslatingPortProxy *mem, Addr addr,
global_statfs *host)
{
Tru64::copyOutStatfsBuf<Tru64::pre_F64_statfs>(mem, addr, host);
diff --git a/src/kern/tru64/tru64_events.cc b/src/kern/tru64/tru64_events.cc
index 216f81b86..5638a2350 100644
--- a/src/kern/tru64/tru64_events.cc
+++ b/src/kern/tru64/tru64_events.cc
@@ -57,12 +57,12 @@ BadAddrEvent::process(ThreadContext *tc)
uint64_t a0 = tc->readIntReg(16);
- AddrRangeList resp;
- bool snoop;
AddrRangeIter iter;
bool found = false;
- tc->getPhysPort()->getPeerAddressRanges(resp, snoop);
+ Port* dataPort = tc->getCpuPtr()->getPort("dcache_port");
+
+ AddrRangeList resp = dataPort->getPeer()->getAddrRanges();
for (iter = resp.begin(); iter != resp.end(); iter++) {
if (*iter == (K0Seg2Phys(a0) & PAddrImplMask))
found = true;