aboutsummaryrefslogtreecommitdiff
path: root/i386/intel
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-14 16:43:52 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-14 16:43:52 +0200
commit0c33f0461f466754b47797f6f860c70520a8ccbb (patch)
treeb2efed97dc192349bc1c099cec4a48d20c31bbbf /i386/intel
parent5de6c7117d078528e506c7a7030ad6d6005111bd (diff)
downloadgnumach-0c33f0461f466754b47797f6f860c70520a8ccbb.tar.gz
gnumach-0c33f0461f466754b47797f6f860c70520a8ccbb.tar.bz2
gnumach-0c33f0461f466754b47797f6f860c70520a8ccbb.zip
pmap: Add MAPWINDOW_SIZE macro
Diffstat (limited to 'i386/intel')
-rw-r--r--i386/intel/pmap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
index cba7890e..d15e2418 100644
--- a/i386/intel/pmap.c
+++ b/i386/intel/pmap.c
@@ -429,6 +429,7 @@ pt_entry_t *kernel_page_dir;
* physical-to-physical transfers.
*/
static pmap_mapwindow_t mapwindows[PMAP_NMAPWINDOWS * NCPUS];
+#define MAPWINDOW_SIZE (PMAP_NMAPWINDOWS * NCPUS * PAGE_SIZE)
#ifdef __x86_64__
static inline pt_entry_t *
@@ -857,9 +858,9 @@ void pmap_bootstrap(void)
}
for (; pte < ptable+NPTES; pte++)
{
- if (va >= kernel_virtual_end - PMAP_NMAPWINDOWS * NCPUS * PAGE_SIZE && va < kernel_virtual_end)
+ if (va >= kernel_virtual_end - MAPWINDOW_SIZE && va < kernel_virtual_end)
{
- pmap_mapwindow_t *win = &mapwindows[atop(va - (kernel_virtual_end - PMAP_NMAPWINDOWS * NCPUS * PAGE_SIZE))];
+ pmap_mapwindow_t *win = &mapwindows[atop(va - (kernel_virtual_end - MAPWINDOW_SIZE))];
win->entry = pte;
win->vaddr = va;
}
@@ -1054,7 +1055,7 @@ void pmap_virtual_space(
vm_offset_t *endp)
{
*startp = kernel_virtual_start;
- *endp = kernel_virtual_end - PMAP_NMAPWINDOWS * NCPUS * PAGE_SIZE;
+ *endp = kernel_virtual_end - MAPWINDOW_SIZE;
}
/*