On Thu, Sep 22, 2011 at 09:58:58PM +0900, Kenji Kaneshige wrote:
Add Local APIC NMI Structure to ACPI MADT.
Signed-off-by: Kenji Kaneshige kaneshige.kenji@jp.fujitsu.com
src/acpi.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
Index: seabios/src/acpi.c
--- seabios.orig/src/acpi.c +++ seabios/src/acpi.c @@ -134,6 +134,14 @@ struct madt_intsrcovr { u16 flags; } PACKED;
+struct madt_local_nmi {
- ACPI_SUB_HEADER_DEF
- u8 processor_id; /* ACPI processor id */
- u16 flags; /* MPS INTI flags */
- u8 lint; /* Local APIC LINT# */
+} PACKED;
/*
- ACPI 2.0 Generic Address Space definition.
*/ @@ -288,7 +296,9 @@ build_madt(void) int madt_size = (sizeof(struct multiple_apic_table) + sizeof(struct madt_processor_apic) * MaxCountCPUs + sizeof(struct madt_io_apic)
+ sizeof(struct madt_intsrcovr) * 16);
+ sizeof(struct madt_intsrcovr) * 16
+ sizeof(struct madt_local_nmi) * MaxCountCPUs);
- struct multiple_apic_table *madt = malloc_high(madt_size); if (!madt) { warn_noalloc();
@@ -340,7 +350,17 @@ build_madt(void) intsrcovr++; }
- build_header((void*)madt, APIC_SIGNATURE, (void*)intsrcovr - (void*)madt, 1);
- struct madt_local_nmi *local_nmi = (void*)intsrcovr;
- for (i = 0; i < MaxCountCPUs; i++) {
local_nmi->type = APIC_LOCAL_NMI;
local_nmi->length = sizeof(*local_nmi);
local_nmi->processor_id = i;
Spec says that value 0xFF signifies that this applies to all processors in the machine, so you need to create only one APIC_LOCAL_NMI entry with 0xFF as a processor id.
local_nmi->flags = 0;
local_nmi->lint = 1; /* LINT1 */
local_nmi++;
- }
- build_header((void*)madt, APIC_SIGNATURE, (void*)local_nmi - (void*)madt, 1); return madt;
}
SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
-- Gleb.