smp.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_SMP_H
  3. #define __ASM_SMP_H
  4. #include <linux/threads.h>
  5. #include <linux/cpumask.h>
  6. #include <linux/bitops.h>
  7. #include <asm/pal.h>
  8. /* HACK: Cabrio WHAMI return value is bogus if more than 8 bits used.. :-( */
  9. static __inline__ unsigned char
  10. __hard_smp_processor_id(void)
  11. {
  12. register unsigned char __r0 __asm__("$0");
  13. __asm__ __volatile__(
  14. "call_pal %1 #whami"
  15. : "=r"(__r0)
  16. :"i" (PAL_whami)
  17. : "$1", "$22", "$23", "$24", "$25");
  18. return __r0;
  19. }
  20. #ifdef CONFIG_SMP
  21. #include <asm/irq.h>
  22. struct cpuinfo_alpha {
  23. unsigned long loops_per_jiffy;
  24. unsigned long last_asn;
  25. int need_new_asn;
  26. int asn_lock;
  27. unsigned long ipi_count;
  28. unsigned long prof_multiplier;
  29. unsigned long prof_counter;
  30. unsigned char mcheck_expected;
  31. unsigned char mcheck_taken;
  32. unsigned char mcheck_extra;
  33. } __attribute__((aligned(64)));
  34. extern struct cpuinfo_alpha cpu_data[NR_CPUS];
  35. #define hard_smp_processor_id() __hard_smp_processor_id()
  36. #define raw_smp_processor_id() (current_thread_info()->cpu)
  37. extern int smp_num_cpus;
  38. extern void arch_send_call_function_single_ipi(int cpu);
  39. extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  40. #else /* CONFIG_SMP */
  41. #define hard_smp_processor_id() 0
  42. #define smp_call_function_on_cpu(func,info,wait,cpu) ({ 0; })
  43. #endif /* CONFIG_SMP */
  44. #define NO_PROC_ID (-1)
  45. #endif