aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/page.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/page.h')
-rw-r--r--arch/powerpc/include/asm/page.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index f072e974f8a2..652719ccd2e9 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -249,6 +249,7 @@ extern long long virt_phys_offset;
249#define is_kernel_addr(x) ((x) >= PAGE_OFFSET) 249#define is_kernel_addr(x) ((x) >= PAGE_OFFSET)
250#endif 250#endif
251 251
252#ifndef CONFIG_PPC_BOOK3S_64
252/* 253/*
253 * Use the top bit of the higher-level page table entries to indicate whether 254 * Use the top bit of the higher-level page table entries to indicate whether
254 * the entries we point to contain hugepages. This works because we know that 255 * the entries we point to contain hugepages. This works because we know that
@@ -260,6 +261,7 @@ extern long long virt_phys_offset;
260#else 261#else
261#define PD_HUGE 0x80000000 262#define PD_HUGE 0x80000000
262#endif 263#endif
264#endif /* CONFIG_PPC_BOOK3S_64 */
263 265
264/* 266/*
265 * Some number of bits at the level of the page table that points to 267 * Some number of bits at the level of the page table that points to
@@ -354,10 +356,21 @@ typedef unsigned long pgprot_t;
354typedef struct { signed long pd; } hugepd_t; 356typedef struct { signed long pd; } hugepd_t;
355 357
356#ifdef CONFIG_HUGETLB_PAGE 358#ifdef CONFIG_HUGETLB_PAGE
359#ifdef CONFIG_PPC_BOOK3S_64
360static inline int hugepd_ok(hugepd_t hpd)
361{
362 /*
363 * hugepd pointer, bottom two bits == 00 and next 4 bits
364 * indicate size of table
365 */
366 return (((hpd.pd & 0x3) == 0x0) && ((hpd.pd & HUGEPD_SHIFT_MASK) != 0));
367}
368#else
357static inline int hugepd_ok(hugepd_t hpd) 369static inline int hugepd_ok(hugepd_t hpd)
358{ 370{
359 return (hpd.pd > 0); 371 return (hpd.pd > 0);
360} 372}
373#endif
361 374
362#define is_hugepd(pdep) (hugepd_ok(*((hugepd_t *)(pdep)))) 375#define is_hugepd(pdep) (hugepd_ok(*((hugepd_t *)(pdep))))
363#else /* CONFIG_HUGETLB_PAGE */ 376#else /* CONFIG_HUGETLB_PAGE */