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

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

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright (C) 2012 Regents of the University of California
  4  */
  5 
  6 #ifndef _ASM_RISCV_SMP_H
  7 #define _ASM_RISCV_SMP_H
  8 
  9 #include <linux/cpumask.h>
 10 #include <linux/irqreturn.h>
 11 #include <linux/thread_info.h>
 12 
 13 #define INVALID_HARTID ULONG_MAX
 14 
 15 struct seq_file;
 16 extern unsigned long boot_cpu_hartid;
 17 
 18 #ifdef CONFIG_SMP
 19 
 20 #include <linux/jump_label.h>
 21 
 22 /*
 23  * Mapping between linux logical cpu index and hartid.
 24  */
 25 extern unsigned long __cpuid_to_hartid_map[NR_CPUS];
 26 #define cpuid_to_hartid_map(cpu)    __cpuid_to_hartid_map[cpu]
 27 
 28 /* print IPI stats */
 29 void show_ipi_stats(struct seq_file *p, int prec);
 30 
 31 /* SMP initialization hook for setup_arch */
 32 void __init setup_smp(void);
 33 
 34 /* Hook for the generic smp_call_function_many() routine. */
 35 void arch_send_call_function_ipi_mask(struct cpumask *mask);
 36 
 37 /* Hook for the generic smp_call_function_single() routine. */
 38 void arch_send_call_function_single_ipi(int cpu);
 39 
 40 int riscv_hartid_to_cpuid(unsigned long hartid);
 41 
 42 /* Enable IPI for CPU hotplug */
 43 void riscv_ipi_enable(void);
 44 
 45 /* Disable IPI for CPU hotplug */
 46 void riscv_ipi_disable(void);
 47 
 48 /* Check if IPI interrupt numbers are available */
 49 bool riscv_ipi_have_virq_range(void);
 50 
 51 /* Set the IPI interrupt numbers for arch (called by irqchip drivers) */
 52 void riscv_ipi_set_virq_range(int virq, int nr);
 53 
 54 /* Check other CPUs stop or not */
 55 bool smp_crash_stop_failed(void);
 56 
 57 /* Secondary hart entry */
 58 asmlinkage void smp_callin(void);
 59 
 60 /*
 61  * Obtains the hart ID of the currently executing task.  This relies on
 62  * THREAD_INFO_IN_TASK, but we define that unconditionally.
 63  */
 64 #define raw_smp_processor_id() (current_thread_info()->cpu)
 65 
 66 #if defined CONFIG_HOTPLUG_CPU
 67 int __cpu_disable(void);
 68 static inline void __cpu_die(unsigned int cpu) { }
 69 #endif /* CONFIG_HOTPLUG_CPU */
 70 
 71 #else
 72 
 73 static inline void show_ipi_stats(struct seq_file *p, int prec)
 74 {
 75 }
 76 
 77 static inline int riscv_hartid_to_cpuid(unsigned long hartid)
 78 {
 79         if (hartid == boot_cpu_hartid)
 80                 return 0;
 81 
 82         return -1;
 83 }
 84 static inline unsigned long cpuid_to_hartid_map(int cpu)
 85 {
 86         return boot_cpu_hartid;
 87 }
 88 
 89 static inline void riscv_ipi_enable(void)
 90 {
 91 }
 92 
 93 static inline void riscv_ipi_disable(void)
 94 {
 95 }
 96 
 97 static inline bool riscv_ipi_have_virq_range(void)
 98 {
 99         return false;
100 }
101 
102 static inline void riscv_ipi_set_virq_range(int virq, int nr)
103 {
104 }
105 
106 #endif /* CONFIG_SMP */
107 
108 #if defined(CONFIG_HOTPLUG_CPU) && (CONFIG_SMP)
109 bool cpu_has_hotplug(unsigned int cpu);
110 #else
111 static inline bool cpu_has_hotplug(unsigned int cpu)
112 {
113         return false;
114 }
115 #endif
116 
117 #endif /* _ASM_RISCV_SMP_H */
118 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php