arch/sparc/kernel/idprom.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/idprom.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/idprom.c- Extension
.c- Size
- 2958 bytes
- Lines
- 100
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/types.hlinux/init.hlinux/export.hlinux/etherdevice.hasm/oplib.hasm/idprom.hasm/machines.h
Detected Declarations
function display_system_typefunction display_system_typefunction calc_idprom_cksumfunction idprom_initexport idprom
Annotated Snippet
if (Sun_Machines[i].id_machtype == machtype) {
if (machtype != (SM_SUN4M_OBP | 0x00) ||
prom_getproperty(prom_root_node, "banner-name",
sysname, sizeof(sysname)) <= 0)
printk(KERN_WARNING "TYPE: %s\n",
Sun_Machines[i].name);
else
printk(KERN_WARNING "TYPE: %s\n", sysname);
return;
}
}
prom_printf("IDPROM: Warning, bogus id_machtype value, 0x%x\n", machtype);
}
#else
static void __init display_system_type(unsigned char machtype)
{
}
#endif
unsigned char *arch_get_platform_mac_address(void)
{
return idprom->id_ethaddr;
}
/* Calculate the IDPROM checksum (xor of the data bytes). */
static unsigned char __init calc_idprom_cksum(struct idprom *idprom)
{
unsigned char cksum, i, *ptr = (unsigned char *)idprom;
for (i = cksum = 0; i <= 0x0E; i++)
cksum ^= *ptr++;
return cksum;
}
/* Create a local IDPROM copy, verify integrity, and display information. */
void __init idprom_init(void)
{
prom_get_idprom((char *) &idprom_buffer, sizeof(idprom_buffer));
idprom = &idprom_buffer;
if (idprom->id_format != 0x01)
prom_printf("IDPROM: Warning, unknown format type!\n");
if (idprom->id_cksum != calc_idprom_cksum(idprom))
prom_printf("IDPROM: Warning, checksum failure (nvram=%x, calc=%x)!\n",
idprom->id_cksum, calc_idprom_cksum(idprom));
display_system_type(idprom->id_machtype);
printk(KERN_WARNING "Ethernet address: %pM\n", idprom->id_ethaddr);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/init.h`, `linux/export.h`, `linux/etherdevice.h`, `asm/oplib.h`, `asm/idprom.h`, `asm/machines.h`.
- Detected declarations: `function display_system_type`, `function display_system_type`, `function calc_idprom_cksum`, `function idprom_init`, `export idprom`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: integration 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.