Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *    Copyright IBM Corp. 1999, 2012
0004  *    Author(s): Denis Joseph Barrow,
0005  *       Martin Schwidefsky <schwidefsky@de.ibm.com>,
0006  */
0007 #ifndef __ASM_SMP_H
0008 #define __ASM_SMP_H
0009 
0010 #include <asm/sigp.h>
0011 #include <asm/lowcore.h>
0012 #include <asm/processor.h>
0013 
0014 #define raw_smp_processor_id()  (S390_lowcore.cpu_nr)
0015 
0016 extern struct mutex smp_cpu_state_mutex;
0017 extern unsigned int smp_cpu_mt_shift;
0018 extern unsigned int smp_cpu_mtid;
0019 extern __vector128 __initdata boot_cpu_vector_save_area[__NUM_VXRS];
0020 extern cpumask_t cpu_setup_mask;
0021 
0022 extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);
0023 
0024 extern void arch_send_call_function_single_ipi(int cpu);
0025 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
0026 
0027 extern void smp_call_online_cpu(void (*func)(void *), void *);
0028 extern void smp_call_ipl_cpu(void (*func)(void *), void *);
0029 extern void smp_emergency_stop(void);
0030 
0031 extern int smp_find_processor_id(u16 address);
0032 extern int smp_store_status(int cpu);
0033 extern void smp_save_dump_cpus(void);
0034 extern void smp_yield_cpu(int cpu);
0035 extern void smp_cpu_set_polarization(int cpu, int val);
0036 extern int smp_cpu_get_polarization(int cpu);
0037 extern int smp_cpu_get_cpu_address(int cpu);
0038 extern void smp_fill_possible_mask(void);
0039 extern void smp_detect_cpus(void);
0040 
0041 static inline void smp_stop_cpu(void)
0042 {
0043     u16 pcpu = stap();
0044 
0045     for (;;) {
0046         __pcpu_sigp(pcpu, SIGP_STOP, 0, NULL);
0047         cpu_relax();
0048     }
0049 }
0050 
0051 /* Return thread 0 CPU number as base CPU */
0052 static inline int smp_get_base_cpu(int cpu)
0053 {
0054     return cpu - (cpu % (smp_cpu_mtid + 1));
0055 }
0056 
0057 static inline void smp_cpus_done(unsigned int max_cpus)
0058 {
0059 }
0060 
0061 extern int smp_rescan_cpus(void);
0062 extern void __noreturn cpu_die(void);
0063 extern void __cpu_die(unsigned int cpu);
0064 extern int __cpu_disable(void);
0065 extern void schedule_mcck_handler(void);
0066 void notrace smp_yield_cpu(int cpu);
0067 
0068 #endif /* __ASM_SMP_H */