vserver 1.9.3
[linux-2.6.git] / include / asm-ppc64 / smp.h
1 /* 
2  * smp.h: PPC64 specific SMP code.
3  *
4  * Original was a copy of sparc smp.h.  Now heavily modified
5  * for PPC.
6  *
7  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
8  * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version
13  * 2 of the License, or (at your option) any later version.
14  */
15
16 #ifdef __KERNEL__
17 #ifndef _PPC64_SMP_H
18 #define _PPC64_SMP_H
19
20 #include <linux/config.h>
21 #include <linux/threads.h>
22 #include <linux/cpumask.h>
23 #include <linux/kernel.h>
24
25 #ifndef __ASSEMBLY__
26
27 #include <asm/paca.h>
28
29 extern int boot_cpuid;
30
31 #ifdef CONFIG_SMP
32
33 extern void smp_send_debugger_break(int cpu);
34 struct pt_regs;
35 extern void smp_message_recv(int, struct pt_regs *);
36
37
38 #define smp_processor_id() (get_paca()->paca_index)
39 #define hard_smp_processor_id() (get_paca()->hw_cpu_id)
40
41 extern cpumask_t cpu_sibling_map[NR_CPUS];
42
43 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
44  *
45  * Make sure this matches openpic_request_IPIs in open_pic.c, or what shows up
46  * in /proc/interrupts will be wrong!!! --Troy */
47 #define PPC_MSG_CALL_FUNCTION   0
48 #define PPC_MSG_RESCHEDULE      1
49 /* This is unused now */
50 #if 0
51 #define PPC_MSG_MIGRATE_TASK    2
52 #endif
53 #define PPC_MSG_DEBUGGER_BREAK  3
54
55 extern cpumask_t irq_affinity[];
56
57 void smp_init_iSeries(void);
58 void smp_init_pSeries(void);
59
60 extern int __cpu_disable(void);
61 extern void __cpu_die(unsigned int cpu);
62 extern void cpu_die(void) __attribute__((noreturn));
63 extern int query_cpu_stopped(unsigned int pcpu);
64 #endif /* !(CONFIG_SMP) */
65
66 #define get_hard_smp_processor_id(CPU) (paca[(CPU)].hw_cpu_id)
67 #define set_hard_smp_processor_id(CPU, VAL) \
68         do { (paca[(CPU)].hw_cpu_id = (VAL)); } while (0)
69
70 extern int smt_enabled_at_boot;
71
72 #endif /* __ASSEMBLY__ */
73
74 #endif /* !(_PPC64_SMP_H) */
75 #endif /* __KERNEL__ */