arch/sparc/kernel/prom_64.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/prom_64.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/prom_64.c- Extension
.c- Size
- 15094 bytes
- Lines
- 638
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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
linux/memblock.hlinux/kernel.hlinux/string.hlinux/types.hlinux/cpu.hlinux/mm.hlinux/of.hasm/prom.hasm/oplib.hasm/irq.hasm/asi.hasm/upa.hasm/smp.hprom.h
Detected Declarations
function Copyrightfunction sun4v_path_componentfunction sun4u_path_componentfunction sbus_path_componentfunction pci_path_componentfunction upa_path_componentfunction vdev_path_componentfunction ebus_path_componentfunction i2c_path_componentfunction usb_path_componentfunction ieee1394_path_componentfunction __build_path_componentfunction build_path_componentfunction arch_find_n_match_cpu_physical_idfunction of_populate_present_maskfunction of_fill_in_cpu_datafunction of_console_init
Annotated Snippet
of_node_is_type(parent, "pciex")) {
pci_path_component(dp, tmp_buf);
return;
}
if (of_node_is_type(parent, "sbus")) {
sbus_path_component(dp, tmp_buf);
return;
}
if (of_node_is_type(parent, "upa")) {
upa_path_component(dp, tmp_buf);
return;
}
if (of_node_is_type(parent, "ebus")) {
ebus_path_component(dp, tmp_buf);
return;
}
if (of_node_name_eq(parent, "usb") ||
of_node_name_eq(parent, "hub")) {
usb_path_component(dp, tmp_buf);
return;
}
if (of_node_is_type(parent, "i2c")) {
i2c_path_component(dp, tmp_buf);
return;
}
if (of_node_is_type(parent, "firewire")) {
ieee1394_path_component(dp, tmp_buf);
return;
}
if (of_node_is_type(parent, "virtual-devices")) {
vdev_path_component(dp, tmp_buf);
return;
}
/* "isa" is handled with platform naming */
}
/* Use platform naming convention. */
if (tlb_type == hypervisor) {
sun4v_path_component(dp, tmp_buf);
return;
} else {
sun4u_path_component(dp, tmp_buf);
}
}
char * __init build_path_component(struct device_node *dp)
{
const char *name = of_get_property(dp, "name", NULL);
char tmp_buf[64], *n;
size_t n_sz;
tmp_buf[0] = '\0';
__build_path_component(dp, tmp_buf);
if (tmp_buf[0] == '\0')
strscpy(tmp_buf, name);
n_sz = strlen(tmp_buf) + 1;
n = prom_early_alloc(n_sz);
strscpy(n, tmp_buf, n_sz);
return n;
}
static const char *get_mid_prop(void)
{
return (tlb_type == spitfire ? "upa-portid" : "portid");
}
bool arch_find_n_match_cpu_physical_id(struct device_node *cpun,
int cpu, unsigned int *thread)
{
const char *mid_prop = get_mid_prop();
int this_cpu_id;
/* On hypervisor based platforms we interrogate the 'reg'
* property. On everything else we look for a 'upa-portid',
* 'portid', or 'cpuid' property.
*/
if (tlb_type == hypervisor) {
struct property *prop = of_find_property(cpun, "reg", NULL);
u32 *regs;
if (!prop) {
pr_warn("CPU node missing reg property\n");
return false;
}
regs = prop->value;
this_cpu_id = regs[0] & 0x0fffffff;
} else {
Annotation
- Immediate include surface: `linux/memblock.h`, `linux/kernel.h`, `linux/string.h`, `linux/types.h`, `linux/cpu.h`, `linux/mm.h`, `linux/of.h`, `asm/prom.h`.
- Detected declarations: `function Copyright`, `function sun4v_path_component`, `function sun4u_path_component`, `function sbus_path_component`, `function pci_path_component`, `function upa_path_component`, `function vdev_path_component`, `function ebus_path_component`, `function i2c_path_component`, `function usb_path_component`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.