forked from Imagelibrary/rtems
Patch from Ian Lance Taylor <ian@airs.com>:
Here is a patch which slightly improves the i386 interrupt handling
macros. These macros were written to use both input and output
parameters, which is not necessary. This patch changes them to use
only an input or output parameter, as appropriate. It also changes
the constraints to permit the interrupt level to be loaded directly in
and out of memory, rather than always requiring a register.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
asm volatile ( "pushf ; \
|
||||
cli ; \
|
||||
pop %0" \
|
||||
: "=r" ((_level)) : "0" ((_level)) \
|
||||
: "=rm" ((_level)) \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
{ \
|
||||
asm volatile ( "push %0 ; \
|
||||
popf" \
|
||||
: "=r" ((_level)) : "0" ((_level)) \
|
||||
: "=rm" ((_level)) \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -53,17 +53,17 @@
|
||||
asm volatile ( "push %0 ; \
|
||||
popf ; \
|
||||
cli" \
|
||||
: "=r" ((_level)) : "0" ((_level)) \
|
||||
: "=rm" ((_level)) \
|
||||
); \
|
||||
}
|
||||
|
||||
#define i386_get_interrupt_level( _level ) \
|
||||
do { \
|
||||
register unsigned32 _eflags = 0; \
|
||||
register unsigned32 _eflags; \
|
||||
\
|
||||
asm volatile ( "pushf ; \
|
||||
pop %0" \
|
||||
: "=r" ((_eflags)) : "0" ((_eflags)) \
|
||||
: "=rm" ((_eflags)) \
|
||||
); \
|
||||
\
|
||||
_level = (_eflags & EFLAGS_INTR_ENABLE) ? 0 : 1; \
|
||||
|
||||
Reference in New Issue
Block a user