Spinlock save cpu flags
This commit is contained in:
@@ -191,20 +191,22 @@ void intr_handler (void* stack_ptr) {
|
||||
if (regs->trap <= 31) {
|
||||
intr_exception (regs);
|
||||
} else {
|
||||
spin_lock (&thiscpu->lock);
|
||||
uint64_t ftc, fpc;
|
||||
|
||||
spin_lock (&thiscpu->lock, &ftc);
|
||||
|
||||
struct proc* proc_current = thiscpu->proc_current;
|
||||
|
||||
if (proc_current != NULL) {
|
||||
spin_lock (&proc_current->lock);
|
||||
spin_lock (&proc_current->lock, &fpc);
|
||||
memcpy (&proc_current->pdata.regs, regs, sizeof (struct saved_regs));
|
||||
|
||||
fx_save (proc_current->pdata.fx_env);
|
||||
|
||||
spin_unlock (&proc_current->lock);
|
||||
spin_unlock (&proc_current->lock, fpc);
|
||||
}
|
||||
|
||||
spin_unlock (&thiscpu->lock);
|
||||
spin_unlock (&thiscpu->lock, ftc);
|
||||
|
||||
lapic_eoi ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user