Fix user apps randomly crashing (APIC, GDT layout, syscall entry)
All checks were successful
Build documentation / build-and-deploy (push) Successful in 23s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 23s
This commit is contained in:
@@ -7,10 +7,12 @@
|
||||
#include <irq/irq.h>
|
||||
#include <libk/std.h>
|
||||
#include <libk/string.h>
|
||||
#include <m/syscall_defs.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/irq.h>
|
||||
#include <sys/smp.h>
|
||||
#include <sys/spin.h>
|
||||
#include <syscall/syscall.h>
|
||||
|
||||
/* 8259 PIC defs. */
|
||||
#define PIC1 0x20
|
||||
@@ -122,6 +124,7 @@ static void amd64_idt_init (void) {
|
||||
IDT_ENTRY (SCHED_PREEMPT_TIMER, 1);
|
||||
IDT_ENTRY (TLB_SHOOTDOWN, 1);
|
||||
IDT_ENTRY (CPU_REQUEST_SCHED, 1);
|
||||
IDT_ENTRY (CPU_SPURIOUS, 1);
|
||||
/* clang-format on */
|
||||
#undef IDT_ENTRY
|
||||
|
||||
@@ -154,7 +157,7 @@ static void amd64_intr_exception (struct saved_regs* regs) {
|
||||
regs->rbx);
|
||||
|
||||
if (regs->cs == (GDT_UCODE | 0x03)) {
|
||||
proc_kill (thiscpu->proc_current);
|
||||
proc_kill (thiscpu->proc_current, regs);
|
||||
} else {
|
||||
spin ();
|
||||
}
|
||||
@@ -226,6 +229,7 @@ uint8_t amd64_resolve_irq (uint8_t irq) {
|
||||
[SCHED_PREEMPT_TIMER] = 0,
|
||||
[TLB_SHOOTDOWN] = 1,
|
||||
[CPU_REQUEST_SCHED] = 2,
|
||||
[CPU_SPURIOUS] = 3,
|
||||
};
|
||||
|
||||
return mappings[irq];
|
||||
|
||||
Reference in New Issue
Block a user