aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/topology_32.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/topology_32.h')
-rw-r--r--include/asm-x86/topology_32.h55
1 files changed, 26 insertions, 29 deletions
diff --git a/include/asm-x86/topology_32.h b/include/asm-x86/topology_32.h
index e28dbdcc5670..35b00067587d 100644
--- a/include/asm-x86/topology_32.h
+++ b/include/asm-x86/topology_32.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2002, IBM Corp. 4 * Copyright (C) 2002, IBM Corp.
5 * 5 *
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -22,34 +22,27 @@
22 * 22 *
23 * Send feedback to <colpatch@us.ibm.com> 23 * Send feedback to <colpatch@us.ibm.com>
24 */ 24 */
25#ifndef _ASM_I386_TOPOLOGY_H 25#ifndef _ASM_X86_TOPOLOGY_H
26#define _ASM_I386_TOPOLOGY_H 26#define _ASM_X86_TOPOLOGY_H
27
28#ifdef CONFIG_X86_HT
29#define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id)
30#define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id)
31#define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu))
32#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
33#endif
34 27
35#ifdef CONFIG_NUMA 28#ifdef CONFIG_NUMA
36
37#include <asm/mpspec.h>
38
39#include <linux/cpumask.h> 29#include <linux/cpumask.h>
30#include <asm/mpspec.h>
40 31
41/* Mappings between logical cpu number and node number */ 32/* Mappings between logical cpu number and node number */
42extern cpumask_t node_to_cpumask_map[];
43extern int cpu_to_node_map[]; 33extern int cpu_to_node_map[];
34extern cpumask_t node_to_cpumask_map[];
44 35
45/* Returns the number of the node containing CPU 'cpu' */ 36/* Returns the number of the node containing CPU 'cpu' */
46static inline int cpu_to_node(int cpu) 37static inline int cpu_to_node(int cpu)
47{ 38{
48 return cpu_to_node_map[cpu]; 39 return cpu_to_node_map[cpu];
49} 40}
50 41
51/* Returns the number of the node containing Node 'node'. This architecture is flat, 42/*
52 so it is a pretty simple function! */ 43 * Returns the number of the node containing Node 'node'. This
44 * architecture is flat, so it is a pretty simple function!
45 */
53#define parent_node(node) (node) 46#define parent_node(node) (node)
54 47
55/* Returns a bitmask of CPUs on Node 'node'. */ 48/* Returns a bitmask of CPUs on Node 'node'. */
@@ -60,13 +53,14 @@ static inline cpumask_t node_to_cpumask(int node)
60 53
61/* Returns the number of the first CPU on Node 'node'. */ 54/* Returns the number of the first CPU on Node 'node'. */
62static inline int node_to_first_cpu(int node) 55static inline int node_to_first_cpu(int node)
63{ 56{
64 cpumask_t mask = node_to_cpumask(node); 57 cpumask_t mask = node_to_cpumask(node);
58
65 return first_cpu(mask); 59 return first_cpu(mask);
66} 60}
67 61
68#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node 62#define pcibus_to_node(bus) __pcibus_to_node(bus)
69#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)) 63#define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus)
70 64
71/* sched_domains SD_NODE_INIT for NUMAQ machines */ 65/* sched_domains SD_NODE_INIT for NUMAQ machines */
72#define SD_NODE_INIT (struct sched_domain) { \ 66#define SD_NODE_INIT (struct sched_domain) { \
@@ -99,21 +93,24 @@ extern unsigned long node_remap_size[];
99 93
100#define node_has_online_mem(nid) (node_start_pfn[nid] != node_end_pfn[nid]) 94#define node_has_online_mem(nid) (node_start_pfn[nid] != node_end_pfn[nid])
101 95
102#else /* !CONFIG_NUMA */ 96#else /* CONFIG_NUMA */
103/*
104 * Other i386 platforms should define their own version of the
105 * above macros here.
106 */
107 97
108#include <asm-generic/topology.h> 98#include <asm-generic/topology.h>
109 99
110#endif /* CONFIG_NUMA */ 100#endif
111 101
112extern cpumask_t cpu_coregroup_map(int cpu); 102extern cpumask_t cpu_coregroup_map(int cpu);
113 103
104#ifdef CONFIG_X86_HT
105#define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id)
106#define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id)
107#define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu))
108#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
109#endif
110
114#ifdef CONFIG_SMP 111#ifdef CONFIG_SMP
115#define mc_capable() (boot_cpu_data.x86_max_cores > 1) 112#define mc_capable() (boot_cpu_data.x86_max_cores > 1)
116#define smt_capable() (smp_num_siblings > 1) 113#define smt_capable() (smp_num_siblings > 1)
117#endif 114#endif
118 115
119#endif /* _ASM_I386_TOPOLOGY_H */ 116#endif