summaryrefslogtreecommitdiff
path: root/arch/sh/include/asm/cmpxchg-irq.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/include/asm/cmpxchg-irq.h')
-rw-r--r--arch/sh/include/asm/cmpxchg-irq.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/sh/include/asm/cmpxchg-irq.h b/arch/sh/include/asm/cmpxchg-irq.h
index bd11f6304..f88877257 100644
--- a/arch/sh/include/asm/cmpxchg-irq.h
+++ b/arch/sh/include/asm/cmpxchg-irq.h
@@ -14,6 +14,17 @@ static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
return retval;
}
+static inline unsigned long xchg_u16(volatile u16 *m, unsigned long val)
+{
+ unsigned long flags, retval;
+
+ local_irq_save(flags);
+ retval = *m;
+ *m = val;
+ local_irq_restore(flags);
+ return retval;
+}
+
static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
{
unsigned long flags, retval;