arch/x86/lib/error-inject.c
Source file repositories/reference/linux-study-clean/arch/x86/lib/error-inject.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/lib/error-inject.c- Extension
.c- Size
- 559 bytes
- Lines
- 26
- Domain
- Architecture Layer
- Bucket
- arch/x86
- 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/linkage.hlinux/error-injection.hlinux/kprobes.hlinux/objtool.h
Detected Declarations
function override_function_with_return
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#include <linux/linkage.h>
#include <linux/error-injection.h>
#include <linux/kprobes.h>
#include <linux/objtool.h>
asmlinkage void just_return_func(void);
asm(
".text\n"
".type just_return_func, @function\n"
".globl just_return_func\n"
ASM_FUNC_ALIGN
"just_return_func:\n"
ANNOTATE_NOENDBR "\n"
ASM_RET
".size just_return_func, .-just_return_func\n"
);
void override_function_with_return(struct pt_regs *regs)
{
regs->ip = (unsigned long)&just_return_func;
}
NOKPROBE_SYMBOL(override_function_with_return);
Annotation
- Immediate include surface: `linux/linkage.h`, `linux/error-injection.h`, `linux/kprobes.h`, `linux/objtool.h`.
- Detected declarations: `function override_function_with_return`.
- Atlas domain: Architecture Layer / arch/x86.
- 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.