2 * smp.h: PPC64 specific SMP code.
4 * Original was a copy of sparc smp.h. Now heavily modified
7 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
8 * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
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.
20 #include <linux/config.h>
21 #include <linux/threads.h>
22 #include <linux/cpumask.h>
23 #include <linux/kernel.h>
29 extern int boot_cpuid;
30 extern int boot_cpuid_phys;
32 extern void cpu_die(void) __attribute__((noreturn));
36 extern void smp_send_debugger_break(int cpu);
38 extern void smp_message_recv(int, struct pt_regs *);
41 #define __smp_processor_id() (get_paca()->paca_index)
42 #define hard_smp_processor_id() (get_paca()->hw_cpu_id)
44 extern cpumask_t cpu_sibling_map[NR_CPUS];
46 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
48 * Make sure this matches openpic_request_IPIs in open_pic.c, or what shows up
49 * in /proc/interrupts will be wrong!!! --Troy */
50 #define PPC_MSG_CALL_FUNCTION 0
51 #define PPC_MSG_RESCHEDULE 1
52 /* This is unused now */
54 #define PPC_MSG_MIGRATE_TASK 2
56 #define PPC_MSG_DEBUGGER_BREAK 3
58 void smp_init_iSeries(void);
59 void smp_init_pSeries(void);
61 extern int __cpu_disable(void);
62 extern void __cpu_die(unsigned int cpu);
63 #endif /* CONFIG_SMP */
65 #define get_hard_smp_processor_id(CPU) (paca[(CPU)].hw_cpu_id)
66 #define set_hard_smp_processor_id(CPU, VAL) \
67 do { (paca[(CPU)].hw_cpu_id = (VAL)); } while (0)
69 extern int smt_enabled_at_boot;
71 extern int smp_mpic_probe(void);
72 extern void smp_mpic_setup_cpu(int cpu);
73 extern void smp_mpic_message_pass(int target, int msg);
74 extern void smp_generic_kick_cpu(int nr);
76 extern void smp_generic_give_timebase(void);
77 extern void smp_generic_take_timebase(void);
79 extern struct smp_ops_t *smp_ops;
81 #endif /* __ASSEMBLY__ */
83 #endif /* !(_PPC64_SMP_H) */
84 #endif /* __KERNEL__ */