diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/x86/include/asm/smp.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/x86/include/asm/smp.h')
-rw-r--r-- | arch/x86/include/asm/smp.h | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 4cfc90824068..73b11bc0ae6f 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
@@ -17,12 +17,24 @@ | |||
17 | #endif | 17 | #endif |
18 | #include <asm/thread_info.h> | 18 | #include <asm/thread_info.h> |
19 | #include <asm/cpumask.h> | 19 | #include <asm/cpumask.h> |
20 | #include <asm/cpufeature.h> | ||
20 | 21 | ||
21 | extern int smp_num_siblings; | 22 | extern int smp_num_siblings; |
22 | extern unsigned int num_processors; | 23 | extern unsigned int num_processors; |
23 | 24 | ||
25 | static inline bool cpu_has_ht_siblings(void) | ||
26 | { | ||
27 | bool has_siblings = false; | ||
28 | #ifdef CONFIG_SMP | ||
29 | has_siblings = cpu_has_ht && smp_num_siblings > 1; | ||
30 | #endif | ||
31 | return has_siblings; | ||
32 | } | ||
33 | |||
24 | DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_map); | 34 | DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_map); |
25 | DECLARE_PER_CPU(cpumask_var_t, cpu_core_map); | 35 | DECLARE_PER_CPU(cpumask_var_t, cpu_core_map); |
36 | /* cpus sharing the last level cache: */ | ||
37 | DECLARE_PER_CPU(cpumask_var_t, cpu_llc_shared_map); | ||
26 | DECLARE_PER_CPU(u16, cpu_llc_id); | 38 | DECLARE_PER_CPU(u16, cpu_llc_id); |
27 | DECLARE_PER_CPU(int, cpu_number); | 39 | DECLARE_PER_CPU(int, cpu_number); |
28 | 40 | ||
@@ -36,21 +48,26 @@ static inline struct cpumask *cpu_core_mask(int cpu) | |||
36 | return per_cpu(cpu_core_map, cpu); | 48 | return per_cpu(cpu_core_map, cpu); |
37 | } | 49 | } |
38 | 50 | ||
51 | static inline struct cpumask *cpu_llc_shared_mask(int cpu) | ||
52 | { | ||
53 | return per_cpu(cpu_llc_shared_map, cpu); | ||
54 | } | ||
55 | |||
39 | DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); | 56 | DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); |
40 | DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); | 57 | DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); |
58 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) | ||
59 | DECLARE_EARLY_PER_CPU(int, x86_cpu_to_logical_apicid); | ||
60 | #endif | ||
41 | 61 | ||
42 | /* Static state in head.S used to set up a CPU */ | 62 | /* Static state in head.S used to set up a CPU */ |
43 | extern struct { | 63 | extern unsigned long stack_start; /* Initial stack pointer address */ |
44 | void *sp; | ||
45 | unsigned short ss; | ||
46 | } stack_start; | ||
47 | 64 | ||
48 | struct smp_ops { | 65 | struct smp_ops { |
49 | void (*smp_prepare_boot_cpu)(void); | 66 | void (*smp_prepare_boot_cpu)(void); |
50 | void (*smp_prepare_cpus)(unsigned max_cpus); | 67 | void (*smp_prepare_cpus)(unsigned max_cpus); |
51 | void (*smp_cpus_done)(unsigned max_cpus); | 68 | void (*smp_cpus_done)(unsigned max_cpus); |
52 | 69 | ||
53 | void (*smp_send_stop)(void); | 70 | void (*stop_other_cpus)(int wait); |
54 | void (*smp_send_reschedule)(int cpu); | 71 | void (*smp_send_reschedule)(int cpu); |
55 | 72 | ||
56 | int (*cpu_up)(unsigned cpu); | 73 | int (*cpu_up)(unsigned cpu); |
@@ -73,7 +90,12 @@ extern struct smp_ops smp_ops; | |||
73 | 90 | ||
74 | static inline void smp_send_stop(void) | 91 | static inline void smp_send_stop(void) |
75 | { | 92 | { |
76 | smp_ops.smp_send_stop(); | 93 | smp_ops.stop_other_cpus(0); |
94 | } | ||
95 | |||
96 | static inline void stop_other_cpus(void) | ||
97 | { | ||
98 | smp_ops.stop_other_cpus(1); | ||
77 | } | 99 | } |
78 | 100 | ||
79 | static inline void smp_prepare_boot_cpu(void) | 101 | static inline void smp_prepare_boot_cpu(void) |