# Set up complete list of sources based on configuration.
-sources = base_sources
+sources = base_sources + simple_cpu_sources
if env['FULL_SYSTEM']:
sources += full_system_sources
#include "base/loader/aout_object.hh"
-#include "mem/memory.hh"
+#include "mem/translating_port.hh"
#include "base/loader/symtab.hh"
#include "base/trace.hh" // for DPRINTF
bool
-AoutObject::loadSections(Memory *mem, bool loadPhys)
+AoutObject::loadSections(TranslatingPort *memPort, bool loadPhys)
{
Addr textAddr = text.baseAddr;
Addr dataAddr = data.baseAddr;
// Since we don't really have an MMU and all memory is
// zero-filled, there's no need to set up the BSS segment.
if (text.size != 0)
- mem->prot_write(textAddr, fileData + N_TXTOFF(*execHdr), text.size);
+ memPort->writeBlobFunctional(textAddr, fileData + N_TXTOFF(*execHdr), text.size);
if (data.size != 0)
- mem->prot_write(dataAddr, fileData + N_DATOFF(*execHdr), data.size);
+ memPort->writeBlobFunctional(dataAddr, fileData + N_DATOFF(*execHdr), data.size);
return true;
}
public:
virtual ~AoutObject() {}
- virtual bool loadSections(Memory *mem, bool loadPhys = false);
+ virtual bool loadSections(TranslatingPort *memPort, bool loadPhys = false);
virtual bool loadGlobalSymbols(SymbolTable *symtab);
virtual bool loadLocalSymbols(SymbolTable *symtab);
#include "base/loader/ecoff_object.hh"
-#include "mem/memory.hh"
+#include "mem/translating_port.hh"
#include "base/loader/symtab.hh"
#include "base/trace.hh" // for DPRINTF
bool
-EcoffObject::loadSections(Memory *mem, bool loadPhys)
+EcoffObject::loadSections(TranslatingPort *memPort, bool loadPhys)
{
Addr textAddr = text.baseAddr;
Addr dataAddr = data.baseAddr;
// Since we don't really have an MMU and all memory is
// zero-filled, there's no need to set up the BSS segment.
- mem->prot_write(textAddr, fileData + ECOFF_TXTOFF(execHdr), text.size);
- mem->prot_write(dataAddr, fileData + ECOFF_DATOFF(execHdr), data.size);
+ memPort->writeBlobFunctional(textAddr, fileData + ECOFF_TXTOFF(execHdr), text.size);
+ memPort->writeBlobFunctional(dataAddr, fileData + ECOFF_DATOFF(execHdr), data.size);
return true;
}
public:
virtual ~EcoffObject() {}
- virtual bool loadSections(Memory *mem, bool loadPhys = false);
+ virtual bool loadSections(TranslatingPort *memPort, bool loadPhys = false);
virtual bool loadGlobalSymbols(SymbolTable *symtab);
virtual bool loadLocalSymbols(SymbolTable *symtab);
#include "base/loader/elf_object.hh"
-#include "mem/memory.hh"
+#include "mem/translating_port.hh"
#include "base/loader/symtab.hh"
#include "base/trace.hh" // for DPRINTF
bool
-ElfObject::loadSections(Memory *mem, bool loadPhys)
+ElfObject::loadSections(TranslatingPort *memPort, bool loadPhys)
{
Addr textAddr = text.baseAddr;
Addr dataAddr = data.baseAddr;
// Since we don't really have an MMU and all memory is
// zero-filled, there's no need to set up the BSS segment.
if (text.size != 0)
- mem->prot_write(textAddr, fileTextBits, text.size);
+ memPort->writeBlobFunctional(textAddr, fileTextBits, text.size);
if (data.size != 0)
- mem->prot_write(dataAddr, fileDataBits, data.size);
+ memPort->writeBlobFunctional(dataAddr, fileDataBits, data.size);
return true;
}
public:
virtual ~ElfObject() {}
- virtual bool loadSections(Memory *mem, bool loadPhys = false);
+ virtual bool loadSections(TranslatingPort *memPort, bool loadPhys = false);
virtual bool loadGlobalSymbols(SymbolTable *symtab);
virtual bool loadLocalSymbols(SymbolTable *symtab);
#include "targetarch/isa_traits.hh" // for Addr
-class Memory;
+class TranslatingPort;
class SymbolTable;
class ObjectFile
void close();
- virtual bool loadSections(Memory *mem, bool loadPhys = false) = 0;
+ virtual bool loadSections(TranslatingPort *memPort, bool loadPhys = false) = 0;
virtual bool loadGlobalSymbols(SymbolTable *symtab) = 0;
virtual bool loadLocalSymbols(SymbolTable *symtab) = 0;
#include "encumbered/eio/eio.hh"
#include "mem/page_table.hh"
#include "mem/memory.hh"
-#include "mem/proxy.hh"
+#include "mem/translating_port.hh"
#include "sim/builder.hh"
#include "sim/fake_syscall.hh"
#include "sim/process.hh"
if (execContexts.empty())
fatal("Process %s is not associated with any CPUs!\n", name());
- initVirtMem = new ProxyMemory(system->physmem, pTable);
+ initVirtMem = new TranslatingPort(system->physmem->getPort("any"), pTable);
// first exec context for this process... initialize & enable
ExecContext *xc = execContexts[0];
static void
copyStringArray(vector<string> &strings, Addr array_ptr, Addr data_ptr,
- Memory *func)
+ TranslatingPort* memPort)
{
for (int i = 0; i < strings.size(); ++i) {
- func->prot_write(array_ptr, (uint8_t*)&data_ptr, sizeof(Addr));
- func->writeStringFunctional(data_ptr, strings[i].c_str());
+ memPort->writeBlobFunctional(array_ptr, (uint8_t*)&data_ptr, sizeof(Addr));
+ memPort->writeStringFunctional(data_ptr, strings[i].c_str());
array_ptr += sizeof(Addr);
data_ptr += strings[i].size() + 1;
}
// add NULL terminator
data_ptr = 0;
- func->prot_write(array_ptr, (uint8_t*)&data_ptr, sizeof(Addr));
+ memPort->writeBlobFunctional(array_ptr, (uint8_t*)&data_ptr, sizeof(Addr));
}
LiveProcess::LiveProcess(const string &nm, ObjectFile *_objFile,
text_size = objFile->textSize();
data_base = objFile->dataBase();
data_size = objFile->dataSize() + objFile->bssSize();
- brk_point = = roundUp(data_base + data_size, VMPageSize);
+ brk_point = roundUp(data_base + data_size, VMPageSize);
// Set up stack. On Alpha, stack goes below text section. This
// code should get moved to some architecture-specific spot.
// write contents to stack
uint64_t argc = argv.size();
- initVirtMem->prot_write(stack_min, (uint8_t*)&argc, sizeof(uint64_t));
+ initVirtMem->writeBlobFunctional(stack_min, (uint8_t*)&argc, sizeof(uint64_t));
copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
#include "targetarch/isa_traits.hh"
class ExecContext;
-class Memory;
+class TranslatingPort;
class System;
class Process : public SimObject
protected:
/// Memory object for initialization (image loading)
- Memory *initVirtMem;
+ TranslatingPort *initVirtMem;
public:
PageTable *pTable;