xref: /openbmc/linux/arch/arm/include/asm/smp.h (revision 4baa9922430662431231ac637adedddbb0cfb2d7)
1*4baa9922SRussell King /*
2*4baa9922SRussell King  *  arch/arm/include/asm/smp.h
3*4baa9922SRussell King  *
4*4baa9922SRussell King  *  Copyright (C) 2004-2005 ARM Ltd.
5*4baa9922SRussell King  *
6*4baa9922SRussell King  * This program is free software; you can redistribute it and/or modify
7*4baa9922SRussell King  * it under the terms of the GNU General Public License version 2 as
8*4baa9922SRussell King  * published by the Free Software Foundation.
9*4baa9922SRussell King  */
10*4baa9922SRussell King #ifndef __ASM_ARM_SMP_H
11*4baa9922SRussell King #define __ASM_ARM_SMP_H
12*4baa9922SRussell King 
13*4baa9922SRussell King #include <linux/threads.h>
14*4baa9922SRussell King #include <linux/cpumask.h>
15*4baa9922SRussell King #include <linux/thread_info.h>
16*4baa9922SRussell King 
17*4baa9922SRussell King #include <asm/arch/smp.h>
18*4baa9922SRussell King 
19*4baa9922SRussell King #ifndef CONFIG_SMP
20*4baa9922SRussell King # error "<asm/smp.h> included in non-SMP build"
21*4baa9922SRussell King #endif
22*4baa9922SRussell King 
23*4baa9922SRussell King #define raw_smp_processor_id() (current_thread_info()->cpu)
24*4baa9922SRussell King 
25*4baa9922SRussell King /*
26*4baa9922SRussell King  * at the moment, there's not a big penalty for changing CPUs
27*4baa9922SRussell King  * (the >big< penalty is running SMP in the first place)
28*4baa9922SRussell King  */
29*4baa9922SRussell King #define PROC_CHANGE_PENALTY		15
30*4baa9922SRussell King 
31*4baa9922SRussell King struct seq_file;
32*4baa9922SRussell King 
33*4baa9922SRussell King /*
34*4baa9922SRussell King  * generate IPI list text
35*4baa9922SRussell King  */
36*4baa9922SRussell King extern void show_ipi_list(struct seq_file *p);
37*4baa9922SRussell King 
38*4baa9922SRussell King /*
39*4baa9922SRussell King  * Called from assembly code, this handles an IPI.
40*4baa9922SRussell King  */
41*4baa9922SRussell King asmlinkage void do_IPI(struct pt_regs *regs);
42*4baa9922SRussell King 
43*4baa9922SRussell King /*
44*4baa9922SRussell King  * Setup the SMP cpu_possible_map
45*4baa9922SRussell King  */
46*4baa9922SRussell King extern void smp_init_cpus(void);
47*4baa9922SRussell King 
48*4baa9922SRussell King /*
49*4baa9922SRussell King  * Move global data into per-processor storage.
50*4baa9922SRussell King  */
51*4baa9922SRussell King extern void smp_store_cpu_info(unsigned int cpuid);
52*4baa9922SRussell King 
53*4baa9922SRussell King /*
54*4baa9922SRussell King  * Raise an IPI cross call on CPUs in callmap.
55*4baa9922SRussell King  */
56*4baa9922SRussell King extern void smp_cross_call(cpumask_t callmap);
57*4baa9922SRussell King 
58*4baa9922SRussell King /*
59*4baa9922SRussell King  * Broadcast a timer interrupt to the other CPUs.
60*4baa9922SRussell King  */
61*4baa9922SRussell King extern void smp_send_timer(void);
62*4baa9922SRussell King 
63*4baa9922SRussell King /*
64*4baa9922SRussell King  * Broadcast a clock event to other CPUs.
65*4baa9922SRussell King  */
66*4baa9922SRussell King extern void smp_timer_broadcast(cpumask_t mask);
67*4baa9922SRussell King 
68*4baa9922SRussell King /*
69*4baa9922SRussell King  * Boot a secondary CPU, and assign it the specified idle task.
70*4baa9922SRussell King  * This also gives us the initial stack to use for this CPU.
71*4baa9922SRussell King  */
72*4baa9922SRussell King extern int boot_secondary(unsigned int cpu, struct task_struct *);
73*4baa9922SRussell King 
74*4baa9922SRussell King /*
75*4baa9922SRussell King  * Called from platform specific assembly code, this is the
76*4baa9922SRussell King  * secondary CPU entry point.
77*4baa9922SRussell King  */
78*4baa9922SRussell King asmlinkage void secondary_start_kernel(void);
79*4baa9922SRussell King 
80*4baa9922SRussell King /*
81*4baa9922SRussell King  * Perform platform specific initialisation of the specified CPU.
82*4baa9922SRussell King  */
83*4baa9922SRussell King extern void platform_secondary_init(unsigned int cpu);
84*4baa9922SRussell King 
85*4baa9922SRussell King /*
86*4baa9922SRussell King  * Initial data for bringing up a secondary CPU.
87*4baa9922SRussell King  */
88*4baa9922SRussell King struct secondary_data {
89*4baa9922SRussell King 	unsigned long pgdir;
90*4baa9922SRussell King 	void *stack;
91*4baa9922SRussell King };
92*4baa9922SRussell King extern struct secondary_data secondary_data;
93*4baa9922SRussell King 
94*4baa9922SRussell King extern int __cpu_disable(void);
95*4baa9922SRussell King extern int mach_cpu_disable(unsigned int cpu);
96*4baa9922SRussell King 
97*4baa9922SRussell King extern void __cpu_die(unsigned int cpu);
98*4baa9922SRussell King extern void cpu_die(void);
99*4baa9922SRussell King 
100*4baa9922SRussell King extern void platform_cpu_die(unsigned int cpu);
101*4baa9922SRussell King extern int platform_cpu_kill(unsigned int cpu);
102*4baa9922SRussell King extern void platform_cpu_enable(unsigned int cpu);
103*4baa9922SRussell King 
104*4baa9922SRussell King extern void arch_send_call_function_single_ipi(int cpu);
105*4baa9922SRussell King extern void arch_send_call_function_ipi(cpumask_t mask);
106*4baa9922SRussell King 
107*4baa9922SRussell King /*
108*4baa9922SRussell King  * Local timer interrupt handling function (can be IPI'ed).
109*4baa9922SRussell King  */
110*4baa9922SRussell King extern void local_timer_interrupt(void);
111*4baa9922SRussell King 
112*4baa9922SRussell King #ifdef CONFIG_LOCAL_TIMERS
113*4baa9922SRussell King 
114*4baa9922SRussell King /*
115*4baa9922SRussell King  * Stop a local timer interrupt.
116*4baa9922SRussell King  */
117*4baa9922SRussell King extern void local_timer_stop(unsigned int cpu);
118*4baa9922SRussell King 
119*4baa9922SRussell King /*
120*4baa9922SRussell King  * Platform provides this to acknowledge a local timer IRQ
121*4baa9922SRussell King  */
122*4baa9922SRussell King extern int local_timer_ack(void);
123*4baa9922SRussell King 
124*4baa9922SRussell King #else
125*4baa9922SRussell King 
126*4baa9922SRussell King static inline void local_timer_stop(unsigned int cpu)
127*4baa9922SRussell King {
128*4baa9922SRussell King }
129*4baa9922SRussell King 
130*4baa9922SRussell King #endif
131*4baa9922SRussell King 
132*4baa9922SRussell King /*
133*4baa9922SRussell King  * Setup a local timer interrupt for a CPU.
134*4baa9922SRussell King  */
135*4baa9922SRussell King extern void local_timer_setup(unsigned int cpu);
136*4baa9922SRussell King 
137*4baa9922SRussell King /*
138*4baa9922SRussell King  * show local interrupt info
139*4baa9922SRussell King  */
140*4baa9922SRussell King extern void show_local_irqs(struct seq_file *);
141*4baa9922SRussell King 
142*4baa9922SRussell King /*
143*4baa9922SRussell King  * Called from assembly, this is the local timer IRQ handler
144*4baa9922SRussell King  */
145*4baa9922SRussell King asmlinkage void do_local_timer(struct pt_regs *);
146*4baa9922SRussell King 
147*4baa9922SRussell King #endif /* ifndef __ASM_ARM_SMP_H */
148