Revision b480d9b7
b/cpu-all.h | ||
---|---|---|
744 | 744 |
#define PAGE_WRITE_ORG 0x0010 |
745 | 745 |
#define PAGE_RESERVED 0x0020 |
746 | 746 |
|
747 |
#if defined(CONFIG_USER_ONLY) |
|
747 | 748 |
void page_dump(FILE *f); |
748 | 749 |
|
749 |
typedef int (*walk_memory_regions_fn)(void *, unsigned long,
|
|
750 |
unsigned long, unsigned long);
|
|
750 |
typedef int (*walk_memory_regions_fn)(void *, abi_ulong,
|
|
751 |
abi_ulong, unsigned long);
|
|
751 | 752 |
int walk_memory_regions(void *, walk_memory_regions_fn); |
752 | 753 |
|
753 | 754 |
int page_get_flags(target_ulong address); |
754 | 755 |
void page_set_flags(target_ulong start, target_ulong end, int flags); |
755 | 756 |
int page_check_range(target_ulong start, target_ulong len, int flags); |
757 |
#endif |
|
756 | 758 |
|
757 | 759 |
void cpu_exec_init_all(unsigned long tb_size); |
758 | 760 |
CPUState *cpu_copy(CPUState *env); |
b/exec-all.h | ||
---|---|---|
29 | 29 |
addresses in userspace mode. Define tb_page_addr_t to be an appropriate |
30 | 30 |
type. */ |
31 | 31 |
#if defined(CONFIG_USER_ONLY) |
32 |
typedef target_ulong tb_page_addr_t;
|
|
32 |
typedef abi_ulong tb_page_addr_t;
|
|
33 | 33 |
#else |
34 | 34 |
typedef ram_addr_t tb_page_addr_t; |
35 | 35 |
#endif |
b/exec.c | ||
---|---|---|
2217 | 2217 |
}; |
2218 | 2218 |
|
2219 | 2219 |
static int walk_memory_regions_end(struct walk_memory_regions_data *data, |
2220 |
unsigned long end, int new_prot)
|
|
2220 |
abi_ulong end, int new_prot)
|
|
2221 | 2221 |
{ |
2222 | 2222 |
if (data->start != -1ul) { |
2223 | 2223 |
int rc = data->fn(data->priv, data->start, end, data->prot); |
... | ... | |
2233 | 2233 |
} |
2234 | 2234 |
|
2235 | 2235 |
static int walk_memory_regions_1(struct walk_memory_regions_data *data, |
2236 |
unsigned long base, int level, void **lp)
|
|
2236 |
abi_ulong base, int level, void **lp)
|
|
2237 | 2237 |
{ |
2238 |
unsigned long pa;
|
|
2238 |
abi_ulong pa;
|
|
2239 | 2239 |
int i, rc; |
2240 | 2240 |
|
2241 | 2241 |
if (*lp == NULL) { |
... | ... | |
2258 | 2258 |
} else { |
2259 | 2259 |
void **pp = *lp; |
2260 | 2260 |
for (i = 0; i < L2_BITS; ++i) { |
2261 |
pa = base | (i << (TARGET_PAGE_BITS + L2_BITS * level)); |
|
2261 |
pa = base | ((abi_ulong)i << |
|
2262 |
(TARGET_PAGE_BITS + L2_BITS * level)); |
|
2262 | 2263 |
rc = walk_memory_regions_1(data, pa, level - 1, pp + i); |
2263 | 2264 |
if (rc != 0) { |
2264 | 2265 |
return rc; |
... | ... | |
2280 | 2281 |
data.prot = 0; |
2281 | 2282 |
|
2282 | 2283 |
for (i = 0; i < V_L1_SIZE; i++) { |
2283 |
int rc = walk_memory_regions_1(&data, i << V_L1_SHIFT, |
|
2284 |
int rc = walk_memory_regions_1(&data, (abi_ulong)i << V_L1_SHIFT,
|
|
2284 | 2285 |
V_L1_SHIFT / L2_BITS - 1, l1_map + i); |
2285 | 2286 |
if (rc != 0) { |
2286 | 2287 |
return rc; |
... | ... | |
2290 | 2291 |
return walk_memory_regions_end(&data, 0, 0); |
2291 | 2292 |
} |
2292 | 2293 |
|
2293 |
static int dump_region(void *priv, unsigned long start,
|
|
2294 |
unsigned long end, unsigned long prot)
|
|
2294 |
static int dump_region(void *priv, abi_ulong start,
|
|
2295 |
abi_ulong end, unsigned long prot)
|
|
2295 | 2296 |
{ |
2296 | 2297 |
FILE *f = (FILE *)priv; |
2297 | 2298 |
|
2298 |
(void) fprintf(f, "%08lx-%08lx %08lx %c%c%c\n", |
|
2299 |
(void) fprintf(f, TARGET_ABI_FMT_lx"-"TARGET_ABI_FMT_lx |
|
2300 |
" "TARGET_ABI_FMT_lx" %c%c%c\n", |
|
2299 | 2301 |
start, end, end - start, |
2300 | 2302 |
((prot & PAGE_READ) ? 'r' : '-'), |
2301 | 2303 |
((prot & PAGE_WRITE) ? 'w' : '-'), |
... | ... | |
2332 | 2334 |
/* This function should never be called with addresses outside the |
2333 | 2335 |
guest address space. If this assert fires, it probably indicates |
2334 | 2336 |
a missing call to h2g_valid. */ |
2335 |
#if HOST_LONG_BITS > L1_MAP_ADDR_SPACE_BITS
|
|
2336 |
assert(end < (1ul << L1_MAP_ADDR_SPACE_BITS));
|
|
2337 |
#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS
|
|
2338 |
assert(end < ((abi_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
|
|
2337 | 2339 |
#endif |
2338 | 2340 |
assert(start < end); |
2339 | 2341 |
|
b/linux-user/elfload.c | ||
---|---|---|
2020 | 2020 |
static struct vm_area_struct *vma_first(const struct mm_struct *); |
2021 | 2021 |
static struct vm_area_struct *vma_next(struct vm_area_struct *); |
2022 | 2022 |
static abi_ulong vma_dump_size(const struct vm_area_struct *); |
2023 |
static int vma_walker(void *priv, unsigned long start, unsigned long end,
|
|
2023 |
static int vma_walker(void *priv, abi_ulong start, abi_ulong end,
|
|
2024 | 2024 |
unsigned long flags); |
2025 | 2025 |
|
2026 | 2026 |
static void fill_elf_header(struct elfhdr *, int, uint16_t, uint32_t); |
... | ... | |
2173 | 2173 |
return (vma->vma_end - vma->vma_start); |
2174 | 2174 |
} |
2175 | 2175 |
|
2176 |
static int vma_walker(void *priv, unsigned long start, unsigned long end,
|
|
2176 |
static int vma_walker(void *priv, abi_ulong start, abi_ulong end,
|
|
2177 | 2177 |
unsigned long flags) |
2178 | 2178 |
{ |
2179 | 2179 |
struct mm_struct *mm = (struct mm_struct *)priv; |
b/linux-user/mmap.c | ||
---|---|---|
88 | 88 |
|
89 | 89 |
if (h2g_valid(p)) { |
90 | 90 |
/* Allocated region overlaps guest address space. This may recurse. */ |
91 |
unsigned long addr = h2g(p);
|
|
91 |
abi_ulong addr = h2g(p);
|
|
92 | 92 |
page_set_flags(addr & TARGET_PAGE_MASK, TARGET_PAGE_ALIGN(addr + size), |
93 | 93 |
PAGE_RESERVED); |
94 | 94 |
} |
Also available in: Unified diff