arch/x86/kernel/callthunks.c
Source file repositories/reference/linux-study-clean/arch/x86/kernel/callthunks.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kernel/callthunks.c- Extension
.c- Size
- 8886 bytes
- Lines
- 383
- Domain
- Architecture Layer
- Bucket
- arch/x86
- 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.
- 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/debugfs.hlinux/kallsyms.hlinux/memory.hlinux/moduleloader.hlinux/static_call.hasm/alternative.hasm/asm-offsets.hasm/cpu.hasm/ftrace.hasm/insn.hasm/kexec.hasm/nospec-branch.hasm/sections.hasm/switch_to.hasm/sync_core.hasm/text-patching.hasm/xen/hypercall.h
Detected Declarations
struct core_textfunction debug_thunksfunction within_coretextfunction within_module_coretextfunction is_coretextfunction skip_addrfunction patch_callfunction patch_call_sitesfunction callthunks_setupfunction callthunks_patch_builtin_callsfunction is_callthunkfunction x86_call_depth_emit_accountingfunction callthunks_patch_module_callsfunction callthunks_debug_showfunction callthunks_debug_openfunction callthunks_debugfs_init
Annotated Snippet
static const struct file_operations dfs_ops = {
.open = callthunks_debug_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static int __init callthunks_debugfs_init(void)
{
struct dentry *dir;
unsigned long cpu;
dir = debugfs_create_dir("callthunks", NULL);
for_each_possible_cpu(cpu) {
void *arg = (void *)cpu;
char name [10];
sprintf(name, "cpu%lu", cpu);
debugfs_create_file(name, 0644, dir, arg, &dfs_ops);
}
return 0;
}
__initcall(callthunks_debugfs_init);
#endif
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/kallsyms.h`, `linux/memory.h`, `linux/moduleloader.h`, `linux/static_call.h`, `asm/alternative.h`, `asm/asm-offsets.h`, `asm/cpu.h`.
- Detected declarations: `struct core_text`, `function debug_thunks`, `function within_coretext`, `function within_module_coretext`, `function is_coretext`, `function skip_addr`, `function patch_call`, `function patch_call_sites`, `function callthunks_setup`, `function callthunks_patch_builtin_calls`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: pattern 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.