summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/apicvar.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-05-24 15:45:05 +0000
committerjhb <jhb@FreeBSD.org>2010-05-24 15:45:05 +0000
commit9e6f9b1e86420cd7da13f1d568950ab52ff2428f (patch)
treea9d317cc94e24d55cd44eed2052b78547f4a46f9 /sys/i386/include/apicvar.h
parentce59c74efda35e47b39621f57c0fe63e02c7af5b (diff)
downloadFreeBSD-src-9e6f9b1e86420cd7da13f1d568950ab52ff2428f.zip
FreeBSD-src-9e6f9b1e86420cd7da13f1d568950ab52ff2428f.tar.gz
Add support for corrected machine check interrupts. CMCI is a new local
APIC interrupt that fires when a threshold of corrected machine check events is reached. CMCI also includes a count of events when reporting corrected errors in the bank's status register. Note that individual banks may or may not support CMCI. If they do, each bank includes its own threshold register that determines when the interrupt fires. Currently the code uses a very simple strategy where it doubles the threshold on each interrupt until it succeeds in throttling the interrupt to occur only once a minute (this interval can be tuned via sysctl). The threshold is also adjusted on each hourly poll which will lower the threshold once events stop occurring. Tested by: Sailaja Bangaru sbappana at yahoo com MFC after: 1 month
Diffstat (limited to 'sys/i386/include/apicvar.h')
-rw-r--r--sys/i386/include/apicvar.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/i386/include/apicvar.h b/sys/i386/include/apicvar.h
index adfc1e8..f917357 100644
--- a/sys/i386/include/apicvar.h
+++ b/sys/i386/include/apicvar.h
@@ -108,7 +108,8 @@
#define APIC_LOCAL_INTS 240
#define APIC_ERROR_INT APIC_LOCAL_INTS
#define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1)
-#define APIC_IPI_INTS (APIC_LOCAL_INTS + 2)
+#define APIC_CMC_INT (APIC_LOCAL_INTS + 2)
+#define APIC_IPI_INTS (APIC_LOCAL_INTS + 3)
#define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */
#define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */
@@ -135,7 +136,8 @@
#define APIC_LOCAL_INTS 240
#define APIC_ERROR_INT APIC_LOCAL_INTS
#define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1)
-#define APIC_IPI_INTS (APIC_LOCAL_INTS + 2)
+#define APIC_CMC_INT (APIC_LOCAL_INTS + 2)
+#define APIC_IPI_INTS (APIC_LOCAL_INTS + 3)
#define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */
#define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */
@@ -170,7 +172,8 @@
#define LVT_ERROR 3
#define LVT_PMC 4
#define LVT_THERMAL 5
-#define LVT_MAX LVT_THERMAL
+#define LVT_CMCI 6
+#define LVT_MAX LVT_CMCI
#ifndef LOCORE
@@ -206,8 +209,8 @@ struct apic_enumerator {
inthand_t
IDTVEC(apic_isr1), IDTVEC(apic_isr2), IDTVEC(apic_isr3),
IDTVEC(apic_isr4), IDTVEC(apic_isr5), IDTVEC(apic_isr6),
- IDTVEC(apic_isr7), IDTVEC(errorint), IDTVEC(spuriousint),
- IDTVEC(timerint);
+ IDTVEC(apic_isr7), IDTVEC(cmcint), IDTVEC(errorint),
+ IDTVEC(spuriousint), IDTVEC(timerint);
extern vm_paddr_t lapic_paddr;
extern int apic_cpuids[];
@@ -237,6 +240,7 @@ void lapic_create(u_int apic_id, int boot_cpu);
void lapic_disable(void);
void lapic_disable_pmc(void);
void lapic_dump(const char *str);
+void lapic_enable_cmc(void);
int lapic_enable_pmc(void);
void lapic_eoi(void);
int lapic_id(void);
@@ -245,6 +249,7 @@ int lapic_intr_pending(u_int vector);
void lapic_ipi_raw(register_t icrlo, u_int dest);
void lapic_ipi_vectored(u_int vector, int dest);
int lapic_ipi_wait(int delay);
+void lapic_handle_cmc(void);
void lapic_handle_error(void);
void lapic_handle_intr(int vector, struct trapframe *frame);
void lapic_handle_timer(struct trapframe *frame);
OpenPOWER on IntegriCloud