diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-05 17:55:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-05 17:55:20 -0400 |
commit | ea62ccd00fd0b6720b033adfc9984f31130ce195 (patch) | |
tree | 9837b797b2466fffcb0af96c388b06eae9c3df18 /include/asm-i386/smp.h | |
parent | 886a0768affe9a32f18c45f8e1393bca9ece5392 (diff) | |
parent | 35060b6a9a4e1c89bc6fbea61090e302dbc61847 (diff) |
Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (231 commits)
[PATCH] i386: Don't delete cpu_devs data to identify different x86 types in late_initcall
[PATCH] i386: type may be unused
[PATCH] i386: Some additional chipset register values validation.
[PATCH] i386: Add missing !X86_PAE dependincy to the 2G/2G split.
[PATCH] x86-64: Don't exclude asm-offsets.c in Documentation/dontdiff
[PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu
[PATCH] i386: white space fixes in i387.h
[PATCH] i386: Drop noisy e820 debugging printks
[PATCH] x86-64: Fix allnoconfig error in genapic_flat.c
[PATCH] x86-64: Shut up warnings for vfat compat ioctls on other file systems
[PATCH] x86-64: Share identical video.S between i386 and x86-64
[PATCH] x86-64: Remove CONFIG_REORDER
[PATCH] x86-64: Print type and size correctly for unknown compat ioctls
[PATCH] i386: Remove copy_*_user BUG_ONs for (size < 0)
[PATCH] i386: Little cleanups in smpboot.c
[PATCH] x86-64: Don't enable NUMA for a single node in K8 NUMA scanning
[PATCH] x86: Use RDTSCP for synchronous get_cycles if possible
[PATCH] i386: Add X86_FEATURE_RDTSCP
[PATCH] i386: Implement X86_FEATURE_SYNC_RDTSC on i386
[PATCH] i386: Implement alternative_io for i386
...
Fix up trivial conflict in include/linux/highmem.h manually.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-i386/smp.h')
-rw-r--r-- | include/asm-i386/smp.h | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index 6bf0033a301c..090abc1da32a 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h | |||
@@ -8,19 +8,15 @@ | |||
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/threads.h> | 9 | #include <linux/threads.h> |
10 | #include <linux/cpumask.h> | 10 | #include <linux/cpumask.h> |
11 | #include <asm/pda.h> | ||
12 | #endif | 11 | #endif |
13 | 12 | ||
14 | #ifdef CONFIG_X86_LOCAL_APIC | 13 | #if defined(CONFIG_X86_LOCAL_APIC) && !defined(__ASSEMBLY__) |
15 | #ifndef __ASSEMBLY__ | ||
16 | #include <asm/fixmap.h> | ||
17 | #include <asm/bitops.h> | 14 | #include <asm/bitops.h> |
18 | #include <asm/mpspec.h> | 15 | #include <asm/mpspec.h> |
16 | #include <asm/apic.h> | ||
19 | #ifdef CONFIG_X86_IO_APIC | 17 | #ifdef CONFIG_X86_IO_APIC |
20 | #include <asm/io_apic.h> | 18 | #include <asm/io_apic.h> |
21 | #endif | 19 | #endif |
22 | #include <asm/apic.h> | ||
23 | #endif | ||
24 | #endif | 20 | #endif |
25 | 21 | ||
26 | #define BAD_APICID 0xFFu | 22 | #define BAD_APICID 0xFFu |
@@ -52,6 +48,59 @@ extern void cpu_exit_clear(void); | |||
52 | extern void cpu_uninit(void); | 48 | extern void cpu_uninit(void); |
53 | #endif | 49 | #endif |
54 | 50 | ||
51 | struct smp_ops | ||
52 | { | ||
53 | void (*smp_prepare_boot_cpu)(void); | ||
54 | void (*smp_prepare_cpus)(unsigned max_cpus); | ||
55 | int (*cpu_up)(unsigned cpu); | ||
56 | void (*smp_cpus_done)(unsigned max_cpus); | ||
57 | |||
58 | void (*smp_send_stop)(void); | ||
59 | void (*smp_send_reschedule)(int cpu); | ||
60 | int (*smp_call_function_mask)(cpumask_t mask, | ||
61 | void (*func)(void *info), void *info, | ||
62 | int wait); | ||
63 | }; | ||
64 | |||
65 | extern struct smp_ops smp_ops; | ||
66 | |||
67 | static inline void smp_prepare_boot_cpu(void) | ||
68 | { | ||
69 | smp_ops.smp_prepare_boot_cpu(); | ||
70 | } | ||
71 | static inline void smp_prepare_cpus(unsigned int max_cpus) | ||
72 | { | ||
73 | smp_ops.smp_prepare_cpus(max_cpus); | ||
74 | } | ||
75 | static inline int __cpu_up(unsigned int cpu) | ||
76 | { | ||
77 | return smp_ops.cpu_up(cpu); | ||
78 | } | ||
79 | static inline void smp_cpus_done(unsigned int max_cpus) | ||
80 | { | ||
81 | smp_ops.smp_cpus_done(max_cpus); | ||
82 | } | ||
83 | |||
84 | static inline void smp_send_stop(void) | ||
85 | { | ||
86 | smp_ops.smp_send_stop(); | ||
87 | } | ||
88 | static inline void smp_send_reschedule(int cpu) | ||
89 | { | ||
90 | smp_ops.smp_send_reschedule(cpu); | ||
91 | } | ||
92 | static inline int smp_call_function_mask(cpumask_t mask, | ||
93 | void (*func) (void *info), void *info, | ||
94 | int wait) | ||
95 | { | ||
96 | return smp_ops.smp_call_function_mask(mask, func, info, wait); | ||
97 | } | ||
98 | |||
99 | void native_smp_prepare_boot_cpu(void); | ||
100 | void native_smp_prepare_cpus(unsigned int max_cpus); | ||
101 | int native_cpu_up(unsigned int cpunum); | ||
102 | void native_smp_cpus_done(unsigned int max_cpus); | ||
103 | |||
55 | #ifndef CONFIG_PARAVIRT | 104 | #ifndef CONFIG_PARAVIRT |
56 | #define startup_ipi_hook(phys_apicid, start_eip, start_esp) \ | 105 | #define startup_ipi_hook(phys_apicid, start_eip, start_esp) \ |
57 | do { } while (0) | 106 | do { } while (0) |
@@ -62,7 +111,8 @@ do { } while (0) | |||
62 | * from the initial startup. We map APIC_BASE very early in page_setup(), | 111 | * from the initial startup. We map APIC_BASE very early in page_setup(), |
63 | * so this is correct in the x86 case. | 112 | * so this is correct in the x86 case. |
64 | */ | 113 | */ |
65 | #define raw_smp_processor_id() (read_pda(cpu_number)) | 114 | DECLARE_PER_CPU(int, cpu_number); |
115 | #define raw_smp_processor_id() (x86_read_percpu(cpu_number)) | ||
66 | 116 | ||
67 | extern cpumask_t cpu_callout_map; | 117 | extern cpumask_t cpu_callout_map; |
68 | extern cpumask_t cpu_callin_map; | 118 | extern cpumask_t cpu_callin_map; |