aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAkinobu Mita <mita@miraclelinux.com>2006-03-24 06:15:11 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:15 -0500
commit3d1712c91df01d2573b934e972e231e8edb102c7 (patch)
tree71ed84ab8e8a59517ec1b7b1af082adc2beb1758 /include
parent9b04c997b1120feefa1e6ee8e2902270bc055cd2 (diff)
[PATCH] x86_64: {set,clear,test}_bit() related cleanup and pci_mmcfg_init() fix
While working on these patch set, I found several possible cleanup on x86-64 and ia64. akpm: I stole this from Andi's queue. Not only does it clean up bitops. It also unrelatedly changes the prototype of pci_mmcfg_init() and removes its arch_initcall(). It seems that the wrong two patches got joined together, but this is the one which has been tested. This patch fixes the current x86_64 build error (the pci_mmcfg_init() declaration in arch/i386/pci/pci.h disagrees with the definition in arch/x86_64/pci/mmconfig.c) This also means that x86_64's pci_mmcfg_init() gets called in the same (new) manner as x86's: from arch/i386/pci/init.c:pci_access_init(), rather than via initcall. The bitops cleanups came along for free. All this worked OK in -mm testing (since 2.6.16-rc4-mm1) because x86_64 was tested with both patches applied. Signed-off-by: Akinobu Mita <mita@miraclelinux.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Con Kolivas <kernel@kolivas.org> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86_64/mmu_context.h6
-rw-r--r--include/asm-x86_64/pgtable.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/include/asm-x86_64/mmu_context.h b/include/asm-x86_64/mmu_context.h
index 16e4be4de0c5..19f0c83d0792 100644
--- a/include/asm-x86_64/mmu_context.h
+++ b/include/asm-x86_64/mmu_context.h
@@ -34,12 +34,12 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
34 unsigned cpu = smp_processor_id(); 34 unsigned cpu = smp_processor_id();
35 if (likely(prev != next)) { 35 if (likely(prev != next)) {
36 /* stop flush ipis for the previous mm */ 36 /* stop flush ipis for the previous mm */
37 clear_bit(cpu, &prev->cpu_vm_mask); 37 cpu_clear(cpu, prev->cpu_vm_mask);
38#ifdef CONFIG_SMP 38#ifdef CONFIG_SMP
39 write_pda(mmu_state, TLBSTATE_OK); 39 write_pda(mmu_state, TLBSTATE_OK);
40 write_pda(active_mm, next); 40 write_pda(active_mm, next);
41#endif 41#endif
42 set_bit(cpu, &next->cpu_vm_mask); 42 cpu_set(cpu, next->cpu_vm_mask);
43 load_cr3(next->pgd); 43 load_cr3(next->pgd);
44 44
45 if (unlikely(next->context.ldt != prev->context.ldt)) 45 if (unlikely(next->context.ldt != prev->context.ldt))
@@ -50,7 +50,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
50 write_pda(mmu_state, TLBSTATE_OK); 50 write_pda(mmu_state, TLBSTATE_OK);
51 if (read_pda(active_mm) != next) 51 if (read_pda(active_mm) != next)
52 out_of_line_bug(); 52 out_of_line_bug();
53 if(!test_and_set_bit(cpu, &next->cpu_vm_mask)) { 53 if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) {
54 /* We were in lazy tlb mode and leave_mm disabled 54 /* We were in lazy tlb mode and leave_mm disabled
55 * tlb flush IPI delivery. We must reload CR3 55 * tlb flush IPI delivery. We must reload CR3
56 * to make sure to use no freed page tables. 56 * to make sure to use no freed page tables.
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index a617d364d08d..def903287193 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -293,19 +293,19 @@ static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned
293{ 293{
294 if (!pte_dirty(*ptep)) 294 if (!pte_dirty(*ptep))
295 return 0; 295 return 0;
296 return test_and_clear_bit(_PAGE_BIT_DIRTY, ptep); 296 return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte);
297} 297}
298 298
299static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) 299static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
300{ 300{
301 if (!pte_young(*ptep)) 301 if (!pte_young(*ptep))
302 return 0; 302 return 0;
303 return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); 303 return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte);
304} 304}
305 305
306static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 306static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
307{ 307{
308 clear_bit(_PAGE_BIT_RW, ptep); 308 clear_bit(_PAGE_BIT_RW, &ptep->pte);
309} 309}
310 310
311/* 311/*