blob: db02be81b90a1cdc6f6e7504fa79980a2e16a0b6 [file] [log] [blame]
Catalin Marinas08e875c2012-03-05 11:49:30 +00001/*
2 * Copyright (C) 2012 ARM Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#ifndef __ASM_SMP_H
17#define __ASM_SMP_H
18
19#include <linux/threads.h>
20#include <linux/cpumask.h>
21#include <linux/thread_info.h>
22
23#ifndef CONFIG_SMP
24# error "<asm/smp.h> included in non-SMP build"
25#endif
26
27#define raw_smp_processor_id() (current_thread_info()->cpu)
28
29struct seq_file;
30
31/*
32 * generate IPI list text
33 */
34extern void show_ipi_list(struct seq_file *p, int prec);
35
36/*
37 * Called from C code, this handles an IPI.
38 */
39extern void handle_IPI(int ipinr, struct pt_regs *regs);
40
41/*
Hanjun Guofccb9a82015-03-24 22:02:45 +080042 * Discover the set of possible CPUs and determine their
43 * SMP operations.
Catalin Marinas08e875c2012-03-05 11:49:30 +000044 */
Lorenzo Pieralisi0f078332015-05-13 14:12:47 +010045extern void smp_init_cpus(void);
Catalin Marinas08e875c2012-03-05 11:49:30 +000046
47/*
48 * Provide a function to raise an IPI cross call on CPUs in callmap.
49 */
50extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
51
Frederic Weisbecker36310732014-08-16 18:48:05 +020052extern void (*__smp_cross_call)(const struct cpumask *, unsigned int);
53
Catalin Marinas08e875c2012-03-05 11:49:30 +000054/*
55 * Called from the secondary holding pen, this is the secondary CPU entry point.
56 */
57asmlinkage void secondary_start_kernel(void);
58
59/*
60 * Initial data for bringing up a secondary CPU.
61 */
62struct secondary_data {
63 void *stack;
64};
65extern struct secondary_data secondary_data;
Mark Rutland652af892013-10-24 20:30:16 +010066extern void secondary_entry(void);
Catalin Marinas08e875c2012-03-05 11:49:30 +000067
68extern void arch_send_call_function_single_ipi(int cpu);
69extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
70
Mark Rutland9327e2c2013-10-24 20:30:18 +010071extern int __cpu_disable(void);
72
73extern void __cpu_die(unsigned int cpu);
74extern void cpu_die(void);
75
Catalin Marinas08e875c2012-03-05 11:49:30 +000076#endif /* ifndef __ASM_SMP_H */