Revision 50a9569b exec.c
b/exec.c | ||
---|---|---|
209 | 209 |
qemu_host_page_mask = ~(qemu_host_page_size - 1); |
210 | 210 |
l1_phys_map = qemu_vmalloc(L1_SIZE * sizeof(void *)); |
211 | 211 |
memset(l1_phys_map, 0, L1_SIZE * sizeof(void *)); |
212 |
|
|
213 |
#if !defined(_WIN32) && defined(CONFIG_USER_ONLY) |
|
214 |
{ |
|
215 |
long long startaddr, endaddr; |
|
216 |
FILE *f; |
|
217 |
int n; |
|
218 |
|
|
219 |
f = fopen("/proc/self/maps", "r"); |
|
220 |
if (f) { |
|
221 |
do { |
|
222 |
n = fscanf (f, "%llx-%llx %*[^\n]\n", &startaddr, &endaddr); |
|
223 |
if (n == 2) { |
|
224 |
page_set_flags(TARGET_PAGE_ALIGN(startaddr), |
|
225 |
TARGET_PAGE_ALIGN(endaddr), |
|
226 |
PAGE_RESERVED); |
|
227 |
} |
|
228 |
} while (!feof(f)); |
|
229 |
fclose(f); |
|
230 |
} |
|
231 |
} |
|
232 |
#endif |
|
212 | 233 |
} |
213 | 234 |
|
214 | 235 |
static inline PageDesc *page_find_alloc(unsigned int index) |
Also available in: Unified diff