--- zzzz-none-000/linux-2.6.39.4/arch/x86/include/asm/irqflags.h 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/arch/x86/include/asm/irqflags.h 2021-11-10 13:23:10.000000000 +0000 @@ -4,6 +4,11 @@ #include #ifndef __ASSEMBLY__ + +#if defined(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) +#include +#include +#endif /* * Interrupt control: */ @@ -68,16 +73,42 @@ static inline void arch_local_irq_restore(unsigned long flags) { +#if defined(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + avm_simple_profiling_irq_disabled((unsigned long)&&here, _RET_IP_, + 0x1, /* old-disable-status */ + !(flags & X86_EFLAGS_IF) /* new-disable-status */ + ); +here: +#endif native_restore_fl(flags); } static inline void arch_local_irq_disable(void) { +#if defined(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + unsigned long flags = arch_local_save_flags(); + + native_irq_disable(); + avm_simple_profiling_irq_disabled(_THIS_IP_, _RET_IP_, + !(flags & X86_EFLAGS_IF), /* old-disable-status */ + 0x1 /* new-disable-status */ + ); +#else native_irq_disable(); +#endif } static inline void arch_local_irq_enable(void) { +#if defined(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + unsigned long flags = arch_local_save_flags(); + + avm_simple_profiling_irq_disabled((unsigned long)&&here, _RET_IP_, + !(flags & X86_EFLAGS_IF), /* old-disable-status */ + 0x0 /* new-disable-status */ + ); +here: +#endif/*--- #if defined(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) ---*/ native_irq_enable(); } @@ -105,7 +136,14 @@ static inline unsigned long arch_local_irq_save(void) { unsigned long flags = arch_local_save_flags(); - arch_local_irq_disable(); + + native_irq_disable(); +#if defined(CONFIG_ENABLE_IRQ_PROFILING_HOOKS) + avm_simple_profiling_irq_disabled(_THIS_IP_, _RET_IP_, + !(flags & X86_EFLAGS_IF), /* old-disable-status */ + 0x1 /* new-disable-status */ + ); +#endif return flags; } #else