arch/mips/sibyte/common/cfe.c
Source file repositories/reference/linux-study-clean/arch/mips/sibyte/common/cfe.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/sibyte/common/cfe.c- Extension
.c- Size
- 7092 bytes
- Lines
- 310
- 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/init.hlinux/kernel.hlinux/linkage.hlinux/mm.hlinux/memblock.hlinux/pm.hlinux/smp.hasm/bootinfo.hasm/reboot.hasm/setup.hasm/sibyte/board.hasm/smp-ops.hasm/fw/cfe/cfe_api.hasm/fw/cfe/cfe_error.h
Detected Declarations
function cfe_linux_exitfunction cfe_linux_restartfunction cfe_linux_haltfunction prom_meminitfunction initrd_setupfunction prom_initfunction usfunction prom_putchar
Annotated Snippet
if (!reboot_smp) {
/* Get CPU 0 to do the cfe_exit */
reboot_smp = 1;
smp_call_function(cfe_linux_exit, arg, 0);
}
} else {
printk("Passing control back to CFE...\n");
cfe_exit(warm, 0);
printk("cfe_exit returned??\n");
}
while (1);
}
static void __noreturn cfe_linux_restart(char *command)
{
static const int zero;
cfe_linux_exit((void *)&zero);
}
static void __noreturn cfe_linux_halt(void)
{
static const int one = 1;
cfe_linux_exit((void *)&one);
}
static __init void prom_meminit(void)
{
u64 addr, size, type; /* regardless of PHYS_ADDR_T_64BIT */
int mem_flags = 0;
unsigned int idx;
int rd_flag;
#ifdef CONFIG_BLK_DEV_INITRD
unsigned long initrd_pstart;
unsigned long initrd_pend;
initrd_pstart = CPHYSADDR(initrd_start);
initrd_pend = CPHYSADDR(initrd_end);
if (initrd_start &&
((initrd_pstart > MAX_RAM_SIZE)
|| (initrd_pend > MAX_RAM_SIZE))) {
panic("initrd out of addressable memory");
}
#endif /* INITRD */
for (idx = 0; cfe_enummem(idx, mem_flags, &addr, &size, &type) != CFE_ERR_NOMORE;
idx++) {
rd_flag = 0;
if (type == CFE_MI_AVAILABLE) {
/*
* See if this block contains (any portion of) the
* ramdisk
*/
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) {
if ((initrd_pstart > addr) &&
(initrd_pstart < (addr + size))) {
memblock_add(addr,
initrd_pstart - addr);
rd_flag = 1;
}
if ((initrd_pend > addr) &&
(initrd_pend < (addr + size))) {
memblock_add(initrd_pend,
(addr + size) - initrd_pend);
rd_flag = 1;
}
}
#endif
if (!rd_flag) {
if (addr > MAX_RAM_SIZE)
continue;
if (addr+size > MAX_RAM_SIZE)
size = MAX_RAM_SIZE - (addr+size) + 1;
/*
* memcpy/__copy_user prefetch, which
* will cause a bus error for
* KSEG/KUSEG addrs not backed by RAM.
* Hence, reserve some padding for the
* prefetch distance.
*/
if (size > 512)
size -= 512;
memblock_add(addr, size);
}
}
}
#ifdef CONFIG_BLK_DEV_INITRD
Annotation
- Immediate include surface: `linux/init.h`, `linux/kernel.h`, `linux/linkage.h`, `linux/mm.h`, `linux/memblock.h`, `linux/pm.h`, `linux/smp.h`, `asm/bootinfo.h`.
- Detected declarations: `function cfe_linux_exit`, `function cfe_linux_restart`, `function cfe_linux_halt`, `function prom_meminit`, `function initrd_setup`, `function prom_init`, `function us`, `function prom_putchar`.
- 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.