diff options
author | bapt <bapt@FreeBSD.org> | 2015-09-12 12:03:02 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-09-12 12:03:02 +0000 |
commit | 934c5c6da6753f906bc4a905e249449fd15b850d (patch) | |
tree | 38501bd60c958b3b5474368fc0834fe6d09c307a /sys/powerpc/include/pte.h | |
parent | ef64c24c72a0a1e4bc5beba3e1c3d78af363773d (diff) | |
parent | ceb1e1488d523eff8fa06828cf0511fc2556c0ef (diff) | |
download | FreeBSD-src-934c5c6da6753f906bc4a905e249449fd15b850d.zip FreeBSD-src-934c5c6da6753f906bc4a905e249449fd15b850d.tar.gz |
Finish merging from head, messed up in previous attempt
Diffstat (limited to 'sys/powerpc/include/pte.h')
-rw-r--r-- | sys/powerpc/include/pte.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/powerpc/include/pte.h b/sys/powerpc/include/pte.h index b3e103a..3a27929 100644 --- a/sys/powerpc/include/pte.h +++ b/sys/powerpc/include/pte.h @@ -207,10 +207,13 @@ typedef struct lpte lpte_t; /* * Page Table Entry definitions and macros. + * + * RPN need only be 32-bit because Book-E has 36-bit addresses, and the smallest + * page size is 4k (12-bit mask), so RPN can really fit into 24 bits. */ #ifndef LOCORE struct pte { - vm_paddr_t rpn; + vm_offset_t rpn; uint32_t flags; }; typedef struct pte pte_t; @@ -266,7 +269,9 @@ typedef struct pte pte_t; #define PTE_REFERENCED 0x04000000 /* Referenced */ /* Macro argument must of pte_t type. */ -#define PTE_PA(pte) ((pte)->rpn & ~PTE_PA_MASK) +#define PTE_PA_SHIFT 12 +#define PTE_RPN_FROM_PA(pa) ((pa) >> PTE_PA_SHIFT) +#define PTE_PA(pte) ((vm_paddr_t)((pte)->rpn) << PTE_PA_SHIFT) #define PTE_ISVALID(pte) ((pte)->flags & PTE_VALID) #define PTE_ISWIRED(pte) ((pte)->flags & PTE_WIRED) #define PTE_ISMANAGED(pte) ((pte)->flags & PTE_MANAGED) |