diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-03-24 06:15:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 10:33:15 -0500 |
commit | 3d1712c91df01d2573b934e972e231e8edb102c7 (patch) | |
tree | 71ed84ab8e8a59517ec1b7b1af082adc2beb1758 /include/asm-x86_64/mmu_context.h | |
parent | 9b04c997b1120feefa1e6ee8e2902270bc055cd2 (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/asm-x86_64/mmu_context.h')
-rw-r--r-- | include/asm-x86_64/mmu_context.h | 6 |
1 files changed, 3 insertions, 3 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. |