Lines Matching +full:cpu +full:- +full:nr

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * smp.h: PowerPC-specific SMP code.
9 * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
33 extern int cpu_to_chip_id(int cpu);
38 void (*message_pass)(int cpu, int msg);
40 void (*cause_ipi)(int cpu);
42 int (*cause_nmi_ipi)(int cpu);
44 int (*kick_cpu)(int nr);
45 int (*prepare_cpu)(int nr);
46 void (*setup_cpu)(int nr);
51 void (*cpu_die)(unsigned int nr);
52 int (*cpu_bootable)(unsigned int nr);
58 extern int smp_send_nmi_ipi(int cpu, void (*fn)(struct pt_regs *), u64 delay_us);
59 extern int smp_send_safe_nmi_ipi(int cpu, void (*fn)(struct pt_regs *), u64 delay_us);
69 void generic_cpu_die(unsigned int cpu);
70 void generic_set_cpu_dead(unsigned int cpu);
71 void generic_set_cpu_up(unsigned int cpu);
72 int generic_check_cpu_restart(unsigned int cpu);
73 int is_cpu_dead(unsigned int cpu);
79 #define raw_smp_processor_id() (local_paca->paca_index)
80 #define hard_smp_processor_id() (get_paca()->hw_cpu_id)
82 /* 32-bit */
87 * of task_struct here, but we need access to the CPU this task is running on.
89 * asm-offsets.h by kbuild to get the current processor ID.
91 * This also needs to be safeguarded when building asm-offsets.s because at
94 * when building something else than asm-offsets.s
103 static inline int get_hard_smp_processor_id(int cpu) in get_hard_smp_processor_id() argument
105 return smp_hw_index[cpu]; in get_hard_smp_processor_id()
108 static inline void set_hard_smp_processor_id(int cpu, int phys) in set_hard_smp_processor_id() argument
110 smp_hw_index[cpu] = phys; in set_hard_smp_processor_id()
119 static inline struct cpumask *cpu_sibling_mask(int cpu) in cpu_sibling_mask() argument
121 return per_cpu(cpu_sibling_map, cpu); in cpu_sibling_mask()
124 static inline struct cpumask *cpu_l2_cache_mask(int cpu) in cpu_l2_cache_mask() argument
126 return per_cpu(cpu_l2_cache_map, cpu); in cpu_l2_cache_mask()
129 static inline struct cpumask *cpu_smallcore_mask(int cpu) in cpu_smallcore_mask() argument
131 return per_cpu(cpu_smallcore_map, cpu); in cpu_smallcore_mask()
134 extern int cpu_to_core_id(int cpu);
140 static inline const struct cpumask *cpu_smt_mask(int cpu) in cpu_smt_mask() argument
143 return per_cpu(cpu_smallcore_map, cpu); in cpu_smt_mask()
145 return per_cpu(cpu_sibling_map, cpu); in cpu_smt_mask()
152 * in /proc/interrupts will be wrong!!! --Troy */
161 #define NMI_IPI_ALL_OTHERS -2
174 extern void smp_muxed_ipi_message_pass(int cpu, int msg);
175 extern void smp_muxed_ipi_set_message(int cpu, int msg);
184 extern void __cpu_die(unsigned int cpu);
192 static inline const struct cpumask *cpu_sibling_mask(int cpu) in cpu_sibling_mask() argument
194 return cpumask_of(cpu); in cpu_sibling_mask()
197 static inline const struct cpumask *cpu_smallcore_mask(int cpu) in cpu_smallcore_mask() argument
199 return cpumask_of(cpu); in cpu_smallcore_mask()
205 static inline int get_hard_smp_processor_id(int cpu) in get_hard_smp_processor_id() argument
207 return paca_ptrs[cpu]->hw_cpu_id; in get_hard_smp_processor_id()
210 static inline void set_hard_smp_processor_id(int cpu, int phys) in set_hard_smp_processor_id() argument
212 paca_ptrs[cpu]->hw_cpu_id = phys; in set_hard_smp_processor_id()
215 /* 32-bit */
218 static inline int get_hard_smp_processor_id(int cpu) in get_hard_smp_processor_id() argument
223 static inline void set_hard_smp_processor_id(int cpu, int phys) in set_hard_smp_processor_id() argument
239 extern void smp_mpic_setup_cpu(int cpu);
240 extern int smp_generic_kick_cpu(int nr);
241 extern int smp_generic_cpu_bootable(unsigned int nr);
249 extern void arch_send_call_function_single_ipi(int cpu);
252 /* Definitions relative to the secondary CPU spin loop
254 * 64-bit but defining them all here doesn't harm