x86: cleanup smp.h variants
[powerpc.git] / include / asm-x86 / topology_64.h
1 #ifndef _ASM_X86_64_TOPOLOGY_H
2 #define _ASM_X86_64_TOPOLOGY_H
3
4
5 #ifdef CONFIG_NUMA
6
7 #include <asm/mpspec.h>
8 #include <linux/bitops.h>
9
10 extern unsigned char cpu_to_node[];
11 extern cpumask_t     node_to_cpumask[];
12
13 #ifdef CONFIG_ACPI_NUMA
14 extern int __node_distance(int, int);
15 #define node_distance(a,b) __node_distance(a,b)
16 /* #else fallback version */
17 #endif
18
19 #define cpu_to_node(cpu)                (cpu_to_node[cpu])
20 #define parent_node(node)               (node)
21 #define node_to_first_cpu(node)         (first_cpu(node_to_cpumask[node]))
22 #define node_to_cpumask(node)           (node_to_cpumask[node])
23 #define pcibus_to_node(bus)     ((struct pci_sysdata *)((bus)->sysdata))->node
24 #define pcibus_to_cpumask(bus)          node_to_cpumask(pcibus_to_node(bus));
25
26 #define numa_node_id()                  read_pda(nodenumber)
27
28 /* sched_domains SD_NODE_INIT for x86_64 machines */
29 #define SD_NODE_INIT (struct sched_domain) {            \
30         .span                   = CPU_MASK_NONE,        \
31         .parent                 = NULL,                 \
32         .child                  = NULL,                 \
33         .groups                 = NULL,                 \
34         .min_interval           = 8,                    \
35         .max_interval           = 32,                   \
36         .busy_factor            = 32,                   \
37         .imbalance_pct          = 125,                  \
38         .cache_nice_tries       = 2,                    \
39         .busy_idx               = 3,                    \
40         .idle_idx               = 2,                    \
41         .newidle_idx            = 0,                    \
42         .wake_idx               = 1,                    \
43         .forkexec_idx           = 1,                    \
44         .flags                  = SD_LOAD_BALANCE       \
45                                 | SD_BALANCE_FORK       \
46                                 | SD_BALANCE_EXEC       \
47                                 | SD_SERIALIZE          \
48                                 | SD_WAKE_BALANCE,      \
49         .last_balance           = jiffies,              \
50         .balance_interval       = 1,                    \
51         .nr_balance_failed      = 0,                    \
52 }
53
54 #endif
55
56 #ifdef CONFIG_SMP
57 #define topology_physical_package_id(cpu)       (cpu_data(cpu).phys_proc_id)
58 #define topology_core_id(cpu)                   (cpu_data(cpu).cpu_core_id)
59 #define topology_core_siblings(cpu)             (per_cpu(cpu_core_map, cpu))
60 #define topology_thread_siblings(cpu)           (per_cpu(cpu_sibling_map, cpu))
61 #define mc_capable()                    (boot_cpu_data.x86_max_cores > 1)
62 #define smt_capable()                   (smp_num_siblings > 1)
63 #endif
64
65 #include <asm-generic/topology.h>
66
67 extern cpumask_t cpu_coregroup_map(int cpu);
68
69 #endif