arch/mips/fw/arc/identify.c
Source file repositories/reference/linux-study-clean/arch/mips/fw/arc/identify.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/fw/arc/identify.c- Extension
.c- Size
- 2316 bytes
- Lines
- 112
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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/bug.hlinux/init.hlinux/kernel.hlinux/types.hlinux/string.hasm/sgialib.hasm/bootinfo.h
Detected Declarations
struct smatchfunction string_to_machfunction ArcGetChildfunction prom_identify_arch
Annotated Snippet
struct smatch {
char *arcname;
char *liname;
int flags;
};
static struct smatch mach_table[] = {
{
.arcname = "SGI-IP22",
.liname = "SGI Indy",
.flags = PROM_FLAG_ARCS,
}, {
.arcname = "SGI-IP28",
.liname = "SGI IP28",
.flags = PROM_FLAG_ARCS,
}, {
.arcname = "SGI-IP30",
.liname = "SGI Octane",
.flags = PROM_FLAG_ARCS,
}, {
.arcname = "SGI-IP32",
.liname = "SGI O2",
.flags = PROM_FLAG_ARCS,
}, {
.arcname = "Microsoft-Jazz",
.liname = "Jazz MIPS_Magnum_4000",
.flags = 0,
}, {
.arcname = "PICA-61",
.liname = "Jazz Acer_PICA_61",
.flags = 0,
}, {
.arcname = "RM200PCI",
.liname = "SNI RM200_PCI",
.flags = PROM_FLAG_DONT_FREE_TEMP,
}, {
.arcname = "RM200PCI-R5K",
.liname = "SNI RM200_PCI-R5K",
.flags = PROM_FLAG_DONT_FREE_TEMP,
}
};
int prom_flags;
static struct smatch * __init string_to_mach(const char *s)
{
int i;
for (i = 0; i < ARRAY_SIZE(mach_table); i++) {
if (!strcmp(s, mach_table[i].arcname))
return &mach_table[i];
}
panic("Yeee, could not determine architecture type <%s>", s);
}
char *system_type;
const char *get_system_type(void)
{
return system_type;
}
static pcomponent * __init ArcGetChild(pcomponent *Current)
{
return (pcomponent *) ARC_CALL1(child_component, Current);
}
void __init prom_identify_arch(void)
{
pcomponent *p;
struct smatch *mach;
const char *iname;
/*
* The root component tells us what machine architecture we have here.
*/
p = ArcGetChild(PROM_NULL_COMPONENT);
if (p == NULL) {
iname = "Unknown";
} else
iname = (char *) (long) p->iname;
printk("ARCH: %s\n", iname);
mach = string_to_mach(iname);
system_type = mach->liname;
prom_flags = mach->flags;
}
Annotation
- Immediate include surface: `linux/bug.h`, `linux/init.h`, `linux/kernel.h`, `linux/types.h`, `linux/string.h`, `asm/sgialib.h`, `asm/bootinfo.h`.
- Detected declarations: `struct smatch`, `function string_to_mach`, `function ArcGetChild`, `function prom_identify_arch`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.