arch/mips/kernel/machine_kexec.c
Source file repositories/reference/linux-study-clean/arch/mips/kernel/machine_kexec.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/kernel/machine_kexec.c- Extension
.c- Size
- 6063 bytes
- Lines
- 266
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler.hlinux/kexec.hlinux/mm.hlinux/delay.hlinux/libfdt.hlinux/reboot.hasm/cacheflush.hasm/page.h
Detected Declarations
function kexec_image_infofunction uhi_machine_kexec_preparefunction machine_kexec_preparefunction machine_kexec_cleanupfunction machine_shutdownfunction machine_crash_shutdownfunction kexec_nonboot_cpu_jumpfunction kexec_rebootfunction machine_kexecfunction phys_to_virt
Annotated Snippet
phys_to_virt(entry & PAGE_MASK) : ptr + 1) {
if (*ptr & IND_SOURCE || *ptr & IND_INDIRECTION ||
*ptr & IND_DESTINATION)
*ptr = (unsigned long) phys_to_virt(*ptr);
}
/* Mark offline BEFORE disabling local irq. */
set_cpu_online(smp_processor_id(), false);
/*
* we do not want to be bothered.
*/
local_irq_disable();
printk("Will call new kernel at %08lx\n", image->start);
printk("Bye ...\n");
/* Make reboot code buffer available to the boot CPU. */
__flush_cache_all();
#ifdef CONFIG_SMP
/* All secondary cpus now may jump to kexec_wait cycle */
relocated_kexec_smp_wait = reboot_code_buffer +
(void *)(kexec_smp_wait - relocate_new_kernel);
smp_wmb();
atomic_set(&kexec_ready_to_reboot, 1);
#endif
kexec_reboot();
}
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/kexec.h`, `linux/mm.h`, `linux/delay.h`, `linux/libfdt.h`, `linux/reboot.h`, `asm/cacheflush.h`, `asm/page.h`.
- Detected declarations: `function kexec_image_info`, `function uhi_machine_kexec_prepare`, `function machine_kexec_prepare`, `function machine_kexec_cleanup`, `function machine_shutdown`, `function machine_crash_shutdown`, `function kexec_nonboot_cpu_jump`, `function kexec_reboot`, `function machine_kexec`, `function phys_to_virt`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.