xref: /openbmc/linux/arch/arm/include/asm/smp.h (revision 826681043d7184b4d650cab5b007b9a86b628eb5)
14baa9922SRussell King /*
24baa9922SRussell King  *  arch/arm/include/asm/smp.h
34baa9922SRussell King  *
44baa9922SRussell King  *  Copyright (C) 2004-2005 ARM Ltd.
54baa9922SRussell King  *
64baa9922SRussell King  * This program is free software; you can redistribute it and/or modify
74baa9922SRussell King  * it under the terms of the GNU General Public License version 2 as
84baa9922SRussell King  * published by the Free Software Foundation.
94baa9922SRussell King  */
104baa9922SRussell King #ifndef __ASM_ARM_SMP_H
114baa9922SRussell King #define __ASM_ARM_SMP_H
124baa9922SRussell King 
134baa9922SRussell King #include <linux/threads.h>
144baa9922SRussell King #include <linux/cpumask.h>
154baa9922SRussell King #include <linux/thread_info.h>
164baa9922SRussell King 
17a09e64fbSRussell King #include <mach/smp.h>
184baa9922SRussell King 
194baa9922SRussell King #ifndef CONFIG_SMP
204baa9922SRussell King # error "<asm/smp.h> included in non-SMP build"
214baa9922SRussell King #endif
224baa9922SRussell King 
234baa9922SRussell King #define raw_smp_processor_id() (current_thread_info()->cpu)
244baa9922SRussell King 
254baa9922SRussell King /*
264baa9922SRussell King  * at the moment, there's not a big penalty for changing CPUs
274baa9922SRussell King  * (the >big< penalty is running SMP in the first place)
284baa9922SRussell King  */
294baa9922SRussell King #define PROC_CHANGE_PENALTY		15
304baa9922SRussell King 
314baa9922SRussell King struct seq_file;
324baa9922SRussell King 
334baa9922SRussell King /*
344baa9922SRussell King  * generate IPI list text
354baa9922SRussell King  */
364baa9922SRussell King extern void show_ipi_list(struct seq_file *p);
374baa9922SRussell King 
384baa9922SRussell King /*
394baa9922SRussell King  * Called from assembly code, this handles an IPI.
404baa9922SRussell King  */
414baa9922SRussell King asmlinkage void do_IPI(struct pt_regs *regs);
424baa9922SRussell King 
434baa9922SRussell King /*
444baa9922SRussell King  * Setup the SMP cpu_possible_map
454baa9922SRussell King  */
464baa9922SRussell King extern void smp_init_cpus(void);
474baa9922SRussell King 
484baa9922SRussell King /*
494baa9922SRussell King  * Move global data into per-processor storage.
504baa9922SRussell King  */
514baa9922SRussell King extern void smp_store_cpu_info(unsigned int cpuid);
524baa9922SRussell King 
534baa9922SRussell King /*
544baa9922SRussell King  * Raise an IPI cross call on CPUs in callmap.
554baa9922SRussell King  */
56*82668104SRussell King extern void smp_cross_call(const struct cpumask *mask);
574baa9922SRussell King 
584baa9922SRussell King /*
594baa9922SRussell King  * Broadcast a clock event to other CPUs.
604baa9922SRussell King  */
61*82668104SRussell King extern void smp_timer_broadcast(const struct cpumask *mask);
624baa9922SRussell King 
634baa9922SRussell King /*
644baa9922SRussell King  * Boot a secondary CPU, and assign it the specified idle task.
654baa9922SRussell King  * This also gives us the initial stack to use for this CPU.
664baa9922SRussell King  */
674baa9922SRussell King extern int boot_secondary(unsigned int cpu, struct task_struct *);
684baa9922SRussell King 
694baa9922SRussell King /*
704baa9922SRussell King  * Called from platform specific assembly code, this is the
714baa9922SRussell King  * secondary CPU entry point.
724baa9922SRussell King  */
734baa9922SRussell King asmlinkage void secondary_start_kernel(void);
744baa9922SRussell King 
754baa9922SRussell King /*
764baa9922SRussell King  * Perform platform specific initialisation of the specified CPU.
774baa9922SRussell King  */
784baa9922SRussell King extern void platform_secondary_init(unsigned int cpu);
794baa9922SRussell King 
804baa9922SRussell King /*
814baa9922SRussell King  * Initial data for bringing up a secondary CPU.
824baa9922SRussell King  */
834baa9922SRussell King struct secondary_data {
844baa9922SRussell King 	unsigned long pgdir;
854baa9922SRussell King 	void *stack;
864baa9922SRussell King };
874baa9922SRussell King extern struct secondary_data secondary_data;
884baa9922SRussell King 
894baa9922SRussell King extern int __cpu_disable(void);
904baa9922SRussell King extern int mach_cpu_disable(unsigned int cpu);
914baa9922SRussell King 
924baa9922SRussell King extern void __cpu_die(unsigned int cpu);
934baa9922SRussell King extern void cpu_die(void);
944baa9922SRussell King 
954baa9922SRussell King extern void platform_cpu_die(unsigned int cpu);
964baa9922SRussell King extern int platform_cpu_kill(unsigned int cpu);
974baa9922SRussell King extern void platform_cpu_enable(unsigned int cpu);
984baa9922SRussell King 
994baa9922SRussell King extern void arch_send_call_function_single_ipi(int cpu);
100*82668104SRussell King extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
101*82668104SRussell King #define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask
1024baa9922SRussell King 
1034baa9922SRussell King /*
1044baa9922SRussell King  * Local timer interrupt handling function (can be IPI'ed).
1054baa9922SRussell King  */
1064baa9922SRussell King extern void local_timer_interrupt(void);
1074baa9922SRussell King 
1084baa9922SRussell King #ifdef CONFIG_LOCAL_TIMERS
1094baa9922SRussell King 
1104baa9922SRussell King /*
1114baa9922SRussell King  * Stop a local timer interrupt.
1124baa9922SRussell King  */
113ebac6546SCatalin Marinas extern void local_timer_stop(void);
1144baa9922SRussell King 
1154baa9922SRussell King /*
1164baa9922SRussell King  * Platform provides this to acknowledge a local timer IRQ
1174baa9922SRussell King  */
1184baa9922SRussell King extern int local_timer_ack(void);
1194baa9922SRussell King 
1204baa9922SRussell King #else
1214baa9922SRussell King 
122ebac6546SCatalin Marinas static inline void local_timer_stop(void)
1234baa9922SRussell King {
1244baa9922SRussell King }
1254baa9922SRussell King 
1264baa9922SRussell King #endif
1274baa9922SRussell King 
1284baa9922SRussell King /*
1294baa9922SRussell King  * Setup a local timer interrupt for a CPU.
1304baa9922SRussell King  */
131ebac6546SCatalin Marinas extern void local_timer_setup(void);
1324baa9922SRussell King 
1334baa9922SRussell King /*
1344baa9922SRussell King  * show local interrupt info
1354baa9922SRussell King  */
1364baa9922SRussell King extern void show_local_irqs(struct seq_file *);
1374baa9922SRussell King 
1384baa9922SRussell King /*
1394baa9922SRussell King  * Called from assembly, this is the local timer IRQ handler
1404baa9922SRussell King  */
1414baa9922SRussell King asmlinkage void do_local_timer(struct pt_regs *);
1424baa9922SRussell King 
1434baa9922SRussell King #endif /* ifndef __ASM_ARM_SMP_H */
144