~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/include/asm/smp.h

Version: ~ [ linux-5.16 ] ~ [ linux-5.15.13 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.90 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.170 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.224 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.261 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.296 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.298 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __ASM_SH_SMP_H
  3 #define __ASM_SH_SMP_H
  4 
  5 #include <linux/bitops.h>
  6 #include <linux/cpumask.h>
  7 #include <asm/smp-ops.h>
  8 
  9 #ifdef CONFIG_SMP
 10 
 11 #include <linux/atomic.h>
 12 #include <asm/current.h>
 13 #include <asm/percpu.h>
 14 
 15 #define raw_smp_processor_id()  (current_thread_info()->cpu)
 16 
 17 /* Map from cpu id to sequential logical cpu number. */
 18 extern int __cpu_number_map[NR_CPUS];
 19 #define cpu_number_map(cpu)  __cpu_number_map[cpu]
 20 
 21 /* The reverse map from sequential logical cpu number to cpu id.  */
 22 extern int __cpu_logical_map[NR_CPUS];
 23 #define cpu_logical_map(cpu)  __cpu_logical_map[cpu]
 24 
 25 enum {
 26         SMP_MSG_FUNCTION,
 27         SMP_MSG_RESCHEDULE,
 28         SMP_MSG_FUNCTION_SINGLE,
 29         SMP_MSG_TIMER,
 30 
 31         SMP_MSG_NR,     /* must be last */
 32 };
 33 
 34 DECLARE_PER_CPU(int, cpu_state);
 35 
 36 void smp_message_recv(unsigned int msg);
 37 
 38 void arch_send_call_function_single_ipi(int cpu);
 39 void arch_send_call_function_ipi_mask(const struct cpumask *mask);
 40 
 41 void native_play_dead(void);
 42 void native_cpu_die(unsigned int cpu);
 43 int native_cpu_disable(unsigned int cpu);
 44 
 45 #ifdef CONFIG_HOTPLUG_CPU
 46 void play_dead_common(void);
 47 extern int __cpu_disable(void);
 48 
 49 static inline void __cpu_die(unsigned int cpu)
 50 {
 51         extern struct plat_smp_ops *mp_ops;     /* private */
 52 
 53         mp_ops->cpu_die(cpu);
 54 }
 55 #endif
 56 
 57 static inline int hard_smp_processor_id(void)
 58 {
 59         extern struct plat_smp_ops *mp_ops;     /* private */
 60 
 61         if (!mp_ops)
 62                 return 0;       /* boot CPU */
 63 
 64         return mp_ops->smp_processor_id();
 65 }
 66 
 67 struct of_cpu_method {
 68         const char *method;
 69         struct plat_smp_ops *ops;
 70 };
 71 
 72 #define CPU_METHOD_OF_DECLARE(name, _method, _ops)                      \
 73         static const struct of_cpu_method __cpu_method_of_table_##name  \
 74                 __used __section("__cpu_method_of_table")               \
 75                 = { .method = _method, .ops = _ops }
 76 
 77 #else
 78 
 79 #define hard_smp_processor_id() (0)
 80 
 81 #endif /* CONFIG_SMP */
 82 
 83 #endif /* __ASM_SH_SMP_H */
 84 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp