--- //depot/vendor/freebsd/src/sys/i386/include/cpufunc.h 2005/05/13 00:11:01 +++ //depot/projects/smpng/sys/i386/include/cpufunc.h 2005/05/27 14:58:46 @@ -42,6 +42,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + struct region_descriptor; #define readb(va) (*(volatile u_int8_t *) (va)) @@ -620,14 +622,16 @@ register_t eflags; eflags = read_eflags(); - disable_intr(); + if (eflags & PSL_I) + disable_intr(); return (eflags); } static __inline void intr_restore(register_t eflags) { - write_eflags(eflags); + if (eflags & PSL_I) + enable_intr(); } #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */