Revision 992f48a0 linux-user/mmap.c
b/linux-user/mmap.c | ||
---|---|---|
30 | 30 |
//#define DEBUG_MMAP |
31 | 31 |
|
32 | 32 |
/* NOTE: all the constants are the HOST ones, but addresses are target. */ |
33 |
int target_mprotect(target_ulong start, target_ulong len, int prot)
|
|
33 |
int target_mprotect(abi_ulong start, abi_ulong len, int prot)
|
|
34 | 34 |
{ |
35 |
target_ulong end, host_start, host_end, addr;
|
|
35 |
abi_ulong end, host_start, host_end, addr;
|
|
36 | 36 |
int prot1, ret; |
37 | 37 |
|
38 | 38 |
#ifdef DEBUG_MMAP |
... | ... | |
96 | 96 |
} |
97 | 97 |
|
98 | 98 |
/* map an incomplete host page */ |
99 |
static int mmap_frag(target_ulong real_start,
|
|
100 |
target_ulong start, target_ulong end,
|
|
101 |
int prot, int flags, int fd, target_ulong offset)
|
|
99 |
static int mmap_frag(abi_ulong real_start,
|
|
100 |
abi_ulong start, abi_ulong end,
|
|
101 |
int prot, int flags, int fd, abi_ulong offset)
|
|
102 | 102 |
{ |
103 |
target_ulong real_end, ret, addr;
|
|
103 |
abi_ulong real_end, ret, addr;
|
|
104 | 104 |
void *host_start; |
105 | 105 |
int prot1, prot_new; |
106 | 106 |
|
... | ... | |
152 | 152 |
} |
153 | 153 |
|
154 | 154 |
/* NOTE: all the constants are the HOST ones */ |
155 |
target_long target_mmap(target_ulong start, target_ulong len, int prot,
|
|
156 |
int flags, int fd, target_ulong offset)
|
|
155 |
abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
|
|
156 |
int flags, int fd, abi_ulong offset)
|
|
157 | 157 |
{ |
158 |
target_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len;
|
|
158 |
abi_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len;
|
|
159 | 159 |
unsigned long host_start; |
160 | 160 |
#if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__) || \ |
161 | 161 |
defined(__ia64) || defined(__mips__) |
162 |
static target_ulong last_start = 0x40000000;
|
|
162 |
static abi_ulong last_start = 0x40000000;
|
|
163 | 163 |
#elif defined(__CYGWIN__) |
164 | 164 |
/* Cygwin doesn't have a whole lot of address space. */ |
165 |
static target_ulong last_start = 0x18000000;
|
|
165 |
static abi_ulong last_start = 0x18000000;
|
|
166 | 166 |
#endif |
167 | 167 |
|
168 | 168 |
#ifdef DEBUG_MMAP |
... | ... | |
228 | 228 |
* TARGET_PAGE_SIZE, see exec.c. qemu_real_host_page_size is the |
229 | 229 |
* hosts real page size. |
230 | 230 |
*/ |
231 |
target_ulong host_end;
|
|
231 |
abi_ulong host_end;
|
|
232 | 232 |
unsigned long host_aligned_start; |
233 | 233 |
|
234 | 234 |
host_len = HOST_PAGE_ALIGN(host_len + qemu_host_page_size |
... | ... | |
354 | 354 |
return start; |
355 | 355 |
} |
356 | 356 |
|
357 |
int target_munmap(target_ulong start, target_ulong len)
|
|
357 |
int target_munmap(abi_ulong start, abi_ulong len)
|
|
358 | 358 |
{ |
359 |
target_ulong end, real_start, real_end, addr;
|
|
359 |
abi_ulong end, real_start, real_end, addr;
|
|
360 | 360 |
int prot, ret; |
361 | 361 |
|
362 | 362 |
#ifdef DEBUG_MMAP |
... | ... | |
408 | 408 |
|
409 | 409 |
/* XXX: currently, we only handle MAP_ANONYMOUS and not MAP_FIXED |
410 | 410 |
blocks which have been allocated starting on a host page */ |
411 |
target_long target_mremap(target_ulong old_addr, target_ulong old_size,
|
|
412 |
target_ulong new_size, unsigned long flags,
|
|
413 |
target_ulong new_addr)
|
|
411 |
abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
|
|
412 |
abi_ulong new_size, unsigned long flags,
|
|
413 |
abi_ulong new_addr)
|
|
414 | 414 |
{ |
415 | 415 |
int prot; |
416 | 416 |
unsigned long host_addr; |
... | ... | |
426 | 426 |
return new_addr; |
427 | 427 |
} |
428 | 428 |
|
429 |
int target_msync(target_ulong start, target_ulong len, int flags)
|
|
429 |
int target_msync(abi_ulong start, abi_ulong len, int flags)
|
|
430 | 430 |
{ |
431 |
target_ulong end;
|
|
431 |
abi_ulong end;
|
|
432 | 432 |
|
433 | 433 |
if (start & ~TARGET_PAGE_MASK) |
434 | 434 |
return -EINVAL; |
Also available in: Unified diff