aboutsummaryrefslogtreecommitdiff
path: root/i386/intel/pmap.h
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2023-02-12 18:28:17 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-02-12 19:13:48 +0100
commiteef53f7a1309e52012babc62da81a2ac750a7e9f (patch)
treefacd946449a10cd4e4339fa7ec61a267e591ef76 /i386/intel/pmap.h
parentf8d840ae46e014d3c65021e169c32e5e39c9ab5a (diff)
downloadgnumach-eef53f7a1309e52012babc62da81a2ac750a7e9f.tar.gz
gnumach-eef53f7a1309e52012babc62da81a2ac750a7e9f.tar.bz2
gnumach-eef53f7a1309e52012babc62da81a2ac750a7e9f.zip
separate initialization of kernel and user PTP tables
* i386/i386/vm_param.h: temporariliy fix kernel upper address * i386/intel/pmap.c: split kernel and user L3 map initialization. For simplicity in handling the different configurations, on 32-bit (+PAE) the name PDPNUM_KERNEL is used in place of PDPNUM, while only on x86_64 the PDPNUM_USER and PDPNUM_KERNEL are treated differently. Also, change iterating over PTP tables in case the kernel map is not right after the user map. * i386/intel/pmap.h: define PDPNUM_USER and PDPNUM_KERNEL and move PDPSHIFT to simplify ifdefs. Message-Id: <20230212172818.1511405-9-luca@orpolo.org>
Diffstat (limited to 'i386/intel/pmap.h')
-rw-r--r--i386/intel/pmap.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/i386/intel/pmap.h b/i386/intel/pmap.h
index 1c6a0d30..34c7cc89 100644
--- a/i386/intel/pmap.h
+++ b/i386/intel/pmap.h
@@ -74,16 +74,14 @@ typedef phys_addr_t pt_entry_t;
#ifdef __x86_64__
#define L4SHIFT 39 /* L4 shift */
#define L4MASK 0x1ff /* mask for L4 index */
-#endif
-#define PDPSHIFT 30 /* page directory pointer */
-#ifdef __x86_64__
-/* Enough for 8GiB addressing space. */
-#define PDPNUM 8 /* number of page directory pointers */
+#define PDPNUM_KERNEL (((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) >> PDPSHIFT) + 1)
+#define PDPNUM_USER (((VM_MAX_USER_ADDRESS - VM_MIN_USER_ADDRESS) >> PDPSHIFT) + 1)
#define PDPMASK 0x1ff /* mask for page directory pointer index */
#else
#define PDPNUM 4 /* number of page directory pointers */
#define PDPMASK 3 /* mask for page directory pointer index */
#endif
+#define PDPSHIFT 30 /* page directory pointer */
#define PDESHIFT 21 /* page descriptor shift */
#define PDEMASK 0x1ff /* mask for page descriptor index */
#define PTESHIFT 12 /* page table shift */