Lines Matching refs:p
34 struct hyp_page *p, in __find_buddy_nocheck() argument
37 phys_addr_t addr = hyp_page_to_phys(p); in __find_buddy_nocheck()
53 struct hyp_page *p, in __find_buddy_avail() argument
56 struct hyp_page *buddy = __find_buddy_nocheck(pool, p, order); in __find_buddy_avail()
72 static inline void page_remove_from_list(struct hyp_page *p) in page_remove_from_list() argument
74 struct list_head *node = hyp_page_to_virt(p); in page_remove_from_list()
80 static inline void page_add_to_list(struct hyp_page *p, struct list_head *head) in page_add_to_list() argument
82 struct list_head *node = hyp_page_to_virt(p); in page_add_to_list()
94 struct hyp_page *p) in __hyp_attach_page() argument
96 phys_addr_t phys = hyp_page_to_phys(p); in __hyp_attach_page()
97 unsigned short order = p->order; in __hyp_attach_page()
100 memset(hyp_page_to_virt(p), 0, PAGE_SIZE << p->order); in __hyp_attach_page()
112 p->order = HYP_NO_ORDER; in __hyp_attach_page()
114 buddy = __find_buddy_avail(pool, p, order); in __hyp_attach_page()
121 p = min(p, buddy); in __hyp_attach_page()
126 p->order = order; in __hyp_attach_page()
127 page_add_to_list(p, &pool->free_area[order]); in __hyp_attach_page()
131 struct hyp_page *p, in __hyp_extract_page() argument
136 page_remove_from_list(p); in __hyp_extract_page()
137 while (p->order > order) { in __hyp_extract_page()
144 p->order--; in __hyp_extract_page()
145 buddy = __find_buddy_nocheck(pool, p, p->order); in __hyp_extract_page()
146 buddy->order = p->order; in __hyp_extract_page()
150 return p; in __hyp_extract_page()
153 static void __hyp_put_page(struct hyp_pool *pool, struct hyp_page *p) in __hyp_put_page() argument
155 if (hyp_page_ref_dec_and_test(p)) in __hyp_put_page()
156 __hyp_attach_page(pool, p); in __hyp_put_page()
168 struct hyp_page *p = hyp_virt_to_page(addr); in hyp_put_page() local
171 __hyp_put_page(pool, p); in hyp_put_page()
177 struct hyp_page *p = hyp_virt_to_page(addr); in hyp_get_page() local
180 hyp_page_ref_inc(p); in hyp_get_page()
184 void hyp_split_page(struct hyp_page *p) in hyp_split_page() argument
186 unsigned short order = p->order; in hyp_split_page()
189 p->order = 0; in hyp_split_page()
191 struct hyp_page *tail = p + i; in hyp_split_page()
201 struct hyp_page *p; in hyp_alloc_pages() local
214 p = node_to_page(pool->free_area[i].next); in hyp_alloc_pages()
215 p = __hyp_extract_page(pool, p, order); in hyp_alloc_pages()
217 hyp_set_page_refcounted(p); in hyp_alloc_pages()
220 return hyp_page_to_virt(p); in hyp_alloc_pages()
227 struct hyp_page *p; in hyp_pool_init() local
238 p = hyp_phys_to_page(phys); in hyp_pool_init()
240 hyp_set_page_refcounted(&p[i]); in hyp_pool_init()
244 __hyp_put_page(pool, &p[i]); in hyp_pool_init()