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 174baa9922SRussell King #ifndef CONFIG_SMP 184baa9922SRussell King # error "<asm/smp.h> included in non-SMP build" 194baa9922SRussell King #endif 204baa9922SRussell King 214baa9922SRussell King #define raw_smp_processor_id() (current_thread_info()->cpu) 224baa9922SRussell King 234baa9922SRussell King /* 244baa9922SRussell King * at the moment, there's not a big penalty for changing CPUs 254baa9922SRussell King * (the >big< penalty is running SMP in the first place) 264baa9922SRussell King */ 274baa9922SRussell King #define PROC_CHANGE_PENALTY 15 284baa9922SRussell King 294baa9922SRussell King struct seq_file; 304baa9922SRussell King 314baa9922SRussell King /* 324baa9922SRussell King * generate IPI list text 334baa9922SRussell King */ 34f13cd417SRussell King extern void show_ipi_list(struct seq_file *, int); 354baa9922SRussell King 364baa9922SRussell King /* 374baa9922SRussell King * Called from assembly code, this handles an IPI. 384baa9922SRussell King */ 39ad3b6993SRussell King asmlinkage void do_IPI(int ipinr, struct pt_regs *regs); 404baa9922SRussell King 414baa9922SRussell King /* 42e03cdadeSRussell King * Setup the set of possible CPUs (via set_cpu_possible) 434baa9922SRussell King */ 444baa9922SRussell King extern void smp_init_cpus(void); 454baa9922SRussell King 464baa9922SRussell King 474baa9922SRussell King /* 48*0f7b332fSRussell King * Provide a function to raise an IPI cross call on CPUs in callmap. 494baa9922SRussell King */ 50*0f7b332fSRussell King extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int)); 514baa9922SRussell King 524baa9922SRussell King /* 534baa9922SRussell King * Boot a secondary CPU, and assign it the specified idle task. 544baa9922SRussell King * This also gives us the initial stack to use for this CPU. 554baa9922SRussell King */ 564baa9922SRussell King extern int boot_secondary(unsigned int cpu, struct task_struct *); 574baa9922SRussell King 584baa9922SRussell King /* 594baa9922SRussell King * Called from platform specific assembly code, this is the 604baa9922SRussell King * secondary CPU entry point. 614baa9922SRussell King */ 624baa9922SRussell King asmlinkage void secondary_start_kernel(void); 634baa9922SRussell King 644baa9922SRussell King /* 654baa9922SRussell King * Perform platform specific initialisation of the specified CPU. 664baa9922SRussell King */ 674baa9922SRussell King extern void platform_secondary_init(unsigned int cpu); 684baa9922SRussell King 694baa9922SRussell King /* 7005c74a6cSRussell King * Initialize cpu_possible map, and enable coherency 7105c74a6cSRussell King */ 7205c74a6cSRussell King extern void platform_smp_prepare_cpus(unsigned int); 7305c74a6cSRussell King 7405c74a6cSRussell King /* 754baa9922SRussell King * Initial data for bringing up a secondary CPU. 764baa9922SRussell King */ 774baa9922SRussell King struct secondary_data { 784baa9922SRussell King unsigned long pgdir; 794baa9922SRussell King void *stack; 804baa9922SRussell King }; 814baa9922SRussell King extern struct secondary_data secondary_data; 824baa9922SRussell King 834baa9922SRussell King extern int __cpu_disable(void); 848e2a43f5SRussell King extern int platform_cpu_disable(unsigned int cpu); 854baa9922SRussell King 864baa9922SRussell King extern void __cpu_die(unsigned int cpu); 874baa9922SRussell King extern void cpu_die(void); 884baa9922SRussell King 894baa9922SRussell King extern void platform_cpu_die(unsigned int cpu); 904baa9922SRussell King extern int platform_cpu_kill(unsigned int cpu); 914baa9922SRussell King extern void platform_cpu_enable(unsigned int cpu); 924baa9922SRussell King 934baa9922SRussell King extern void arch_send_call_function_single_ipi(int cpu); 9482668104SRussell King extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 954baa9922SRussell King 964baa9922SRussell King /* 974baa9922SRussell King * show local interrupt info 984baa9922SRussell King */ 99f13cd417SRussell King extern void show_local_irqs(struct seq_file *, int); 1004baa9922SRussell King 1014baa9922SRussell King #endif /* ifndef __ASM_ARM_SMP_H */ 102