arch/powerpc/include/asm/topology.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/topology.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/topology.h- Extension
.h- Size
- 4684 bytes
- Lines
- 189
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/mmzone.hasm-generic/topology.hasm/cputable.hasm/smp.hlinux/cpu_smt.hlinux/cpumask.hasm/cputhreads.h
Detected Declarations
struct devicestruct device_nodestruct drmem_lmbstruct pci_busfunction pcibus_to_nodefunction update_numa_cpu_lookup_tablefunction early_cpu_to_nodefunction early_cpu_to_nodefunction dump_numa_cpu_topologyfunction sysfs_remove_device_from_nodefunction of_drconf_to_nid_singlefunction update_numa_distancefunction find_and_update_cpu_nidfunction topology_is_primary_threadfunction topology_smt_thread_allowedfunction topology_is_core_online
Annotated Snippet
static inline int early_cpu_to_node(int cpu) { return 0; }
static inline void dump_numa_cpu_topology(void) {}
static inline int sysfs_add_device_to_node(struct device *dev, int nid)
{
return 0;
}
static inline void sysfs_remove_device_from_node(struct device *dev,
int nid)
{
}
static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
static inline int cpu_relative_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc)
{
return 0;
}
static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb)
{
return first_online_node;
}
static inline void update_numa_distance(struct device_node *node) {}
#ifdef CONFIG_SMP
static inline void map_cpu_to_node(int cpu, int node) {}
#ifdef CONFIG_HOTPLUG_CPU
static inline void unmap_cpu_from_node(unsigned long cpu) {}
#endif /* CONFIG_HOTPLUG_CPU */
#endif /* CONFIG_SMP */
#endif /* CONFIG_NUMA */
#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
void find_and_update_cpu_nid(int cpu);
extern int cpu_to_coregroup_id(int cpu);
#else
static inline void find_and_update_cpu_nid(int cpu) {}
static inline int cpu_to_coregroup_id(int cpu)
{
#ifdef CONFIG_SMP
return cpu_to_core_id(cpu);
#else
return 0;
#endif
}
#endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
#include <asm-generic/topology.h>
#ifdef CONFIG_SMP
#include <asm/cputable.h>
struct cpumask *cpu_coregroup_mask(int cpu);
const struct cpumask *cpu_die_mask(int cpu);
int cpu_die_id(int cpu);
/*
* Points to where the LLC is. On power9 this will point at CACHE
* domain, On others it will point to SMT domain. In all cases
* cpu_l2_cache_mask points to where LLC is
*/
#define arch_llc_mask(cpu) cpu_l2_cache_mask(cpu)
#ifdef CONFIG_PPC64
#include <asm/smp.h>
#define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu))
#define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
#define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
#define topology_core_id(cpu) (cpu_to_core_id(cpu))
#define topology_die_id(cpu) (cpu_die_id(cpu))
#define topology_die_cpumask(cpu) (cpu_die_mask(cpu))
#endif
#endif
#ifdef CONFIG_HOTPLUG_SMT
#include <linux/cpu_smt.h>
#include <linux/cpumask.h>
#include <asm/cputhreads.h>
static inline bool topology_is_primary_thread(unsigned int cpu)
{
return cpu == cpu_first_thread_sibling(cpu);
Annotation
- Immediate include surface: `asm/mmzone.h`, `asm-generic/topology.h`, `asm/cputable.h`, `asm/smp.h`, `linux/cpu_smt.h`, `linux/cpumask.h`, `asm/cputhreads.h`.
- Detected declarations: `struct device`, `struct device_node`, `struct drmem_lmb`, `struct pci_bus`, `function pcibus_to_node`, `function update_numa_cpu_lookup_table`, `function early_cpu_to_node`, `function early_cpu_to_node`, `function dump_numa_cpu_topology`, `function sysfs_remove_device_from_node`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.