include/linux/irq-entry-common.h
Source file repositories/reference/linux-study-clean/include/linux/irq-entry-common.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/irq-entry-common.h- Extension
.h- Size
- 20987 bytes
- Lines
- 614
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/context_tracking.hlinux/hrtimer_rearm.hlinux/kmsan.hlinux/rseq_entry.hlinux/static_call_types.hlinux/syscalls.hlinux/tick.hlinux/unwind_deferred.hasm/entry-common.h
Detected Declarations
function arch_enter_from_user_modefunction syscall_enter_from_user_mode_workfunction arch_exit_to_user_mode_workfunction arch_exit_to_user_mode_preparefunction arch_exit_to_user_modefunction __exit_to_user_mode_preparefunction __exit_to_user_mode_validatefunction __exit_to_user_mode_preparefunction __exit_to_user_mode_preparefunction syscall_exit_to_user_modefunction statefunction irqentry_exit_to_user_modefunction statefunction ct_irq_enterfunction irqentry_exit_to_kernel_mode_after_preemptfunction irqentry_exit_to_kernel_mode_preemptfunction irqentry_enter_from_kernel_mode
Annotated Snippet
static __always_inline void arch_enter_from_user_mode(struct pt_regs *regs) {}
#endif
/**
* arch_in_rcu_eqs - Architecture specific check for RCU extended quiescent
* states.
*
* Returns: true if the CPU is potentially in an RCU EQS, false otherwise.
*
* Architectures only need to define this if threads other than the idle thread
* may have an interruptible EQS. This does not need to handle idle threads. It
* is safe to over-estimate at the cost of redundant RCU management work.
*
* Invoked from irqentry_enter()
*/
#ifndef arch_in_rcu_eqs
static __always_inline bool arch_in_rcu_eqs(void) { return false; }
#endif
/**
* enter_from_user_mode - Establish state when coming from user mode
* @regs: Pointer to currents pt_regs
*
* Syscall/interrupt entry disables interrupts, but user mode is traced as
* interrupts enabled. Also with NO_HZ_FULL RCU might be idle.
*
* 1) Tell lockdep that interrupts are disabled
* 2) Invoke context tracking if enabled to reactivate RCU
* 3) Trace interrupts off state
*
* Invoked from architecture specific syscall entry code with interrupts
* disabled. The calling code has to be non-instrumentable. When the
* function returns all state is correct and interrupts are still
* disabled. The subsequent functions can be instrumented.
*
* This is invoked when there is architecture specific functionality to be
* done between establishing state and enabling interrupts. The caller must
* enable interrupts before invoking syscall_enter_from_user_mode_work().
*/
static __always_inline void enter_from_user_mode(struct pt_regs *regs)
{
arch_enter_from_user_mode(regs);
lockdep_hardirqs_off(CALLER_ADDR0);
CT_WARN_ON(__ct_state() != CT_STATE_USER);
user_exit_irqoff();
instrumentation_begin();
kmsan_unpoison_entry_regs(regs);
trace_hardirqs_off_finish();
instrumentation_end();
}
/**
* arch_exit_to_user_mode_work - Architecture specific TIF work for exit
* to user mode.
* @regs: Pointer to currents pt_regs
* @ti_work: Cached TIF flags gathered with interrupts disabled
*
* Invoked from exit_to_user_mode_loop() with interrupt enabled
*
* Defaults to NOOP. Can be supplied by architecture specific code.
*/
static inline void arch_exit_to_user_mode_work(struct pt_regs *regs,
unsigned long ti_work);
#ifndef arch_exit_to_user_mode_work
static inline void arch_exit_to_user_mode_work(struct pt_regs *regs,
unsigned long ti_work)
{
}
#endif
/**
* arch_exit_to_user_mode_prepare - Architecture specific preparation for
* exit to user mode.
* @regs: Pointer to currents pt_regs
* @ti_work: Cached TIF flags gathered with interrupts disabled
*
* Invoked from exit_to_user_mode_prepare() with interrupt disabled as the last
* function before return. Defaults to NOOP.
*/
static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
unsigned long ti_work);
#ifndef arch_exit_to_user_mode_prepare
static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
unsigned long ti_work)
{
}
Annotation
- Immediate include surface: `linux/context_tracking.h`, `linux/hrtimer_rearm.h`, `linux/kmsan.h`, `linux/rseq_entry.h`, `linux/static_call_types.h`, `linux/syscalls.h`, `linux/tick.h`, `linux/unwind_deferred.h`.
- Detected declarations: `function arch_enter_from_user_mode`, `function syscall_enter_from_user_mode_work`, `function arch_exit_to_user_mode_work`, `function arch_exit_to_user_mode_prepare`, `function arch_exit_to_user_mode`, `function __exit_to_user_mode_prepare`, `function __exit_to_user_mode_validate`, `function __exit_to_user_mode_prepare`, `function __exit_to_user_mode_prepare`, `function syscall_exit_to_user_mode`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.