]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/mips/include/asm/pgtable.h
MIPS: OCTEON: Use correct CSR to soft reset
[mirror_ubuntu-artful-kernel.git] / arch / mips / include / asm / pgtable.h
CommitLineData
1da177e4
LT
1/*
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
4 * for more details.
5 *
6 * Copyright (C) 2003 Ralf Baechle
7 */
8#ifndef _ASM_PGTABLE_H
9#define _ASM_PGTABLE_H
10
5bbea36a 11#include <linux/mm_types.h>
970d032f 12#include <linux/mmzone.h>
875d43e7 13#ifdef CONFIG_32BIT
1da177e4
LT
14#include <asm/pgtable-32.h>
15#endif
875d43e7 16#ifdef CONFIG_64BIT
1da177e4
LT
17#include <asm/pgtable-64.h>
18#endif
19
f10fae02 20#include <asm/io.h>
1da177e4
LT
21#include <asm/pgtable-bits.h>
22
8c65b4a6
TS
23struct mm_struct;
24struct vm_area_struct;
25
1da177e4 26#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
be0c37c9 27#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | _PAGE_READ | \
35133692 28 _page_cachable_default)
be0c37c9
SH
29#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_NO_EXEC | \
30 _page_cachable_default)
31#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | \
35133692 32 _page_cachable_default)
1da177e4 33#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
35133692 34 _PAGE_GLOBAL | _page_cachable_default)
e2a9e5ad
PB
35#define PAGE_KERNEL_NC __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
36 _PAGE_GLOBAL | _CACHE_CACHABLE_NONCOHERENT)
be0c37c9 37#define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
35133692 38 _page_cachable_default)
1da177e4
LT
39#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \
40 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED)
41
42/*
6dd9344c
DD
43 * If _PAGE_NO_EXEC is not defined, we can't do page protection for
44 * execute, and consider it to be the same as read. Also, write
45 * permissions imply read permissions. This is the closest we can get
46 * by reasonable means..
1da177e4 47 */
1da177e4 48
35133692
CD
49/*
50 * Dummy values to fill the table in mmap.c
51 * The real values will be generated at runtime
52 */
53#define __P000 __pgprot(0)
54#define __P001 __pgprot(0)
55#define __P010 __pgprot(0)
56#define __P011 __pgprot(0)
57#define __P100 __pgprot(0)
58#define __P101 __pgprot(0)
59#define __P110 __pgprot(0)
60#define __P111 __pgprot(0)
61
62#define __S000 __pgprot(0)
63#define __S001 __pgprot(0)
64#define __S010 __pgprot(0)
65#define __S011 __pgprot(0)
66#define __S100 __pgprot(0)
67#define __S101 __pgprot(0)
68#define __S110 __pgprot(0)
69#define __S111 __pgprot(0)
70
71extern unsigned long _page_cachable_default;
1da177e4
LT
72
73/*
74 * ZERO_PAGE is a global shared page that is always zero; used
75 * for zero-mapped memory areas etc..
76 */
77
78extern unsigned long empty_zero_page;
79extern unsigned long zero_page_mask;
80
81#define ZERO_PAGE(vaddr) \
99e3b942 82 (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))))
816422ad 83#define __HAVE_COLOR_ZERO_PAGE
62eede62 84
1da177e4
LT
85extern void paging_init(void);
86
87/*
88 * Conversion functions: convert a page and protection to a page entry,
89 * and a page entry and page directory to the page they refer to.
90 */
c9d06962 91#define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd))
970d032f
RB
92
93#define __pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
94#ifndef CONFIG_TRANSPARENT_HUGEPAGE
95#define pmd_page(pmd) __pmd_page(pmd)
96#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
97
46a82b2d 98#define pmd_page_vaddr(pmd) pmd_val(pmd)
1da177e4 99
f1014d1b
MC
100#define htw_stop() \
101do { \
ed4cbc81
MC
102 unsigned long flags; \
103 \
461d1597 104 if (cpu_has_htw) { \
ed4cbc81
MC
105 local_irq_save(flags); \
106 if(!raw_current_cpu_data.htw_seq++) { \
107 write_c0_pwctl(read_c0_pwctl() & \
108 ~(1 << MIPS_PWCTL_PWEN_SHIFT)); \
109 back_to_back_c0_hazard(); \
110 } \
111 local_irq_restore(flags); \
461d1597 112 } \
f1014d1b
MC
113} while(0)
114
115#define htw_start() \
116do { \
ed4cbc81
MC
117 unsigned long flags; \
118 \
f1014d1b 119 if (cpu_has_htw) { \
ed4cbc81
MC
120 local_irq_save(flags); \
121 if (!--raw_current_cpu_data.htw_seq) { \
122 write_c0_pwctl(read_c0_pwctl() | \
123 (1 << MIPS_PWCTL_PWEN_SHIFT)); \
124 back_to_back_c0_hazard(); \
125 } \
126 local_irq_restore(flags); \
f1014d1b
MC
127 } \
128} while(0)
129
f1014d1b 130
2a4a8b1e
LP
131extern void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
132 pte_t pteval);
133
34adb28d 134#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
6e953891 135
c5b36783 136#define pte_none(pte) (!(((pte).pte_high) & ~_PAGE_GLOBAL))
6e953891
SS
137#define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT)
138
1da177e4
LT
139static inline void set_pte(pte_t *ptep, pte_t pte)
140{
141 ptep->pte_high = pte.pte_high;
142 smp_wmb();
143 ptep->pte_low = pte.pte_low;
1da177e4 144
c5b36783 145 if (pte.pte_high & _PAGE_GLOBAL) {
1da177e4
LT
146 pte_t *buddy = ptep_buddy(ptep);
147 /*
148 * Make sure the buddy is global too (if it's !none,
149 * it better already be global)
150 */
c5b36783 151 if (pte_none(*buddy))
6e953891 152 buddy->pte_high |= _PAGE_GLOBAL;
1da177e4
LT
153 }
154}
1da177e4
LT
155
156static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
157{
6e953891
SS
158 pte_t null = __pte(0);
159
fde3538a 160 htw_stop();
1da177e4 161 /* Preserve global status for the pair */
c5b36783
SH
162 if (ptep_buddy(ptep)->pte_high & _PAGE_GLOBAL)
163 null.pte_high = _PAGE_GLOBAL;
6e953891
SS
164
165 set_pte_at(mm, addr, ptep, null);
fde3538a 166 htw_start();
1da177e4
LT
167}
168#else
6e953891
SS
169
170#define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
171#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
172
1da177e4
LT
173/*
174 * Certain architectures need to do special things when pte's
175 * within a page table are directly modified. Thus, the following
176 * hook is made available.
177 */
178static inline void set_pte(pte_t *ptep, pte_t pteval)
179{
180 *ptep = pteval;
181#if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX)
182 if (pte_val(pteval) & _PAGE_GLOBAL) {
183 pte_t *buddy = ptep_buddy(ptep);
184 /*
185 * Make sure the buddy is global too (if it's !none,
186 * it better already be global)
187 */
188 if (pte_none(*buddy))
189 pte_val(*buddy) = pte_val(*buddy) | _PAGE_GLOBAL;
190 }
191#endif
192}
1da177e4
LT
193
194static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
195{
fde3538a 196 htw_stop();
1da177e4
LT
197#if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX)
198 /* Preserve global status for the pair */
199 if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL)
200 set_pte_at(mm, addr, ptep, __pte(_PAGE_GLOBAL));
201 else
202#endif
203 set_pte_at(mm, addr, ptep, __pte(0));
fde3538a 204 htw_start();
1da177e4
LT
205}
206#endif
207
208/*
c6e8b587 209 * (pmds are folded into puds so this doesn't get actually called,
1da177e4
LT
210 * but the define is needed for a generic inline function.)
211 */
212#define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0)
c6e8b587 213
325f8a0a 214#ifndef __PAGETABLE_PMD_FOLDED
c6e8b587
RB
215/*
216 * (puds are folded into pgds so this doesn't get actually called,
217 * but the define is needed for a generic inline function.)
218 */
219#define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0)
220#endif
1da177e4 221
5ff97472
RB
222#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
223#define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1)
224#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
1da177e4 225
9975e77d
RB
226/*
227 * We used to declare this array with size but gcc 3.3 and older are not able
228 * to find that this expression is a constant, so the size is dropped.
229 */
230extern pgd_t swapper_pg_dir[];
1da177e4
LT
231
232/*
233 * The following only work if pte_present() is true.
234 * Undefined behaviour if not..
235 */
34adb28d 236#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
6e953891
SS
237static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; }
238static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; }
239static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; }
6e953891 240
1da177e4
LT
241static inline pte_t pte_wrprotect(pte_t pte)
242{
c5b36783 243 pte.pte_low &= ~_PAGE_WRITE;
6e953891 244 pte.pte_high &= ~_PAGE_SILENT_WRITE;
1da177e4
LT
245 return pte;
246}
247
1da177e4
LT
248static inline pte_t pte_mkclean(pte_t pte)
249{
c5b36783 250 pte.pte_low &= ~_PAGE_MODIFIED;
6e953891 251 pte.pte_high &= ~_PAGE_SILENT_WRITE;
1da177e4
LT
252 return pte;
253}
254
255static inline pte_t pte_mkold(pte_t pte)
256{
c5b36783 257 pte.pte_low &= ~_PAGE_ACCESSED;
6e953891 258 pte.pte_high &= ~_PAGE_SILENT_READ;
1da177e4
LT
259 return pte;
260}
261
262static inline pte_t pte_mkwrite(pte_t pte)
263{
6e953891 264 pte.pte_low |= _PAGE_WRITE;
c5b36783 265 if (pte.pte_low & _PAGE_MODIFIED)
6e953891 266 pte.pte_high |= _PAGE_SILENT_WRITE;
1da177e4
LT
267 return pte;
268}
269
1da177e4
LT
270static inline pte_t pte_mkdirty(pte_t pte)
271{
6e953891 272 pte.pte_low |= _PAGE_MODIFIED;
c5b36783 273 if (pte.pte_low & _PAGE_WRITE)
6e953891 274 pte.pte_high |= _PAGE_SILENT_WRITE;
1da177e4
LT
275 return pte;
276}
277
278static inline pte_t pte_mkyoung(pte_t pte)
279{
6e953891 280 pte.pte_low |= _PAGE_ACCESSED;
c5b36783 281 if (pte.pte_low & _PAGE_READ)
6e953891 282 pte.pte_high |= _PAGE_SILENT_READ;
1da177e4
LT
283 return pte;
284}
285#else
1da177e4
LT
286static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; }
287static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; }
288static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
1da177e4
LT
289
290static inline pte_t pte_wrprotect(pte_t pte)
291{
292 pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE);
293 return pte;
294}
295
1da177e4
LT
296static inline pte_t pte_mkclean(pte_t pte)
297{
77a5c593 298 pte_val(pte) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE);
1da177e4
LT
299 return pte;
300}
301
302static inline pte_t pte_mkold(pte_t pte)
303{
77a5c593 304 pte_val(pte) &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ);
1da177e4
LT
305 return pte;
306}
307
308static inline pte_t pte_mkwrite(pte_t pte)
309{
310 pte_val(pte) |= _PAGE_WRITE;
311 if (pte_val(pte) & _PAGE_MODIFIED)
312 pte_val(pte) |= _PAGE_SILENT_WRITE;
313 return pte;
314}
315
1da177e4
LT
316static inline pte_t pte_mkdirty(pte_t pte)
317{
318 pte_val(pte) |= _PAGE_MODIFIED;
319 if (pte_val(pte) & _PAGE_WRITE)
320 pte_val(pte) |= _PAGE_SILENT_WRITE;
321 return pte;
322}
323
324static inline pte_t pte_mkyoung(pte_t pte)
325{
326 pte_val(pte) |= _PAGE_ACCESSED;
be0c37c9
SH
327#ifdef CONFIG_CPU_MIPSR2
328 if (!(pte_val(pte) & _PAGE_NO_READ))
329 pte_val(pte) |= _PAGE_SILENT_READ;
330 else
331#endif
332 if (pte_val(pte) & _PAGE_READ)
333 pte_val(pte) |= _PAGE_SILENT_READ;
1da177e4
LT
334 return pte;
335}
dd794392 336
05f9883a 337#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
dd794392
DD
338static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_HUGE; }
339
340static inline pte_t pte_mkhuge(pte_t pte)
341{
342 pte_val(pte) |= _PAGE_HUGE;
343 return pte;
344}
05f9883a 345#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
1da177e4 346#endif
7e675137
NP
347static inline int pte_special(pte_t pte) { return 0; }
348static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
1da177e4
LT
349
350/*
70342287 351 * Macro to make mark a page protection value as "uncacheable". Note
1da177e4
LT
352 * that "protection" is really a misnomer here as the protection value
353 * contains the memory attribute bits, dirty bits, and various other
354 * bits as well.
355 */
356#define pgprot_noncached pgprot_noncached
357
358static inline pgprot_t pgprot_noncached(pgprot_t _prot)
359{
360 unsigned long prot = pgprot_val(_prot);
361
362 prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;
363
364 return __pgprot(prot);
365}
366
4b050ba7
MC
367static inline pgprot_t pgprot_writecombine(pgprot_t _prot)
368{
369 unsigned long prot = pgprot_val(_prot);
370
371 /* cpu_data[0].writecombine is already shifted by _CACHE_SHIFT */
372 prot = (prot & ~_CACHE_MASK) | cpu_data[0].writecombine;
373
374 return __pgprot(prot);
375}
376
1da177e4
LT
377/*
378 * Conversion functions: convert a page and protection to a page entry,
379 * and a page entry and page directory to the page they refer to.
380 */
381#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
382
34adb28d 383#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
1da177e4
LT
384static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
385{
c5b36783 386 pte.pte_low &= (_PAGE_MODIFIED | _PAGE_ACCESSED | _PFNX_MASK);
77a5c593 387 pte.pte_high &= (_PFN_MASK | _CACHE_MASK);
c5b36783
SH
388 pte.pte_low |= pgprot_val(newprot) & ~_PFNX_MASK;
389 pte.pte_high |= pgprot_val(newprot) & ~_PFN_MASK;
1da177e4
LT
390 return pte;
391}
392#else
393static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
394{
395 return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot));
396}
397#endif
398
399
400extern void __update_tlb(struct vm_area_struct *vma, unsigned long address,
401 pte_t pte);
1da177e4
LT
402
403static inline void update_mmu_cache(struct vm_area_struct *vma,
4b3073e1 404 unsigned long address, pte_t *ptep)
1da177e4 405{
4b3073e1 406 pte_t pte = *ptep;
1da177e4 407 __update_tlb(vma, address, pte);
1da177e4
LT
408}
409
970d032f
RB
410static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
411 unsigned long address, pmd_t *pmdp)
412{
413 pte_t pte = *(pte_t *)pmdp;
414
415 __update_tlb(vma, address, pte);
416}
417
1da177e4 418#define kern_addr_valid(addr) (1)
1da177e4 419
34adb28d 420#ifdef CONFIG_PHYS_ADDR_T_64BIT
1da177e4
LT
421extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot);
422
1da177e4
LT
423static inline int io_remap_pfn_range(struct vm_area_struct *vma,
424 unsigned long vaddr,
425 unsigned long pfn,
426 unsigned long size,
427 pgprot_t prot)
428{
15d45cce 429 phys_addr_t phys_addr_high = fixup_bigphys_addr(pfn << PAGE_SHIFT, size);
ac5d8c02 430 return remap_pfn_range(vma, vaddr, phys_addr_high >> PAGE_SHIFT, size, prot);
1da177e4 431}
40d158e6 432#define io_remap_pfn_range io_remap_pfn_range
1da177e4
LT
433#endif
434
970d032f
RB
435#ifdef CONFIG_TRANSPARENT_HUGEPAGE
436
437extern int has_transparent_hugepage(void);
438
439static inline int pmd_trans_huge(pmd_t pmd)
440{
441 return !!(pmd_val(pmd) & _PAGE_HUGE);
442}
443
444static inline pmd_t pmd_mkhuge(pmd_t pmd)
445{
446 pmd_val(pmd) |= _PAGE_HUGE;
447
448 return pmd;
449}
450
451static inline int pmd_trans_splitting(pmd_t pmd)
452{
453 return !!(pmd_val(pmd) & _PAGE_SPLITTING);
454}
455
456static inline pmd_t pmd_mksplitting(pmd_t pmd)
457{
458 pmd_val(pmd) |= _PAGE_SPLITTING;
459
460 return pmd;
461}
462
463extern void set_pmd_at(struct mm_struct *mm, unsigned long addr,
464 pmd_t *pmdp, pmd_t pmd);
465
466#define __HAVE_ARCH_PMDP_SPLITTING_FLUSH
467/* Extern to avoid header file madness */
468extern void pmdp_splitting_flush(struct vm_area_struct *vma,
469 unsigned long address,
470 pmd_t *pmdp);
471
472#define __HAVE_ARCH_PMD_WRITE
473static inline int pmd_write(pmd_t pmd)
474{
475 return !!(pmd_val(pmd) & _PAGE_WRITE);
476}
477
478static inline pmd_t pmd_wrprotect(pmd_t pmd)
479{
480 pmd_val(pmd) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE);
481 return pmd;
482}
483
484static inline pmd_t pmd_mkwrite(pmd_t pmd)
485{
486 pmd_val(pmd) |= _PAGE_WRITE;
487 if (pmd_val(pmd) & _PAGE_MODIFIED)
488 pmd_val(pmd) |= _PAGE_SILENT_WRITE;
489
490 return pmd;
491}
492
493static inline int pmd_dirty(pmd_t pmd)
494{
495 return !!(pmd_val(pmd) & _PAGE_MODIFIED);
496}
497
498static inline pmd_t pmd_mkclean(pmd_t pmd)
499{
500 pmd_val(pmd) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE);
501 return pmd;
502}
503
504static inline pmd_t pmd_mkdirty(pmd_t pmd)
505{
506 pmd_val(pmd) |= _PAGE_MODIFIED;
507 if (pmd_val(pmd) & _PAGE_WRITE)
508 pmd_val(pmd) |= _PAGE_SILENT_WRITE;
509
510 return pmd;
511}
512
513static inline int pmd_young(pmd_t pmd)
514{
515 return !!(pmd_val(pmd) & _PAGE_ACCESSED);
516}
517
518static inline pmd_t pmd_mkold(pmd_t pmd)
519{
520 pmd_val(pmd) &= ~(_PAGE_ACCESSED|_PAGE_SILENT_READ);
521
522 return pmd;
523}
524
525static inline pmd_t pmd_mkyoung(pmd_t pmd)
526{
527 pmd_val(pmd) |= _PAGE_ACCESSED;
528
be0c37c9
SH
529#ifdef CONFIG_CPU_MIPSR2
530 if (!(pmd_val(pmd) & _PAGE_NO_READ))
531 pmd_val(pmd) |= _PAGE_SILENT_READ;
532 else
533#endif
534 if (pmd_val(pmd) & _PAGE_READ)
535 pmd_val(pmd) |= _PAGE_SILENT_READ;
970d032f
RB
536
537 return pmd;
538}
539
540/* Extern to avoid header file madness */
541extern pmd_t mk_pmd(struct page *page, pgprot_t prot);
542
543static inline unsigned long pmd_pfn(pmd_t pmd)
544{
545 return pmd_val(pmd) >> _PFN_SHIFT;
546}
547
548static inline struct page *pmd_page(pmd_t pmd)
549{
550 if (pmd_trans_huge(pmd))
551 return pfn_to_page(pmd_pfn(pmd));
552
553 return pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT);
554}
555
556static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
557{
558 pmd_val(pmd) = (pmd_val(pmd) & _PAGE_CHG_MASK) | pgprot_val(newprot);
559 return pmd;
560}
561
562static inline pmd_t pmd_mknotpresent(pmd_t pmd)
563{
564 pmd_val(pmd) &= ~(_PAGE_PRESENT | _PAGE_VALID | _PAGE_DIRTY);
565
566 return pmd;
567}
568
569/*
570 * The generic version pmdp_get_and_clear uses a version of pmd_clear() with a
571 * different prototype.
572 */
573#define __HAVE_ARCH_PMDP_GET_AND_CLEAR
574static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
575 unsigned long address, pmd_t *pmdp)
576{
577 pmd_t old = *pmdp;
578
579 pmd_clear(pmdp);
580
581 return old;
582}
583
584#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
585
1da177e4
LT
586#include <asm-generic/pgtable.h>
587
22f1fdfd
WZ
588/*
589 * uncached accelerated TLB map for video memory access
590 */
591#ifdef CONFIG_CPU_SUPPORTS_UNCACHED_ACCELERATED
592#define __HAVE_PHYS_MEM_ACCESS_PROT
593
594struct file;
595pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
596 unsigned long size, pgprot_t vma_prot);
597int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
598 unsigned long size, pgprot_t *vma_prot);
599#endif
600
1da177e4
LT
601/*
602 * We provide our own get_unmapped area to cope with the virtual aliasing
603 * constraints placed on us by the cache architecture.
604 */
605#define HAVE_ARCH_UNMAPPED_AREA
d0be89f6 606#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
1da177e4
LT
607
608/*
609 * No page table caches to initialise
610 */
611#define pgtable_cache_init() do { } while (0)
612
613#endif /* _ASM_PGTABLE_H */