diff options
author | Andi Kleen <ak@suse.de> | 2008-07-24 00:27:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:18 -0400 |
commit | ceb868796181dc95ea01a110e123afd391639873 (patch) | |
tree | 991be618e5195b05c31974a19adb4b9602315013 /arch/x86/mm/hugetlbpage.c | |
parent | 4abd32dbab201c3ced0b0af12accea77cd9eeffc (diff) |
hugetlb: introduce pud_huge
Straight forward extensions for huge pages located in the PUD instead of
PMDs.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/mm/hugetlbpage.c')
-rw-r--r-- | arch/x86/mm/hugetlbpage.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c index 52476fde8996..a4789e87a315 100644 --- a/arch/x86/mm/hugetlbpage.c +++ b/arch/x86/mm/hugetlbpage.c | |||
@@ -189,6 +189,11 @@ int pmd_huge(pmd_t pmd) | |||
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
191 | 191 | ||
192 | int pud_huge(pud_t pud) | ||
193 | { | ||
194 | return 0; | ||
195 | } | ||
196 | |||
192 | struct page * | 197 | struct page * |
193 | follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 198 | follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
194 | pmd_t *pmd, int write) | 199 | pmd_t *pmd, int write) |
@@ -209,6 +214,11 @@ int pmd_huge(pmd_t pmd) | |||
209 | return !!(pmd_val(pmd) & _PAGE_PSE); | 214 | return !!(pmd_val(pmd) & _PAGE_PSE); |
210 | } | 215 | } |
211 | 216 | ||
217 | int pud_huge(pud_t pud) | ||
218 | { | ||
219 | return 0; | ||
220 | } | ||
221 | |||
212 | struct page * | 222 | struct page * |
213 | follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 223 | follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
214 | pmd_t *pmd, int write) | 224 | pmd_t *pmd, int write) |
@@ -217,9 +227,22 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address, | |||
217 | 227 | ||
218 | page = pte_page(*(pte_t *)pmd); | 228 | page = pte_page(*(pte_t *)pmd); |
219 | if (page) | 229 | if (page) |
220 | page += ((address & ~HPAGE_MASK) >> PAGE_SHIFT); | 230 | page += ((address & ~PMD_MASK) >> PAGE_SHIFT); |
221 | return page; | 231 | return page; |
222 | } | 232 | } |
233 | |||
234 | struct page * | ||
235 | follow_huge_pud(struct mm_struct *mm, unsigned long address, | ||
236 | pud_t *pud, int write) | ||
237 | { | ||
238 | struct page *page; | ||
239 | |||
240 | page = pte_page(*(pte_t *)pud); | ||
241 | if (page) | ||
242 | page += ((address & ~PUD_MASK) >> PAGE_SHIFT); | ||
243 | return page; | ||
244 | } | ||
245 | |||
223 | #endif | 246 | #endif |
224 | 247 | ||
225 | /* x86_64 also uses this file */ | 248 | /* x86_64 also uses this file */ |