cregit-Linux how code gets into the kernel

Release 4.11 arch/arm/include/asm/irqflags.h

#ifndef __ASM_ARM_IRQFLAGS_H

#define __ASM_ARM_IRQFLAGS_H

#ifdef __KERNEL__

#include <asm/ptrace.h>

/*
 * CPU interrupt mask handling.
 */
#ifdef CONFIG_CPU_V7M

#define IRQMASK_REG_NAME_R "primask"

#define IRQMASK_REG_NAME_W "primask"

#define IRQMASK_I_BIT	1
#else

#define IRQMASK_REG_NAME_R "cpsr"

#define IRQMASK_REG_NAME_W "cpsr_c"

#define IRQMASK_I_BIT	PSR_I_BIT
#endif

#if __LINUX_ARM_ARCH__ >= 6


#define arch_local_irq_save arch_local_irq_save

static inline unsigned long arch_local_irq_save(void) { unsigned long flags; asm volatile( " mrs %0, " IRQMASK_REG_NAME_R " @ arch_local_irq_save\n" " cpsid i" : "=r" (flags) : : "memory", "cc"); return flags; }

Contributors

PersonTokensPropCommitsCommitProp
David Howells1785.00%133.33%
Russell King210.00%133.33%
Catalin Marinas15.00%133.33%
Total20100.00%3100.00%

#define arch_local_irq_enable arch_local_irq_enable
static inline void arch_local_irq_enable(void) { asm volatile( " cpsie i @ arch_local_irq_enable" : : : "memory", "cc"); }

Contributors

PersonTokensPropCommitsCommitProp
David Howells12100.00%1100.00%
Total12100.00%1100.00%

#define arch_local_irq_disable arch_local_irq_disable
static inline void arch_local_irq_disable(void) { asm volatile( " cpsid i @ arch_local_irq_disable" : : : "memory", "cc"); }

Contributors

PersonTokensPropCommitsCommitProp
David Howells12100.00%1100.00%
Total12100.00%1100.00%

#define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc") #define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc") #ifndef CONFIG_CPU_V7M #define local_abt_enable() __asm__("cpsie a @ __sta" : : : "memory", "cc") #define local_abt_disable() __asm__("cpsid a @ __cla" : : : "memory", "cc") #else #define local_abt_enable() do { } while (0) #define local_abt_disable() do { } while (0) #endif #else /* * Save the current interrupt enable state & disable IRQs */ #define arch_local_irq_save arch_local_irq_save
static inline unsigned long arch_local_irq_save(void) { unsigned long flags, temp; asm volatile( " mrs %0, cpsr @ arch_local_irq_save\n" " orr %1, %0, #128\n" " msr cpsr_c, %1" : "=r" (flags), "=r" (temp) : : "memory", "cc"); return flags; }

Contributors

PersonTokensPropCommitsCommitProp
David Howells2090.91%150.00%
Russell King29.09%150.00%
Total22100.00%2100.00%

/* * Enable IRQs */ #define arch_local_irq_enable arch_local_irq_enable
static inline void arch_local_irq_enable(void) { unsigned long temp; asm volatile( " mrs %0, cpsr @ arch_local_irq_enable\n" " bic %0, %0, #128\n" " msr cpsr_c, %0" : "=r" (temp) : : "memory", "cc"); }

Contributors

PersonTokensPropCommitsCommitProp
David Howells16100.00%1100.00%
Total16100.00%1100.00%

/* * Disable IRQs */ #define arch_local_irq_disable arch_local_irq_disable
static inline void arch_local_irq_disable(void) { unsigned long temp; asm volatile( " mrs %0, cpsr @ arch_local_irq_disable\n" " orr %0, %0, #128\n" " msr cpsr_c, %0" : "=r" (temp) : : "memory", "cc"); }

Contributors

PersonTokensPropCommitsCommitProp
David Howells16100.00%1100.00%
Total16100.00%1100.00%

/* * Enable FIQs */ #define local_fiq_enable() \ ({ \ unsigned long temp; \ __asm__ __volatile__( \ "mrs %0, cpsr @ stf\n" \ " bic %0, %0, #64\n" \ " msr cpsr_c, %0" \ : "=r" (temp) \ : \ : "memory", "cc"); \ }) /* * Disable FIQs */ #define local_fiq_disable() \ ({ \ unsigned long temp; \ __asm__ __volatile__( \ "mrs %0, cpsr @ clf\n" \ " orr %0, %0, #64\n" \ " msr cpsr_c, %0" \ : "=r" (temp) \ : \ : "memory", "cc"); \ }) #define local_abt_enable() do { } while (0) #define local_abt_disable() do { } while (0) #endif /* * Save the current interrupt enable state. */ #define arch_local_save_flags arch_local_save_flags
static inline unsigned long arch_local_save_flags(void) { unsigned long flags; asm volatile( " mrs %0, " IRQMASK_REG_NAME_R " @ local_save_flags" : "=r" (flags) : : "memory", "cc"); return flags; }

Contributors

PersonTokensPropCommitsCommitProp
David Howells1785.00%133.33%
Russell King210.00%133.33%
Catalin Marinas15.00%133.33%
Total20100.00%3100.00%

/* * restore saved IRQ & FIQ state */ #define arch_local_irq_restore arch_local_irq_restore
static inline void arch_local_irq_restore(unsigned long flags) { asm volatile( " msr " IRQMASK_REG_NAME_W ", %0 @ local_irq_restore" : : "r" (flags) : "memory", "cc"); }

Contributors

PersonTokensPropCommitsCommitProp
David Howells1178.57%133.33%
Russell King214.29%133.33%
Catalin Marinas17.14%133.33%
Total14100.00%3100.00%

#define arch_irqs_disabled_flags arch_irqs_disabled_flags
static inline int arch_irqs_disabled_flags(unsigned long flags) { return flags & IRQMASK_I_BIT; }

Contributors

PersonTokensPropCommitsCommitProp
David Howells1275.00%133.33%
Russell King318.75%133.33%
Catalin Marinas16.25%133.33%
Total16100.00%3100.00%

#include <asm-generic/irqflags.h> #endif /* ifdef __KERNEL__ */ #endif /* ifndef __ASM_ARM_IRQFLAGS_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
David Howells13342.63%120.00%
Russell King6621.15%120.00%
Daniel R Thompson3912.50%120.00%
Catalin Marinas3711.86%120.00%
Lucas Stach3711.86%120.00%
Total312100.00%5100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.