* Ali Saidi
*/
-#include <sys/types.h>
#include <sys/mman.h>
+#include <sys/types.h>
#include <sys/user.h>
-#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <zlib.h>
+#include <cerrno>
#include <cstdio>
#include <iostream>
#include <string>
#include "base/misc.hh"
#include "base/random.hh"
#include "base/types.hh"
-#include "config/full_system.hh"
#include "config/the_isa.hh"
+#include "debug/LLSC.hh"
+#include "debug/MemoryAccess.hh"
#include "mem/packet_access.hh"
#include "mem/physical.hh"
#include "sim/eventq.hh"
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);
}
fatal("Insufficient memory to allocate compression state for %s\n",
filename);
- // unmap file that was mmaped in the constructor
+ // unmap file that was mmapped in the constructor
// This is done here to make sure that gzip and open don't muck with our
// nice large space of memory before we reallocate it
munmap((char*)pmemAddr, size());
UNSERIALIZE_SCALAR(_size);
if (size() > params()->range.size())
- fatal("Memory size has changed!\n");
+ fatal("Memory size has changed! size %lld, param size %lld\n",
+ size(), params()->range.size());
pmemAddr = (uint8_t *)mmap(NULL, size(),
PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);