diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-10-01 03:19:35 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-10-01 04:27:00 +0200 |
commit | e8b1030e140bf0590b4acd4d6dcb84afc7af6403 (patch) | |
tree | 863be8cb59f016dd3e8450e782d0b51bd19d0732 /i386 | |
parent | 2a92200459c3293e42de91d59a398177a72777e3 (diff) | |
download | gnumach-e8b1030e140bf0590b4acd4d6dcb84afc7af6403.tar.gz gnumach-e8b1030e140bf0590b4acd4d6dcb84afc7af6403.tar.bz2 gnumach-e8b1030e140bf0590b4acd4d6dcb84afc7af6403.zip |
pmap: Factorize l4 base access
This also makes the code more coherent with other levels.
Diffstat (limited to 'i386')
-rw-r--r-- | i386/intel/pmap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index 7d0ec6c8..e8016fe6 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -448,8 +448,11 @@ pmap_ptp(const pmap_t pmap, vm_offset_t lin_addr) { pt_entry_t *pdp_table; #ifdef __x86_64__ - pt_entry_t pdp; - pdp = pmap->l4base[lin2l4num(lin_addr)]; + pt_entry_t *l4_table; + l4_table = pmap_l4base(pmap, lin_addr); + if (l4_table == PT_ENTRY_NULL) + return(PT_ENTRY_NULL); + pt_entry_t pdp = *l4_table; if ((pdp & INTEL_PTE_VALID) == 0) return PT_ENTRY_NULL; pdp_table = (pt_entry_t *) ptetokv(pdp); |