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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/powerpc/include/asm/topology.h (Architecture mips) and /arch/sparc/include/asm-sparc/topology.h (Architecture sparc)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  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 struct drmem_lmb;                                 
 10                                                   
 11 #ifdef CONFIG_NUMA                                
 12                                                   
 13 /*                                                
 14  * If zone_reclaim_mode is enabled, a RECLAIM_    
 15  * all zones on all nodes will be eligible for    
 16  */                                               
 17 #define RECLAIM_DISTANCE 10                       
 18                                                   
 19 #include <asm/mmzone.h>                           
 20                                                   
 21 #define cpumask_of_node(node) ((node) == -1 ?     
 22                                cpu_all_mask :     
 23                                node_to_cpumask    
 24                                                   
 25 struct pci_bus;                                   
 26 #ifdef CONFIG_PCI                                 
 27 extern int pcibus_to_node(struct pci_bus *bus)    
 28 #else                                             
 29 static inline int pcibus_to_node(struct pci_bu    
 30 {                                                 
 31         return -1;                                
 32 }                                                 
 33 #endif                                            
 34                                                   
 35 #define cpumask_of_pcibus(bus)  (pcibus_to_nod    
 36                                  cpu_all_mask     
 37                                  cpumask_of_no    
 38                                                   
 39 int cpu_relative_distance(__be32 *cpu1_assoc,     
 40 extern int __node_distance(int, int);             
 41 #define node_distance(a, b) __node_distance(a,    
 42                                                   
 43 extern void __init dump_numa_cpu_topology(void    
 44                                                   
 45 extern int sysfs_add_device_to_node(struct dev    
 46 extern void sysfs_remove_device_from_node(stru    
 47                                                   
 48 static inline void update_numa_cpu_lookup_tabl    
 49 {                                                 
 50         numa_cpu_lookup_table[cpu] = node;        
 51 }                                                 
 52                                                   
 53 static inline int early_cpu_to_node(int cpu)      
 54 {                                                 
 55         int nid;                                  
 56                                                   
 57         nid = numa_cpu_lookup_table[cpu];         
 58                                                   
 59         /*                                        
 60          * Fall back to node 0 if nid is unset    
 61          * This allows callers to safely do NO    
 62          */                                       
 63         return (nid < 0) ? 0 : nid;               
 64 }                                                 
 65                                                   
 66 int of_drconf_to_nid_single(struct drmem_lmb *    
 67 void update_numa_distance(struct device_node *    
 68                                                   
 69 extern void map_cpu_to_node(int cpu, int node)    
 70 #ifdef CONFIG_HOTPLUG_CPU                         
 71 extern void unmap_cpu_from_node(unsigned long     
 72 #endif /* CONFIG_HOTPLUG_CPU */                   
 73                                                   
 74 #else                                             
 75                                                   
 76 static inline int early_cpu_to_node(int cpu) {    
 77                                                   
 78 static inline void dump_numa_cpu_topology(void    
 79                                                   
 80 static inline int sysfs_add_device_to_node(str    
 81 {                                                 
 82         return 0;                                 
 83 }                                                 
 84                                                   
 85 static inline void sysfs_remove_device_from_no    
 86                                                   
 87 {                                                 
 88 }                                                 
 89                                                   
 90 static inline void update_numa_cpu_lookup_tabl    
 91                                                   
 92 static inline int cpu_relative_distance(__be32    
 93 {                                                 
 94         return 0;                                 
 95 }                                                 
 96                                                   
 97 static inline int of_drconf_to_nid_single(stru    
 98 {                                                 
 99         return first_online_node;                 
100 }                                                 
101                                                   
102 static inline void update_numa_distance(struct    
103                                                   
104 #ifdef CONFIG_SMP                                 
105 static inline void map_cpu_to_node(int cpu, in    
106 #ifdef CONFIG_HOTPLUG_CPU                         
107 static inline void unmap_cpu_from_node(unsigne    
108 #endif /* CONFIG_HOTPLUG_CPU */                   
109 #endif /* CONFIG_SMP */                           
110                                                   
111 #endif /* CONFIG_NUMA */                          
112                                                   
113 #if defined(CONFIG_NUMA) && defined(CONFIG_PPC    
114 void find_and_update_cpu_nid(int cpu);            
115 extern int cpu_to_coregroup_id(int cpu);          
116 #else                                             
117 static inline void find_and_update_cpu_nid(int    
118 static inline int cpu_to_coregroup_id(int cpu)    
119 {                                                 
120 #ifdef CONFIG_SMP                                 
121         return cpu_to_core_id(cpu);               
122 #else                                             
123         return 0;                                 
124 #endif                                            
125 }                                                 
126                                                   
127 #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */     
128                                                   
129 #include <asm-generic/topology.h>                 
130                                                   
131 #ifdef CONFIG_SMP                                 
132 #include <asm/cputable.h>                         
133                                                   
134 #ifdef CONFIG_PPC64                               
135 #include <asm/smp.h>                              
136                                                   
137 #define topology_physical_package_id(cpu)         
138                                                   
139 #define topology_sibling_cpumask(cpu)   (per_c    
140 #define topology_core_cpumask(cpu)      (per_c    
141 #define topology_core_id(cpu)           (cpu_t    
142                                                   
143 #endif                                            
144 #endif                                            
145                                                   
146 #ifdef CONFIG_HOTPLUG_SMT                         
147 #include <linux/cpu_smt.h>                        
148 #include <linux/cpumask.h>                        
149 #include <asm/cputhreads.h>                       
150                                                   
151 static inline bool topology_is_primary_thread(    
152 {                                                 
153         return cpu == cpu_first_thread_sibling    
154 }                                                 
155                                                   
156 static inline bool topology_smt_thread_allowed    
157 {                                                 
158         return cpu_thread_in_core(cpu) < cpu_s    
159 }                                                 
160                                                   
161 #define topology_is_core_online topology_is_co    
162 static inline bool topology_is_core_online(uns    
163 {                                                 
164         int i, first_cpu = cpu_first_thread_si    
165                                                   
166         for (i = first_cpu; i < first_cpu + th    
167                 if (cpu_online(i))                
168                         return true;              
169         }                                         
170         return false;                             
171 }                                                 
172 #endif                                            
173                                                   
174 #endif /* __KERNEL__ */                           
175 #endif  /* _ASM_POWERPC_TOPOLOGY_H */             
176                                                   

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php