diff options
Diffstat (limited to 'c/src/exec/score/cpu/i386/i386.h')
-rw-r--r-- | c/src/exec/score/cpu/i386/i386.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/c/src/exec/score/cpu/i386/i386.h b/c/src/exec/score/cpu/i386/i386.h index 3ebde48ed3..d43669ba53 100644 --- a/c/src/exec/score/cpu/i386/i386.h +++ b/c/src/exec/score/cpu/i386/i386.h @@ -166,6 +166,18 @@ typedef struct { ); \ } +#define i386_get_interrupt_level( _level ) \ + do { \ + register unsigned32 _eflags = 0; \ + \ + asm volatile ( "push %0 ; \ + popf " \ + : "=r" ((_eflags)) : "0" ((_eflags)) \ + ); \ + \ + _level = (_eflags & 0x0200) ? 0 : 1; \ + } while (0) + /* * The following routine swaps the endian format of an unsigned int. * It must be static so it can be referenced indirectly. |