blob: e75791ea33a621ed96e9dbbb6bd49f664f99b2e5 [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
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/kernel.h>
14#include <linux/bitops.h>
15#include <linux/errno.h>
16#include <linux/cpumask.h>
17#include <linux/threads.h>
18
19#ifdef CONFIG_SMP
20
21#ifndef __ASSEMBLY__
22
23struct cpuinfo_PPC {
24 unsigned long loops_per_jiffy;
25 unsigned long pvr;
26 unsigned long *pgd_cache;
27 unsigned long *pte_cache;
28 unsigned long pgtable_cache_sz;
29};
30
31extern struct cpuinfo_PPC cpu_data[];
32extern cpumask_t cpu_online_map;
33extern cpumask_t cpu_possible_map;
34extern unsigned long smp_proc_in_lock[];
35extern volatile unsigned long cpu_callin_map[];
36extern int smp_tb_synchronized;
Paul Mackerras0b879a32005-10-19 23:12:01 +100037extern struct smp_ops_t *smp_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39extern void smp_send_tlb_invalidate(int);
40extern void smp_send_xmon_break(int cpu);
41struct pt_regs;
Olaf Hering40a5f7c2006-10-06 23:06:48 +020042extern void smp_message_recv(int);
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Paul Mackerras31139972005-09-10 21:13:13 +100044extern int __cpu_disable(void);
45extern void __cpu_die(unsigned int cpu);
46extern void cpu_die(void) __attribute__((noreturn));
47
Ingo Molnar39c715b2005-06-21 17:14:34 -070048#define raw_smp_processor_id() (current_thread_info()->cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
50extern int __cpu_up(unsigned int cpu);
51
52extern int smp_hw_index[];
Paul Mackerras14cf11a2005-09-26 16:04:21 +100053#define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])
54#define get_hard_smp_processor_id(cpu) (smp_hw_index[(cpu)])
Paul Mackerras80579e12005-10-27 22:42:04 +100055#define set_hard_smp_processor_id(cpu, phys)\
56 (smp_hw_index[(cpu)] = (phys))
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058#endif /* __ASSEMBLY__ */
59
60#else /* !(CONFIG_SMP) */
61
Paul Mackerras31139972005-09-10 21:13:13 +100062static inline void cpu_die(void) { }
Paul Mackerras14cf11a2005-09-26 16:04:21 +100063#define get_hard_smp_processor_id(cpu) 0
Paul Mackerras80579e12005-10-27 22:42:04 +100064#define set_hard_smp_processor_id(cpu, phys)
Paul Mackerras14cf11a2005-09-26 16:04:21 +100065#define hard_smp_processor_id() 0
Paul Mackerras31139972005-09-10 21:13:13 +100066
Linus Torvalds1da177e2005-04-16 15:20:36 -070067#endif /* !(CONFIG_SMP) */
68
Paul Mackerras80579e12005-10-27 22:42:04 +100069#ifndef __ASSEMBLY__
70extern int boot_cpuid;
71extern int boot_cpuid_phys;
72#endif
73
Linus Torvalds1da177e2005-04-16 15:20:36 -070074#endif /* !(_PPC_SMP_H) */
75#endif /* __KERNEL__ */