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

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

Version: ~ [ linux-6.0-rc6 ] ~ [ linux-5.19.10 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.69 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.144 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.214 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.259 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.294 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.329 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ 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 ] ~

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

~ [ 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