summaryrefslogtreecommitdiff
path: root/util/m5/m5.c
diff options
context:
space:
mode:
authorJoel Hestness <hestness@cs.utexas.edu>2010-08-12 17:16:04 -0700
committerJoel Hestness <hestness@cs.utexas.edu>2010-08-12 17:16:04 -0700
commit73d9a51835f7f9b725b4bec851dac9d6482438e7 (patch)
tree7bd8b363020d2229f67b99942d2f5c5f1b67704f /util/m5/m5.c
parent53c241fc16e4edaae8440b3dd360503537dbaba3 (diff)
downloadgem5-73d9a51835f7f9b725b4bec851dac9d6482438e7.tar.xz
util/m5/m5.c: ensure readfile() buffer pages are in page table
(and marked dirty, in case that matters) by touching them beforehand
Diffstat (limited to 'util/m5/m5.c')
-rw-r--r--util/m5/m5.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/m5/m5.c b/util/m5/m5.c
index 7747fc0bc..96150f2bb 100644
--- a/util/m5/m5.c
+++ b/util/m5/m5.c
@@ -65,6 +65,11 @@ read_file(int dest_fid)
int offset = 0;
int len;
+ // Touch all buffer pages to ensure they are mapped in the
+ // page table. This is required in the case of X86_FS, where
+ // Linux does demand paging.
+ memset(buf, 0, sizeof(buf));
+
while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) {
write(dest_fid, buf, len);
offset += len;