projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53c241f
)
util/m5/m5.c: ensure readfile() buffer pages are in page table
author
Joel Hestness
<hestness@cs.utexas.edu>
Fri, 13 Aug 2010 00:16:04 +0000
(17:16 -0700)
committer
Joel Hestness
<hestness@cs.utexas.edu>
Fri, 13 Aug 2010 00:16:04 +0000
(17:16 -0700)
(and marked dirty, in case that matters) by touching them beforehand
util/m5/m5.c
patch
|
blob
|
history
diff --git
a/util/m5/m5.c
b/util/m5/m5.c
index 7747fc0bca8a0707475db74fccb05a3886dbff67..96150f2bbfd595f0f97a9d032d97d93408e94668 100644
(file)
--- 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;