Lines Matching refs:p

165 static PageFlagsNode *pageflags_next(PageFlagsNode *p, target_ulong start,  in pageflags_next()  argument
170 n = interval_tree_iter_next(&p->itree, start, last); in pageflags_next()
183 PageFlagsNode *p = container_of(n, PageFlagsNode, itree); in walk_memory_regions() local
185 rc = fn(priv, n->start, n->last + 1, p->flags); in walk_memory_regions()
220 PageFlagsNode *p = pageflags_find(address, address); in page_get_flags() local
227 if (p) { in page_get_flags()
228 return p->flags; in page_get_flags()
235 p = pageflags_find(address, address); in page_get_flags()
237 return p ? p->flags : 0; in page_get_flags()
243 PageFlagsNode *p = g_new(PageFlagsNode, 1); in pageflags_create() local
245 p->itree.start = start; in pageflags_create()
246 p->itree.last = last; in pageflags_create()
247 p->flags = flags; in pageflags_create()
248 interval_tree_insert(&p->itree, &pageflags_root); in pageflags_create()
257 PageFlagsNode *p = pageflags_find(start, last); in pageflags_unset() local
260 if (!p) { in pageflags_unset()
264 if (p->flags & PAGE_EXEC) { in pageflags_unset()
268 interval_tree_remove(&p->itree, &pageflags_root); in pageflags_unset()
269 p_last = p->itree.last; in pageflags_unset()
271 if (p->itree.start < start) { in pageflags_unset()
273 p->itree.last = start - 1; in pageflags_unset()
274 interval_tree_insert(&p->itree, &pageflags_root); in pageflags_unset()
276 pageflags_create(last + 1, p_last, p->flags); in pageflags_unset()
281 g_free_rcu(p, rcu); in pageflags_unset()
284 p->itree.start = last + 1; in pageflags_unset()
285 interval_tree_insert(&p->itree, &pageflags_root); in pageflags_unset()
352 PageFlagsNode *p; in pageflags_set_clear() local
358 p = pageflags_find(start, last); in pageflags_set_clear()
359 if (!p) { in pageflags_set_clear()
366 p_start = p->itree.start; in pageflags_set_clear()
367 p_last = p->itree.last; in pageflags_set_clear()
368 p_flags = p->flags; in pageflags_set_clear()
388 p->flags = merge_flags; in pageflags_set_clear()
390 interval_tree_remove(&p->itree, &pageflags_root); in pageflags_set_clear()
391 g_free_rcu(p, rcu); in pageflags_set_clear()
402 interval_tree_remove(&p->itree, &pageflags_root); in pageflags_set_clear()
403 p->itree.last = start - 1; in pageflags_set_clear()
404 interval_tree_insert(&p->itree, &pageflags_root); in pageflags_set_clear()
425 interval_tree_remove(&p->itree, &pageflags_root); in pageflags_set_clear()
426 p->itree.start = last + 1; in pageflags_set_clear()
427 interval_tree_insert(&p->itree, &pageflags_root); in pageflags_set_clear()
433 p->flags = merge_flags; in pageflags_set_clear()
435 interval_tree_remove(&p->itree, &pageflags_root); in pageflags_set_clear()
436 g_free_rcu(p, rcu); in pageflags_set_clear()
450 interval_tree_remove(&p->itree, &pageflags_root); in pageflags_set_clear()
451 p->itree.start = start; in pageflags_set_clear()
452 interval_tree_insert(&p->itree, &pageflags_root); in pageflags_set_clear()
462 interval_tree_remove(&p->itree, &pageflags_root); in pageflags_set_clear()
464 p->itree.last = start - 1; in pageflags_set_clear()
465 interval_tree_insert(&p->itree, &pageflags_root); in pageflags_set_clear()
474 p->itree.start = last + 1; in pageflags_set_clear()
475 interval_tree_insert(&p->itree, &pageflags_root); in pageflags_set_clear()
477 g_free_rcu(p, rcu); in pageflags_set_clear()
550 PageFlagsNode *p = pageflags_find(start, last); in page_check_range() local
553 if (!p) { in page_check_range()
561 p = pageflags_find(start, last); in page_check_range()
563 if (!p) { in page_check_range()
568 if (start < p->itree.start) { in page_check_range()
573 missing = flags & ~p->flags; in page_check_range()
579 if (!(p->flags & PAGE_WRITE_ORG)) { in page_check_range()
597 if (last <= p->itree.last) { in page_check_range()
601 start = p->itree.last + 1; in page_check_range()
634 PageFlagsNode *p; in page_find_range_empty() local
645 p = pageflags_find(min, min + len_m1); in page_find_range_empty()
646 if (p == NULL) { in page_find_range_empty()
650 if (max <= p->itree.last) { in page_find_range_empty()
655 min = p->itree.last + 1; in page_find_range_empty()
661 PageFlagsNode *p; in page_protect() local
676 p = pageflags_find(start, last); in page_protect()
677 if (!p) { in page_protect()
680 prot = p->flags; in page_protect()
682 if (unlikely(p->itree.last < last)) { in page_protect()
685 while ((p = pageflags_next(p, start, last)) != NULL) { in page_protect()
686 prot |= p->flags; in page_protect()
706 PageFlagsNode *p; in page_unprotect() local
716 p = pageflags_find(address, address); in page_unprotect()
719 if (!p || !(p->flags & PAGE_WRITE_ORG)) { in page_unprotect()
725 if (p->flags & PAGE_WRITE) { in page_unprotect()
745 prot = p->flags | PAGE_WRITE; in page_unprotect()
756 p = pageflags_find(addr, addr); in page_unprotect()
757 if (p) { in page_unprotect()
758 prot |= p->flags; in page_unprotect()
759 if (p->flags & PAGE_WRITE_ORG) { in page_unprotect()