2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 2003 Ralf Baechle
11 #include <linux/mm_types.h>
12 #include <linux/mmzone.h>
14 #include <asm/pgtable-32.h>
17 #include <asm/pgtable-64.h>
20 #include <asm/cmpxchg.h>
22 #include <asm/pgtable-bits.h>
23 #include <asm/cpu-features.h>
26 struct vm_area_struct;
28 #define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_NO_READ | \
29 _page_cachable_default)
30 #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | \
31 _page_cachable_default)
32 #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_NO_EXEC | \
33 _page_cachable_default)
34 #define PAGE_READONLY __pgprot(_PAGE_PRESENT | \
35 _page_cachable_default)
36 #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
37 _PAGE_GLOBAL | _page_cachable_default)
38 #define PAGE_KERNEL_NC __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
39 _PAGE_GLOBAL | _CACHE_CACHABLE_NONCOHERENT)
40 #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \
41 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED)
44 * If _PAGE_NO_EXEC is not defined, we can't do page protection for
45 * execute, and consider it to be the same as read. Also, write
46 * permissions imply read permissions. This is the closest we can get
47 * by reasonable means..
51 * Dummy values to fill the table in mmap.c
52 * The real values will be generated at runtime
54 #define __P000 __pgprot(0)
55 #define __P001 __pgprot(0)
56 #define __P010 __pgprot(0)
57 #define __P011 __pgprot(0)
58 #define __P100 __pgprot(0)
59 #define __P101 __pgprot(0)
60 #define __P110 __pgprot(0)
61 #define __P111 __pgprot(0)
63 #define __S000 __pgprot(0)
64 #define __S001 __pgprot(0)
65 #define __S010 __pgprot(0)
66 #define __S011 __pgprot(0)
67 #define __S100 __pgprot(0)
68 #define __S101 __pgprot(0)
69 #define __S110 __pgprot(0)
70 #define __S111 __pgprot(0)
72 extern unsigned long _page_cachable_default;
75 * ZERO_PAGE is a global shared page that is always zero; used
76 * for zero-mapped memory areas etc..
79 extern unsigned long empty_zero_page;
80 extern unsigned long zero_page_mask;
82 #define ZERO_PAGE(vaddr) \
83 (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))))
84 #define __HAVE_COLOR_ZERO_PAGE
86 extern void paging_init(void);
89 * Conversion functions: convert a page and protection to a page entry,
90 * and a page entry and page directory to the page they refer to.
92 #define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd))
94 #define __pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
95 #ifndef CONFIG_TRANSPARENT_HUGEPAGE
96 #define pmd_page(pmd) __pmd_page(pmd)
97 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
99 #define pmd_page_vaddr(pmd) pmd_val(pmd)
103 unsigned long flags; \
106 local_irq_save(flags); \
107 if(!raw_current_cpu_data.htw_seq++) { \
108 write_c0_pwctl(read_c0_pwctl() & \
109 ~(1 << MIPS_PWCTL_PWEN_SHIFT)); \
110 back_to_back_c0_hazard(); \
112 local_irq_restore(flags); \
116 #define htw_start() \
118 unsigned long flags; \
121 local_irq_save(flags); \
122 if (!--raw_current_cpu_data.htw_seq) { \
123 write_c0_pwctl(read_c0_pwctl() | \
124 (1 << MIPS_PWCTL_PWEN_SHIFT)); \
125 back_to_back_c0_hazard(); \
127 local_irq_restore(flags); \
131 static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
132 pte_t *ptep, pte_t pteval);
134 #if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
137 # define pte_none(pte) (!(((pte).pte_high) & ~_PAGE_GLOBAL))
139 # define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL))
142 #define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT)
143 #define pte_no_exec(pte) ((pte).pte_low & _PAGE_NO_EXEC)
145 static inline void set_pte(pte_t *ptep, pte_t pte)
147 ptep->pte_high = pte.pte_high;
149 ptep->pte_low = pte.pte_low;
152 if (pte.pte_high & _PAGE_GLOBAL) {
154 if (pte.pte_low & _PAGE_GLOBAL) {
156 pte_t *buddy = ptep_buddy(ptep);
158 * Make sure the buddy is global too (if it's !none,
159 * it better already be global)
161 if (pte_none(*buddy)) {
162 if (!IS_ENABLED(CONFIG_XPA))
163 buddy->pte_low |= _PAGE_GLOBAL;
164 buddy->pte_high |= _PAGE_GLOBAL;
169 static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
171 pte_t null = __pte(0);
174 /* Preserve global status for the pair */
175 if (IS_ENABLED(CONFIG_XPA)) {
176 if (ptep_buddy(ptep)->pte_high & _PAGE_GLOBAL)
177 null.pte_high = _PAGE_GLOBAL;
179 if (ptep_buddy(ptep)->pte_low & _PAGE_GLOBAL)
180 null.pte_low = null.pte_high = _PAGE_GLOBAL;
183 set_pte_at(mm, addr, ptep, null);
188 #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
189 #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
190 #define pte_no_exec(pte) (pte_val(pte) & _PAGE_NO_EXEC)
193 * Certain architectures need to do special things when pte's
194 * within a page table are directly modified. Thus, the following
195 * hook is made available.
197 static inline void set_pte(pte_t *ptep, pte_t pteval)
200 #if !defined(CONFIG_CPU_R3K_TLB)
201 if (pte_val(pteval) & _PAGE_GLOBAL) {
202 pte_t *buddy = ptep_buddy(ptep);
204 * Make sure the buddy is global too (if it's !none,
205 * it better already be global)
207 # if defined(CONFIG_PHYS_ADDR_T_64BIT) && !defined(CONFIG_CPU_MIPS32)
208 cmpxchg64(&buddy->pte, 0, _PAGE_GLOBAL);
210 cmpxchg(&buddy->pte, 0, _PAGE_GLOBAL);
216 static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
219 #if !defined(CONFIG_CPU_R3K_TLB)
220 /* Preserve global status for the pair */
221 if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL)
222 set_pte_at(mm, addr, ptep, __pte(_PAGE_GLOBAL));
225 set_pte_at(mm, addr, ptep, __pte(0));
230 static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
231 pte_t *ptep, pte_t pteval)
233 extern void __update_cache(unsigned long address, pte_t pte);
235 if (!pte_present(pteval))
236 goto cache_sync_done;
238 if (pte_present(*ptep) && (pte_pfn(*ptep) == pte_pfn(pteval)))
239 goto cache_sync_done;
241 __update_cache(addr, pteval);
243 set_pte(ptep, pteval);
247 * (pmds are folded into puds so this doesn't get actually called,
248 * but the define is needed for a generic inline function.)
250 #define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0)
252 #ifndef __PAGETABLE_PMD_FOLDED
254 * (puds are folded into pgds so this doesn't get actually called,
255 * but the define is needed for a generic inline function.)
257 #define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0)
260 #define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
261 #define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1)
262 #define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
265 * We used to declare this array with size but gcc 3.3 and older are not able
266 * to find that this expression is a constant, so the size is dropped.
268 extern pgd_t swapper_pg_dir[];
271 * Platform specific pte_special() and pte_mkspecial() definitions
272 * are required only when ARCH_HAS_PTE_SPECIAL is enabled.
274 #if defined(CONFIG_ARCH_HAS_PTE_SPECIAL)
275 #if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
276 static inline int pte_special(pte_t pte)
278 return pte.pte_low & _PAGE_SPECIAL;
281 static inline pte_t pte_mkspecial(pte_t pte)
283 pte.pte_low |= _PAGE_SPECIAL;
287 static inline int pte_special(pte_t pte)
289 return pte_val(pte) & _PAGE_SPECIAL;
292 static inline pte_t pte_mkspecial(pte_t pte)
294 pte_val(pte) |= _PAGE_SPECIAL;
298 #endif /* CONFIG_ARCH_HAS_PTE_SPECIAL */
301 * The following only work if pte_present() is true.
302 * Undefined behaviour if not..
304 #if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
305 static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; }
306 static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; }
307 static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; }
309 static inline pte_t pte_wrprotect(pte_t pte)
311 pte.pte_low &= ~_PAGE_WRITE;
312 if (!IS_ENABLED(CONFIG_XPA))
313 pte.pte_low &= ~_PAGE_SILENT_WRITE;
314 pte.pte_high &= ~_PAGE_SILENT_WRITE;
318 static inline pte_t pte_mkclean(pte_t pte)
320 pte.pte_low &= ~_PAGE_MODIFIED;
321 if (!IS_ENABLED(CONFIG_XPA))
322 pte.pte_low &= ~_PAGE_SILENT_WRITE;
323 pte.pte_high &= ~_PAGE_SILENT_WRITE;
327 static inline pte_t pte_mkold(pte_t pte)
329 pte.pte_low &= ~_PAGE_ACCESSED;
330 if (!IS_ENABLED(CONFIG_XPA))
331 pte.pte_low &= ~_PAGE_SILENT_READ;
332 pte.pte_high &= ~_PAGE_SILENT_READ;
336 static inline pte_t pte_mkwrite(pte_t pte)
338 pte.pte_low |= _PAGE_WRITE;
339 if (pte.pte_low & _PAGE_MODIFIED) {
340 if (!IS_ENABLED(CONFIG_XPA))
341 pte.pte_low |= _PAGE_SILENT_WRITE;
342 pte.pte_high |= _PAGE_SILENT_WRITE;
347 static inline pte_t pte_mkdirty(pte_t pte)
349 pte.pte_low |= _PAGE_MODIFIED;
350 if (pte.pte_low & _PAGE_WRITE) {
351 if (!IS_ENABLED(CONFIG_XPA))
352 pte.pte_low |= _PAGE_SILENT_WRITE;
353 pte.pte_high |= _PAGE_SILENT_WRITE;
358 static inline pte_t pte_mkyoung(pte_t pte)
360 pte.pte_low |= _PAGE_ACCESSED;
361 if (!(pte.pte_low & _PAGE_NO_READ)) {
362 if (!IS_ENABLED(CONFIG_XPA))
363 pte.pte_low |= _PAGE_SILENT_READ;
364 pte.pte_high |= _PAGE_SILENT_READ;
369 static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; }
370 static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; }
371 static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
373 static inline pte_t pte_wrprotect(pte_t pte)
375 pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE);
379 static inline pte_t pte_mkclean(pte_t pte)
381 pte_val(pte) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE);
385 static inline pte_t pte_mkold(pte_t pte)
387 pte_val(pte) &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ);
391 static inline pte_t pte_mkwrite(pte_t pte)
393 pte_val(pte) |= _PAGE_WRITE;
394 if (pte_val(pte) & _PAGE_MODIFIED)
395 pte_val(pte) |= _PAGE_SILENT_WRITE;
399 static inline pte_t pte_mkdirty(pte_t pte)
401 pte_val(pte) |= _PAGE_MODIFIED | _PAGE_SOFT_DIRTY;
402 if (pte_val(pte) & _PAGE_WRITE)
403 pte_val(pte) |= _PAGE_SILENT_WRITE;
407 static inline pte_t pte_mkyoung(pte_t pte)
409 pte_val(pte) |= _PAGE_ACCESSED;
410 if (!(pte_val(pte) & _PAGE_NO_READ))
411 pte_val(pte) |= _PAGE_SILENT_READ;
415 #define pte_sw_mkyoung pte_mkyoung
417 #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
418 static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_HUGE; }
420 static inline pte_t pte_mkhuge(pte_t pte)
422 pte_val(pte) |= _PAGE_HUGE;
425 #endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
427 #ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY
428 static inline bool pte_soft_dirty(pte_t pte)
430 return pte_val(pte) & _PAGE_SOFT_DIRTY;
432 #define pte_swp_soft_dirty pte_soft_dirty
434 static inline pte_t pte_mksoft_dirty(pte_t pte)
436 pte_val(pte) |= _PAGE_SOFT_DIRTY;
439 #define pte_swp_mksoft_dirty pte_mksoft_dirty
441 static inline pte_t pte_clear_soft_dirty(pte_t pte)
443 pte_val(pte) &= ~(_PAGE_SOFT_DIRTY);
446 #define pte_swp_clear_soft_dirty pte_clear_soft_dirty
448 #endif /* CONFIG_HAVE_ARCH_SOFT_DIRTY */
453 * Macro to make mark a page protection value as "uncacheable". Note
454 * that "protection" is really a misnomer here as the protection value
455 * contains the memory attribute bits, dirty bits, and various other
458 #define pgprot_noncached pgprot_noncached
460 static inline pgprot_t pgprot_noncached(pgprot_t _prot)
462 unsigned long prot = pgprot_val(_prot);
464 prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;
466 return __pgprot(prot);
469 #define pgprot_writecombine pgprot_writecombine
471 static inline pgprot_t pgprot_writecombine(pgprot_t _prot)
473 unsigned long prot = pgprot_val(_prot);
475 /* cpu_data[0].writecombine is already shifted by _CACHE_SHIFT */
476 prot = (prot & ~_CACHE_MASK) | cpu_data[0].writecombine;
478 return __pgprot(prot);
481 static inline void flush_tlb_fix_spurious_fault(struct vm_area_struct *vma,
482 unsigned long address)
486 #define __HAVE_ARCH_PTE_SAME
487 static inline int pte_same(pte_t pte_a, pte_t pte_b)
489 return pte_val(pte_a) == pte_val(pte_b);
492 #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
493 static inline int ptep_set_access_flags(struct vm_area_struct *vma,
494 unsigned long address, pte_t *ptep,
495 pte_t entry, int dirty)
497 if (!pte_same(*ptep, entry))
498 set_pte_at(vma->vm_mm, address, ptep, entry);
500 * update_mmu_cache will unconditionally execute, handling both
501 * the case that the PTE changed and the spurious fault case.
507 * Conversion functions: convert a page and protection to a page entry,
508 * and a page entry and page directory to the page they refer to.
510 #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
512 #if defined(CONFIG_XPA)
513 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
515 pte.pte_low &= (_PAGE_MODIFIED | _PAGE_ACCESSED | _PFNX_MASK);
516 pte.pte_high &= (_PFN_MASK | _CACHE_MASK);
517 pte.pte_low |= pgprot_val(newprot) & ~_PFNX_MASK;
518 pte.pte_high |= pgprot_val(newprot) & ~(_PFN_MASK | _CACHE_MASK);
521 #elif defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
522 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
524 pte.pte_low &= _PAGE_CHG_MASK;
525 pte.pte_high &= (_PFN_MASK | _CACHE_MASK);
526 pte.pte_low |= pgprot_val(newprot);
527 pte.pte_high |= pgprot_val(newprot) & ~(_PFN_MASK | _CACHE_MASK);
531 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
533 pte_val(pte) &= _PAGE_CHG_MASK;
534 pte_val(pte) |= pgprot_val(newprot) & ~_PAGE_CHG_MASK;
535 if ((pte_val(pte) & _PAGE_ACCESSED) && !(pte_val(pte) & _PAGE_NO_READ))
536 pte_val(pte) |= _PAGE_SILENT_READ;
542 extern void __update_tlb(struct vm_area_struct *vma, unsigned long address,
545 static inline void update_mmu_cache(struct vm_area_struct *vma,
546 unsigned long address, pte_t *ptep)
549 __update_tlb(vma, address, pte);
552 #define __HAVE_ARCH_UPDATE_MMU_TLB
553 #define update_mmu_tlb update_mmu_cache
555 static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
556 unsigned long address, pmd_t *pmdp)
558 pte_t pte = *(pte_t *)pmdp;
560 __update_tlb(vma, address, pte);
563 #define kern_addr_valid(addr) (1)
566 * Allow physical addresses to be fixed up to help 36-bit peripherals.
568 #ifdef CONFIG_MIPS_FIXUP_BIGPHYS_ADDR
569 phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size);
570 int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long vaddr,
571 unsigned long pfn, unsigned long size, pgprot_t prot);
572 #define io_remap_pfn_range io_remap_pfn_range
574 #define fixup_bigphys_addr(addr, size) (addr)
575 #endif /* CONFIG_MIPS_FIXUP_BIGPHYS_ADDR */
577 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
579 /* We don't have hardware dirty/accessed bits, generic_pmdp_establish is fine.*/
580 #define pmdp_establish generic_pmdp_establish
582 #define has_transparent_hugepage has_transparent_hugepage
583 extern int has_transparent_hugepage(void);
585 static inline int pmd_trans_huge(pmd_t pmd)
587 return !!(pmd_val(pmd) & _PAGE_HUGE);
590 static inline pmd_t pmd_mkhuge(pmd_t pmd)
592 pmd_val(pmd) |= _PAGE_HUGE;
597 extern void set_pmd_at(struct mm_struct *mm, unsigned long addr,
598 pmd_t *pmdp, pmd_t pmd);
600 #define pmd_write pmd_write
601 static inline int pmd_write(pmd_t pmd)
603 return !!(pmd_val(pmd) & _PAGE_WRITE);
606 static inline pmd_t pmd_wrprotect(pmd_t pmd)
608 pmd_val(pmd) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE);
612 static inline pmd_t pmd_mkwrite(pmd_t pmd)
614 pmd_val(pmd) |= _PAGE_WRITE;
615 if (pmd_val(pmd) & _PAGE_MODIFIED)
616 pmd_val(pmd) |= _PAGE_SILENT_WRITE;
621 static inline int pmd_dirty(pmd_t pmd)
623 return !!(pmd_val(pmd) & _PAGE_MODIFIED);
626 static inline pmd_t pmd_mkclean(pmd_t pmd)
628 pmd_val(pmd) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE);
632 static inline pmd_t pmd_mkdirty(pmd_t pmd)
634 pmd_val(pmd) |= _PAGE_MODIFIED | _PAGE_SOFT_DIRTY;
635 if (pmd_val(pmd) & _PAGE_WRITE)
636 pmd_val(pmd) |= _PAGE_SILENT_WRITE;
641 static inline int pmd_young(pmd_t pmd)
643 return !!(pmd_val(pmd) & _PAGE_ACCESSED);
646 static inline pmd_t pmd_mkold(pmd_t pmd)
648 pmd_val(pmd) &= ~(_PAGE_ACCESSED|_PAGE_SILENT_READ);
653 static inline pmd_t pmd_mkyoung(pmd_t pmd)
655 pmd_val(pmd) |= _PAGE_ACCESSED;
657 if (!(pmd_val(pmd) & _PAGE_NO_READ))
658 pmd_val(pmd) |= _PAGE_SILENT_READ;
663 #ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY
664 static inline int pmd_soft_dirty(pmd_t pmd)
666 return !!(pmd_val(pmd) & _PAGE_SOFT_DIRTY);
669 static inline pmd_t pmd_mksoft_dirty(pmd_t pmd)
671 pmd_val(pmd) |= _PAGE_SOFT_DIRTY;
675 static inline pmd_t pmd_clear_soft_dirty(pmd_t pmd)
677 pmd_val(pmd) &= ~(_PAGE_SOFT_DIRTY);
681 #endif /* CONFIG_HAVE_ARCH_SOFT_DIRTY */
683 /* Extern to avoid header file madness */
684 extern pmd_t mk_pmd(struct page *page, pgprot_t prot);
686 static inline unsigned long pmd_pfn(pmd_t pmd)
688 return pmd_val(pmd) >> _PFN_SHIFT;
691 static inline struct page *pmd_page(pmd_t pmd)
693 if (pmd_trans_huge(pmd))
694 return pfn_to_page(pmd_pfn(pmd));
696 return pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT);
699 static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
701 pmd_val(pmd) = (pmd_val(pmd) & (_PAGE_CHG_MASK | _PAGE_HUGE)) |
702 (pgprot_val(newprot) & ~_PAGE_CHG_MASK);
706 static inline pmd_t pmd_mkinvalid(pmd_t pmd)
708 pmd_val(pmd) &= ~(_PAGE_PRESENT | _PAGE_VALID | _PAGE_DIRTY);
714 * The generic version pmdp_huge_get_and_clear uses a version of pmd_clear() with a
715 * different prototype.
717 #define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
718 static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
719 unsigned long address, pmd_t *pmdp)
728 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
731 #define pmd_leaf(pmd) ((pmd_val(pmd) & _PAGE_HUGE) != 0)
732 #define pud_leaf(pud) ((pud_val(pud) & _PAGE_HUGE) != 0)
735 #define gup_fast_permitted(start, end) (!cpu_has_dc_aliases)
738 * We provide our own get_unmapped area to cope with the virtual aliasing
739 * constraints placed on us by the cache architecture.
741 #define HAVE_ARCH_UNMAPPED_AREA
742 #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
744 #endif /* _ASM_PGTABLE_H */