linux/arch/s390/include/asm/smp.h
<<
>>
Prefs
   1/*
   2 *    Copyright IBM Corp. 1999, 2012
   3 *    Author(s): Denis Joseph Barrow,
   4 *               Martin Schwidefsky <schwidefsky@de.ibm.com>,
   5 *               Heiko Carstens <heiko.carstens@de.ibm.com>,
   6 */
   7#ifndef __ASM_SMP_H
   8#define __ASM_SMP_H
   9
  10#ifdef CONFIG_SMP
  11
  12#include <asm/lowcore.h>
  13
  14#define raw_smp_processor_id()  (S390_lowcore.cpu_nr)
  15
  16extern struct mutex smp_cpu_state_mutex;
  17extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
  18
  19extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);
  20
  21extern void arch_send_call_function_single_ipi(int cpu);
  22extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  23
  24extern void smp_call_online_cpu(void (*func)(void *), void *);
  25extern void smp_call_ipl_cpu(void (*func)(void *), void *);
  26
  27extern int smp_find_processor_id(u16 address);
  28extern int smp_store_status(int cpu);
  29extern int smp_vcpu_scheduled(int cpu);
  30extern void smp_yield_cpu(int cpu);
  31extern void smp_yield(void);
  32extern void smp_stop_cpu(void);
  33extern void smp_cpu_set_polarization(int cpu, int val);
  34extern int smp_cpu_get_polarization(int cpu);
  35
  36#else /* CONFIG_SMP */
  37
  38static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
  39{
  40        func(data);
  41}
  42
  43static inline void smp_call_online_cpu(void (*func)(void *), void *data)
  44{
  45        func(data);
  46}
  47
  48static inline int smp_find_processor_id(u16 address) { return 0; }
  49static inline int smp_store_status(int cpu) { return 0; }
  50static inline int smp_vcpu_scheduled(int cpu) { return 1; }
  51static inline void smp_yield_cpu(int cpu) { }
  52static inline void smp_yield(void) { }
  53static inline void smp_stop_cpu(void) { }
  54
  55#endif /* CONFIG_SMP */
  56
  57#ifdef CONFIG_HOTPLUG_CPU
  58extern int smp_rescan_cpus(void);
  59extern void __noreturn cpu_die(void);
  60extern void __cpu_die(unsigned int cpu);
  61extern int __cpu_disable(void);
  62#else
  63static inline int smp_rescan_cpus(void) { return 0; }
  64static inline void cpu_die(void) { }
  65#endif
  66
  67#endif /* __ASM_SMP_H */
  68