Merge git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-irqflags
* git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-irqflags: Fix IRQ flag handling naming MIPS: Add missing #inclusions of <linux/irq.h> smc91x: Add missing #inclusion of <linux/irq.h> Drop a couple of unnecessary asm/system.h inclusions SH: Add missing consts to sys_execve() declaration Blackfin: Rename IRQ flags handling functions Blackfin: Add missing dep to asm/irqflags.h Blackfin: Rename DES PC2() symbol to avoid collision Blackfin: Split the BF532 BFIN_*_FIO_FLAG() functions to their own header Blackfin: Split PLL code from mach-specific cdef headers
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
*/
|
||||
#define atomic_set(v, i) (((v)->counter) = (i))
|
||||
|
||||
#include <linux/irqflags.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
/**
|
||||
@@ -57,7 +58,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
|
||||
unsigned long flags;
|
||||
int temp;
|
||||
|
||||
raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
|
||||
raw_local_irq_save(flags); /* Don't trace it in an irqsoff handler */
|
||||
temp = v->counter;
|
||||
temp += i;
|
||||
v->counter = temp;
|
||||
@@ -78,7 +79,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
|
||||
unsigned long flags;
|
||||
int temp;
|
||||
|
||||
raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
|
||||
raw_local_irq_save(flags); /* Don't trace it in an irqsoff handler */
|
||||
temp = v->counter;
|
||||
temp -= i;
|
||||
v->counter = temp;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define __ASM_GENERIC_CMPXCHG_LOCAL_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/irqflags.h>
|
||||
|
||||
extern unsigned long wrong_size_cmpxchg(volatile void *ptr);
|
||||
|
||||
|
||||
@@ -5,68 +5,62 @@
|
||||
* All architectures should implement at least the first two functions,
|
||||
* usually inline assembly will be the best way.
|
||||
*/
|
||||
#ifndef RAW_IRQ_DISABLED
|
||||
#define RAW_IRQ_DISABLED 0
|
||||
#define RAW_IRQ_ENABLED 1
|
||||
#ifndef ARCH_IRQ_DISABLED
|
||||
#define ARCH_IRQ_DISABLED 0
|
||||
#define ARCH_IRQ_ENABLED 1
|
||||
#endif
|
||||
|
||||
/* read interrupt enabled status */
|
||||
#ifndef __raw_local_save_flags
|
||||
unsigned long __raw_local_save_flags(void);
|
||||
#ifndef arch_local_save_flags
|
||||
unsigned long arch_local_save_flags(void);
|
||||
#endif
|
||||
|
||||
/* set interrupt enabled status */
|
||||
#ifndef raw_local_irq_restore
|
||||
void raw_local_irq_restore(unsigned long flags);
|
||||
#ifndef arch_local_irq_restore
|
||||
void arch_local_irq_restore(unsigned long flags);
|
||||
#endif
|
||||
|
||||
/* get status and disable interrupts */
|
||||
#ifndef __raw_local_irq_save
|
||||
static inline unsigned long __raw_local_irq_save(void)
|
||||
#ifndef arch_local_irq_save
|
||||
static inline unsigned long arch_local_irq_save(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
flags = __raw_local_save_flags();
|
||||
raw_local_irq_restore(RAW_IRQ_DISABLED);
|
||||
flags = arch_local_save_flags();
|
||||
arch_local_irq_restore(ARCH_IRQ_DISABLED);
|
||||
return flags;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* test flags */
|
||||
#ifndef raw_irqs_disabled_flags
|
||||
static inline int raw_irqs_disabled_flags(unsigned long flags)
|
||||
#ifndef arch_irqs_disabled_flags
|
||||
static inline int arch_irqs_disabled_flags(unsigned long flags)
|
||||
{
|
||||
return flags == RAW_IRQ_DISABLED;
|
||||
return flags == ARCH_IRQ_DISABLED;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* unconditionally enable interrupts */
|
||||
#ifndef raw_local_irq_enable
|
||||
static inline void raw_local_irq_enable(void)
|
||||
#ifndef arch_local_irq_enable
|
||||
static inline void arch_local_irq_enable(void)
|
||||
{
|
||||
raw_local_irq_restore(RAW_IRQ_ENABLED);
|
||||
arch_local_irq_restore(ARCH_IRQ_ENABLED);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* unconditionally disable interrupts */
|
||||
#ifndef raw_local_irq_disable
|
||||
static inline void raw_local_irq_disable(void)
|
||||
#ifndef arch_local_irq_disable
|
||||
static inline void arch_local_irq_disable(void)
|
||||
{
|
||||
raw_local_irq_restore(RAW_IRQ_DISABLED);
|
||||
arch_local_irq_restore(ARCH_IRQ_DISABLED);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* test hardware interrupt enable bit */
|
||||
#ifndef raw_irqs_disabled
|
||||
static inline int raw_irqs_disabled(void)
|
||||
#ifndef arch_irqs_disabled
|
||||
static inline int arch_irqs_disabled(void)
|
||||
{
|
||||
return raw_irqs_disabled_flags(__raw_local_save_flags());
|
||||
return arch_irqs_disabled_flags(arch_local_save_flags());
|
||||
}
|
||||
#endif
|
||||
|
||||
#define raw_local_save_flags(flags) \
|
||||
do { (flags) = __raw_local_save_flags(); } while (0)
|
||||
|
||||
#define raw_local_irq_save(flags) \
|
||||
do { (flags) = __raw_local_irq_save(); } while (0)
|
||||
|
||||
#endif /* __ASM_GENERIC_IRQFLAGS_H */
|
||||
|
||||
Reference in New Issue
Block a user