Add blocksize functions to physical memory. Fix the port we were using in the process loader.

mem/physical.cc:
    Implement the blockSize function, return VMPageSize for the physical memory
mem/port.hh:
    Add a function to get a pointer to a peer, needed for initVirtMem to work in the loader.
sim/process.cc:
    The way the translating port is setup we don't want the memory port, we want the peer port associated with that memory.  We may need to revisit this.

--HG--
extra : convert_revision : 46a51d448d1683db7bd5afe64adbe167a5743060
This commit is contained in:
Ron Dreslinski
2006-02-21 13:39:01 -05:00
parent 944646124e
commit 4bd11c10a5
3 changed files with 13 additions and 1 deletions

View File

@@ -164,6 +164,13 @@ PhysicalMemory::prot_memset(Addr addr, uint8_t val, int size)
memset(pmem_addr + addr - base_addr, val, size);
}
int
PhysicalMemory::deviceBlockSize()
{
//For now the largest accesses we can take are Page Sized
return VMPageSize;
}
void
PhysicalMemory::serialize(ostream &os)
{

View File

@@ -93,6 +93,11 @@ class Port
*/
void setPeer(Port *port) { peer = port; }
/** Function to set the pointer for the peer port.
@todo should be called by the configuration stuff (python).
*/
Port *getPeer(Port *port) { return peer; }
protected:
/** These functions are protected because they should only be

View File

@@ -154,7 +154,7 @@ Process::startup()
if (execContexts.empty())
fatal("Process %s is not associated with any CPUs!\n", name());
initVirtMem = new TranslatingPort(system->physmem->getPort("any"), pTable);
initVirtMem = new TranslatingPort((system->physmem->getPort("any"))->getPeer(), pTable);
// first exec context for this process... initialize & enable
ExecContext *xc = execContexts[0];