Mem: Use sysconf to get the page size instead of the PAGE_SIZE macro.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 8 Jun 2011 07:57:50 +0000 (00:57 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 8 Jun 2011 07:57:50 +0000 (00:57 -0700)
src/mem/physical.cc

index 84af4c752af32b3da1ea57db797f6bf70c12723b..7337c800c6167bd6e8e6b67e64fe3a8c648aaa5e 100644 (file)
@@ -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);
     }