mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-02 07:28:21 +00:00
fix interrupt disabled bug
This commit is contained in:
@@ -189,13 +189,14 @@ long interrupt_raiseipl(long ipl) {
|
|||||||
bool interrupt_set(bool status) {
|
bool interrupt_set(bool status) {
|
||||||
arch_interrupt_disable();
|
arch_interrupt_disable();
|
||||||
bool old = current_cpu()->intstatus;
|
bool old = current_cpu()->intstatus;
|
||||||
current_cpu()->intstatus = status;
|
|
||||||
|
|
||||||
if (status) {
|
if (status && current_cpu()->isrqueue) {
|
||||||
if (current_cpu()->isrqueue)
|
|
||||||
DOPENDING_SAVE();
|
DOPENDING_SAVE();
|
||||||
arch_interrupt_enable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
current_cpu()->intstatus = status;
|
||||||
|
if (status)
|
||||||
|
arch_interrupt_enable();
|
||||||
|
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,10 +117,7 @@ __attribute__((no_caller_saved_registers)) void sched_userspacecheck(context_t *
|
|||||||
if (&args < (checkargs_t *)current_cpu()->schedulerstack && &args >= (checkargs_t *)((uintptr_t)current_cpu()->schedulerstack - SCHEDULER_STACK_SIZE)) {
|
if (&args < (checkargs_t *)current_cpu()->schedulerstack && &args >= (checkargs_t *)((uintptr_t)current_cpu()->schedulerstack - SCHEDULER_STACK_SIZE)) {
|
||||||
arch_context_saveandcall(checktrampoline, current_thread()->kernelstacktop, &args);
|
arch_context_saveandcall(checktrampoline, current_thread()->kernelstacktop, &args);
|
||||||
} else {
|
} else {
|
||||||
if (userspacecheck(&args)) {
|
userspacecheck(&args);
|
||||||
// need context switch
|
|
||||||
arch_context_switch(context);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
current_cpu()->intstatus = intstatus;
|
current_cpu()->intstatus = intstatus;
|
||||||
|
|||||||
Reference in New Issue
Block a user