arch/riscv/errata/thead/errata.c
Source file repositories/reference/linux-study-clean/arch/riscv/errata/thead/errata.c
File Facts
- System
- Linux kernel
- Corpus path
arch/riscv/errata/thead/errata.c- Extension
.c- Size
- 6170 bytes
- Lines
- 225
- Domain
- Architecture Layer
- Bucket
- arch/riscv
- 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.
- 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/bug.hlinux/kernel.hlinux/memory.hlinux/module.hlinux/string.hlinux/uaccess.hasm/alternative.hasm/bugs.hasm/cacheflush.hasm/cpufeature.hasm/dma-noncoherent.hasm/errata_list.hasm/hwprobe.hasm/io.hasm/text-patching.hasm/vendorid_list.hasm/vendor_extensions.h
Detected Declarations
function Copyrightfunction volatilefunction thead_errata_cache_wbackfunction thead_errata_cache_wback_invfunction errata_probe_cmofunction errata_probe_pmufunction errata_probe_ghostwritefunction thead_errata_probefunction thead_errata_patch_func
Annotated Snippet
if (cpu_req_errata & tmp) {
oldptr = ALT_OLD_PTR(alt);
altptr = ALT_ALT_PTR(alt);
/* On vm-alternatives, the mmu isn't running yet */
if (stage == RISCV_ALTERNATIVES_EARLY_BOOT) {
memcpy(oldptr, altptr, alt->alt_len);
} else {
mutex_lock(&text_mutex);
patch_text_nosync(oldptr, altptr, alt->alt_len);
mutex_unlock(&text_mutex);
}
}
}
if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
local_flush_icache_all();
}
Annotation
- Immediate include surface: `linux/bug.h`, `linux/kernel.h`, `linux/memory.h`, `linux/module.h`, `linux/string.h`, `linux/uaccess.h`, `asm/alternative.h`, `asm/bugs.h`.
- Detected declarations: `function Copyright`, `function volatile`, `function thead_errata_cache_wback`, `function thead_errata_cache_wback_inv`, `function errata_probe_cmo`, `function errata_probe_pmu`, `function errata_probe_ghostwrite`, `function thead_errata_probe`, `function thead_errata_patch_func`.
- Atlas domain: Architecture Layer / arch/riscv.
- Implementation status: source implementation candidate.
- 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.