Lines Matching full:start

64 int target_mprotect(abi_ulong start, abi_ulong len, int prot)  in target_mprotect()  argument
69 qemu_log_mask(CPU_LOG_PAGE, "mprotect: start=0x" TARGET_ABI_FMT_lx in target_mprotect()
70 " len=0x" TARGET_ABI_FMT_lx " prot=%c%c%c\n", start, len, in target_mprotect()
74 if ((start & ~TARGET_PAGE_MASK) != 0) in target_mprotect()
77 end = start + len; in target_mprotect()
78 if (end < start) in target_mprotect()
85 host_start = start & qemu_host_page_mask; in target_mprotect()
87 if (start > host_start) { in target_mprotect()
88 /* handle host page containing start */ in target_mprotect()
90 for (addr = host_start; addr < start; addr += TARGET_PAGE_SIZE) { in target_mprotect()
123 page_set_flags(start, start + len - 1, prot | PAGE_VALID); in target_mprotect()
187 abi_ulong start, abi_ulong end, in mmap_frag() argument
200 if (addr < start || addr >= end) in mmap_frag()
227 if (!mmap_pread(fd, g2h_untagged(start), end - start, offset, true)) { in mmap_frag()
239 memset(g2h_untagged(start), 0, end - start); in mmap_frag()
256 static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size, in mmap_find_vma_reserved() argument
261 ret = page_find_range_empty(start, reserved_va, size, alignment); in mmap_find_vma_reserved()
262 if (ret == -1 && start > TARGET_PAGE_SIZE) { in mmap_find_vma_reserved()
264 ret = page_find_range_empty(TARGET_PAGE_SIZE, start - 1, in mmap_find_vma_reserved()
273 * starts at 'start'.
277 static abi_ulong mmap_find_vma_aligned(abi_ulong start, abi_ulong size, in mmap_find_vma_aligned() argument
285 /* If 'start' == 0, then a default start address is used. */ in mmap_find_vma_aligned()
286 if (start == 0) { in mmap_find_vma_aligned()
287 start = mmap_next_start; in mmap_find_vma_aligned()
289 start &= qemu_host_page_mask; in mmap_find_vma_aligned()
295 return mmap_find_vma_reserved(start, size, in mmap_find_vma_aligned()
300 addr = start; in mmap_find_vma_aligned()
335 if (start == mmap_next_start && addr >= TASK_UNMAPPED_BASE) { in mmap_find_vma_aligned()
346 * first with enough free space, so start again at the in mmap_find_vma_aligned()
359 /* Start over at low memory. */ in mmap_find_vma_aligned()
369 * Since the result the kernel gave didn't fit, start in mmap_find_vma_aligned()
391 } else if (wrapped && addr >= start) { in mmap_find_vma_aligned()
397 abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size) in mmap_find_vma() argument
399 return mmap_find_vma_aligned(start, size, 0); in mmap_find_vma()
403 abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, in target_mmap() argument
410 qemu_log("mmap: start=0x" TARGET_ABI_FMT_lx in target_mmap()
412 start, len, in target_mmap()
483 real_start = start & qemu_host_page_mask; in target_mmap()
494 start = mmap_find_vma_aligned(real_start, host_len, in target_mmap()
497 start = mmap_find_vma(real_start, host_len); in target_mmap()
498 if (start == (abi_ulong)-1) { in target_mmap()
548 p = mmap(g2h_untagged(start), host_len, prot, in target_mmap()
552 /* update start so that it points to the file position at 'offset' */ in target_mmap()
555 p = mmap(g2h_untagged(start), len, prot, in target_mmap()
558 munmap(g2h_untagged(start), host_len); in target_mmap()
563 start = h2g(host_start); in target_mmap()
565 if (start & ~TARGET_PAGE_MASK) { in target_mmap()
569 end = start + len; in target_mmap()
577 if (!guest_range_valid_untagged(start, len)) { in target_mmap()
587 (offset & ~qemu_host_page_mask) != (start & ~qemu_host_page_mask)) { in target_mmap()
597 retaddr = target_mmap(start, len, prot | PROT_WRITE, in target_mmap()
602 if (!mmap_pread(fd, g2h_untagged(start), len, offset, false)) { in target_mmap()
606 ret = target_mprotect(start, len, prot); in target_mmap()
613 if ((flags & MAP_EXCL) && !page_check_range_empty(start, end - 1)) { in target_mmap()
618 /* handle the start of the mapping */ in target_mmap()
619 if (start > real_start) { in target_mmap()
622 ret = mmap_frag(real_start, start, end, in target_mmap()
628 ret = mmap_frag(real_start, start, real_start + qemu_host_page_size, in target_mmap()
639 offset + real_end - qemu_host_page_size - start); in target_mmap()
652 offset1 = offset + real_start - start; in target_mmap()
660 page_set_flags(start, start + len - 1, prot | PAGE_VALID); in target_mmap()
663 printf("ret=0x" TARGET_ABI_FMT_lx "\n", start); in target_mmap()
668 return start; in target_mmap()
674 void mmap_reserve(abi_ulong start, abi_ulong size) in mmap_reserve() argument
682 real_start = start & qemu_host_page_mask; in mmap_reserve()
683 real_end = HOST_PAGE_ALIGN(start + size); in mmap_reserve()
684 end = start + size; in mmap_reserve()
685 if (start > real_start) { in mmap_reserve()
686 /* handle host page containing start */ in mmap_reserve()
688 for (addr = real_start; addr < start; addr += TARGET_PAGE_SIZE) { in mmap_reserve()
716 int target_munmap(abi_ulong start, abi_ulong len) in target_munmap() argument
722 printf("munmap: start=0x" TARGET_ABI_FMT_lx " len=0x" in target_munmap()
724 start, len); in target_munmap()
726 if (start & ~TARGET_PAGE_MASK) in target_munmap()
732 end = start + len; in target_munmap()
733 real_start = start & qemu_host_page_mask; in target_munmap()
736 if (start > real_start) { in target_munmap()
737 /* handle host page containing start */ in target_munmap()
739 for (addr = real_start; addr < start; addr += TARGET_PAGE_SIZE) { in target_munmap()
771 page_set_flags(start, start + len - 1, 0); in target_munmap()
777 int target_msync(abi_ulong start, abi_ulong len, int flags) in target_msync() argument
781 if (start & ~TARGET_PAGE_MASK) in target_msync()
784 end = start + len; in target_msync()
785 if (end < start) in target_msync()
787 if (end == start) in target_msync()
790 start &= qemu_host_page_mask; in target_msync()
791 return msync(g2h_untagged(start), end - start, flags); in target_msync()