diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-05-08 02:27:28 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-09 02:35:00 -0400 |
commit | 16c2d476232523260c495eafbf9cdc1be984b7df (patch) | |
tree | fb6614b9752b51864e121317478088978823792c /include/asm-powerpc | |
parent | d0f13e3c20b6fb73ccb467bdca97fa7cf5a574cd (diff) |
[POWERPC] Add ability to 4K kernel to hash in 64K pages
This adds the ability for a kernel compiled with 4K page size
to have special slices containing 64K pages and hash the right type
of hash PTEs.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/pgtable-4k.h | 6 | ||||
-rw-r--r-- | include/asm-powerpc/pgtable-64k.h | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h index 1744d6ac12a2..add5481fd7c7 100644 --- a/include/asm-powerpc/pgtable-4k.h +++ b/include/asm-powerpc/pgtable-4k.h | |||
@@ -80,7 +80,11 @@ | |||
80 | 80 | ||
81 | #define pte_iterate_hashed_end() } while(0) | 81 | #define pte_iterate_hashed_end() } while(0) |
82 | 82 | ||
83 | #define pte_pagesize_index(pte) MMU_PAGE_4K | 83 | #ifdef CONFIG_PPC_HAS_HASH_64K |
84 | #define pte_pagesize_index(mm, addr, pte) get_slice_psize(mm, addr) | ||
85 | #else | ||
86 | #define pte_pagesize_index(mm, addr, pte) MMU_PAGE_4K | ||
87 | #endif | ||
84 | 88 | ||
85 | /* | 89 | /* |
86 | * 4-level page tables related bits | 90 | * 4-level page tables related bits |
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h index 16ef4978520d..31cbd3d7fce8 100644 --- a/include/asm-powerpc/pgtable-64k.h +++ b/include/asm-powerpc/pgtable-64k.h | |||
@@ -35,6 +35,11 @@ | |||
35 | #define _PAGE_HPTE_SUB0 0x08000000 /* combo only: first sub page */ | 35 | #define _PAGE_HPTE_SUB0 0x08000000 /* combo only: first sub page */ |
36 | #define _PAGE_COMBO 0x10000000 /* this is a combo 4k page */ | 36 | #define _PAGE_COMBO 0x10000000 /* this is a combo 4k page */ |
37 | #define _PAGE_4K_PFN 0x20000000 /* PFN is for a single 4k page */ | 37 | #define _PAGE_4K_PFN 0x20000000 /* PFN is for a single 4k page */ |
38 | |||
39 | /* Note the full page bits must be in the same location as for normal | ||
40 | * 4k pages as the same asssembly will be used to insert 64K pages | ||
41 | * wether the kernel has CONFIG_PPC_64K_PAGES or not | ||
42 | */ | ||
38 | #define _PAGE_F_SECOND 0x00008000 /* full page: hidx bits */ | 43 | #define _PAGE_F_SECOND 0x00008000 /* full page: hidx bits */ |
39 | #define _PAGE_F_GIX 0x00007000 /* full page: hidx bits */ | 44 | #define _PAGE_F_GIX 0x00007000 /* full page: hidx bits */ |
40 | 45 | ||
@@ -88,7 +93,7 @@ | |||
88 | 93 | ||
89 | #define pte_iterate_hashed_end() } while(0); } } while(0) | 94 | #define pte_iterate_hashed_end() } while(0); } } while(0) |
90 | 95 | ||
91 | #define pte_pagesize_index(pte) \ | 96 | #define pte_pagesize_index(mm, addr, pte) \ |
92 | (((pte) & _PAGE_COMBO)? MMU_PAGE_4K: MMU_PAGE_64K) | 97 | (((pte) & _PAGE_COMBO)? MMU_PAGE_4K: MMU_PAGE_64K) |
93 | 98 | ||
94 | #define remap_4k_pfn(vma, addr, pfn, prot) \ | 99 | #define remap_4k_pfn(vma, addr, pfn, prot) \ |