Deleted Added
sdiff udiff text old ( 12002:3f51adda9470 ) new ( 12003:bbe320b2f604 )
full compact
1/*
2 * Copyright (c) 2011 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 91 unchanged lines hidden (view full) ---

102 if ((n % 8) == 7)
103 i++;
104 }
105}
106
107int
108read_file(int dest_fid)
109{
110 char buf[256*1024];
111 int offset = 0;
112 int len;
113
114 // Touch all buffer pages to ensure they are mapped in the
115 // page table. This is required in the case of X86_FS, where
116 // Linux does demand paging.
117 memset(buf, 0, sizeof(buf));
118
119 while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) {
120 write(dest_fid, buf, len);
121 offset += len;
122 }
123}
124
125void
126write_file(const char *filename)
127{
128 fprintf(stderr, "opening %s\n", filename);
129 int src_fid = open(filename, O_RDONLY);
130

--- 273 unchanged lines hidden ---