Added mmap start and end so detailed CPU can know if an access is
in a mmaped region --HG-- extra : convert_revision : e4ee0520c84d94a0d2e804d02035228766abe71f
This commit is contained in:
parent
2298e2ba48
commit
9ebeb9b2de
3 changed files with 7 additions and 5 deletions
|
@ -282,7 +282,7 @@ LiveProcess::LiveProcess(const string &name, ObjectFile *objFile,
|
|||
|
||||
// Set up region for mmaps. Tru64 seems to start just above 0 and
|
||||
// grow up from there.
|
||||
mmap_base = 0x10000;
|
||||
mmap_start = mmap_end = 0x10000;
|
||||
|
||||
// Set pointer for next thread stack. Reserve 8M for main stack.
|
||||
next_thread_stack_base = stack_base - (8 * 1024 * 1024);
|
||||
|
|
|
@ -93,7 +93,8 @@ class Process : public SimObject
|
|||
Addr next_thread_stack_base;
|
||||
|
||||
// Base of region for mmaps (when user doesn't specify an address).
|
||||
Addr mmap_base;
|
||||
Addr mmap_start;
|
||||
Addr mmap_end;
|
||||
|
||||
std::string prog_fname; // file name
|
||||
Addr prog_entry; // entry point (initial PC)
|
||||
|
@ -156,7 +157,8 @@ class Process : public SimObject
|
|||
{
|
||||
return ((data_base <= addr && addr < brk_point) ||
|
||||
((stack_base - 16*1024*1024) <= addr && addr < stack_base) ||
|
||||
(text_base <= addr && addr < (text_base + text_size)));
|
||||
(text_base <= addr && addr < (text_base + text_size)) ||
|
||||
(mmap_start <= addr && addr < mmap_end));
|
||||
}
|
||||
|
||||
virtual void syscall(ExecContext *xc) = 0;
|
||||
|
|
|
@ -410,8 +410,8 @@ mmapFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
|
|||
|
||||
if (start == 0) {
|
||||
// user didn't give an address... pick one from our "mmap region"
|
||||
start = p->mmap_base;
|
||||
p->mmap_base += RoundUp<Addr>(length, VMPageSize);
|
||||
start = p->mmap_end;
|
||||
p->mmap_end += RoundUp<Addr>(length, VMPageSize);
|
||||
}
|
||||
|
||||
if (!(flags & OS::TGT_MAP_ANONYMOUS)) {
|
||||
|
|
Loading…
Reference in a new issue