[arch][arm64][mmu] use slightly more efficient pmm_alloc_page routine
Only used when allocating page size aligned page tables, which is the
common case.
@@ -193,7 +193,13 @@ static int alloc_page_table(paddr_t *paddrp, uint page_size_shift) {
LTRACEF("page_size_shift %u\n", page_size_shift);
- if (size >= PAGE_SIZE) {
+ if (size == PAGE_SIZE) {
+ vm_page_t *p = pmm_alloc_page();
+ if (!p) {
+ return ERR_NO_MEMORY;
+ }
+ *paddrp = vm_page_to_paddr(p);
+ } else if (size > PAGE_SIZE) {
size_t count = size / PAGE_SIZE;
size_t ret = pmm_alloc_contiguous(count, page_size_shift, paddrp, NULL);
if (ret != count)
