mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
linux-user: remove useless macros GUEST_BASE and RESERVED_VA
As we have removed CONFIG_USE_GUEST_BASE, we always use a guest base and the macros GUEST_BASE and RESERVED_VA become useless: replace them by their values. Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <1440420834-8388-1-git-send-email-laurent@vivier.eu> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
4cbea59869
commit
b76f21a707
11 changed files with 64 additions and 78 deletions
|
@ -215,14 +215,14 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size)
|
|||
int prot;
|
||||
int looped = 0;
|
||||
|
||||
if (size > RESERVED_VA) {
|
||||
if (size > reserved_va) {
|
||||
return (abi_ulong)-1;
|
||||
}
|
||||
|
||||
size = HOST_PAGE_ALIGN(size);
|
||||
end_addr = start + size;
|
||||
if (end_addr > RESERVED_VA) {
|
||||
end_addr = RESERVED_VA;
|
||||
if (end_addr > reserved_va) {
|
||||
end_addr = reserved_va;
|
||||
}
|
||||
addr = end_addr - qemu_host_page_size;
|
||||
|
||||
|
@ -231,7 +231,7 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size)
|
|||
if (looped) {
|
||||
return (abi_ulong)-1;
|
||||
}
|
||||
end_addr = RESERVED_VA;
|
||||
end_addr = reserved_va;
|
||||
addr = end_addr - qemu_host_page_size;
|
||||
looped = 1;
|
||||
continue;
|
||||
|
@ -274,7 +274,7 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
|
|||
|
||||
size = HOST_PAGE_ALIGN(size);
|
||||
|
||||
if (RESERVED_VA) {
|
||||
if (reserved_va) {
|
||||
return mmap_find_vma_reserved(start, size);
|
||||
}
|
||||
|
||||
|
@ -667,7 +667,7 @@ int target_munmap(abi_ulong start, abi_ulong len)
|
|||
ret = 0;
|
||||
/* unmap what we can */
|
||||
if (real_start < real_end) {
|
||||
if (RESERVED_VA) {
|
||||
if (reserved_va) {
|
||||
mmap_reserve(real_start, real_end - real_start);
|
||||
} else {
|
||||
ret = munmap(g2h(real_start), real_end - real_start);
|
||||
|
@ -697,7 +697,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
|
|||
flags,
|
||||
g2h(new_addr));
|
||||
|
||||
if (RESERVED_VA && host_addr != MAP_FAILED) {
|
||||
if (reserved_va && host_addr != MAP_FAILED) {
|
||||
/* If new and old addresses overlap then the above mremap will
|
||||
already have failed with EINVAL. */
|
||||
mmap_reserve(old_addr, old_size);
|
||||
|
@ -715,13 +715,13 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
|
|||
old_size, new_size,
|
||||
flags | MREMAP_FIXED,
|
||||
g2h(mmap_start));
|
||||
if ( RESERVED_VA ) {
|
||||
if (reserved_va) {
|
||||
mmap_reserve(old_addr, old_size);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int prot = 0;
|
||||
if (RESERVED_VA && old_size < new_size) {
|
||||
if (reserved_va && old_size < new_size) {
|
||||
abi_ulong addr;
|
||||
for (addr = old_addr + old_size;
|
||||
addr < old_addr + new_size;
|
||||
|
@ -731,7 +731,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
|
|||
}
|
||||
if (prot == 0) {
|
||||
host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
|
||||
if (host_addr != MAP_FAILED && RESERVED_VA && old_size > new_size) {
|
||||
if (host_addr != MAP_FAILED && reserved_va && old_size > new_size) {
|
||||
mmap_reserve(old_addr + old_size, new_size - old_size);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue