Get rid of validInstAddr() & validDataAddr().

SE mode can now use page tables to determine which addresses are valid.

sim/process.cc:
sim/process.hh:
    Get rid of validInstAddr() & validDataAddr().
    SE mode can now use page tables to determine which addresses are valid.
    Also get rid of some Process object fields that were only used by those functions.

--HG--
extra : convert_revision : 74a25c0c2453bfc598eedacdbfccea1cf6493ba6
This commit is contained in:
Steve Reinhardt 2006-03-12 16:01:41 -05:00
parent 84a6044f31
commit 37c860d334
4 changed files with 5 additions and 50 deletions

View file

@ -233,8 +233,6 @@ class CPUExecContext
AlphaDTB *getDTBPtr() { return dtb; }
bool validInstAddr(Addr addr) { return true; }
bool validDataAddr(Addr addr) { return true; }
int getInstAsid() { return regs.instAsid(); }
int getDataAsid() { return regs.dataAsid(); }
@ -256,12 +254,6 @@ class CPUExecContext
#else
Process *getProcessPtr() { return process; }
bool validInstAddr(Addr addr)
{ return process->validInstAddr(addr); }
bool validDataAddr(Addr addr)
{ return process->validDataAddr(addr); }
int getInstAsid() { return asid; }
int getDataAsid() { return asid; }

View file

@ -143,8 +143,6 @@ class ExecContext
virtual int getThreadNum() = 0;
virtual bool validInstAddr(Addr addr) = 0;
virtual bool validDataAddr(Addr addr) = 0;
virtual int getInstAsid() = 0;
virtual int getDataAsid() = 0;
@ -309,8 +307,6 @@ class ProxyExecContext : public ExecContext
int getThreadNum() { return actualXC->getThreadNum(); }
bool validInstAddr(Addr addr) { return actualXC->validInstAddr(addr); }
bool validDataAddr(Addr addr) { return actualXC->validDataAddr(addr); }
int getInstAsid() { return actualXC->getInstAsid(); }
int getDataAsid() { return actualXC->getDataAsid(); }

View file

@ -37,11 +37,7 @@
#include "base/loader/symtab.hh"
#include "base/statistics.hh"
#include "config/full_system.hh"
#include "cpu/cpu_exec_context.hh"
#include "cpu/exec_context.hh"
#include "cpu/smt.hh"
#include "encumbered/cpu/full/thread.hh"
#include "encumbered/eio/eio.hh"
#include "mem/page_table.hh"
#include "mem/memory.hh"
#include "mem/translating_port.hh"
@ -269,16 +265,12 @@ LiveProcess::LiveProcess(const string &nm, ObjectFile *_objFile,
{
prog_fname = argv[0];
prog_entry = objFile->entryPoint();
text_base = objFile->textBase();
text_size = objFile->textSize();
data_base = objFile->dataBase();
data_size = objFile->dataSize() + objFile->bssSize();
brk_point = roundUp(data_base + data_size, VMPageSize);
brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize();
brk_point = roundUp(brk_point, VMPageSize);
// Set up stack. On Alpha, stack goes below text section. This
// code should get moved to some architecture-specific spot.
stack_base = text_base - (409600+4096);
stack_base = objFile->textBase() - (409600+4096);
// Set up region for mmaps. Tru64 seems to start just above 0 and
// grow up from there.
@ -353,6 +345,8 @@ LiveProcess::startup()
execContexts[0]->setIntReg(ArgumentReg1, argv_array_base);
execContexts[0]->setIntReg(StackPointerReg, stack_min);
execContexts[0]->setIntReg(GlobalPointerReg, objFile->globalPointer());
Addr prog_entry = objFile->entryPoint();
execContexts[0]->setPC(prog_entry);
execContexts[0]->setNextPC(prog_entry + sizeof(MachInst));

View file

@ -92,12 +92,6 @@ class Process : public SimObject
// list of all blocked contexts
std::list<WaitRec> waitList;
Addr text_base; // text (code) segment base
unsigned text_size; // text (code) size in bytes
Addr data_base; // initialized data segment base
unsigned data_size; // initialized data + bss size in bytes
Addr brk_point; // top of the data segment
Addr stack_base; // stack segment base (highest address)
@ -116,7 +110,6 @@ class Process : public SimObject
Addr nxm_end;
std::string prog_fname; // file name
Addr prog_entry; // entry point (initial PC)
Stats::Scalar<> num_syscalls; // number of syscalls executed
@ -171,26 +164,6 @@ class Process : public SimObject
// look up simulator fd for given target fd
int sim_fd(int tgt_fd);
// is this a valid instruction fetch address?
bool validInstAddr(Addr addr)
{
return (text_base <= addr &&
addr < text_base + text_size &&
!(addr & (sizeof(MachInst)-1)));
}
// is this a valid address? (used to filter data fetches)
// note that we just assume stack size <= 16MB
// this may be alpha-specific
bool validDataAddr(Addr addr)
{
return ((data_base <= addr && addr < brk_point) ||
(next_thread_stack_base <= addr && addr < stack_base) ||
(text_base <= addr && addr < (text_base + text_size)) ||
(mmap_start <= addr && addr < mmap_end) ||
(nxm_start <= addr && addr < nxm_end));
}
virtual void syscall(ExecContext *xc) = 0;
};