2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
15 #ifndef _ASM_TILE_TOPOLOGY_H
16 #define _ASM_TILE_TOPOLOGY_H
20 #include <linux/cpumask.h>
22 /* Mappings between logical cpu number and node number. */
23 extern struct cpumask node_2_cpu_mask
[];
24 extern char cpu_2_node
[];
26 /* Returns the number of the node containing CPU 'cpu'. */
27 static inline int cpu_to_node(int cpu
)
29 return cpu_2_node
[cpu
];
33 * Returns the number of the node containing Node 'node'.
34 * This architecture is flat, so it is a pretty simple function!
36 #define parent_node(node) (node)
38 /* Returns a bitmask of CPUs on Node 'node'. */
39 static inline const struct cpumask
*cpumask_of_node(int node
)
41 return &node_2_cpu_mask
[node
];
44 /* For now, use numa node -1 for global allocation. */
45 #define pcibus_to_node(bus) ((void)(bus), -1)
47 /* By definition, we create nodes based on online memory. */
48 #define node_has_online_mem(nid) 1
50 #endif /* CONFIG_NUMA */
52 #include <asm-generic/topology.h>
55 #define topology_physical_package_id(cpu) ((void)(cpu), 0)
56 #define topology_core_id(cpu) (cpu)
57 #define topology_core_cpumask(cpu) ((void)(cpu), cpu_online_mask)
58 #define topology_sibling_cpumask(cpu) cpumask_of(cpu)
61 #endif /* _ASM_TILE_TOPOLOGY_H */