redesign of nested if flag handling
=> only clearing and setting of the IF flag
This commit is contained in:
parent
4d14ec6aa7
commit
8868900e19
1 changed files with 5 additions and 2 deletions
|
@ -31,7 +31,9 @@ inline static void irq_disable(void) {
|
|||
inline static uint32_t irq_nested_disable(void) {
|
||||
uint32_t flags;
|
||||
asm volatile("pushf; cli; popl %0": "=r"(flags) : : "memory");
|
||||
return flags;
|
||||
if (flags & (1 << 9))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline static void irq_enable(void) {
|
||||
|
@ -39,7 +41,8 @@ inline static void irq_enable(void) {
|
|||
}
|
||||
|
||||
inline static void irq_nested_enable(uint32_t flags) {
|
||||
asm volatile("pushl %0; popf" : : "r"(flags) : "memory");
|
||||
if (flags)
|
||||
irq_enable();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Reference in a new issue