Skip to content

Commit 4efac91

Browse files
committed
madt: disable trbe interrupt in structure for Windows compatibility
1 parent 951fd21 commit 4efac91

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

include/common/madt.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#define ACPI_MADT_TABLE_STRUCTURE_NAME MULTI_APIC_DESCRIPTION_TABLE
1010

11+
// #define GICC_HAS_TRBE_INTERRUPT
12+
1113
typedef struct {
1214
UINT32 LocalInterruptControllerAddress;
1315
UINT32 Flags; // Multiple MADT flags
@@ -37,10 +39,19 @@ typedef struct {
3739
UINT8 ProcessorPowerEfficiencyClass;
3840
UINT8 Reserved2;
3941
UINT16 SpeOverflowInterrupt;
42+
#ifdef GICC_HAS_TRBE_INTERRUPT
43+
// Introduced in ACPI 6.5
44+
// Windows seems do not support this arg currently
4045
UINT16 TRBEInterrupt;
46+
#endif
4147
} __attribute__((packed)) MADT_GICC_STRUCTURE;
48+
#ifdef GICC_HAS_TRBE_INTERRUPT
4249
_Static_assert(sizeof(MADT_GICC_STRUCTURE) == 82,
4350
"MADT_GICC_STRUCTURE size is incorrect");
51+
#else
52+
_Static_assert(sizeof(MADT_GICC_STRUCTURE) == 80,
53+
"MADT_GICC_STRUCTURE size is incorrect");
54+
#endif
4455

4556
// GICC CPU Interface Flags
4657
#define MADT_GICC_FLAG_ENABLED BIT(0)
@@ -180,6 +191,7 @@ _Static_assert(sizeof(MADT_GIC_ITS_STRUCTURE) == 20,
180191
.Reserved2 = 0, \
181192
}
182193

194+
#ifdef GICC_HAS_TRBE_INTERRUPT
183195
#define MADT_DECLARE_GICC_STRUCTURE(index, cpu_id, mpidr) \
184196
.GiccStructures[index] = { \
185197
.Type = 0xB, \
@@ -202,6 +214,29 @@ _Static_assert(sizeof(MADT_GIC_ITS_STRUCTURE) == 20,
202214
.SpeOverflowInterrupt = 0, \
203215
.TRBEInterrupt = 0, \
204216
}
217+
#else
218+
#define MADT_DECLARE_GICC_STRUCTURE(index, cpu_id, mpidr) \
219+
.GiccStructures[index] = { \
220+
.Type = 0xB, \
221+
.Length = sizeof(MADT_GICC_STRUCTURE), \
222+
.Reserved = 0, \
223+
.CPUInterfaceNumber = cpu_id, \
224+
.ACPIProcessorUID = cpu_id, \
225+
.Flags = MADT_GICC_FLAG_ENABLED, \
226+
.ParkingProtocolVersion = 0, \
227+
.PerformanceInterruptGSI = GICC_PERFORMANCE_INTERRUPT_GSI, \
228+
.ParkedAddress = 0, \
229+
.PhysicalBaseAddress = 0, \
230+
.GICV = 0, \
231+
.GICH = 0, \
232+
.VGICMaintenanceInterrupt = GICC_VGIC_MAINTENANCE_INTERRUPT, \
233+
.GICRBaseAddress = GICR_BASE_ADDRESS + GICR_STRIDE * cpu_id, \
234+
.MPIDR = mpidr, \
235+
.ProcessorPowerEfficiencyClass = CPUID_TO_CLUSTER(cpu_id), \
236+
.Reserved2 = 0, \
237+
.SpeOverflowInterrupt = 0, \
238+
}
239+
#endif
205240

206241
#define MADT_DEFINE_TABLE(core_count, its_count, name) \
207242
typedef struct { \

0 commit comments

Comments
 (0)