Index: sys/amd64/include/cpufunc.h =================================================================== --- sys/amd64/include/cpufunc.h +++ sys/amd64/include/cpufunc.h @@ -45,6 +45,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + struct region_descriptor; #define readb(va) (*(volatile uint8_t *) (va)) @@ -836,6 +838,13 @@ write_rflags(rflags); } +static __inline bool +interrupts_enabled(void) +{ + + return (read_rflags() & PSL_I); +} + static __inline void stac(void) { Index: sys/i386/include/cpufunc.h =================================================================== --- sys/i386/include/cpufunc.h +++ sys/i386/include/cpufunc.h @@ -44,6 +44,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + struct region_descriptor; #define readb(va) (*(volatile uint8_t *) (va)) @@ -691,6 +693,13 @@ write_eflags(eflags); } +static __inline bool +interrupts_enabled(void) +{ + + return (read_eflags() & PSL_I); +} + #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ int breakpoint(void);