Patch by "Grey": Small optimization of arch_int_disable_interrupts_inline()
and arch_int_restore_interrupts_inline(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35377 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -25,22 +25,15 @@ arch_int_disable_interrupts_inline(void)
|
|||||||
asm volatile("pushfl;\n"
|
asm volatile("pushfl;\n"
|
||||||
"popl %0;\n"
|
"popl %0;\n"
|
||||||
"cli" : "=g" (flags));
|
"cli" : "=g" (flags));
|
||||||
return (flags & 0x200) != 0;
|
return flags ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
arch_int_restore_interrupts_inline(int oldState)
|
arch_int_restore_interrupts_inline(int oldState)
|
||||||
{
|
{
|
||||||
int flags = oldState ? 0x200 : 0;
|
if (oldState & 0x200)
|
||||||
|
asm("sti");
|
||||||
asm volatile("pushfl;\n"
|
|
||||||
"popl %0;\n"
|
|
||||||
"andl $0xfffffdff,%0;\n"
|
|
||||||
"orl %1,%0;\n"
|
|
||||||
"pushl %0;\n"
|
|
||||||
"popfl\n"
|
|
||||||
: "=&r"(flags) : "r"(flags));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user