diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2006-03-02 01:01:03 -0500 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2006-03-02 01:01:03 -0500 |
commit | 0c2c7171a83f772b297016aa7382157f070b3466 (patch) | |
tree | e4991486490e340f541d3df3c1520aad57aaf107 /mem/translating_port.cc | |
parent | 22504f8b48978be286d98be0df72d015ab6ff559 (diff) | |
download | gem5-0c2c7171a83f772b297016aa7382157f070b3466.tar.xz |
More progress... run a few instructions now, but die on the second
memory access (I think because we're deallocating our one and only
CpuRequest object).
base/loader/aout_object.cc:
base/loader/ecoff_object.cc:
base/loader/elf_object.cc:
Add flag to force allocation of new pages on data writes.
cpu/simple/cpu.cc:
Several minor fixes.
Switch to atomic mode for now.
mem/physical.hh:
Don't copy the packet to the response event, just keep a reference
to the original.
mem/translating_port.cc:
mem/translating_port.hh:
Add parameter to writeBlobFunctional() to force allocation of
unallocated pages on writes.
--HG--
extra : convert_revision : 05cb31c7b0047b492dcfa0d12ddee690ef762b44
Diffstat (limited to 'mem/translating_port.cc')
-rw-r--r-- | mem/translating_port.cc | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/mem/translating_port.cc b/mem/translating_port.cc index 052d350b9..e385a74b6 100644 --- a/mem/translating_port.cc +++ b/mem/translating_port.cc @@ -47,29 +47,37 @@ TranslatingPort::readBlobFunctional(Addr addr, uint8_t *p, int size) for (ChunkGenerator gen(addr, size, VMPageSize); !gen.done(); gen.next()) { - if (!pTable->translate(gen.addr(),paddr)) - return Machine_Check_Fault; + if (!pTable->translate(gen.addr(),paddr)) + return Machine_Check_Fault; - port->readBlobFunctional(paddr, p + prevSize, gen.size()); - prevSize += gen.size(); + port->readBlobFunctional(paddr, p + prevSize, gen.size()); + prevSize += gen.size(); } return No_Fault; } Fault -TranslatingPort::writeBlobFunctional(Addr addr, uint8_t *p, int size) +TranslatingPort::writeBlobFunctional(Addr addr, uint8_t *p, int size, + bool alloc) { Addr paddr; int prevSize = 0; for (ChunkGenerator gen(addr, size, VMPageSize); !gen.done(); gen.next()) { - if (!pTable->translate(gen.addr(),paddr)) - return Machine_Check_Fault; - - port->writeBlobFunctional(paddr, p + prevSize, gen.size()); - prevSize += gen.size(); + if (!pTable->translate(gen.addr(), paddr)) { + if (alloc) { + pTable->allocate(roundDown(gen.addr(), VMPageSize), + VMPageSize); + pTable->translate(gen.addr(), paddr); + } else { + return Machine_Check_Fault; + } + } + + port->writeBlobFunctional(paddr, p + prevSize, gen.size()); + prevSize += gen.size(); } return No_Fault; |