summaryrefslogtreecommitdiff
path: root/arch/x86/machine/lapic.c
diff options
context:
space:
mode:
authorRemy Noel <mocramis@gmail.com>2018-03-26 05:45:36 +0200
committerRemy Noel <mocramis@gmail.com>2018-04-21 00:04:20 +0200
commitb6ee3f35eb82e826e800cdc4ba483c1428a6e6d6 (patch)
treeff6f1aec7558b6af553273a720d80f77b548d019 /arch/x86/machine/lapic.c
parentc59b444cf25e01de7911514af9ebc15d342197b5 (diff)
perfmon: add perfmon overflow interrupt.
Diffstat (limited to 'arch/x86/machine/lapic.c')
-rw-r--r--arch/x86/machine/lapic.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/machine/lapic.c b/arch/x86/machine/lapic.c
index 3f6d0c2..ebff5fc 100644
--- a/arch/x86/machine/lapic.c
+++ b/arch/x86/machine/lapic.c
@@ -25,6 +25,7 @@
#include <kern/log.h>
#include <kern/macros.h>
#include <kern/panic.h>
+#include <kern/perfmon.h>
#include <machine/cpu.h>
#include <machine/lapic.h>
#include <machine/pmap.h>
@@ -159,7 +160,7 @@ struct lapic_map {
struct lapic_register icr_high;
struct lapic_register lvt_timer;
const struct lapic_register reserved14; /* Thermal sensor register */
- const struct lapic_register reserved15; /* Performance counters register */
+ struct lapic_register lvt_pmc; /* Performance counters register */
struct lapic_register lvt_lint0;
struct lapic_register lvt_lint1;
struct lapic_register lvt_error;
@@ -239,6 +240,7 @@ lapic_setup_registers(void)
lapic_write(&lapic_map->lvt_error, TRAP_LAPIC_ERROR);
lapic_write(&lapic_map->timer_dcr, LAPIC_TIMER_DCR_DIV1);
lapic_write(&lapic_map->timer_icr, lapic_bus_freq / CLOCK_FREQ);
+ lapic_write(&lapic_map->lvt_pmc, TRAP_LAPIC_PMC_OF);
}
void __init
@@ -334,6 +336,13 @@ lapic_ipi_broadcast(uint32_t vector)
}
void
+lapic_pmc_of_intr(struct trap_frame *frame)
+{
+ perfmon_handle_of_intr(frame);
+ lapic_eoi();
+}
+
+void
lapic_timer_intr(struct trap_frame *frame)
{
(void)frame;