Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * linux/include/asm-generic/topology.h
0003  *
0004  * Written by: Matthew Dobson, IBM Corporation
0005  *
0006  * Copyright (C) 2002, IBM Corp.
0007  *
0008  * All rights reserved.
0009  *
0010  * This program is free software; you can redistribute it and/or modify
0011  * it under the terms of the GNU General Public License as published by
0012  * the Free Software Foundation; either version 2 of the License, or
0013  * (at your option) any later version.
0014  *
0015  * This program is distributed in the hope that it will be useful, but
0016  * WITHOUT ANY WARRANTY; without even the implied warranty of
0017  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
0018  * NON INFRINGEMENT.  See the GNU General Public License for more
0019  * details.
0020  *
0021  * You should have received a copy of the GNU General Public License
0022  * along with this program; if not, write to the Free Software
0023  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
0024  *
0025  * Send feedback to <colpatch@us.ibm.com>
0026  */
0027 #ifndef _ASM_GENERIC_TOPOLOGY_H
0028 #define _ASM_GENERIC_TOPOLOGY_H
0029 
0030 #ifndef CONFIG_NUMA
0031 
0032 /* Other architectures wishing to use this simple topology API should fill
0033    in the below functions as appropriate in their own <asm/topology.h> file. */
0034 #ifndef cpu_to_node
0035 #define cpu_to_node(cpu)    ((void)(cpu),0)
0036 #endif
0037 #ifndef set_numa_node
0038 #define set_numa_node(node)
0039 #endif
0040 #ifndef set_cpu_numa_node
0041 #define set_cpu_numa_node(cpu, node)
0042 #endif
0043 #ifndef cpu_to_mem
0044 #define cpu_to_mem(cpu)     ((void)(cpu),0)
0045 #endif
0046 
0047 #ifndef cpumask_of_node
0048   #ifdef CONFIG_NUMA
0049     #define cpumask_of_node(node)   ((node) == 0 ? cpu_online_mask : cpu_none_mask)
0050   #else
0051     #define cpumask_of_node(node)   ((void)(node), cpu_online_mask)
0052   #endif
0053 #endif
0054 #ifndef pcibus_to_node
0055 #define pcibus_to_node(bus) ((void)(bus), -1)
0056 #endif
0057 
0058 #ifndef cpumask_of_pcibus
0059 #define cpumask_of_pcibus(bus)  (pcibus_to_node(bus) == -1 ?        \
0060                  cpu_all_mask :             \
0061                  cpumask_of_node(pcibus_to_node(bus)))
0062 #endif
0063 
0064 #endif  /* CONFIG_NUMA */
0065 
0066 #if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES)
0067 
0068 #ifndef set_numa_mem
0069 #define set_numa_mem(node)
0070 #endif
0071 #ifndef set_cpu_numa_mem
0072 #define set_cpu_numa_mem(cpu, node)
0073 #endif
0074 
0075 #endif  /* !CONFIG_NUMA || !CONFIG_HAVE_MEMORYLESS_NODES */
0076 
0077 #endif /* _ASM_GENERIC_TOPOLOGY_H */