From: Gabe Black Date: Wed, 8 Jun 2011 07:57:50 +0000 (-0700) Subject: Mem: Use sysconf to get the page size instead of the PAGE_SIZE macro. X-Git-Tag: stable_2012_02_02~284 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1f7a6274017821d58f3087120079477ac211ceaf;p=gem5.git Mem: Use sysconf to get the page size instead of the PAGE_SIZE macro. --- diff --git a/src/mem/physical.cc b/src/mem/physical.cc index 84af4c752..7337c800c 100644 --- a/src/mem/physical.cc +++ b/src/mem/physical.cc @@ -90,7 +90,7 @@ PhysicalMemory::PhysicalMemory(const Params *p) int fd = open(params()->file.c_str(), O_RDONLY); _size = lseek(fd, 0, SEEK_END); lseek(fd, 0, SEEK_SET); - pmemAddr = (uint8_t *)mmap(NULL, roundUp(size(), PAGE_SIZE), + pmemAddr = (uint8_t *)mmap(NULL, roundUp(size(), sysconf(_SC_PAGESIZE)), PROT_READ | PROT_WRITE, map_flags, fd, 0); }