pgtable.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. #ifndef _I386_PGTABLE_H
  2. #define _I386_PGTABLE_H
  3. /*
  4. * The Linux memory management assumes a three-level page table setup. On
  5. * the i386, we use that, but "fold" the mid level into the top-level page
  6. * table, so that we physically have the same two-level page table as the
  7. * i386 mmu expects.
  8. *
  9. * This file contains the functions and defines necessary to modify and use
  10. * the i386 page table tree.
  11. */
  12. #ifndef __ASSEMBLY__
  13. #include <asm/processor.h>
  14. #include <asm/fixmap.h>
  15. #include <linux/threads.h>
  16. #include <asm/paravirt.h>
  17. #ifndef _I386_BITOPS_H
  18. #include <asm/bitops.h>
  19. #endif
  20. #include <linux/slab.h>
  21. #include <linux/list.h>
  22. #include <linux/spinlock.h>
  23. struct mm_struct;
  24. struct vm_area_struct;
  25. /*
  26. * ZERO_PAGE is a global shared page that is always zero: used
  27. * for zero-mapped memory areas etc..
  28. */
  29. #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
  30. extern unsigned long empty_zero_page[1024];
  31. extern pgd_t swapper_pg_dir[1024];
  32. extern struct kmem_cache *pmd_cache;
  33. extern spinlock_t pgd_lock;
  34. extern struct page *pgd_list;
  35. void check_pgt_cache(void);
  36. void pmd_ctor(void *, struct kmem_cache *, unsigned long);
  37. void pgtable_cache_init(void);
  38. void paging_init(void);
  39. /*
  40. * The Linux x86 paging architecture is 'compile-time dual-mode', it
  41. * implements both the traditional 2-level x86 page tables and the
  42. * newer 3-level PAE-mode page tables.
  43. */
  44. #ifdef CONFIG_X86_PAE
  45. # include <asm/pgtable-3level-defs.h>
  46. # define PMD_SIZE (1UL << PMD_SHIFT)
  47. # define PMD_MASK (~(PMD_SIZE-1))
  48. #else
  49. # include <asm/pgtable-2level-defs.h>
  50. #endif
  51. #define PGDIR_SIZE (1UL << PGDIR_SHIFT)
  52. #define PGDIR_MASK (~(PGDIR_SIZE-1))
  53. #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
  54. #define FIRST_USER_ADDRESS 0
  55. #define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
  56. #define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
  57. #define TWOLEVEL_PGDIR_SHIFT 22
  58. #define BOOT_USER_PGD_PTRS (__PAGE_OFFSET >> TWOLEVEL_PGDIR_SHIFT)
  59. #define BOOT_KERNEL_PGD_PTRS (1024-BOOT_USER_PGD_PTRS)
  60. /* Just any arbitrary offset to the start of the vmalloc VM area: the
  61. * current 8MB value just means that there will be a 8MB "hole" after the
  62. * physical memory until the kernel virtual memory starts. That means that
  63. * any out-of-bounds memory accesses will hopefully be caught.
  64. * The vmalloc() routines leaves a hole of 4kB between each vmalloced
  65. * area for the same reason. ;)
  66. */
  67. #define VMALLOC_OFFSET (8*1024*1024)
  68. #define VMALLOC_START (((unsigned long) high_memory + \
  69. 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1))
  70. #ifdef CONFIG_HIGHMEM
  71. # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
  72. #else
  73. # define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
  74. #endif
  75. /*
  76. * _PAGE_PSE set in the page directory entry just means that
  77. * the page directory entry points directly to a 4MB-aligned block of
  78. * memory.
  79. */
  80. #define _PAGE_BIT_PRESENT 0
  81. #define _PAGE_BIT_RW 1
  82. #define _PAGE_BIT_USER 2
  83. #define _PAGE_BIT_PWT 3
  84. #define _PAGE_BIT_PCD 4
  85. #define _PAGE_BIT_ACCESSED 5
  86. #define _PAGE_BIT_DIRTY 6
  87. #define _PAGE_BIT_PSE 7 /* 4 MB (or 2MB) page, Pentium+, if present.. */
  88. #define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */
  89. #define _PAGE_BIT_UNUSED1 9 /* available for programmer */
  90. #define _PAGE_BIT_UNUSED2 10
  91. #define _PAGE_BIT_UNUSED3 11
  92. #define _PAGE_BIT_NX 63
  93. #define _PAGE_PRESENT 0x001
  94. #define _PAGE_RW 0x002
  95. #define _PAGE_USER 0x004
  96. #define _PAGE_PWT 0x008
  97. #define _PAGE_PCD 0x010
  98. #define _PAGE_ACCESSED 0x020
  99. #define _PAGE_DIRTY 0x040
  100. #define _PAGE_PSE 0x080 /* 4 MB (or 2MB) page, Pentium+, if present.. */
  101. #define _PAGE_GLOBAL 0x100 /* Global TLB entry PPro+ */
  102. #define _PAGE_UNUSED1 0x200 /* available for programmer */
  103. #define _PAGE_UNUSED2 0x400
  104. #define _PAGE_UNUSED3 0x800
  105. /* If _PAGE_PRESENT is clear, we use these: */
  106. #define _PAGE_FILE 0x040 /* nonlinear file mapping, saved PTE; unset:swap */
  107. #define _PAGE_PROTNONE 0x080 /* if the user mapped it with PROT_NONE;
  108. pte_present gives true */
  109. #ifdef CONFIG_X86_PAE
  110. #define _PAGE_NX (1ULL<<_PAGE_BIT_NX)
  111. #else
  112. #define _PAGE_NX 0
  113. #endif
  114. #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
  115. #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
  116. #define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
  117. #define PAGE_NONE \
  118. __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
  119. #define PAGE_SHARED \
  120. __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
  121. #define PAGE_SHARED_EXEC \
  122. __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
  123. #define PAGE_COPY_NOEXEC \
  124. __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
  125. #define PAGE_COPY_EXEC \
  126. __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
  127. #define PAGE_COPY \
  128. PAGE_COPY_NOEXEC
  129. #define PAGE_READONLY \
  130. __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
  131. #define PAGE_READONLY_EXEC \
  132. __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
  133. #define _PAGE_KERNEL \
  134. (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX)
  135. #define _PAGE_KERNEL_EXEC \
  136. (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
  137. extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
  138. #define __PAGE_KERNEL_RO (__PAGE_KERNEL & ~_PAGE_RW)
  139. #define __PAGE_KERNEL_RX (__PAGE_KERNEL_EXEC & ~_PAGE_RW)
  140. #define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD)
  141. #define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
  142. #define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
  143. #define PAGE_KERNEL __pgprot(__PAGE_KERNEL)
  144. #define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO)
  145. #define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)
  146. #define PAGE_KERNEL_RX __pgprot(__PAGE_KERNEL_RX)
  147. #define PAGE_KERNEL_NOCACHE __pgprot(__PAGE_KERNEL_NOCACHE)
  148. #define PAGE_KERNEL_LARGE __pgprot(__PAGE_KERNEL_LARGE)
  149. #define PAGE_KERNEL_LARGE_EXEC __pgprot(__PAGE_KERNEL_LARGE_EXEC)
  150. /*
  151. * The i386 can't do page protection for execute, and considers that
  152. * the same are read. Also, write permissions imply read permissions.
  153. * This is the closest we can get..
  154. */
  155. #define __P000 PAGE_NONE
  156. #define __P001 PAGE_READONLY
  157. #define __P010 PAGE_COPY
  158. #define __P011 PAGE_COPY
  159. #define __P100 PAGE_READONLY_EXEC
  160. #define __P101 PAGE_READONLY_EXEC
  161. #define __P110 PAGE_COPY_EXEC
  162. #define __P111 PAGE_COPY_EXEC
  163. #define __S000 PAGE_NONE
  164. #define __S001 PAGE_READONLY
  165. #define __S010 PAGE_SHARED
  166. #define __S011 PAGE_SHARED
  167. #define __S100 PAGE_READONLY_EXEC
  168. #define __S101 PAGE_READONLY_EXEC
  169. #define __S110 PAGE_SHARED_EXEC
  170. #define __S111 PAGE_SHARED_EXEC
  171. /*
  172. * Define this if things work differently on an i386 and an i486:
  173. * it will (on an i486) warn about kernel memory accesses that are
  174. * done without a 'access_ok(VERIFY_WRITE,..)'
  175. */
  176. #undef TEST_ACCESS_OK
  177. /* The boot page tables (all created as a single array) */
  178. extern unsigned long pg0[];
  179. #define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
  180. /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
  181. #define pmd_none(x) (!(unsigned long)pmd_val(x))
  182. #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
  183. #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
  184. #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
  185. /*
  186. * The following only work if pte_present() is true.
  187. * Undefined behaviour if not..
  188. */
  189. static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; }
  190. static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; }
  191. static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; }
  192. static inline int pte_huge(pte_t pte) { return (pte).pte_low & _PAGE_PSE; }
  193. /*
  194. * The following only works if pte_present() is not true.
  195. */
  196. static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; }
  197. static inline pte_t pte_mkclean(pte_t pte) { (pte).pte_low &= ~_PAGE_DIRTY; return pte; }
  198. static inline pte_t pte_mkold(pte_t pte) { (pte).pte_low &= ~_PAGE_ACCESSED; return pte; }
  199. static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_RW; return pte; }
  200. static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; }
  201. static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; }
  202. static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; }
  203. static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return pte; }
  204. #ifdef CONFIG_X86_PAE
  205. # include <asm/pgtable-3level.h>
  206. #else
  207. # include <asm/pgtable-2level.h>
  208. #endif
  209. #ifndef CONFIG_PARAVIRT
  210. /*
  211. * Rules for using pte_update - it must be called after any PTE update which
  212. * has not been done using the set_pte / clear_pte interfaces. It is used by
  213. * shadow mode hypervisors to resynchronize the shadow page tables. Kernel PTE
  214. * updates should either be sets, clears, or set_pte_atomic for P->P
  215. * transitions, which means this hook should only be called for user PTEs.
  216. * This hook implies a P->P protection or access change has taken place, which
  217. * requires a subsequent TLB flush. The notification can optionally be delayed
  218. * until the TLB flush event by using the pte_update_defer form of the
  219. * interface, but care must be taken to assure that the flush happens while
  220. * still holding the same page table lock so that the shadow and primary pages
  221. * do not become out of sync on SMP.
  222. */
  223. #define pte_update(mm, addr, ptep) do { } while (0)
  224. #define pte_update_defer(mm, addr, ptep) do { } while (0)
  225. #endif
  226. /* local pte updates need not use xchg for locking */
  227. static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
  228. {
  229. pte_t res = *ptep;
  230. /* Pure native function needs no input for mm, addr */
  231. native_pte_clear(NULL, 0, ptep);
  232. return res;
  233. }
  234. /*
  235. * We only update the dirty/accessed state if we set
  236. * the dirty bit by hand in the kernel, since the hardware
  237. * will do the accessed bit for us, and we don't want to
  238. * race with other CPU's that might be updating the dirty
  239. * bit at the same time.
  240. */
  241. #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
  242. #define ptep_set_access_flags(vma, address, ptep, entry, dirty) \
  243. ({ \
  244. int __changed = !pte_same(*(ptep), entry); \
  245. if (__changed && dirty) { \
  246. (ptep)->pte_low = (entry).pte_low; \
  247. pte_update_defer((vma)->vm_mm, (address), (ptep)); \
  248. flush_tlb_page(vma, address); \
  249. } \
  250. __changed; \
  251. })
  252. #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
  253. #define ptep_test_and_clear_young(vma, addr, ptep) ({ \
  254. int __ret = 0; \
  255. if (pte_young(*(ptep))) \
  256. __ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, \
  257. &(ptep)->pte_low); \
  258. if (__ret) \
  259. pte_update((vma)->vm_mm, addr, ptep); \
  260. __ret; \
  261. })
  262. #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
  263. #define ptep_clear_flush_young(vma, address, ptep) \
  264. ({ \
  265. int __young; \
  266. __young = ptep_test_and_clear_young((vma), (address), (ptep)); \
  267. if (__young) \
  268. flush_tlb_page(vma, address); \
  269. __young; \
  270. })
  271. #define __HAVE_ARCH_PTEP_GET_AND_CLEAR
  272. static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
  273. {
  274. pte_t pte = native_ptep_get_and_clear(ptep);
  275. pte_update(mm, addr, ptep);
  276. return pte;
  277. }
  278. #define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
  279. static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full)
  280. {
  281. pte_t pte;
  282. if (full) {
  283. /*
  284. * Full address destruction in progress; paravirt does not
  285. * care about updates and native needs no locking
  286. */
  287. pte = native_local_ptep_get_and_clear(ptep);
  288. } else {
  289. pte = ptep_get_and_clear(mm, addr, ptep);
  290. }
  291. return pte;
  292. }
  293. #define __HAVE_ARCH_PTEP_SET_WRPROTECT
  294. static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
  295. {
  296. clear_bit(_PAGE_BIT_RW, &ptep->pte_low);
  297. pte_update(mm, addr, ptep);
  298. }
  299. /*
  300. * clone_pgd_range(pgd_t *dst, pgd_t *src, int count);
  301. *
  302. * dst - pointer to pgd range anwhere on a pgd page
  303. * src - ""
  304. * count - the number of pgds to copy.
  305. *
  306. * dst and src can be on the same page, but the range must not overlap,
  307. * and must not cross a page boundary.
  308. */
  309. static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)
  310. {
  311. memcpy(dst, src, count * sizeof(pgd_t));
  312. }
  313. /*
  314. * Macro to mark a page protection value as "uncacheable". On processors which do not support
  315. * it, this is a no-op.
  316. */
  317. #define pgprot_noncached(prot) ((boot_cpu_data.x86 > 3) \
  318. ? (__pgprot(pgprot_val(prot) | _PAGE_PCD | _PAGE_PWT)) : (prot))
  319. /*
  320. * Conversion functions: convert a page and protection to a page entry,
  321. * and a page entry and page directory to the page they refer to.
  322. */
  323. #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
  324. static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
  325. {
  326. pte.pte_low &= _PAGE_CHG_MASK;
  327. pte.pte_low |= pgprot_val(newprot);
  328. #ifdef CONFIG_X86_PAE
  329. /*
  330. * Chop off the NX bit (if present), and add the NX portion of
  331. * the newprot (if present):
  332. */
  333. pte.pte_high &= ~(1 << (_PAGE_BIT_NX - 32));
  334. pte.pte_high |= (pgprot_val(newprot) >> 32) & \
  335. (__supported_pte_mask >> 32);
  336. #endif
  337. return pte;
  338. }
  339. #define pmd_large(pmd) \
  340. ((pmd_val(pmd) & (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT))
  341. /*
  342. * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
  343. *
  344. * this macro returns the index of the entry in the pgd page which would
  345. * control the given virtual address
  346. */
  347. #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
  348. #define pgd_index_k(addr) pgd_index(addr)
  349. /*
  350. * pgd_offset() returns a (pgd_t *)
  351. * pgd_index() is used get the offset into the pgd page's array of pgd_t's;
  352. */
  353. #define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
  354. /*
  355. * a shortcut which implies the use of the kernel's pgd, instead
  356. * of a process's
  357. */
  358. #define pgd_offset_k(address) pgd_offset(&init_mm, address)
  359. /*
  360. * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
  361. *
  362. * this macro returns the index of the entry in the pmd page which would
  363. * control the given virtual address
  364. */
  365. #define pmd_index(address) \
  366. (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
  367. /*
  368. * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
  369. *
  370. * this macro returns the index of the entry in the pte page which would
  371. * control the given virtual address
  372. */
  373. #define pte_index(address) \
  374. (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
  375. #define pte_offset_kernel(dir, address) \
  376. ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
  377. #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
  378. #define pmd_page_vaddr(pmd) \
  379. ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
  380. /*
  381. * Helper function that returns the kernel pagetable entry controlling
  382. * the virtual address 'address'. NULL means no pagetable entry present.
  383. * NOTE: the return type is pte_t but if the pmd is PSE then we return it
  384. * as a pte too.
  385. */
  386. extern pte_t *lookup_address(unsigned long address);
  387. /*
  388. * Make a given kernel text page executable/non-executable.
  389. * Returns the previous executability setting of that page (which
  390. * is used to restore the previous state). Used by the SMP bootup code.
  391. * NOTE: this is an __init function for security reasons.
  392. */
  393. #ifdef CONFIG_X86_PAE
  394. extern int set_kernel_exec(unsigned long vaddr, int enable);
  395. #else
  396. static inline int set_kernel_exec(unsigned long vaddr, int enable) { return 0;}
  397. #endif
  398. #if defined(CONFIG_HIGHPTE)
  399. #define pte_offset_map(dir, address) \
  400. ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)),KM_PTE0) + pte_index(address))
  401. #define pte_offset_map_nested(dir, address) \
  402. ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)),KM_PTE1) + pte_index(address))
  403. #define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
  404. #define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
  405. #else
  406. #define pte_offset_map(dir, address) \
  407. ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
  408. #define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
  409. #define pte_unmap(pte) do { } while (0)
  410. #define pte_unmap_nested(pte) do { } while (0)
  411. #endif
  412. /* Clear a kernel PTE and flush it from the TLB */
  413. #define kpte_clear_flush(ptep, vaddr) \
  414. do { \
  415. pte_clear(&init_mm, vaddr, ptep); \
  416. __flush_tlb_one(vaddr); \
  417. } while (0)
  418. /*
  419. * The i386 doesn't have any external MMU info: the kernel page
  420. * tables contain all the necessary information.
  421. */
  422. #define update_mmu_cache(vma,address,pte) do { } while (0)
  423. void native_pagetable_setup_start(pgd_t *base);
  424. void native_pagetable_setup_done(pgd_t *base);
  425. #ifndef CONFIG_PARAVIRT
  426. static inline void paravirt_pagetable_setup_start(pgd_t *base)
  427. {
  428. native_pagetable_setup_start(base);
  429. }
  430. static inline void paravirt_pagetable_setup_done(pgd_t *base)
  431. {
  432. native_pagetable_setup_done(base);
  433. }
  434. #endif /* !CONFIG_PARAVIRT */
  435. #endif /* !__ASSEMBLY__ */
  436. #ifdef CONFIG_FLATMEM
  437. #define kern_addr_valid(addr) (1)
  438. #endif /* CONFIG_FLATMEM */
  439. #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
  440. remap_pfn_range(vma, vaddr, pfn, size, prot)
  441. #include <asm-generic/pgtable.h>
  442. #endif /* _I386_PGTABLE_H */