11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * linux/include/asm-generic/topology.h 31da177e4SLinus Torvalds * 41da177e4SLinus Torvalds * Written by: Matthew Dobson, IBM Corporation 51da177e4SLinus Torvalds * 61da177e4SLinus Torvalds * Copyright (C) 2002, IBM Corp. 71da177e4SLinus Torvalds * 81da177e4SLinus Torvalds * All rights reserved. 91da177e4SLinus Torvalds * 101da177e4SLinus Torvalds * This program is free software; you can redistribute it and/or modify 111da177e4SLinus Torvalds * it under the terms of the GNU General Public License as published by 121da177e4SLinus Torvalds * the Free Software Foundation; either version 2 of the License, or 131da177e4SLinus Torvalds * (at your option) any later version. 141da177e4SLinus Torvalds * 151da177e4SLinus Torvalds * This program is distributed in the hope that it will be useful, but 161da177e4SLinus Torvalds * WITHOUT ANY WARRANTY; without even the implied warranty of 171da177e4SLinus Torvalds * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or 181da177e4SLinus Torvalds * NON INFRINGEMENT. See the GNU General Public License for more 191da177e4SLinus Torvalds * details. 201da177e4SLinus Torvalds * 211da177e4SLinus Torvalds * You should have received a copy of the GNU General Public License 221da177e4SLinus Torvalds * along with this program; if not, write to the Free Software 231da177e4SLinus Torvalds * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 241da177e4SLinus Torvalds * 251da177e4SLinus Torvalds * Send feedback to <colpatch@us.ibm.com> 261da177e4SLinus Torvalds */ 271da177e4SLinus Torvalds #ifndef _ASM_GENERIC_TOPOLOGY_H 281da177e4SLinus Torvalds #define _ASM_GENERIC_TOPOLOGY_H 291da177e4SLinus Torvalds 30aa6b5446SMike Travis #ifndef CONFIG_NUMA 31aa6b5446SMike Travis 321da177e4SLinus Torvalds /* Other architectures wishing to use this simple topology API should fill 331da177e4SLinus Torvalds in the below functions as appropriate in their own <asm/topology.h> file. */ 341da177e4SLinus Torvalds #ifndef cpu_to_node 35271cad6dSAndi Kleen #define cpu_to_node(cpu) ((void)(cpu),0) 361da177e4SLinus Torvalds #endif 3725106000SLee Schermerhorn #ifndef set_numa_node 3825106000SLee Schermerhorn #define set_numa_node(node) 3925106000SLee Schermerhorn #endif 4025106000SLee Schermerhorn #ifndef set_cpu_numa_node 4125106000SLee Schermerhorn #define set_cpu_numa_node(cpu, node) 4225106000SLee Schermerhorn #endif 437aac7898SLee Schermerhorn #ifndef cpu_to_mem 447aac7898SLee Schermerhorn #define cpu_to_mem(cpu) ((void)(cpu),0) 457aac7898SLee Schermerhorn #endif 4625106000SLee Schermerhorn 47f0b848ceSRusty Russell #ifndef cpumask_of_node 48*a9ee6cf5SMike Rapoport #ifdef CONFIG_NUMA 49b339752dSTejun Heo #define cpumask_of_node(node) ((node) == 0 ? cpu_online_mask : cpu_none_mask) 50b339752dSTejun Heo #else 514377748cSArnd Bergmann #define cpumask_of_node(node) ((void)(node), cpu_online_mask) 52f0b848ceSRusty Russell #endif 53b339752dSTejun Heo #endif 548c5a0908SChristoph Lameter #ifndef pcibus_to_node 55271cad6dSAndi Kleen #define pcibus_to_node(bus) ((void)(bus), -1) 568c5a0908SChristoph Lameter #endif 578c5a0908SChristoph Lameter 58f0b848ceSRusty Russell #ifndef cpumask_of_pcibus 59f0b848ceSRusty Russell #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ 60f0b848ceSRusty Russell cpu_all_mask : \ 61f0b848ceSRusty Russell cpumask_of_node(pcibus_to_node(bus))) 62f0b848ceSRusty Russell #endif 63f0b848ceSRusty Russell 64aa6b5446SMike Travis #endif /* CONFIG_NUMA */ 65aa6b5446SMike Travis 6625106000SLee Schermerhorn #if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES) 6725106000SLee Schermerhorn 6825106000SLee Schermerhorn #ifndef set_numa_mem 6925106000SLee Schermerhorn #define set_numa_mem(node) 7025106000SLee Schermerhorn #endif 7125106000SLee Schermerhorn #ifndef set_cpu_numa_mem 7225106000SLee Schermerhorn #define set_cpu_numa_mem(cpu, node) 7325106000SLee Schermerhorn #endif 7425106000SLee Schermerhorn 7525106000SLee Schermerhorn #endif /* !CONFIG_NUMA || !CONFIG_HAVE_MEMORYLESS_NODES */ 7625106000SLee Schermerhorn 771da177e4SLinus Torvalds #endif /* _ASM_GENERIC_TOPOLOGY_H */ 78