blob: 30e9268a888c4664f441586630dc1ecf682102cd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* 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 (davem@caip.rutgers.edu)
7 * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
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
24struct 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
32extern struct cpuinfo_PPC cpu_data[];
33extern cpumask_t cpu_online_map;
34extern cpumask_t cpu_possible_map;
35extern unsigned long smp_proc_in_lock[];
36extern volatile unsigned long cpu_callin_map[];
37extern int smp_tb_synchronized;
Paul Mackerras0b879a32005-10-19 23:12:01 +100038extern struct smp_ops_t *smp_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
40extern void smp_send_tlb_invalidate(int);
41extern void smp_send_xmon_break(int cpu);
42struct pt_regs;
43extern void smp_message_recv(int, struct pt_regs *);
44
Paul Mackerras31139972005-09-10 21:13:13 +100045extern int __cpu_disable(void);
46extern void __cpu_die(unsigned int cpu);
47extern void cpu_die(void) __attribute__((noreturn));
48
Ingo Molnar39c715b2005-06-21 17:14:34 -070049#define raw_smp_processor_id() (current_thread_info()->cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51extern int __cpu_up(unsigned int cpu);
52
53extern int smp_hw_index[];
Paul Mackerras14cf11a2005-09-26 16:04:21 +100054#define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])
55#define get_hard_smp_processor_id(cpu) (smp_hw_index[(cpu)])
Paul Mackerras80579e12005-10-27 22:42:04 +100056#define set_hard_smp_processor_id(cpu, phys)\
57 (smp_hw_index[(cpu)] = (phys))
58
Linus Torvalds1da177e2005-04-16 15:20:36 -070059#endif /* __ASSEMBLY__ */
60
61#else /* !(CONFIG_SMP) */
62
Paul Mackerras31139972005-09-10 21:13:13 +100063static inline void cpu_die(void) { }
Paul Mackerras14cf11a2005-09-26 16:04:21 +100064#define get_hard_smp_processor_id(cpu) 0
Paul Mackerras80579e12005-10-27 22:42:04 +100065#define set_hard_smp_processor_id(cpu, phys)
Paul Mackerras14cf11a2005-09-26 16:04:21 +100066#define hard_smp_processor_id() 0
Paul Mackerras31139972005-09-10 21:13:13 +100067
Linus Torvalds1da177e2005-04-16 15:20:36 -070068#endif /* !(CONFIG_SMP) */
69
Paul Mackerras80579e12005-10-27 22:42:04 +100070#ifndef __ASSEMBLY__
71extern int boot_cpuid;
72extern int boot_cpuid_phys;
73#endif
74
Linus Torvalds1da177e2005-04-16 15:20:36 -070075#endif /* !(_PPC_SMP_H) */
76#endif /* __KERNEL__ */