Lines Matching refs:nr_pages
49 static void *cache_alloc(xencall_handle *xcall, size_t nr_pages) in cache_alloc() argument
60 if ( nr_pages > 1 ) in cache_alloc()
79 static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages) in cache_free() argument
88 if ( nr_pages == 1 && in cache_free()
128 void *xencall_alloc_buffer_pages(xencall_handle *xcall, size_t nr_pages) in xencall_alloc_buffer_pages() argument
130 void *p = cache_alloc(xcall, nr_pages); in xencall_alloc_buffer_pages()
133 p = osdep_alloc_pages(xcall, nr_pages); in xencall_alloc_buffer_pages()
138 memset(p, 0, nr_pages * PAGE_SIZE); in xencall_alloc_buffer_pages()
143 void xencall_free_buffer_pages(xencall_handle *xcall, void *p, size_t nr_pages) in xencall_free_buffer_pages() argument
148 if ( !cache_free(xcall, p, nr_pages) ) in xencall_free_buffer_pages()
149 osdep_free_pages(xcall, p, nr_pages); in xencall_free_buffer_pages()
153 int nr_pages; member
160 int nr_pages = actual_size >> PAGE_SHIFT; in xencall_alloc_buffer() local
163 hdr = xencall_alloc_buffer_pages(xcall, nr_pages); in xencall_alloc_buffer()
167 hdr->nr_pages = nr_pages; in xencall_alloc_buffer()
182 xencall_free_buffer_pages(xcall, hdr, hdr->nr_pages); in xencall_free_buffer()