arch/riscv/kernel/sys_hwprobe.c
Source file repositories/reference/linux-study-clean/arch/riscv/kernel/sys_hwprobe.c
File Facts
- System
- Linux kernel
- Corpus path
arch/riscv/kernel/sys_hwprobe.c- Extension
.c- Size
- 16448 bytes
- Lines
- 613
- Domain
- Architecture Layer
- Bucket
- arch/riscv
- Inferred role
- Architecture Layer: syscall or user/kernel boundary
- Status
- core 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 participates in a user/kernel boundary; inspect argument validation, copy_from_user/copy_to_user, credentials, and dispatch target.
- 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/syscalls.hlinux/completion.hlinux/atomic.hlinux/once.hasm/cacheflush.hasm/cpufeature.hasm/hwprobe.hasm/processor.hasm/delay.hasm/sbi.hasm/switch_to.hasm/uaccess.hasm/unistd.hasm/vector.hasm/vendor_extensions/mips_hwprobe.hasm/vendor_extensions/sifive_hwprobe.hasm/vendor_extensions/thead_hwprobe.hvdso/vsyscall.h
Detected Declarations
syscall riscv_hwprobefunction hwprobe_arch_idfunction for_each_cpufunction hwprobe_isa_ext0function hwprobe_isa_ext1function hwprobe_ext0_hasfunction hwprobe_misalignedfunction for_each_cpufunction hwprobe_misalignedfunction hwprobe_vec_misalignedfunction hwprobe_vec_misalignedfunction hwprobe_one_pairfunction hwprobe_get_valuesfunction hwprobe_get_cpusfunction for_each_cpufunction riscv_hwprobe_register_async_probefunction riscv_hwprobe_complete_async_probefunction complete_hwprobe_vdso_datafunction init_hwprobe_vdso_datafunction complete_hwprobe_vdso_datafunction do_riscv_hwprobe
Annotated Snippet
SYSCALL_DEFINE5(riscv_hwprobe, struct riscv_hwprobe __user *, pairs,
size_t, pair_count, size_t, cpusetsize, unsigned long __user *,
cpus, unsigned int, flags)
{
return do_riscv_hwprobe(pairs, pair_count, cpusetsize,
cpus, flags);
}
Annotation
- Immediate include surface: `linux/syscalls.h`, `linux/completion.h`, `linux/atomic.h`, `linux/once.h`, `asm/cacheflush.h`, `asm/cpufeature.h`, `asm/hwprobe.h`, `asm/processor.h`.
- Detected declarations: `syscall riscv_hwprobe`, `function hwprobe_arch_id`, `function for_each_cpu`, `function hwprobe_isa_ext0`, `function hwprobe_isa_ext1`, `function hwprobe_ext0_has`, `function hwprobe_misaligned`, `function for_each_cpu`, `function hwprobe_misaligned`, `function hwprobe_vec_misaligned`.
- Atlas domain: Architecture Layer / arch/riscv.
- Implementation status: core 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.