]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* smp.h: PPC specific SMP stuff. |
2 | * | |
3 | * Original was a copy of sparc smp.h. Now heavily modified | |
4 | * for PPC. | |
5 | * | |
6 | * Copyright (C) 1996 David S. Miller ([email protected]) | |
7 | * Copyright (C) 1996-2001 Cort Dougan <[email protected]> | |
8 | */ | |
9 | #ifdef __KERNEL__ | |
10 | #ifndef _PPC_SMP_H | |
11 | #define _PPC_SMP_H | |
12 | ||
13 | #include <linux/config.h> | |
14 | #include <linux/kernel.h> | |
15 | #include <linux/bitops.h> | |
16 | #include <linux/errno.h> | |
17 | #include <linux/cpumask.h> | |
18 | #include <linux/threads.h> | |
19 | ||
20 | #ifdef CONFIG_SMP | |
21 | ||
22 | #ifndef __ASSEMBLY__ | |
23 | ||
24 | struct cpuinfo_PPC { | |
25 | unsigned long loops_per_jiffy; | |
26 | unsigned long pvr; | |
27 | unsigned long *pgd_cache; | |
28 | unsigned long *pte_cache; | |
29 | unsigned long pgtable_cache_sz; | |
30 | }; | |
31 | ||
32 | extern struct cpuinfo_PPC cpu_data[]; | |
33 | extern cpumask_t cpu_online_map; | |
34 | extern cpumask_t cpu_possible_map; | |
35 | extern unsigned long smp_proc_in_lock[]; | |
36 | extern volatile unsigned long cpu_callin_map[]; | |
37 | extern int smp_tb_synchronized; | |
0b879a31 | 38 | extern struct smp_ops_t *smp_ops; |
1da177e4 LT |
39 | |
40 | extern void smp_send_tlb_invalidate(int); | |
41 | extern void smp_send_xmon_break(int cpu); | |
42 | struct pt_regs; | |
43 | extern void smp_message_recv(int, struct pt_regs *); | |
44 | ||
31139971 PM |
45 | extern int __cpu_disable(void); |
46 | extern void __cpu_die(unsigned int cpu); | |
47 | extern void cpu_die(void) __attribute__((noreturn)); | |
48 | ||
39c715b7 | 49 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
1da177e4 LT |
50 | |
51 | extern int __cpu_up(unsigned int cpu); | |
52 | ||
53 | extern int smp_hw_index[]; | |
14cf11af PM |
54 | #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()]) |
55 | #define get_hard_smp_processor_id(cpu) (smp_hw_index[(cpu)]) | |
1da177e4 LT |
56 | |
57 | #endif /* __ASSEMBLY__ */ | |
58 | ||
59 | #else /* !(CONFIG_SMP) */ | |
60 | ||
31139971 | 61 | static inline void cpu_die(void) { } |
14cf11af PM |
62 | #define get_hard_smp_processor_id(cpu) 0 |
63 | #define hard_smp_processor_id() 0 | |
31139971 | 64 | |
1da177e4 LT |
65 | #endif /* !(CONFIG_SMP) */ |
66 | ||
67 | #endif /* !(_PPC_SMP_H) */ | |
68 | #endif /* __KERNEL__ */ |