From a58df573dd634676675156563c391f11fc894aca Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 23 Nov 2022 13:04:04 -0500 Subject: [PATCH 22/52] mips: Generalize GET_ODD_1M_PFN_FROM_EVEN to work with other page sizes In preparation for modifying the TLB miss handlers to work with larger page sizes. No functional change intended. --- sys/mips/include/pte.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/mips/include/pte.h b/sys/mips/include/pte.h index d3780c8593f9..5d2671f55781 100644 --- a/sys/mips/include/pte.h +++ b/sys/mips/include/pte.h @@ -543,16 +543,16 @@ TLBLO_PTE_TO_PA(pt_entry_t pte) dsrl32 r, (PTE_HWFLAGS_NBITS_TO_LEFT - 32) /* - * GET_ODD_1M_PFN_FROM_EVEN(r) + * GET_ODD_PFN_FROM_EVEN(r) * - * Get the odd 1M PFN (TLB lo1) from the even 1M PTE. First, mask out the PFN - * from the even PTE. Then add 1M worth of pages to it (256). Finally, shift it - * back to its position in the PTE. + * Get the odd superpage PFN (TLB lo1) from the even PTE. First, mask out the + * PFN from the even PTE. Then add "size" worth of pages to it (256 = 1MB). + * Finally, shift it back to its position in the PTE. */ -#define GET_ODD_1M_PFN_FROM_EVEN(r) \ +#define GET_ODD_PFN_FROM_EVEN(size, r) \ dsll r, (PTE_PFN_NBITS_TO_LEFT); \ dsrl r, (PTE_PFN_NBITS_TO_LEFT + PTE_PFN_NBITS_TO_RIGHT); \ - daddiu r, r, (1024 * 1024 / PAGE_SIZE); \ + daddiu r, r, ((size) / PAGE_SIZE); \ dsll r, (PTE_PFN_NBITS_TO_RIGHT) /* -- 2.41.0