blob: 0f42fcc1900b9473f4fd1f7bc04d2fec99153fd2 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
29extern int boot_cpuid;
30extern int boot_cpuid_phys;
31
32extern void cpu_die(void);
33
34#ifdef CONFIG_SMP
35
36extern void smp_send_debugger_break(int cpu);
37struct pt_regs;
38extern void smp_message_recv(int, struct pt_regs *);
39
40#ifdef CONFIG_HOTPLUG_CPU
41extern void fixup_irqs(cpumask_t map);
42int generic_cpu_disable(void);
43int generic_cpu_enable(unsigned int cpu);
44void generic_cpu_die(unsigned int cpu);
45void generic_mach_cpu_die(void);
46#endif
47
Ingo Molnar39c715b2005-06-21 17:14:34 -070048#define raw_smp_processor_id() (get_paca()->paca_index)
Linus Torvalds1da177e2005-04-16 15:20:36 -070049#define hard_smp_processor_id() (get_paca()->hw_cpu_id)
50
51extern cpumask_t cpu_sibling_map[NR_CPUS];
52
53/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
54 *
55 * Make sure this matches openpic_request_IPIs in open_pic.c, or what shows up
56 * in /proc/interrupts will be wrong!!! --Troy */
57#define PPC_MSG_CALL_FUNCTION 0
58#define PPC_MSG_RESCHEDULE 1
59/* This is unused now */
60#if 0
61#define PPC_MSG_MIGRATE_TASK 2
62#endif
63#define PPC_MSG_DEBUGGER_BREAK 3
64
65void smp_init_iSeries(void);
66void smp_init_pSeries(void);
Arnd Bergmann19fe0472005-10-31 20:08:38 -050067void smp_init_cell(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
69extern int __cpu_disable(void);
70extern void __cpu_die(unsigned int cpu);
71#endif /* CONFIG_SMP */
72
73#define get_hard_smp_processor_id(CPU) (paca[(CPU)].hw_cpu_id)
74#define set_hard_smp_processor_id(CPU, VAL) \
75 do { (paca[(CPU)].hw_cpu_id = (VAL)); } while (0)
76
77extern int smt_enabled_at_boot;
78
79extern int smp_mpic_probe(void);
80extern void smp_mpic_setup_cpu(int cpu);
Linus Torvalds1da177e2005-04-16 15:20:36 -070081extern void smp_generic_kick_cpu(int nr);
82
83extern void smp_generic_give_timebase(void);
84extern void smp_generic_take_timebase(void);
85
86extern struct smp_ops_t *smp_ops;
87
Arnd Bergmannfef1c772005-06-23 09:43:37 +100088#ifdef CONFIG_PPC_PSERIES
89void vpa_init(int cpu);
90#else
91static inline void vpa_init(int cpu)
92{
93}
94#endif /* CONFIG_PPC_PSERIES */
95
Linus Torvalds1da177e2005-04-16 15:20:36 -070096#endif /* __ASSEMBLY__ */
97
98#endif /* !(_PPC64_SMP_H) */
99#endif /* __KERNEL__ */