Lines Matching refs:last
80 static void shm_region_add(abi_ptr start, abi_ptr last) in shm_region_add() argument
85 i->last = last; in shm_region_add()
96 return i->last; in shm_region_find()
102 static void shm_region_rm_complete(abi_ptr start, abi_ptr last) in shm_region_rm_complete() argument
106 for (i = interval_tree_iter_first(&shm_regions, start, last); i; i = n) { in shm_region_rm_complete()
107 n = interval_tree_iter_next(i, start, last); in shm_region_rm_complete()
108 if (i->start >= start && i->last <= last) { in shm_region_rm_complete()
176 abi_ulong host_start, host_last, last; in target_mprotect() local
196 last = start + len - 1; in target_mprotect()
198 host_last = ROUND_UP(last, host_page_size) - 1; in target_mprotect()
209 for (abi_ulong a = last; a < host_last; a += TARGET_PAGE_SIZE) { in target_mprotect()
233 if (last < host_last) { in target_mprotect()
236 for (abi_ulong a = last; a < host_last; a += TARGET_PAGE_SIZE) { in target_mprotect()
266 page_set_flags(start, last, page_flags); in target_mprotect()
333 static bool mmap_frag(abi_ulong real_start, abi_ulong start, abi_ulong last, in mmap_frag() argument
361 for (abi_ulong a = real_last; a > last; a -= TARGET_PAGE_SIZE) { in mmap_frag()
396 memset(g2h_untagged(start), 0, last - start + 1); in mmap_frag()
397 } else if (!mmap_pread(fd, g2h_untagged(start), last - start + 1, in mmap_frag()
557 static abi_long mmap_end(abi_ulong start, abi_ulong last, in mmap_end() argument
567 page_set_flags(start, last, page_flags); in mmap_end()
574 if (passthrough_last < last) { in mmap_end()
575 page_set_flags(passthrough_last + 1, last, page_flags); in mmap_end()
578 shm_region_rm_complete(start, last); in mmap_end()
600 abi_ulong last; in mmap_h_eq_g() local
618 last = start + len - 1; in mmap_h_eq_g()
619 return mmap_end(start, last, start, last, flags, page_flags); in mmap_h_eq_g()
656 abi_ulong last, pass_last; in mmap_h_lt_g() local
767 last = start + len - 1; in mmap_h_lt_g()
769 pass_last = ROUND_UP(last - fileend_adj, host_page_size) - 1; in mmap_h_lt_g()
771 pass_last = last; in mmap_h_lt_g()
773 return mmap_end(start, last, start, pass_last, mmap_flags, page_flags); in mmap_h_lt_g()
789 abi_ulong last, real_start, real_last; in mmap_h_gt_g() local
811 last = start + len - 1; in mmap_h_gt_g()
812 return mmap_end(start, last, start, last, flags, page_flags); in mmap_h_gt_g()
828 last = start + len - 1; in mmap_h_gt_g()
830 real_last = ROUND_UP(last, host_page_size) - 1; in mmap_h_gt_g()
837 if (last <= real_page_last) { in mmap_h_gt_g()
839 if (!mmap_frag(real_start, start, last, target_prot, in mmap_h_gt_g()
843 return mmap_end(start, last, -1, 0, flags, page_flags); in mmap_h_gt_g()
853 if (last < real_last) { in mmap_h_gt_g()
855 if (!mmap_frag(real_page_start, real_page_start, last, in mmap_h_gt_g()
864 return mmap_end(start, last, -1, 0, flags, page_flags); in mmap_h_gt_g()
901 return mmap_end(start, last, -1, 0, flags, page_flags); in mmap_h_gt_g()
1025 abi_ulong last; in mmap_reserve_or_unmap() local
1030 last = start + len - 1; in mmap_reserve_or_unmap()
1032 real_last = ROUND_UP(last, host_page_size) - 1; in mmap_reserve_or_unmap()
1045 for (a = last; a < real_last; a += TARGET_PAGE_SIZE) { in mmap_reserve_or_unmap()
1059 for (prot = 0, a = last; a < real_last; a += TARGET_PAGE_SIZE) { in mmap_reserve_or_unmap()
1368 abi_ulong last; in target_shmat() local
1434 last = shmaddr + m_len - 1; in target_shmat()
1435 page_set_flags(shmaddr, last, in target_shmat()
1440 shm_region_rm_complete(shmaddr, last); in target_shmat()
1441 shm_region_add(shmaddr, last); in target_shmat()
1473 abi_ulong last = shm_region_find(shmaddr); in target_shmdt() local
1474 if (last == 0) { in target_shmdt()
1480 abi_ulong size = last - shmaddr + 1; in target_shmdt()
1482 page_set_flags(shmaddr, last, 0); in target_shmdt()
1483 shm_region_rm_complete(shmaddr, last); in target_shmdt()