aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/pgtable.h')
-rw-r--r--include/asm-generic/pgtable.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index f27c83668d10..701beab27aab 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -453,6 +453,32 @@ extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
453 unsigned long size); 453 unsigned long size);
454#endif 454#endif
455 455
456#ifdef __HAVE_COLOR_ZERO_PAGE
457static inline int is_zero_pfn(unsigned long pfn)
458{
459 extern unsigned long zero_pfn;
460 unsigned long offset_from_zero_pfn = pfn - zero_pfn;
461 return offset_from_zero_pfn <= (zero_page_mask >> PAGE_SHIFT);
462}
463
464static inline unsigned long my_zero_pfn(unsigned long addr)
465{
466 return page_to_pfn(ZERO_PAGE(addr));
467}
468#else
469static inline int is_zero_pfn(unsigned long pfn)
470{
471 extern unsigned long zero_pfn;
472 return pfn == zero_pfn;
473}
474
475static inline unsigned long my_zero_pfn(unsigned long addr)
476{
477 extern unsigned long zero_pfn;
478 return zero_pfn;
479}
480#endif
481
456#ifdef CONFIG_MMU 482#ifdef CONFIG_MMU
457 483
458#ifndef CONFIG_TRANSPARENT_HUGEPAGE 484#ifndef CONFIG_TRANSPARENT_HUGEPAGE