From 81da5c11b9c7b2cba0da88f877ffe0cc8ed37f49 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 14 Apr 2003 02:08:01 -0700 Subject: [PATCH] Make the x86 flags save/restore code check the type of the macro argument, so that portability issues will be found in a timely manner. --- include/asm-i386/system.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index fbc90dd3bbed3..2b57b01de589b 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -378,8 +378,8 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, #define set_wmb(var, value) do { var = value; wmb(); } while (0) /* interrupt control.. */ -#define local_save_flags(x) __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */) -#define local_irq_restore(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory", "cc") +#define local_save_flags(x) do { typecheck(unsigned long,x); __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */); } while (0) +#define local_irq_restore(x) do { typecheck(unsigned long,x); __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory", "cc"); } while (0) #define local_irq_disable() __asm__ __volatile__("cli": : :"memory") #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") /* used in the idle loop; sti takes one instruction cycle to complete */ -- 2.53.0