18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Common corrected MCE threshold handler code:
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci#include <linux/interrupt.h>
68c2ecf20Sopenharmony_ci#include <linux/kernel.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <asm/irq_vectors.h>
98c2ecf20Sopenharmony_ci#include <asm/traps.h>
108c2ecf20Sopenharmony_ci#include <asm/apic.h>
118c2ecf20Sopenharmony_ci#include <asm/mce.h>
128c2ecf20Sopenharmony_ci#include <asm/trace/irq_vectors.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include "internal.h"
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cistatic void default_threshold_interrupt(void)
178c2ecf20Sopenharmony_ci{
188c2ecf20Sopenharmony_ci	pr_err("Unexpected threshold interrupt at vector %x\n",
198c2ecf20Sopenharmony_ci		THRESHOLD_APIC_VECTOR);
208c2ecf20Sopenharmony_ci}
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_civoid (*mce_threshold_vector)(void) = default_threshold_interrupt;
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciDEFINE_IDTENTRY_SYSVEC(sysvec_threshold)
258c2ecf20Sopenharmony_ci{
268c2ecf20Sopenharmony_ci	trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR);
278c2ecf20Sopenharmony_ci	inc_irq_stat(irq_threshold_count);
288c2ecf20Sopenharmony_ci	mce_threshold_vector();
298c2ecf20Sopenharmony_ci	trace_threshold_apic_exit(THRESHOLD_APIC_VECTOR);
308c2ecf20Sopenharmony_ci	ack_APIC_irq();
318c2ecf20Sopenharmony_ci}
32