Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ASM_SMP_H
0003 #define __ASM_SMP_H
0004 
0005 #include <linux/threads.h>
0006 #include <linux/cpumask.h>
0007 #include <linux/bitops.h>
0008 #include <asm/pal.h>
0009 
0010 /* HACK: Cabrio WHAMI return value is bogus if more than 8 bits used.. :-( */
0011 
0012 static __inline__ unsigned char
0013 __hard_smp_processor_id(void)
0014 {
0015     register unsigned char __r0 __asm__("$0");
0016     __asm__ __volatile__(
0017         "call_pal %1 #whami"
0018         : "=r"(__r0)
0019         :"i" (PAL_whami)
0020         : "$1", "$22", "$23", "$24", "$25");
0021     return __r0;
0022 }
0023 
0024 #ifdef CONFIG_SMP
0025 
0026 #include <asm/irq.h>
0027 
0028 struct cpuinfo_alpha {
0029     unsigned long loops_per_jiffy;
0030     unsigned long last_asn;
0031     int need_new_asn;
0032     int asn_lock;
0033     unsigned long ipi_count;
0034     unsigned long prof_multiplier;
0035     unsigned long prof_counter;
0036     unsigned char mcheck_expected;
0037     unsigned char mcheck_taken;
0038     unsigned char mcheck_extra;
0039 } __attribute__((aligned(64)));
0040 
0041 extern struct cpuinfo_alpha cpu_data[NR_CPUS];
0042 
0043 #define hard_smp_processor_id() __hard_smp_processor_id()
0044 #define raw_smp_processor_id()  (current_thread_info()->cpu)
0045 
0046 extern int smp_num_cpus;
0047 
0048 extern void arch_send_call_function_single_ipi(int cpu);
0049 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
0050 
0051 #else /* CONFIG_SMP */
0052 
0053 #define hard_smp_processor_id()     0
0054 #define smp_call_function_on_cpu(func,info,wait,cpu)    ({ 0; })
0055 
0056 #endif /* CONFIG_SMP */
0057 
0058 #define NO_PROC_ID  (-1)
0059 
0060 #endif