topology.h 918 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _ASM_ALPHA_TOPOLOGY_H
  2. #define _ASM_ALPHA_TOPOLOGY_H
  3. #include <linux/smp.h>
  4. #include <linux/threads.h>
  5. #include <asm/machvec.h>
  6. #ifdef CONFIG_NUMA
  7. static inline int cpu_to_node(int cpu)
  8. {
  9. int node;
  10. if (!alpha_mv.cpuid_to_nid)
  11. return 0;
  12. node = alpha_mv.cpuid_to_nid(cpu);
  13. #ifdef DEBUG_NUMA
  14. BUG_ON(node < 0);
  15. #endif
  16. return node;
  17. }
  18. extern struct cpumask node_to_cpumask_map[];
  19. /* FIXME: This is dumb, recalculating every time. But simple. */
  20. static const struct cpumask *cpumask_of_node(int node)
  21. {
  22. int cpu;
  23. if (node == -1)
  24. return cpu_all_mask;
  25. cpumask_clear(&node_to_cpumask_map[node]);
  26. for_each_online_cpu(cpu) {
  27. if (cpu_to_node(cpu) == node)
  28. cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
  29. }
  30. return &node_to_cpumask_map[node];
  31. }
  32. #define cpumask_of_pcibus(bus) (cpu_online_mask)
  33. #endif /* !CONFIG_NUMA */
  34. # include <asm-generic/topology.h>
  35. #endif /* _ASM_ALPHA_TOPOLOGY_H */