diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-06-17 14:41:59 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-20 09:09:54 -0400 |
commit | d494a96125c99f1e37b1f831b29b42c9b712ee05 (patch) | |
tree | 2a43489c1e3ba0fce51326e7548512252a052eef /arch/x86/mm | |
parent | 7c7e6e07e2a7c0d2d96389f4f0540e44a80ecdaa (diff) |
x86: implement set_pte_vaddr
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/init_64.c | 9 | ||||
-rw-r--r-- | arch/x86/mm/pgtable.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/pgtable_32.c | 6 |
3 files changed, 8 insertions, 9 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index e5f531949857..74fae8335128 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -135,15 +135,15 @@ static __init void *spp_getpage(void) | |||
135 | return ptr; | 135 | return ptr; |
136 | } | 136 | } |
137 | 137 | ||
138 | static void | 138 | void |
139 | set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot) | 139 | set_pte_vaddr(unsigned long vaddr, pte_t new_pte) |
140 | { | 140 | { |
141 | pgd_t *pgd; | 141 | pgd_t *pgd; |
142 | pud_t *pud; | 142 | pud_t *pud; |
143 | pmd_t *pmd; | 143 | pmd_t *pmd; |
144 | pte_t *pte, new_pte; | 144 | pte_t *pte; |
145 | 145 | ||
146 | pr_debug("set_pte_phys %lx to %lx\n", vaddr, phys); | 146 | pr_debug("set_pte_vaddr %lx to %lx\n", vaddr, native_pte_val(new_pte)); |
147 | 147 | ||
148 | pgd = pgd_offset_k(vaddr); | 148 | pgd = pgd_offset_k(vaddr); |
149 | if (pgd_none(*pgd)) { | 149 | if (pgd_none(*pgd)) { |
@@ -170,7 +170,6 @@ set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot) | |||
170 | return; | 170 | return; |
171 | } | 171 | } |
172 | } | 172 | } |
173 | new_pte = pfn_pte(phys >> PAGE_SHIFT, prot); | ||
174 | 173 | ||
175 | pte = pte_offset_kernel(pmd, vaddr); | 174 | pte = pte_offset_kernel(pmd, vaddr); |
176 | if (!pte_none(*pte) && pte_val(new_pte) && | 175 | if (!pte_none(*pte) && pte_val(new_pte) && |
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 3ebebe480b53..7498124e30fc 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -285,6 +285,6 @@ void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags) | |||
285 | BUG(); | 285 | BUG(); |
286 | return; | 286 | return; |
287 | } | 287 | } |
288 | set_pte_pfn(address, phys >> PAGE_SHIFT, flags); | 288 | set_pte_vaddr(address, pfn_pte(phys >> PAGE_SHIFT, flags)); |
289 | fixmaps_set++; | 289 | fixmaps_set++; |
290 | } | 290 | } |
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c index 3f97c3c87288..0662f345212f 100644 --- a/arch/x86/mm/pgtable_32.c +++ b/arch/x86/mm/pgtable_32.c | |||
@@ -71,7 +71,7 @@ void show_mem(void) | |||
71 | * Associate a virtual page frame with a given physical page frame | 71 | * Associate a virtual page frame with a given physical page frame |
72 | * and protection flags for that frame. | 72 | * and protection flags for that frame. |
73 | */ | 73 | */ |
74 | static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) | 74 | void set_pte_vaddr(unsigned long vaddr, pte_t pteval) |
75 | { | 75 | { |
76 | pgd_t *pgd; | 76 | pgd_t *pgd; |
77 | pud_t *pud; | 77 | pud_t *pud; |
@@ -94,8 +94,8 @@ static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) | |||
94 | return; | 94 | return; |
95 | } | 95 | } |
96 | pte = pte_offset_kernel(pmd, vaddr); | 96 | pte = pte_offset_kernel(pmd, vaddr); |
97 | if (pgprot_val(flags)) | 97 | if (pte_val(pteval)) |
98 | set_pte_present(&init_mm, vaddr, pte, pfn_pte(pfn, flags)); | 98 | set_pte_present(&init_mm, vaddr, pte, pteval); |
99 | else | 99 | else |
100 | pte_clear(&init_mm, vaddr, pte); | 100 | pte_clear(&init_mm, vaddr, pte); |
101 | 101 | ||