arch/mips/kernel/vpe.c
Source file repositories/reference/linux-study-clean/arch/mips/kernel/vpe.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/kernel/vpe.c- Extension
.c- Size
- 21761 bytes
- Lines
- 901
- Domain
- Architecture Layer
- Bucket
- arch/mips
- Inferred role
- Architecture Layer: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/device.hlinux/fs.hlinux/init.hlinux/slab.hlinux/list.hlinux/vmalloc.hlinux/elf.hlinux/seq_file.hlinux/string.hlinux/syscalls.hlinux/moduleloader.hlinux/interrupt.hlinux/poll.hlinux/memblock.hasm/mipsregs.hasm/mipsmtregs.hasm/cacheflush.hlinux/atomic.hasm/mips_mt.hasm/processor.hasm/vpe.h
Detected Declarations
struct mips_hi16function release_vpefunction release_progmemfunction get_offsetfunction layout_sectionsfunction apply_r_mips_nonefunction apply_r_mips_gprel16function apply_r_mips_pc16function apply_r_mips_32function apply_r_mips_26function apply_r_mips_hi16function apply_r_mips_lo16function apply_relocationsfunction save_gp_addressfunction simplify_symbolsfunction dump_elfsymbolsfunction find_vpe_symbolsfunction spacefunction vpe_openfunction vpe_releasefunction vpe_writefunction vpe_notifymodule init vpe_module_initexport vpe_get_sharedexport vpe_notify
Annotated Snippet
const struct file_operations vpe_fops = {
.owner = THIS_MODULE,
.open = vpe_open,
.release = vpe_release,
.write = vpe_write,
.llseek = noop_llseek,
};
void *vpe_get_shared(int index)
{
struct vpe *v = get_vpe(index);
if (v == NULL)
return NULL;
return v->shared_ptr;
}
EXPORT_SYMBOL(vpe_get_shared);
int vpe_notify(int index, struct vpe_notifications *notify)
{
struct vpe *v = get_vpe(index);
if (v == NULL)
return -1;
list_add(¬ify->list, &v->notify);
return 0;
}
EXPORT_SYMBOL(vpe_notify);
module_init(vpe_module_init);
module_exit(vpe_module_exit);
MODULE_DESCRIPTION("MIPS VPE Loader");
MODULE_AUTHOR("Elizabeth Oldham, MIPS Technologies, Inc.");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/device.h`, `linux/fs.h`, `linux/init.h`, `linux/slab.h`, `linux/list.h`, `linux/vmalloc.h`, `linux/elf.h`.
- Detected declarations: `struct mips_hi16`, `function release_vpe`, `function release_progmem`, `function get_offset`, `function layout_sections`, `function apply_r_mips_none`, `function apply_r_mips_gprel16`, `function apply_r_mips_pc16`, `function apply_r_mips_32`, `function apply_r_mips_26`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: pattern 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.