From f6cd7a4bb7ee66b58f88fbdc6bdc4faa6a559952 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Thu, 17 Mar 2016 10:29:32 -0700 Subject: syscall_emul: move mmapGrowsDown() to LiveProcess The mmapGrowsDown() method was a static method on the OperatingSystem class (and derived classes), which worked OK for the templated syscall emulation methods, but made it hard to access elsewhere. This patch moves the method to be a virtual function on the LiveProcess method, where it can be overridden for specific platforms (for now, Alpha). This patch also changes the value of mmapGrowsDown() from being false by default and true only on X86Linux32 to being true by default and false only on Alpha, which seems closer to reality (though in reality most people use ASLR and this doesn't really matter anymore). In the process, also got rid of the unused mmap_start field on LiveProcess and OperatingSystem mmapGrowsUp variable. --- src/arch/sparc/process.hh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/arch/sparc') diff --git a/src/arch/sparc/process.hh b/src/arch/sparc/process.hh index 2eda40aac..e9d81367b 100644 --- a/src/arch/sparc/process.hh +++ b/src/arch/sparc/process.hh @@ -82,7 +82,7 @@ class Sparc32LiveProcess : public SparcLiveProcess stack_base = (Addr)0xf0000000ULL; // Set up region for mmaps. - mmap_start = mmap_end = 0x70000000; + mmap_end = 0x70000000; } void initState(); @@ -111,9 +111,8 @@ class Sparc64LiveProcess : public SparcLiveProcess // downward, less the hole for the kernel address space. stack_base = (Addr)0x80000000000ULL; - // Set up region for mmaps. Tru64 seems to start just above 0 and - // grow up from there. - mmap_start = mmap_end = 0xfffff80000000000ULL; + // Set up region for mmaps. + mmap_end = 0xfffff80000000000ULL; } void initState(); -- cgit v1.2.3