Skip to content

Commit

Permalink
x86_64: always go through isr_common for lapic timer
Browse files Browse the repository at this point in the history
We should always update the clocks on lapic timer,
so it should not short-circuit in kernel mode.
  • Loading branch information
klange committed Jan 21, 2024
1 parent 4c9f9a6 commit 5b0c5da
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion kernel/arch/x86_64/idt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
6 changes: 0 additions & 6 deletions kernel/arch/x86_64/irq.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b0c5da

Please sign in to comment.