Loading bsd-user/mmap.c +13 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,19 @@ void qemu_free(void *ptr) munmap(p, *p); } void *qemu_realloc(void *ptr, size_t size) { size_t old_size, copy; void *new_ptr; old_size = *(size_t *)((char *)ptr - 16); copy = old_size < size ? old_size : size; new_ptr = qemu_malloc(size); memcpy(new_ptr, ptr, copy); qemu_free(ptr); return new_ptr; } /* NOTE: all the constants are the HOST ones, but addresses are target. */ int target_mprotect(abi_ulong start, abi_ulong len, int prot) { Loading Loading
bsd-user/mmap.c +13 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,19 @@ void qemu_free(void *ptr) munmap(p, *p); } void *qemu_realloc(void *ptr, size_t size) { size_t old_size, copy; void *new_ptr; old_size = *(size_t *)((char *)ptr - 16); copy = old_size < size ? old_size : size; new_ptr = qemu_malloc(size); memcpy(new_ptr, ptr, copy); qemu_free(ptr); return new_ptr; } /* NOTE: all the constants are the HOST ones, but addresses are target. */ int target_mprotect(abi_ulong start, abi_ulong len, int prot) { Loading