arch/arm64/include/asm/irqflags.h
Source file repositories/reference/linux-study-clean/arch/arm64/include/asm/irqflags.h
File Facts
- System
- Linux kernel
- Corpus path
arch/arm64/include/asm/irqflags.h- Extension
.h- Size
- 4475 bytes
- Lines
- 200
- Domain
- Architecture Layer
- Bucket
- arch/arm64
- 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.
Dependency Surface
asm/barrier.hasm/ptrace.hasm/sysreg.h
Detected Declarations
function Copyrightfunction __pmr_local_irq_enablefunction arch_local_irq_enablefunction __daif_local_irq_disablefunction __pmr_local_irq_disablefunction arch_local_irq_disablefunction __daif_local_save_flagsfunction __pmr_local_save_flagsfunction arch_local_save_flagsfunction __daif_irqs_disabled_flagsfunction __pmr_irqs_disabled_flagsfunction arch_irqs_disabled_flagsfunction __daif_irqs_disabledfunction __pmr_irqs_disabledfunction arch_irqs_disabledfunction __daif_local_irq_savefunction __pmr_local_irq_savefunction arch_local_irq_savefunction __daif_local_irq_restorefunction __pmr_local_irq_restorefunction arch_local_irq_restore
Annotated Snippet
#ifndef __ASM_IRQFLAGS_H
#define __ASM_IRQFLAGS_H
#include <asm/barrier.h>
#include <asm/ptrace.h>
#include <asm/sysreg.h>
/*
* Aarch64 has flags for masking: Debug, Asynchronous (serror), Interrupts and
* FIQ exceptions, in the 'daif' register. We mask and unmask them in 'daif'
* order:
* Masking debug exceptions causes all other exceptions to be masked too/
* Masking SError masks IRQ/FIQ, but not debug exceptions. IRQ and FIQ are
* always masked and unmasked together, and have no side effects for other
* flags. Keeping to this order makes it easier for entry.S to know which
* exceptions should be unmasked.
*/
static __always_inline void __daif_local_irq_enable(void)
{
barrier();
asm volatile("msr daifclr, #3");
barrier();
}
static __always_inline void __pmr_local_irq_enable(void)
{
if (IS_ENABLED(CONFIG_ARM64_DEBUG_PRIORITY_MASKING)) {
u32 pmr = read_sysreg_s(SYS_ICC_PMR_EL1);
WARN_ON_ONCE(pmr != GIC_PRIO_IRQON && pmr != GIC_PRIO_IRQOFF);
}
barrier();
write_sysreg_s(GIC_PRIO_IRQON, SYS_ICC_PMR_EL1);
pmr_sync();
barrier();
}
static __always_inline void arch_local_irq_enable(void)
{
if (system_uses_irq_prio_masking()) {
__pmr_local_irq_enable();
} else {
__daif_local_irq_enable();
}
}
static __always_inline void __daif_local_irq_disable(void)
{
barrier();
asm volatile("msr daifset, #3");
barrier();
}
static __always_inline void __pmr_local_irq_disable(void)
{
if (IS_ENABLED(CONFIG_ARM64_DEBUG_PRIORITY_MASKING)) {
u32 pmr = read_sysreg_s(SYS_ICC_PMR_EL1);
WARN_ON_ONCE(pmr != GIC_PRIO_IRQON && pmr != GIC_PRIO_IRQOFF);
}
barrier();
write_sysreg_s(GIC_PRIO_IRQOFF, SYS_ICC_PMR_EL1);
barrier();
}
static __always_inline void arch_local_irq_disable(void)
{
if (system_uses_irq_prio_masking()) {
__pmr_local_irq_disable();
} else {
__daif_local_irq_disable();
}
}
static __always_inline unsigned long __daif_local_save_flags(void)
{
return read_sysreg(daif);
}
static __always_inline unsigned long __pmr_local_save_flags(void)
{
return read_sysreg_s(SYS_ICC_PMR_EL1);
}
/*
* Save the current interrupt enable state.
*/
static __always_inline unsigned long arch_local_save_flags(void)
{
Annotation
- Immediate include surface: `asm/barrier.h`, `asm/ptrace.h`, `asm/sysreg.h`.
- Detected declarations: `function Copyright`, `function __pmr_local_irq_enable`, `function arch_local_irq_enable`, `function __daif_local_irq_disable`, `function __pmr_local_irq_disable`, `function arch_local_irq_disable`, `function __daif_local_save_flags`, `function __pmr_local_save_flags`, `function arch_local_save_flags`, `function __daif_irqs_disabled_flags`.
- Atlas domain: Architecture Layer / arch/arm64.
- 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.