pmap: Fix lookup function and add test for it
[barrelfish] / lib / barrelfish / arch / x86_64 / pmap.c
index 4ecd7fd..b6f9ce6 100644 (file)
@@ -984,8 +984,8 @@ static errval_t lookup(struct pmap *pmap, genvaddr_t vaddr,
     }
 
     if (info) {
-        info->vaddr = vaddr & ~(genvaddr_t)(find_info.page_size - 1);
-        info->size = find_info.page_size;
+        info->vaddr = find_info.page->u.frame.vaddr;
+        info->size = find_info.page_size * find_info.page->v.u.frame.pte_count;
         info->cap = find_info.page->v.cap;
         info->offset = find_info.page->v.u.frame.offset;
         info->flags = find_info.page->v.u.frame.flags;