diff options
Diffstat (limited to 'include/asm-mips/pgtable.h')
-rw-r--r-- | include/asm-mips/pgtable.h | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 782221e57c0a..2f597eea4448 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h | |||
@@ -23,15 +23,15 @@ struct vm_area_struct; | |||
23 | 23 | ||
24 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) | 24 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) |
25 | #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ | 25 | #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ |
26 | PAGE_CACHABLE_DEFAULT) | 26 | _page_cachable_default) |
27 | #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | \ | 27 | #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | \ |
28 | PAGE_CACHABLE_DEFAULT) | 28 | _page_cachable_default) |
29 | #define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | \ | 29 | #define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | \ |
30 | PAGE_CACHABLE_DEFAULT) | 30 | _page_cachable_default) |
31 | #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ | 31 | #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ |
32 | _PAGE_GLOBAL | PAGE_CACHABLE_DEFAULT) | 32 | _PAGE_GLOBAL | _page_cachable_default) |
33 | #define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ | 33 | #define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ |
34 | PAGE_CACHABLE_DEFAULT) | 34 | _page_cachable_default) |
35 | #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ | 35 | #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ |
36 | __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) | 36 | __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) |
37 | 37 | ||
@@ -40,23 +40,30 @@ struct vm_area_struct; | |||
40 | * read. Also, write permissions imply read permissions. This is the closest | 40 | * read. Also, write permissions imply read permissions. This is the closest |
41 | * we can get by reasonable means.. | 41 | * we can get by reasonable means.. |
42 | */ | 42 | */ |
43 | #define __P000 PAGE_NONE | 43 | |
44 | #define __P001 PAGE_READONLY | 44 | /* |
45 | #define __P010 PAGE_COPY | 45 | * Dummy values to fill the table in mmap.c |
46 | #define __P011 PAGE_COPY | 46 | * The real values will be generated at runtime |
47 | #define __P100 PAGE_READONLY | 47 | */ |
48 | #define __P101 PAGE_READONLY | 48 | #define __P000 __pgprot(0) |
49 | #define __P110 PAGE_COPY | 49 | #define __P001 __pgprot(0) |
50 | #define __P111 PAGE_COPY | 50 | #define __P010 __pgprot(0) |
51 | 51 | #define __P011 __pgprot(0) | |
52 | #define __S000 PAGE_NONE | 52 | #define __P100 __pgprot(0) |
53 | #define __S001 PAGE_READONLY | 53 | #define __P101 __pgprot(0) |
54 | #define __S010 PAGE_SHARED | 54 | #define __P110 __pgprot(0) |
55 | #define __S011 PAGE_SHARED | 55 | #define __P111 __pgprot(0) |
56 | #define __S100 PAGE_READONLY | 56 | |
57 | #define __S101 PAGE_READONLY | 57 | #define __S000 __pgprot(0) |
58 | #define __S110 PAGE_SHARED | 58 | #define __S001 __pgprot(0) |
59 | #define __S111 PAGE_SHARED | 59 | #define __S010 __pgprot(0) |
60 | #define __S011 __pgprot(0) | ||
61 | #define __S100 __pgprot(0) | ||
62 | #define __S101 __pgprot(0) | ||
63 | #define __S110 __pgprot(0) | ||
64 | #define __S111 __pgprot(0) | ||
65 | |||
66 | extern unsigned long _page_cachable_default; | ||
60 | 67 | ||
61 | /* | 68 | /* |
62 | * ZERO_PAGE is a global shared page that is always zero; used | 69 | * ZERO_PAGE is a global shared page that is always zero; used |
@@ -79,7 +86,7 @@ extern void paging_init(void); | |||
79 | #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) | 86 | #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) |
80 | #define pmd_page_vaddr(pmd) pmd_val(pmd) | 87 | #define pmd_page_vaddr(pmd) pmd_val(pmd) |
81 | 88 | ||
82 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 89 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) |
83 | 90 | ||
84 | #define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL)) | 91 | #define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL)) |
85 | #define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT) | 92 | #define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT) |
@@ -182,7 +189,7 @@ extern pgd_t swapper_pg_dir[]; | |||
182 | * The following only work if pte_present() is true. | 189 | * The following only work if pte_present() is true. |
183 | * Undefined behaviour if not.. | 190 | * Undefined behaviour if not.. |
184 | */ | 191 | */ |
185 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 192 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) |
186 | static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } | 193 | static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } |
187 | static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } | 194 | static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } |
188 | static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } | 195 | static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } |
@@ -311,7 +318,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot) | |||
311 | */ | 318 | */ |
312 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) | 319 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) |
313 | 320 | ||
314 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 321 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) |
315 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 322 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
316 | { | 323 | { |
317 | pte.pte_low &= _PAGE_CHG_MASK; | 324 | pte.pte_low &= _PAGE_CHG_MASK; |