From f349e4963cf427ed9ae1faefbcba7fa00b3d45d2 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Fri, 28 Apr 2023 21:06:57 +0100 Subject: [PATCH] x86_64: charge clock cycles to threads when handling IRQs Clock cycles that are used to handle the IRQ itself are *not* charged to the thread. --- arch/x86_64/irq.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86_64/irq.c b/arch/x86_64/irq.c index 633d6a2..a3e8ec1 100644 --- a/arch/x86_64/irq.c +++ b/arch/x86_64/irq.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -232,11 +233,15 @@ void isr_dispatch(struct cpu_context *regs) void irq_dispatch(struct cpu_context *regs) { + end_charge_period(); + irq_ack(regs->int_no); struct queue *hooks = &irq_hooks[regs->int_no - IRQ0]; queue_foreach(struct irq_hook, hook, hooks, irq_entry) { hook->irq_callback(); } + + start_charge_period(); } void syscall_dispatch(struct cpu_context *regs)