--- zzzz-none-000/linux-5.4.213/arch/arm/include/asm/irqflags.h 2022-09-15 10:04:56.000000000 +0000 +++ miami-7690-761/linux-5.4.213/arch/arm/include/asm/irqflags.h 2024-05-29 11:19:50.000000000 +0000 @@ -21,6 +21,11 @@ #if __LINUX_ARM_ARCH__ >= 6 +#if IS_ENABLED(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) +#include +#define _local_RET_IP_ ((unsigned long)__builtin_return_address(0)) +#endif + #define arch_local_irq_save arch_local_irq_save static inline unsigned long arch_local_irq_save(void) { @@ -80,6 +85,12 @@ : "=r" (flags), "=r" (temp) : : "memory", "cc"); +#if IS_ENABLED(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) +here: + avm_simple_profiling_irq_disabled((unsigned long)&&here, _local_RET_IP_, + flags & PSR_I_BIT, /* old-status */ + PSR_I_BIT /* new-status */); +#endif return flags; } @@ -89,6 +100,14 @@ #define arch_local_irq_enable arch_local_irq_enable static inline void arch_local_irq_enable(void) { +#if IS_ENABLED(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + unsigned long flags = arch_local_save_flags(); + + avm_simple_profiling_irq_disabled((unsigned long)&&here, _local_RET_IP_, + flags & PSR_I_BIT, /* old-status */ + 0 /* new-status */); +here: +#endif unsigned long temp; asm volatile( " mrs %0, cpsr @ arch_local_irq_enable\n" @@ -168,6 +187,12 @@ #define arch_local_irq_restore arch_local_irq_restore static inline void arch_local_irq_restore(unsigned long flags) { +#if IS_ENABLED(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + avm_simple_profiling_irq_disabled((unsigned long)&&here, _local_RET_IP_, + PSR_I_BIT, /* old-status */ + (flags & PSR_I_BIT) /* new-status */); +here: +#endif asm volatile( " msr " IRQMASK_REG_NAME_W ", %0 @ local_irq_restore" :