aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-09 02:42:01 -0500
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-02-11 17:54:10 -0500
commite42778de31d78ae262a3b901264eabefb9c3b51b (patch)
tree737f6261ab74666bba4fa92f87a133704eee39b8 /arch
parent1dfc07aad5479f1fb832ff6f61a5a9ce822d9e1f (diff)
x86: move defs around to allow paravirt.h to just include page_types.h
Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/page.h78
-rw-r--r--arch/x86/include/asm/page_32_types.h2
-rw-r--r--arch/x86/include/asm/page_types.h74
-rw-r--r--arch/x86/include/asm/paravirt.h2
4 files changed, 77 insertions, 79 deletions
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index da54f6c48a7f..28423609b00e 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -31,84 +31,6 @@ static inline void copy_user_page(void *to, void *from, unsigned long vaddr,
31 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) 31 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
32#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 32#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
33 33
34static inline pgd_t native_make_pgd(pgdval_t val)
35{
36 return (pgd_t) { val };
37}
38
39static inline pgdval_t native_pgd_val(pgd_t pgd)
40{
41 return pgd.pgd;
42}
43
44static inline pgdval_t pgd_flags(pgd_t pgd)
45{
46 return native_pgd_val(pgd) & PTE_FLAGS_MASK;
47}
48
49#if PAGETABLE_LEVELS >= 3
50#if PAGETABLE_LEVELS == 4
51static inline pud_t native_make_pud(pmdval_t val)
52{
53 return (pud_t) { val };
54}
55
56static inline pudval_t native_pud_val(pud_t pud)
57{
58 return pud.pud;
59}
60#else /* PAGETABLE_LEVELS == 3 */
61static inline pudval_t native_pud_val(pud_t pud)
62{
63 return native_pgd_val(pud.pgd);
64}
65#endif /* PAGETABLE_LEVELS == 4 */
66
67static inline pudval_t pud_flags(pud_t pud)
68{
69 return native_pud_val(pud) & PTE_FLAGS_MASK;
70}
71
72static inline pmd_t native_make_pmd(pmdval_t val)
73{
74 return (pmd_t) { val };
75}
76
77static inline pmdval_t native_pmd_val(pmd_t pmd)
78{
79 return pmd.pmd;
80}
81
82#else /* PAGETABLE_LEVELS == 2 */
83static inline pmdval_t native_pmd_val(pmd_t pmd)
84{
85 return native_pgd_val(pmd.pud.pgd);
86}
87#endif /* PAGETABLE_LEVELS >= 3 */
88
89static inline pmdval_t pmd_flags(pmd_t pmd)
90{
91 return native_pmd_val(pmd) & PTE_FLAGS_MASK;
92}
93
94static inline pte_t native_make_pte(pteval_t val)
95{
96 return (pte_t) { .pte = val };
97}
98
99static inline pteval_t native_pte_val(pte_t pte)
100{
101 return pte.pte;
102}
103
104static inline pteval_t pte_flags(pte_t pte)
105{
106 return native_pte_val(pte) & PTE_FLAGS_MASK;
107}
108
109#define pgprot_val(x) ((x).pgprot)
110#define __pgprot(x) ((pgprot_t) { (x) } )
111
112#ifdef CONFIG_PARAVIRT 34#ifdef CONFIG_PARAVIRT
113#include <asm/paravirt.h> 35#include <asm/paravirt.h>
114#else /* !CONFIG_PARAVIRT */ 36#else /* !CONFIG_PARAVIRT */
diff --git a/arch/x86/include/asm/page_32_types.h b/arch/x86/include/asm/page_32_types.h
index b7b5402d7ab7..83f820a2b108 100644
--- a/arch/x86/include/asm/page_32_types.h
+++ b/arch/x86/include/asm/page_32_types.h
@@ -43,6 +43,8 @@
43 43
44#ifndef __ASSEMBLY__ 44#ifndef __ASSEMBLY__
45 45
46#include <linux/types.h>
47
46#ifdef CONFIG_X86_PAE 48#ifdef CONFIG_X86_PAE
47typedef u64 pteval_t; 49typedef u64 pteval_t;
48typedef u64 pmdval_t; 50typedef u64 pmdval_t;
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
index 92dfd251a659..c41e3e8f2271 100644
--- a/arch/x86/include/asm/page_types.h
+++ b/arch/x86/include/asm/page_types.h
@@ -51,18 +51,92 @@
51typedef struct { pgdval_t pgd; } pgd_t; 51typedef struct { pgdval_t pgd; } pgd_t;
52typedef struct { pgprotval_t pgprot; } pgprot_t; 52typedef struct { pgprotval_t pgprot; } pgprot_t;
53 53
54static inline pgd_t native_make_pgd(pgdval_t val)
55{
56 return (pgd_t) { val };
57}
58
59static inline pgdval_t native_pgd_val(pgd_t pgd)
60{
61 return pgd.pgd;
62}
63
64static inline pgdval_t pgd_flags(pgd_t pgd)
65{
66 return native_pgd_val(pgd) & PTE_FLAGS_MASK;
67}
68
54#if PAGETABLE_LEVELS > 3 69#if PAGETABLE_LEVELS > 3
55typedef struct { pudval_t pud; } pud_t; 70typedef struct { pudval_t pud; } pud_t;
71
72static inline pud_t native_make_pud(pmdval_t val)
73{
74 return (pud_t) { val };
75}
76
77static inline pudval_t native_pud_val(pud_t pud)
78{
79 return pud.pud;
80}
56#else 81#else
57#include <asm-generic/pgtable-nopud.h> 82#include <asm-generic/pgtable-nopud.h>
83
84static inline pudval_t native_pud_val(pud_t pud)
85{
86 return native_pgd_val(pud.pgd);
87}
58#endif 88#endif
59 89
60#if PAGETABLE_LEVELS > 2 90#if PAGETABLE_LEVELS > 2
61typedef struct { pmdval_t pmd; } pmd_t; 91typedef struct { pmdval_t pmd; } pmd_t;
92
93static inline pudval_t pud_flags(pud_t pud)
94{
95 return native_pud_val(pud) & PTE_FLAGS_MASK;
96}
97
98static inline pmd_t native_make_pmd(pmdval_t val)
99{
100 return (pmd_t) { val };
101}
102
103static inline pmdval_t native_pmd_val(pmd_t pmd)
104{
105 return pmd.pmd;
106}
62#else 107#else
63#include <asm-generic/pgtable-nopmd.h> 108#include <asm-generic/pgtable-nopmd.h>
109
110static inline pmdval_t native_pmd_val(pmd_t pmd)
111{
112 return native_pgd_val(pmd.pud.pgd);
113}
64#endif 114#endif
65 115
116static inline pmdval_t pmd_flags(pmd_t pmd)
117{
118 return native_pmd_val(pmd) & PTE_FLAGS_MASK;
119}
120
121static inline pte_t native_make_pte(pteval_t val)
122{
123 return (pte_t) { .pte = val };
124}
125
126static inline pteval_t native_pte_val(pte_t pte)
127{
128 return pte.pte;
129}
130
131static inline pteval_t pte_flags(pte_t pte)
132{
133 return native_pte_val(pte) & PTE_FLAGS_MASK;
134}
135
136#define pgprot_val(x) ((x).pgprot)
137#define __pgprot(x) ((pgprot_t) { (x) } )
138
139
66typedef struct page *pgtable_t; 140typedef struct page *pgtable_t;
67 141
68extern int page_is_ram(unsigned long pagenr); 142extern int page_is_ram(unsigned long pagenr);
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index c85e7475e171..db570f23b228 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -4,7 +4,7 @@
4 * para-virtualization: those hooks are defined here. */ 4 * para-virtualization: those hooks are defined here. */
5 5
6#ifdef CONFIG_PARAVIRT 6#ifdef CONFIG_PARAVIRT
7#include <asm/page.h> 7#include <asm/page_types.h>
8#include <asm/asm.h> 8#include <asm/asm.h>
9 9
10/* Bitmask of what can be clobbered: usually at least eax. */ 10/* Bitmask of what can be clobbered: usually at least eax. */