xref: /openbmc/linux/arch/parisc/include/asm/smp.h (revision b24413180f5600bcb3bb70fbed5cf186b60864bd)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2deae26bfSKyle McMartin #ifndef __ASM_SMP_H
3deae26bfSKyle McMartin #define __ASM_SMP_H
4deae26bfSKyle McMartin 
5a7e6601fSHelge Deller extern int init_per_cpu(int cpuid);
6deae26bfSKyle McMartin 
7deae26bfSKyle McMartin #if defined(CONFIG_SMP)
8deae26bfSKyle McMartin 
9deae26bfSKyle McMartin /* Page Zero Location PDC will look for the address to branch to when we poke
10deae26bfSKyle McMartin ** slave CPUs still in "Icache loop".
11deae26bfSKyle McMartin */
12deae26bfSKyle McMartin #define PDC_OS_BOOT_RENDEZVOUS     0x10
13deae26bfSKyle McMartin #define PDC_OS_BOOT_RENDEZVOUS_HI  0x28
14deae26bfSKyle McMartin 
15deae26bfSKyle McMartin #ifndef ASSEMBLY
16deae26bfSKyle McMartin #include <linux/bitops.h>
17deae26bfSKyle McMartin #include <linux/threads.h>	/* for NR_CPUS */
18deae26bfSKyle McMartin #include <linux/cpumask.h>
19deae26bfSKyle McMartin typedef unsigned long address_t;
20deae26bfSKyle McMartin 
21deae26bfSKyle McMartin 
22deae26bfSKyle McMartin /*
23deae26bfSKyle McMartin  *	Private routines/data
24deae26bfSKyle McMartin  *
25deae26bfSKyle McMartin  *	physical and logical are equivalent until we support CPU hotplug.
26deae26bfSKyle McMartin  */
27deae26bfSKyle McMartin #define cpu_number_map(cpu)	(cpu)
28deae26bfSKyle McMartin #define cpu_logical_map(cpu)	(cpu)
29deae26bfSKyle McMartin 
30deae26bfSKyle McMartin extern void smp_send_all_nop(void);
31deae26bfSKyle McMartin 
32deae26bfSKyle McMartin extern void arch_send_call_function_single_ipi(int cpu);
3391887a36SRusty Russell extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
34deae26bfSKyle McMartin 
35deae26bfSKyle McMartin #endif /* !ASSEMBLY */
36deae26bfSKyle McMartin 
37deae26bfSKyle McMartin #define raw_smp_processor_id()	(current_thread_info()->cpu)
38deae26bfSKyle McMartin 
39deae26bfSKyle McMartin #else /* CONFIG_SMP */
40deae26bfSKyle McMartin 
41deae26bfSKyle McMartin static inline void smp_send_all_nop(void) { return; }
42deae26bfSKyle McMartin 
43deae26bfSKyle McMartin #endif
44deae26bfSKyle McMartin 
45deae26bfSKyle McMartin #define NO_PROC_ID		0xFF		/* No processor magic marker */
46deae26bfSKyle McMartin #define ANY_PROC_ID		0xFF		/* Any processor magic marker */
47deae26bfSKyle McMartin static inline int __cpu_disable (void) {
48deae26bfSKyle McMartin   return 0;
49deae26bfSKyle McMartin }
50deae26bfSKyle McMartin static inline void __cpu_die (unsigned int cpu) {
51deae26bfSKyle McMartin   while(1)
52deae26bfSKyle McMartin     ;
53deae26bfSKyle McMartin }
54deae26bfSKyle McMartin 
55deae26bfSKyle McMartin #endif /*  __ASM_SMP_H */
56