aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/pgtable.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-02-11 13:20:05 -0500
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-02-11 17:54:10 -0500
commit54321d947ae9d6a051b81e3eccaf2d8658aeecc6 (patch)
tree2843c22a872d39cf815ca0d6b250bb8684dadb2b /arch/x86/include/asm/pgtable.h
parente2f5bda94152fa567f6b48126741014123f982b8 (diff)
x86: move pte types into pgtable*.h
pgtable*.h is intended for definitions relating to actual pagetables and their entries, so move all the definitions for (pte|pmd|pud|pgd)(val)?_t to the appropriate pgtable*.h headers. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/include/asm/pgtable.h')
-rw-r--r--arch/x86/include/asm/pgtable.h103
1 files changed, 60 insertions, 43 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 9f5085097977..b0d1066ab6a5 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -25,6 +25,66 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
25extern spinlock_t pgd_lock; 25extern spinlock_t pgd_lock;
26extern struct list_head pgd_list; 26extern struct list_head pgd_list;
27 27
28#ifdef CONFIG_PARAVIRT
29#include <asm/paravirt.h>
30#else /* !CONFIG_PARAVIRT */
31#define set_pte(ptep, pte) native_set_pte(ptep, pte)
32#define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte)
33
34#define set_pte_present(mm, addr, ptep, pte) \
35 native_set_pte_present(mm, addr, ptep, pte)
36#define set_pte_atomic(ptep, pte) \
37 native_set_pte_atomic(ptep, pte)
38
39#define set_pmd(pmdp, pmd) native_set_pmd(pmdp, pmd)
40
41#ifndef __PAGETABLE_PUD_FOLDED
42#define set_pgd(pgdp, pgd) native_set_pgd(pgdp, pgd)
43#define pgd_clear(pgd) native_pgd_clear(pgd)
44#endif
45
46#ifndef set_pud
47# define set_pud(pudp, pud) native_set_pud(pudp, pud)
48#endif
49
50#ifndef __PAGETABLE_PMD_FOLDED
51#define pud_clear(pud) native_pud_clear(pud)
52#endif
53
54#define pte_clear(mm, addr, ptep) native_pte_clear(mm, addr, ptep)
55#define pmd_clear(pmd) native_pmd_clear(pmd)
56
57#define pte_update(mm, addr, ptep) do { } while (0)
58#define pte_update_defer(mm, addr, ptep) do { } while (0)
59
60static inline void __init paravirt_pagetable_setup_start(pgd_t *base)
61{
62 native_pagetable_setup_start(base);
63}
64
65static inline void __init paravirt_pagetable_setup_done(pgd_t *base)
66{
67 native_pagetable_setup_done(base);
68}
69
70#define pgd_val(x) native_pgd_val(x)
71#define __pgd(x) native_make_pgd(x)
72
73#ifndef __PAGETABLE_PUD_FOLDED
74#define pud_val(x) native_pud_val(x)
75#define __pud(x) native_make_pud(x)
76#endif
77
78#ifndef __PAGETABLE_PMD_FOLDED
79#define pmd_val(x) native_pmd_val(x)
80#define __pmd(x) native_make_pmd(x)
81#endif
82
83#define pte_val(x) native_pte_val(x)
84#define __pte(x) native_make_pte(x)
85
86#endif /* CONFIG_PARAVIRT */
87
28/* 88/*
29 * The following only work if pte_present() is true. 89 * The following only work if pte_present() is true.
30 * Undefined behaviour if not.. 90 * Undefined behaviour if not..
@@ -214,49 +274,6 @@ static inline int is_new_memtype_allowed(unsigned long flags,
214 return 1; 274 return 1;
215} 275}
216 276
217#ifdef CONFIG_PARAVIRT
218#include <asm/paravirt.h>
219#else /* !CONFIG_PARAVIRT */
220#define set_pte(ptep, pte) native_set_pte(ptep, pte)
221#define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte)
222
223#define set_pte_present(mm, addr, ptep, pte) \
224 native_set_pte_present(mm, addr, ptep, pte)
225#define set_pte_atomic(ptep, pte) \
226 native_set_pte_atomic(ptep, pte)
227
228#define set_pmd(pmdp, pmd) native_set_pmd(pmdp, pmd)
229
230#ifndef __PAGETABLE_PUD_FOLDED
231#define set_pgd(pgdp, pgd) native_set_pgd(pgdp, pgd)
232#define pgd_clear(pgd) native_pgd_clear(pgd)
233#endif
234
235#ifndef set_pud
236# define set_pud(pudp, pud) native_set_pud(pudp, pud)
237#endif
238
239#ifndef __PAGETABLE_PMD_FOLDED
240#define pud_clear(pud) native_pud_clear(pud)
241#endif
242
243#define pte_clear(mm, addr, ptep) native_pte_clear(mm, addr, ptep)
244#define pmd_clear(pmd) native_pmd_clear(pmd)
245
246#define pte_update(mm, addr, ptep) do { } while (0)
247#define pte_update_defer(mm, addr, ptep) do { } while (0)
248
249static inline void __init paravirt_pagetable_setup_start(pgd_t *base)
250{
251 native_pagetable_setup_start(base);
252}
253
254static inline void __init paravirt_pagetable_setup_done(pgd_t *base)
255{
256 native_pagetable_setup_done(base);
257}
258#endif /* CONFIG_PARAVIRT */
259
260#endif /* __ASSEMBLY__ */ 277#endif /* __ASSEMBLY__ */
261 278
262#ifdef CONFIG_X86_32 279#ifdef CONFIG_X86_32