smp.h 1.3 KB

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