git: dfd4c8759325 - stable/15 - x88/local_apic.c: for each lvt element, add LVT register index

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sun, 25 Jan 2026 00:24:41 UTC
The branch stable/15 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=dfd4c8759325ffad17e8e2806fa176b4f4376324

commit dfd4c8759325ffad17e8e2806fa176b4f4376324
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-12-09 03:53:50 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-01-25 00:23:34 +0000

    x88/local_apic.c: for each lvt element, add LVT register index
    
    (cherry picked from commit 87ed56a5c43521d97975d936df4fc36184f1b685)
---
 sys/x86/x86/local_apic.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index 606c551ed921..aecad4cbd463 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -128,6 +128,7 @@ struct lvt {
 	u_int lvt_active:1;
 	u_int lvt_mode:16;
 	u_int lvt_vector:8;
+	u_int lvt_reg;
 };
 
 struct lapic {
@@ -156,6 +157,7 @@ static struct lvt lvts[] = {
 		.lvt_active = 1,
 		.lvt_mode = APIC_LVT_DM_EXTINT,
 		.lvt_vector = 0,
+		.lvt_reg = LAPIC_LVT_LINT0,
 	},
 	/* LINT1: NMI */
 	[APIC_LVT_LINT1] = {
@@ -165,6 +167,7 @@ static struct lvt lvts[] = {
 		.lvt_active = 1,
 		.lvt_mode = APIC_LVT_DM_NMI,
 		.lvt_vector = 0,
+		.lvt_reg = LAPIC_LVT_LINT1,
 	},
 	[APIC_LVT_TIMER] = {
 		.lvt_edgetrigger = 1,
@@ -173,6 +176,7 @@ static struct lvt lvts[] = {
 		.lvt_active = 1,
 		.lvt_mode = APIC_LVT_DM_FIXED,
 		.lvt_vector = APIC_TIMER_INT,
+		.lvt_reg = LAPIC_LVT_TIMER,
 	},
 	[APIC_LVT_ERROR] = {
 		.lvt_edgetrigger = 1,
@@ -181,6 +185,7 @@ static struct lvt lvts[] = {
 		.lvt_active = 1,
 		.lvt_mode = APIC_LVT_DM_FIXED,
 		.lvt_vector = APIC_ERROR_INT,
+		.lvt_reg = LAPIC_LVT_ERROR,
 	},
 	[APIC_LVT_PMC] = {
 		.lvt_edgetrigger = 1,
@@ -189,6 +194,7 @@ static struct lvt lvts[] = {
 		.lvt_active = 1,
 		.lvt_mode = APIC_LVT_DM_NMI,
 		.lvt_vector = 0,
+		.lvt_reg = LAPIC_LVT_PCINT,
 	},
 	[APIC_LVT_THERMAL] = {
 		.lvt_edgetrigger = 1,
@@ -197,6 +203,7 @@ static struct lvt lvts[] = {
 		.lvt_active = 1,
 		.lvt_mode = APIC_LVT_DM_FIXED,
 		.lvt_vector = APIC_THERMAL_INT,
+		.lvt_reg = LAPIC_LVT_THERMAL,
 	},
 	[APIC_LVT_CMCI] = {
 		.lvt_edgetrigger = 1,
@@ -205,6 +212,7 @@ static struct lvt lvts[] = {
 		.lvt_active = 1,
 		.lvt_mode = APIC_LVT_DM_FIXED,
 		.lvt_vector = APIC_CMC_INT,
+		.lvt_reg = LAPIC_LVT_CMCI,
 	},
 };
 
@@ -217,6 +225,7 @@ static struct lvt elvts[] = {
 		.lvt_active = 0,
 		.lvt_mode = APIC_LVT_DM_FIXED,
 		.lvt_vector = 0,
+		.lvt_reg = LAPIC_EXT_LVT0,
 	},
 	[APIC_ELVT_MCA] = {
 		.lvt_edgetrigger = 1,
@@ -225,6 +234,7 @@ static struct lvt elvts[] = {
 		.lvt_active = 0,
 		.lvt_mode = APIC_LVT_DM_FIXED,
 		.lvt_vector = APIC_CMC_INT,
+		.lvt_reg = LAPIC_EXT_LVT1,
 	},
 	[APIC_ELVT_DEI] = {
 		.lvt_edgetrigger = 1,
@@ -233,6 +243,7 @@ static struct lvt elvts[] = {
 		.lvt_active = 0,
 		.lvt_mode = APIC_LVT_DM_FIXED,
 		.lvt_vector = 0,
+		.lvt_reg = LAPIC_EXT_LVT2,
 	},
 	[APIC_ELVT_SBI] = {
 		.lvt_edgetrigger = 1,
@@ -241,6 +252,7 @@ static struct lvt elvts[] = {
 		.lvt_active = 0,
 		.lvt_mode = APIC_LVT_DM_FIXED,
 		.lvt_vector = 0,
+		.lvt_reg = LAPIC_EXT_LVT3,
 	},
 };