cpu->proc_current cannot be NULL
This commit is contained in:
@@ -160,6 +160,23 @@ static void intr_exception (struct saved_regs* regs) {
|
||||
regs->error, regs->rip, regs->cs, regs->rflags, regs->rsp, regs->ss, cr2, cr3,
|
||||
regs->rbx);
|
||||
|
||||
debugprintf ("call stack:\n");
|
||||
|
||||
uint64_t rbp = regs->rbp;
|
||||
|
||||
for (size_t depth = 0; depth < 20; depth++) {
|
||||
if (rbp == 0)
|
||||
break;
|
||||
|
||||
uint64_t rip = *(uint64_t*)(rbp + 8);
|
||||
debugprintf (" #%d %016lx\n", depth, rip);
|
||||
|
||||
rbp = *(uint64_t*)rbp;
|
||||
|
||||
if (rbp == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (regs->cs == (GDT_UCODE | 0x03)) {
|
||||
struct reschedule_ctx rctx;
|
||||
memset (&rctx, 0, sizeof (rctx));
|
||||
@@ -200,14 +217,12 @@ void intr_handler (void* stack_ptr) {
|
||||
|
||||
struct proc* proc_current = thiscpu->proc_current;
|
||||
|
||||
if (proc_current != NULL) {
|
||||
spin_lock (&proc_current->lock, &fpc);
|
||||
memcpy (&proc_current->pdata.regs, regs, sizeof (struct saved_regs));
|
||||
spin_lock (&proc_current->lock, &fpc);
|
||||
memcpy (&proc_current->pdata.regs, regs, sizeof (struct saved_regs));
|
||||
|
||||
fx_save (proc_current->pdata.fx_env);
|
||||
fx_save (proc_current->pdata.fx_env);
|
||||
|
||||
spin_unlock (&proc_current->lock, fpc);
|
||||
}
|
||||
spin_unlock (&proc_current->lock, fpc);
|
||||
|
||||
spin_unlock (&thiscpu->lock, ftc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user