18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * linux/include/asm-generic/topology.h 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Written by: Matthew Dobson, IBM Corporation 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Copyright (C) 2002, IBM Corp. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * All rights reserved. 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 118c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by 128c2ecf20Sopenharmony_ci * the Free Software Foundation; either version 2 of the License, or 138c2ecf20Sopenharmony_ci * (at your option) any later version. 148c2ecf20Sopenharmony_ci * 158c2ecf20Sopenharmony_ci * This program is distributed in the hope that it will be useful, but 168c2ecf20Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of 178c2ecf20Sopenharmony_ci * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or 188c2ecf20Sopenharmony_ci * NON INFRINGEMENT. See the GNU General Public License for more 198c2ecf20Sopenharmony_ci * details. 208c2ecf20Sopenharmony_ci * 218c2ecf20Sopenharmony_ci * You should have received a copy of the GNU General Public License 228c2ecf20Sopenharmony_ci * along with this program; if not, write to the Free Software 238c2ecf20Sopenharmony_ci * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 248c2ecf20Sopenharmony_ci * 258c2ecf20Sopenharmony_ci * Send feedback to <colpatch@us.ibm.com> 268c2ecf20Sopenharmony_ci */ 278c2ecf20Sopenharmony_ci#ifndef _ASM_GENERIC_TOPOLOGY_H 288c2ecf20Sopenharmony_ci#define _ASM_GENERIC_TOPOLOGY_H 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#ifndef CONFIG_NUMA 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci/* Other architectures wishing to use this simple topology API should fill 338c2ecf20Sopenharmony_ci in the below functions as appropriate in their own <asm/topology.h> file. */ 348c2ecf20Sopenharmony_ci#ifndef cpu_to_node 358c2ecf20Sopenharmony_ci#define cpu_to_node(cpu) ((void)(cpu),0) 368c2ecf20Sopenharmony_ci#endif 378c2ecf20Sopenharmony_ci#ifndef set_numa_node 388c2ecf20Sopenharmony_ci#define set_numa_node(node) 398c2ecf20Sopenharmony_ci#endif 408c2ecf20Sopenharmony_ci#ifndef set_cpu_numa_node 418c2ecf20Sopenharmony_ci#define set_cpu_numa_node(cpu, node) 428c2ecf20Sopenharmony_ci#endif 438c2ecf20Sopenharmony_ci#ifndef cpu_to_mem 448c2ecf20Sopenharmony_ci#define cpu_to_mem(cpu) ((void)(cpu),0) 458c2ecf20Sopenharmony_ci#endif 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci#ifndef cpumask_of_node 488c2ecf20Sopenharmony_ci #ifdef CONFIG_NEED_MULTIPLE_NODES 498c2ecf20Sopenharmony_ci #define cpumask_of_node(node) ((node) == 0 ? cpu_online_mask : cpu_none_mask) 508c2ecf20Sopenharmony_ci #else 518c2ecf20Sopenharmony_ci #define cpumask_of_node(node) ((void)(node), cpu_online_mask) 528c2ecf20Sopenharmony_ci #endif 538c2ecf20Sopenharmony_ci#endif 548c2ecf20Sopenharmony_ci#ifndef pcibus_to_node 558c2ecf20Sopenharmony_ci#define pcibus_to_node(bus) ((void)(bus), -1) 568c2ecf20Sopenharmony_ci#endif 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#ifndef cpumask_of_pcibus 598c2ecf20Sopenharmony_ci#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ 608c2ecf20Sopenharmony_ci cpu_all_mask : \ 618c2ecf20Sopenharmony_ci cpumask_of_node(pcibus_to_node(bus))) 628c2ecf20Sopenharmony_ci#endif 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci#endif /* CONFIG_NUMA */ 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci#if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES) 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci#ifndef set_numa_mem 698c2ecf20Sopenharmony_ci#define set_numa_mem(node) 708c2ecf20Sopenharmony_ci#endif 718c2ecf20Sopenharmony_ci#ifndef set_cpu_numa_mem 728c2ecf20Sopenharmony_ci#define set_cpu_numa_mem(cpu, node) 738c2ecf20Sopenharmony_ci#endif 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci#endif /* !CONFIG_NUMA || !CONFIG_HAVE_MEMORYLESS_NODES */ 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci#endif /* _ASM_GENERIC_TOPOLOGY_H */ 78