summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mem/AbstractMemory.py1
-rw-r--r--src/mem/abstract_mem.cc24
2 files changed, 4 insertions, 21 deletions
diff --git a/src/mem/AbstractMemory.py b/src/mem/AbstractMemory.py
index bf1621f4d..ce3f04c49 100644
--- a/src/mem/AbstractMemory.py
+++ b/src/mem/AbstractMemory.py
@@ -46,7 +46,6 @@ class AbstractMemory(MemObject):
type = 'AbstractMemory'
abstract = True
range = Param.AddrRange(AddrRange('128MB'), "Address range")
- file = Param.String('', "Memory-mapped file")
null = Param.Bool(False, "Do not store data, always return zero")
zero = Param.Bool(False, "Initialize memory with zeros")
diff --git a/src/mem/abstract_mem.cc b/src/mem/abstract_mem.cc
index ebe4a64b5..4d34bec80 100644
--- a/src/mem/abstract_mem.cc
+++ b/src/mem/abstract_mem.cc
@@ -76,29 +76,13 @@ AbstractMemory::AbstractMemory(const Params *p) :
if (params()->null)
return;
- if (params()->file == "") {
- int map_flags = MAP_ANON | MAP_PRIVATE;
- pmemAddr = (uint8_t *)mmap(NULL, size(),
- PROT_READ | PROT_WRITE, map_flags, -1, 0);
- } else {
- int map_flags = MAP_PRIVATE;
- int fd = open(params()->file.c_str(), O_RDONLY);
- long _size = lseek(fd, 0, SEEK_END);
- if (_size != range.size()) {
- fatal("Specified size %d does not match file %s %d\n",
- range.size(), params()->file, _size);
- }
- lseek(fd, 0, SEEK_SET);
- pmemAddr = (uint8_t *)mmap(NULL, roundUp(_size, sysconf(_SC_PAGESIZE)),
- PROT_READ | PROT_WRITE, map_flags, fd, 0);
- }
+ int map_flags = MAP_ANON | MAP_PRIVATE;
+ pmemAddr = (uint8_t *)mmap(NULL, size(),
+ PROT_READ | PROT_WRITE, map_flags, -1, 0);
if (pmemAddr == (void *)MAP_FAILED) {
perror("mmap");
- if (params()->file == "")
- fatal("Could not mmap!\n");
- else
- fatal("Could not find file: %s\n", params()->file);
+ fatal("Could not mmap!\n");
}
//If requested, initialize all the memory to 0