~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/topology.h

Version: ~ [ linux-5.6 ] ~ [ linux-5.5.13 ] ~ [ linux-5.4.28 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.113 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.174 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.217 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.217 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.82 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ASM_POWERPC_TOPOLOGY_H
  3 #define _ASM_POWERPC_TOPOLOGY_H
  4 #ifdef __KERNEL__
  5 
  6 
  7 struct device;
  8 struct device_node;
  9 
 10 #ifdef CONFIG_NUMA
 11 
 12 /*
 13  * If zone_reclaim_mode is enabled, a RECLAIM_DISTANCE of 10 will mean that
 14  * all zones on all nodes will be eligible for zone_reclaim().
 15  */
 16 #define RECLAIM_DISTANCE 10
 17 
 18 #include <asm/mmzone.h>
 19 
 20 #define cpumask_of_node(node) ((node) == -1 ?                           \
 21                                cpu_all_mask :                           \
 22                                node_to_cpumask_map[node])
 23 
 24 struct pci_bus;
 25 #ifdef CONFIG_PCI
 26 extern int pcibus_to_node(struct pci_bus *bus);
 27 #else
 28 static inline int pcibus_to_node(struct pci_bus *bus)
 29 {
 30         return -1;
 31 }
 32 #endif
 33 
 34 #define cpumask_of_pcibus(bus)  (pcibus_to_node(bus) == -1 ?            \
 35                                  cpu_all_mask :                         \
 36                                  cpumask_of_node(pcibus_to_node(bus)))
 37 
 38 extern int __node_distance(int, int);
 39 #define node_distance(a, b) __node_distance(a, b)
 40 
 41 extern void __init dump_numa_cpu_topology(void);
 42 
 43 extern int sysfs_add_device_to_node(struct device *dev, int nid);
 44 extern void sysfs_remove_device_from_node(struct device *dev, int nid);
 45 extern int numa_update_cpu_topology(bool cpus_locked);
 46 
 47 static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node)
 48 {
 49         numa_cpu_lookup_table[cpu] = node;
 50 }
 51 
 52 static inline int early_cpu_to_node(int cpu)
 53 {
 54         int nid;
 55 
 56         nid = numa_cpu_lookup_table[cpu];
 57 
 58         /*
 59          * Fall back to node 0 if nid is unset (it should be, except bugs).
 60          * This allows callers to safely do NODE_DATA(early_cpu_to_node(cpu)).
 61          */
 62         return (nid < 0) ? 0 : nid;
 63 }
 64 #else
 65 
 66 static inline int early_cpu_to_node(int cpu) { return 0; }
 67 
 68 static inline void dump_numa_cpu_topology(void) {}
 69 
 70 static inline int sysfs_add_device_to_node(struct device *dev, int nid)
 71 {
 72         return 0;
 73 }
 74 
 75 static inline void sysfs_remove_device_from_node(struct device *dev,
 76                                                 int nid)
 77 {
 78 }
 79 
 80 static inline int numa_update_cpu_topology(bool cpus_locked)
 81 {
 82         return 0;
 83 }
 84 
 85 static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
 86 
 87 #endif /* CONFIG_NUMA */
 88 
 89 #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
 90 extern int start_topology_update(void);
 91 extern int stop_topology_update(void);
 92 extern int prrn_is_enabled(void);
 93 extern int find_and_online_cpu_nid(int cpu);
 94 extern int timed_topology_update(int nsecs);
 95 extern void __init shared_proc_topology_init(void);
 96 #else
 97 static inline int start_topology_update(void)
 98 {
 99         return 0;
100 }
101 static inline int stop_topology_update(void)
102 {
103         return 0;
104 }
105 static inline int prrn_is_enabled(void)
106 {
107         return 0;
108 }
109 static inline int find_and_online_cpu_nid(int cpu)
110 {
111         return 0;
112 }
113 static inline int timed_topology_update(int nsecs)
114 {
115         return 0;
116 }
117 
118 #ifdef CONFIG_SMP
119 static inline void shared_proc_topology_init(void) {}
120 #endif
121 #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
122 
123 #include <asm-generic/topology.h>
124 
125 #ifdef CONFIG_SMP
126 #include <asm/cputable.h>
127 
128 #ifdef CONFIG_PPC64
129 #include <asm/smp.h>
130 
131 #define topology_physical_package_id(cpu)       (cpu_to_chip_id(cpu))
132 #define topology_sibling_cpumask(cpu)   (per_cpu(cpu_sibling_map, cpu))
133 #define topology_core_cpumask(cpu)      (per_cpu(cpu_core_map, cpu))
134 #define topology_core_id(cpu)           (cpu_to_core_id(cpu))
135 #endif
136 #endif
137 
138 #endif /* __KERNEL__ */
139 #endif  /* _ASM_POWERPC_TOPOLOGY_H */
140 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp