19 #include <asm/pgtable-bits.h>
24 #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
25 #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | (cpu_has_rixi ? 0 : _PAGE_READ) | \
26 _page_cachable_default)
27 #define PAGE_COPY __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | \
28 (cpu_has_rixi ? _PAGE_NO_EXEC : 0) | _page_cachable_default)
29 #define PAGE_READONLY __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | \
30 _page_cachable_default)
31 #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
32 _PAGE_GLOBAL | _page_cachable_default)
33 #define PAGE_USERIO __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | _PAGE_WRITE | \
34 _page_cachable_default)
35 #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \
36 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED)
49 #define __P000 __pgprot(0)
50 #define __P001 __pgprot(0)
51 #define __P010 __pgprot(0)
52 #define __P011 __pgprot(0)
53 #define __P100 __pgprot(0)
54 #define __P101 __pgprot(0)
55 #define __P110 __pgprot(0)
56 #define __P111 __pgprot(0)
58 #define __S000 __pgprot(0)
59 #define __S001 __pgprot(0)
60 #define __S010 __pgprot(0)
61 #define __S011 __pgprot(0)
62 #define __S100 __pgprot(0)
63 #define __S101 __pgprot(0)
64 #define __S110 __pgprot(0)
65 #define __S111 __pgprot(0)
77 #define ZERO_PAGE(vaddr) \
78 (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))))
80 #define is_zero_pfn is_zero_pfn
83 extern unsigned long zero_pfn;
84 unsigned long offset_from_zero_pfn = pfn - zero_pfn;
85 return offset_from_zero_pfn <= (zero_page_mask >>
PAGE_SHIFT);
88 #define my_zero_pfn(addr) page_to_pfn(ZERO_PAGE(addr))
96 #define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd))
97 #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
98 #define pmd_page_vaddr(pmd) pmd_val(pmd)
100 #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
102 #define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL))
103 #define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT)
124 #define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
138 #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
139 #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
149 #if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX)
161 #define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
165 #if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX)
179 #define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0)
181 #ifndef __PAGETABLE_PMD_FOLDED
186 #define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0)
189 #define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
190 #define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1)
191 #define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
203 #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
331 #define pgprot_noncached pgprot_noncached
346 #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
348 #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
378 #define kern_addr_valid(addr) (1)
380 #ifdef CONFIG_64BIT_PHYS_ADDR
393 #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
394 remap_pfn_range(vma, vaddr, pfn, size, prot)
402 #ifdef CONFIG_CPU_SUPPORTS_UNCACHED_ACCELERATED
403 #define __HAVE_PHYS_MEM_ACCESS_PROT
416 #define HAVE_ARCH_UNMAPPED_AREA
417 #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
422 #define pgtable_cache_init() do { } while (0)