kprintf: fix checking if interrupt is disabled
Change-Id: I2ee1a1e2438ae761c4136593953ede2738bc6f74
This commit is contained in:
committed by
Masamichi Takagi
parent
c94cf8e6f0
commit
3e00189de0
@@ -1273,6 +1273,15 @@ unsigned long cpu_enable_interrupt_save(void)
|
||||
return flags;
|
||||
}
|
||||
|
||||
int cpu_interrupt_disabled(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
asm volatile("pushf; pop %0" : "=r"(flags) : : "memory", "cc");
|
||||
|
||||
return !(flags & 0x200);
|
||||
}
|
||||
|
||||
/*@
|
||||
@ behavior valid_vector:
|
||||
@ assumes 32 <= vector <= 255;
|
||||
|
||||
Reference in New Issue
Block a user