Fix user CPU context saving
All checks were successful
Build documentation / build-and-deploy (push) Successful in 31s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 31s
This commit is contained in:
@@ -165,13 +165,19 @@ static void amd64_intr_exception (struct saved_regs* regs) {
|
||||
|
||||
/* Handle incoming interrupt, dispatch IRQ handlers. */
|
||||
void amd64_intr_handler (void* stack_ptr) {
|
||||
spin_lock_ctx_t ctxcpu;
|
||||
spin_lock_ctx_t ctxcpu, ctxpr;
|
||||
|
||||
amd64_load_kernel_cr3 ();
|
||||
|
||||
struct saved_regs* regs = stack_ptr;
|
||||
|
||||
spin_lock (&thiscpu->lock, &ctxcpu);
|
||||
memcpy (&thiscpu->regs, regs, sizeof (struct saved_regs));
|
||||
struct proc* proc_current = thiscpu->proc_current;
|
||||
spin_lock (&proc_current->lock, &ctxpr);
|
||||
|
||||
memcpy (&proc_current->pdata.regs, regs, sizeof (struct saved_regs));
|
||||
|
||||
spin_unlock (&proc_current->lock, &ctxpr);
|
||||
spin_unlock (&thiscpu->lock, &ctxcpu);
|
||||
|
||||
if (regs->trap <= 31) {
|
||||
|
||||
Reference in New Issue
Block a user