Implement waiting for process, CE add command cancelation, rctx many cpus
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m27s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m27s
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <amd64/io.h>
|
||||
#include <aux/compiler.h>
|
||||
#include <irq/irq.h>
|
||||
#include <libk/lengthof.h>
|
||||
#include <libk/std.h>
|
||||
#include <libk/string.h>
|
||||
#include <mm/liballoc.h>
|
||||
@@ -160,11 +161,19 @@ static void intr_exception (struct saved_regs* regs) {
|
||||
regs->rbx);
|
||||
|
||||
if (regs->cs == (GDT_UCODE | 0x03)) {
|
||||
struct reschedule_ctx rctx = {.reschedule = false, .cpu = NULL};
|
||||
struct reschedule_ctx rctx = {0};
|
||||
proc_kill (thiscpu->proc_current, &rctx);
|
||||
|
||||
if (rctx.reschedule)
|
||||
cpu_request_sched (rctx.cpu);
|
||||
bool do_thiscpu = false;
|
||||
for (size_t i = 0; i < lengthof (rctx.cpus); i++) {
|
||||
if (rctx.cpus[i] != NULL && rctx.cpus[i] != thiscpu)
|
||||
cpu_request_sched (rctx.cpus[i]);
|
||||
else
|
||||
do_thiscpu = true;
|
||||
}
|
||||
|
||||
if (do_thiscpu)
|
||||
cpu_request_sched (thiscpu);
|
||||
} else {
|
||||
__asm__ volatile ("cli");
|
||||
spin ();
|
||||
@@ -196,11 +205,19 @@ void intr_handler (void* stack_ptr) {
|
||||
if (irq == NULL)
|
||||
return;
|
||||
|
||||
struct reschedule_ctx rctx = {.reschedule = false, .cpu = NULL};
|
||||
struct reschedule_ctx rctx = {0};
|
||||
irq->func (irq->arg, stack_ptr, &rctx);
|
||||
|
||||
if (rctx.reschedule)
|
||||
cpu_request_sched (rctx.cpu);
|
||||
bool do_thiscpu = false;
|
||||
for (size_t i = 0; i < lengthof (rctx.cpus); i++) {
|
||||
if (rctx.cpus[i] != NULL && rctx.cpus[i] != thiscpu)
|
||||
cpu_request_sched (rctx.cpus[i]);
|
||||
else
|
||||
do_thiscpu = true;
|
||||
}
|
||||
|
||||
if (do_thiscpu)
|
||||
cpu_request_sched (thiscpu);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user