diff --git a/kernel/arch/x86_64/idt.c b/kernel/arch/x86_64/idt.c index 7120b1f9..b4e048d3 100644 --- a/kernel/arch/x86_64/idt.c +++ b/kernel/arch/x86_64/idt.c @@ -538,7 +538,7 @@ static void _page_fault(struct regs * r) { static void _local_timer(struct regs * r) { extern void arch_update_clock(void); arch_update_clock(); - switch_task(1); + if (r->cs != 0x08) switch_task(1); } /** diff --git a/kernel/arch/x86_64/irq.S b/kernel/arch/x86_64/irq.S index bcb59300..f39a1a63 100644 --- a/kernel/arch/x86_64/irq.S +++ b/kernel/arch/x86_64/irq.S @@ -98,16 +98,10 @@ _isr123: add $0xb0, %r12 movl $0, (%r12) popq %r12 - /* Are we in userspace? */ - cmpq $8, 8(%rsp) - je 1f /* Then we can proceed! */ pushq $0x00 pushq $123 jmp isr_common -1: - /* If we were not in userspace, nothing to do; we were already idle. */ - iretq .global _isr124