pgtable.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. /* MN10300 Page table manipulators and constants
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. *
  11. *
  12. * The Linux memory management assumes a three-level page table setup. On
  13. * the i386, we use that, but "fold" the mid level into the top-level page
  14. * table, so that we physically have the same two-level page table as the
  15. * i386 mmu expects.
  16. *
  17. * This file contains the functions and defines necessary to modify and use
  18. * the i386 page table tree for the purposes of the MN10300 TLB handler
  19. * functions.
  20. */
  21. #ifndef _ASM_PGTABLE_H
  22. #define _ASM_PGTABLE_H
  23. #include <asm/cpu-regs.h>
  24. #ifndef __ASSEMBLY__
  25. #include <asm/processor.h>
  26. #include <asm/cache.h>
  27. #include <linux/threads.h>
  28. #include <asm/bitops.h>
  29. #include <linux/slab.h>
  30. #include <linux/list.h>
  31. #include <linux/spinlock.h>
  32. /*
  33. * ZERO_PAGE is a global shared page that is always zero: used
  34. * for zero-mapped memory areas etc..
  35. */
  36. #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
  37. extern unsigned long empty_zero_page[1024];
  38. extern spinlock_t pgd_lock;
  39. extern struct page *pgd_list;
  40. extern void pmd_ctor(void *, struct kmem_cache *, unsigned long);
  41. extern void pgtable_cache_init(void);
  42. extern void paging_init(void);
  43. #endif /* !__ASSEMBLY__ */
  44. /*
  45. * The Linux mn10300 paging architecture only implements both the traditional
  46. * 2-level page tables
  47. */
  48. #define PGDIR_SHIFT 22
  49. #define PTRS_PER_PGD 1024
  50. #define PTRS_PER_PUD 1 /* we don't really have any PUD physically */
  51. #define __PAGETABLE_PUD_FOLDED
  52. #define PTRS_PER_PMD 1 /* we don't really have any PMD physically */
  53. #define __PAGETABLE_PMD_FOLDED
  54. #define PTRS_PER_PTE 1024
  55. #define PGD_SIZE PAGE_SIZE
  56. #define PMD_SIZE (1UL << PMD_SHIFT)
  57. #define PGDIR_SIZE (1UL << PGDIR_SHIFT)
  58. #define PGDIR_MASK (~(PGDIR_SIZE - 1))
  59. #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
  60. #define FIRST_USER_ADDRESS 0UL
  61. #define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
  62. #define KERNEL_PGD_PTRS (PTRS_PER_PGD - USER_PGD_PTRS)
  63. #define TWOLEVEL_PGDIR_SHIFT 22
  64. #define BOOT_USER_PGD_PTRS (__PAGE_OFFSET >> TWOLEVEL_PGDIR_SHIFT)
  65. #define BOOT_KERNEL_PGD_PTRS (1024 - BOOT_USER_PGD_PTRS)
  66. #ifndef __ASSEMBLY__
  67. extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
  68. #endif
  69. /*
  70. * Unfortunately, due to the way the MMU works on the MN10300, the vmalloc VM
  71. * area has to be in the lower half of the virtual address range (the upper
  72. * half is not translated through the TLB).
  73. *
  74. * So in this case, the vmalloc area goes at the bottom of the address map
  75. * (leaving a hole at the very bottom to catch addressing errors), and
  76. * userspace starts immediately above.
  77. *
  78. * The vmalloc() routines also leaves a hole of 4kB between each vmalloced
  79. * area to catch addressing errors.
  80. */
  81. #ifndef __ASSEMBLY__
  82. #define VMALLOC_OFFSET (8UL * 1024 * 1024)
  83. #define VMALLOC_START (0x70000000UL)
  84. #define VMALLOC_END (0x7C000000UL)
  85. #else
  86. #define VMALLOC_OFFSET (8 * 1024 * 1024)
  87. #define VMALLOC_START (0x70000000)
  88. #define VMALLOC_END (0x7C000000)
  89. #endif
  90. #ifndef __ASSEMBLY__
  91. extern pte_t kernel_vmalloc_ptes[(VMALLOC_END - VMALLOC_START) / PAGE_SIZE];
  92. #endif
  93. /* IPTEL2/DPTEL2 bit assignments */
  94. #define _PAGE_BIT_VALID xPTEL2_V_BIT
  95. #define _PAGE_BIT_CACHE xPTEL2_C_BIT
  96. #define _PAGE_BIT_PRESENT xPTEL2_PV_BIT
  97. #define _PAGE_BIT_DIRTY xPTEL2_D_BIT
  98. #define _PAGE_BIT_GLOBAL xPTEL2_G_BIT
  99. #define _PAGE_BIT_ACCESSED xPTEL2_UNUSED1_BIT /* mustn't be loaded into IPTEL2/DPTEL2 */
  100. #define _PAGE_VALID xPTEL2_V
  101. #define _PAGE_CACHE xPTEL2_C
  102. #define _PAGE_PRESENT xPTEL2_PV
  103. #define _PAGE_DIRTY xPTEL2_D
  104. #define _PAGE_PROT xPTEL2_PR
  105. #define _PAGE_PROT_RKNU xPTEL2_PR_ROK
  106. #define _PAGE_PROT_WKNU xPTEL2_PR_RWK
  107. #define _PAGE_PROT_RKRU xPTEL2_PR_ROK_ROU
  108. #define _PAGE_PROT_WKRU xPTEL2_PR_RWK_ROU
  109. #define _PAGE_PROT_WKWU xPTEL2_PR_RWK_RWU
  110. #define _PAGE_GLOBAL xPTEL2_G
  111. #define _PAGE_PS_MASK xPTEL2_PS
  112. #define _PAGE_PS_4Kb xPTEL2_PS_4Kb
  113. #define _PAGE_PS_128Kb xPTEL2_PS_128Kb
  114. #define _PAGE_PS_1Kb xPTEL2_PS_1Kb
  115. #define _PAGE_PS_4Mb xPTEL2_PS_4Mb
  116. #define _PAGE_PSE xPTEL2_PS_4Mb /* 4MB page */
  117. #define _PAGE_CACHE_WT xPTEL2_CWT
  118. #define _PAGE_ACCESSED xPTEL2_UNUSED1
  119. #define _PAGE_NX 0 /* no-execute bit */
  120. /* If _PAGE_VALID is clear, we use these: */
  121. #define _PAGE_PROTNONE 0x000 /* If not present */
  122. #define __PAGE_PROT_UWAUX 0x010
  123. #define __PAGE_PROT_USER 0x020
  124. #define __PAGE_PROT_WRITE 0x040
  125. #define _PAGE_PRESENTV (_PAGE_PRESENT|_PAGE_VALID)
  126. #ifndef __ASSEMBLY__
  127. #define VMALLOC_VMADDR(x) ((unsigned long)(x))
  128. #define _PAGE_TABLE (_PAGE_PRESENTV | _PAGE_PROT_WKNU | _PAGE_ACCESSED | _PAGE_DIRTY)
  129. #define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
  130. #define __PAGE_NONE (_PAGE_PRESENTV | _PAGE_PROT_RKNU | _PAGE_ACCESSED | _PAGE_CACHE)
  131. #define __PAGE_SHARED (_PAGE_PRESENTV | _PAGE_PROT_WKWU | _PAGE_ACCESSED | _PAGE_CACHE)
  132. #define __PAGE_COPY (_PAGE_PRESENTV | _PAGE_PROT_RKRU | _PAGE_ACCESSED | _PAGE_CACHE)
  133. #define __PAGE_READONLY (_PAGE_PRESENTV | _PAGE_PROT_RKRU | _PAGE_ACCESSED | _PAGE_CACHE)
  134. #define PAGE_NONE __pgprot(__PAGE_NONE | _PAGE_NX)
  135. #define PAGE_SHARED_NOEXEC __pgprot(__PAGE_SHARED | _PAGE_NX)
  136. #define PAGE_COPY_NOEXEC __pgprot(__PAGE_COPY | _PAGE_NX)
  137. #define PAGE_READONLY_NOEXEC __pgprot(__PAGE_READONLY | _PAGE_NX)
  138. #define PAGE_SHARED_EXEC __pgprot(__PAGE_SHARED)
  139. #define PAGE_COPY_EXEC __pgprot(__PAGE_COPY)
  140. #define PAGE_READONLY_EXEC __pgprot(__PAGE_READONLY)
  141. #define PAGE_COPY PAGE_COPY_NOEXEC
  142. #define PAGE_READONLY PAGE_READONLY_NOEXEC
  143. #define PAGE_SHARED PAGE_SHARED_EXEC
  144. #define __PAGE_KERNEL_BASE (_PAGE_PRESENTV | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)
  145. #define __PAGE_KERNEL (__PAGE_KERNEL_BASE | _PAGE_PROT_WKNU | _PAGE_CACHE | _PAGE_NX)
  146. #define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL_BASE | _PAGE_PROT_WKNU | _PAGE_NX)
  147. #define __PAGE_KERNEL_EXEC (__PAGE_KERNEL & ~_PAGE_NX)
  148. #define __PAGE_KERNEL_RO (__PAGE_KERNEL_BASE | _PAGE_PROT_RKNU | _PAGE_CACHE | _PAGE_NX)
  149. #define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
  150. #define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
  151. #define PAGE_KERNEL __pgprot(__PAGE_KERNEL)
  152. #define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO)
  153. #define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)
  154. #define PAGE_KERNEL_NOCACHE __pgprot(__PAGE_KERNEL_NOCACHE)
  155. #define PAGE_KERNEL_LARGE __pgprot(__PAGE_KERNEL_LARGE)
  156. #define PAGE_KERNEL_LARGE_EXEC __pgprot(__PAGE_KERNEL_LARGE_EXEC)
  157. #define __PAGE_USERIO (__PAGE_KERNEL_BASE | _PAGE_PROT_WKWU | _PAGE_NX)
  158. #define PAGE_USERIO __pgprot(__PAGE_USERIO)
  159. /*
  160. * Whilst the MN10300 can do page protection for execute (given separate data
  161. * and insn TLBs), we are not supporting it at the moment. Write permission,
  162. * however, always implies read permission (but not execute permission).
  163. */
  164. #define __P000 PAGE_NONE
  165. #define __P001 PAGE_READONLY_NOEXEC
  166. #define __P010 PAGE_COPY_NOEXEC
  167. #define __P011 PAGE_COPY_NOEXEC
  168. #define __P100 PAGE_READONLY_EXEC
  169. #define __P101 PAGE_READONLY_EXEC
  170. #define __P110 PAGE_COPY_EXEC
  171. #define __P111 PAGE_COPY_EXEC
  172. #define __S000 PAGE_NONE
  173. #define __S001 PAGE_READONLY_NOEXEC
  174. #define __S010 PAGE_SHARED_NOEXEC
  175. #define __S011 PAGE_SHARED_NOEXEC
  176. #define __S100 PAGE_READONLY_EXEC
  177. #define __S101 PAGE_READONLY_EXEC
  178. #define __S110 PAGE_SHARED_EXEC
  179. #define __S111 PAGE_SHARED_EXEC
  180. /*
  181. * Define this to warn about kernel memory accesses that are
  182. * done without a 'verify_area(VERIFY_WRITE,..)'
  183. */
  184. #undef TEST_VERIFY_AREA
  185. #define pte_present(x) (pte_val(x) & _PAGE_VALID)
  186. #define pte_clear(mm, addr, xp) \
  187. do { \
  188. set_pte_at((mm), (addr), (xp), __pte(0)); \
  189. } while (0)
  190. #define pmd_none(x) (!pmd_val(x))
  191. #define pmd_present(x) (!pmd_none(x))
  192. #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
  193. #define pmd_bad(x) 0
  194. #define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT))
  195. #ifndef __ASSEMBLY__
  196. /*
  197. * The following only work if pte_present() is true.
  198. * Undefined behaviour if not..
  199. */
  200. static inline int pte_user(pte_t pte) { return pte_val(pte) & __PAGE_PROT_USER; }
  201. static inline int pte_read(pte_t pte) { return pte_val(pte) & __PAGE_PROT_USER; }
  202. static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
  203. static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
  204. static inline int pte_write(pte_t pte) { return pte_val(pte) & __PAGE_PROT_WRITE; }
  205. static inline int pte_special(pte_t pte){ return 0; }
  206. static inline pte_t pte_rdprotect(pte_t pte)
  207. {
  208. pte_val(pte) &= ~(__PAGE_PROT_USER|__PAGE_PROT_UWAUX); return pte;
  209. }
  210. static inline pte_t pte_exprotect(pte_t pte)
  211. {
  212. pte_val(pte) |= _PAGE_NX; return pte;
  213. }
  214. static inline pte_t pte_wrprotect(pte_t pte)
  215. {
  216. pte_val(pte) &= ~(__PAGE_PROT_WRITE|__PAGE_PROT_UWAUX); return pte;
  217. }
  218. static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
  219. static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
  220. static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; }
  221. static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
  222. static inline pte_t pte_mkexec(pte_t pte) { pte_val(pte) &= ~_PAGE_NX; return pte; }
  223. static inline pte_t pte_mkread(pte_t pte)
  224. {
  225. pte_val(pte) |= __PAGE_PROT_USER;
  226. if (pte_write(pte))
  227. pte_val(pte) |= __PAGE_PROT_UWAUX;
  228. return pte;
  229. }
  230. static inline pte_t pte_mkwrite(pte_t pte)
  231. {
  232. pte_val(pte) |= __PAGE_PROT_WRITE;
  233. if (pte_val(pte) & __PAGE_PROT_USER)
  234. pte_val(pte) |= __PAGE_PROT_UWAUX;
  235. return pte;
  236. }
  237. static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
  238. #define pte_ERROR(e) \
  239. printk(KERN_ERR "%s:%d: bad pte %08lx.\n", \
  240. __FILE__, __LINE__, pte_val(e))
  241. #define pgd_ERROR(e) \
  242. printk(KERN_ERR "%s:%d: bad pgd %08lx.\n", \
  243. __FILE__, __LINE__, pgd_val(e))
  244. /*
  245. * The "pgd_xxx()" functions here are trivial for a folded two-level
  246. * setup: the pgd is never bad, and a pmd always exists (as it's folded
  247. * into the pgd entry)
  248. */
  249. #define pgd_clear(xp) do { } while (0)
  250. /*
  251. * Certain architectures need to do special things when PTEs
  252. * within a page table are directly modified. Thus, the following
  253. * hook is made available.
  254. */
  255. #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
  256. #define set_pte_at(mm, addr, ptep, pteval) set_pte((ptep), (pteval))
  257. #define set_pte_atomic(pteptr, pteval) set_pte((pteptr), (pteval))
  258. /*
  259. * (pmds are folded into pgds so this doesn't get actually called,
  260. * but the define is needed for a generic inline function.)
  261. */
  262. #define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
  263. #define ptep_get_and_clear(mm, addr, ptep) \
  264. __pte(xchg(&(ptep)->pte, 0))
  265. #define pte_same(a, b) (pte_val(a) == pte_val(b))
  266. #define pte_page(x) pfn_to_page(pte_pfn(x))
  267. #define pte_none(x) (!pte_val(x))
  268. #define pte_pfn(x) ((unsigned long) (pte_val(x) >> PAGE_SHIFT))
  269. #define __pfn_addr(pfn) ((pfn) << PAGE_SHIFT)
  270. #define pfn_pte(pfn, prot) __pte(__pfn_addr(pfn) | pgprot_val(prot))
  271. #define pfn_pmd(pfn, prot) __pmd(__pfn_addr(pfn) | pgprot_val(prot))
  272. /*
  273. * All present user pages are user-executable:
  274. */
  275. static inline int pte_exec(pte_t pte)
  276. {
  277. return pte_user(pte);
  278. }
  279. /*
  280. * All present pages are kernel-executable:
  281. */
  282. static inline int pte_exec_kernel(pte_t pte)
  283. {
  284. return 1;
  285. }
  286. /* Encode and de-code a swap entry */
  287. #define __swp_type(x) (((x).val >> 1) & 0x3f)
  288. #define __swp_offset(x) ((x).val >> 7)
  289. #define __swp_entry(type, offset) \
  290. ((swp_entry_t) { ((type) << 1) | ((offset) << 7) })
  291. #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
  292. #define __swp_entry_to_pte(x) __pte((x).val)
  293. static inline
  294. int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr,
  295. pte_t *ptep)
  296. {
  297. if (!pte_dirty(*ptep))
  298. return 0;
  299. return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte);
  300. }
  301. static inline
  302. int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr,
  303. pte_t *ptep)
  304. {
  305. if (!pte_young(*ptep))
  306. return 0;
  307. return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte);
  308. }
  309. static inline
  310. void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
  311. {
  312. pte_val(*ptep) &= ~(__PAGE_PROT_WRITE|__PAGE_PROT_UWAUX);
  313. }
  314. static inline void ptep_mkdirty(pte_t *ptep)
  315. {
  316. set_bit(_PAGE_BIT_DIRTY, &ptep->pte);
  317. }
  318. /*
  319. * Macro to mark a page protection value as "uncacheable". On processors which
  320. * do not support it, this is a no-op.
  321. */
  322. #define pgprot_noncached(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHE)
  323. /*
  324. * Macro to mark a page protection value as "Write-Through".
  325. * On processors which do not support it, this is a no-op.
  326. */
  327. #define pgprot_through(prot) __pgprot(pgprot_val(prot) | _PAGE_CACHE_WT)
  328. /*
  329. * Conversion functions: convert a page and protection to a page entry,
  330. * and a page entry and page directory to the page they refer to.
  331. */
  332. #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
  333. #define mk_pte_huge(entry) \
  334. ((entry).pte |= _PAGE_PRESENT | _PAGE_PSE | _PAGE_VALID)
  335. static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
  336. {
  337. pte_val(pte) &= _PAGE_CHG_MASK;
  338. pte_val(pte) |= pgprot_val(newprot);
  339. return pte;
  340. }
  341. #define page_pte(page) page_pte_prot((page), __pgprot(0))
  342. #define pmd_page_kernel(pmd) \
  343. ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
  344. #define pmd_page(pmd) pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
  345. #define pmd_large(pmd) \
  346. ((pmd_val(pmd) & (_PAGE_PSE | _PAGE_PRESENT)) == \
  347. (_PAGE_PSE | _PAGE_PRESENT))
  348. /*
  349. * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
  350. *
  351. * this macro returns the index of the entry in the pgd page which would
  352. * control the given virtual address
  353. */
  354. #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
  355. /*
  356. * pgd_offset() returns a (pgd_t *)
  357. * pgd_index() is used get the offset into the pgd page's array of pgd_t's;
  358. */
  359. #define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
  360. /*
  361. * a shortcut which implies the use of the kernel's pgd, instead
  362. * of a process's
  363. */
  364. #define pgd_offset_k(address) pgd_offset(&init_mm, address)
  365. /*
  366. * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
  367. *
  368. * this macro returns the index of the entry in the pmd page which would
  369. * control the given virtual address
  370. */
  371. #define pmd_index(address) \
  372. (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
  373. /*
  374. * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
  375. *
  376. * this macro returns the index of the entry in the pte page which would
  377. * control the given virtual address
  378. */
  379. #define pte_index(address) \
  380. (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
  381. #define pte_offset_kernel(dir, address) \
  382. ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address))
  383. /*
  384. * Make a given kernel text page executable/non-executable.
  385. * Returns the previous executability setting of that page (which
  386. * is used to restore the previous state). Used by the SMP bootup code.
  387. * NOTE: this is an __init function for security reasons.
  388. */
  389. static inline int set_kernel_exec(unsigned long vaddr, int enable)
  390. {
  391. return 0;
  392. }
  393. #define pte_offset_map(dir, address) \
  394. ((pte_t *) page_address(pmd_page(*(dir))) + pte_index(address))
  395. #define pte_unmap(pte) do {} while (0)
  396. /*
  397. * The MN10300 has external MMU info in the form of a TLB: this is adapted from
  398. * the kernel page tables containing the necessary information by tlb-mn10300.S
  399. */
  400. extern void update_mmu_cache(struct vm_area_struct *vma,
  401. unsigned long address, pte_t *ptep);
  402. #endif /* !__ASSEMBLY__ */
  403. #define kern_addr_valid(addr) (1)
  404. #define MK_IOSPACE_PFN(space, pfn) (pfn)
  405. #define GET_IOSPACE(pfn) 0
  406. #define GET_PFN(pfn) (pfn)
  407. #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
  408. #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
  409. #define __HAVE_ARCH_PTEP_GET_AND_CLEAR
  410. #define __HAVE_ARCH_PTEP_SET_WRPROTECT
  411. #define __HAVE_ARCH_PTEP_MKDIRTY
  412. #define __HAVE_ARCH_PTE_SAME
  413. #include <asm-generic/pgtable.h>
  414. #endif /* !__ASSEMBLY__ */
  415. #endif /* _ASM_PGTABLE_H */