diff options
author | Robert Moore <Robert.Moore@intel.com> | 2014-02-14 09:09:34 -0800 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2014-02-14 09:09:34 -0800 |
commit | 56bcdb6f2bc69232effba09a82fd66450cae3226 (patch) | |
tree | 1350c5d141f66ec4b90a9d8934fe8247cc856708 | |
parent | 548bef3d1a2b94fb5d65f77b2f1f152fb7f4189e (diff) |
iASL/Tables: For SPMI table, first reserved field must always be 1.
This change enforces a value of one for the first reserved field,
instead of zero. ACPICA BZ 1081.
-rw-r--r-- | source/common/dmtbinfo.c | 2 | ||||
-rw-r--r-- | source/compiler/aslmessages.h | 2 | ||||
-rw-r--r-- | source/compiler/dtfield.c | 34 | ||||
-rw-r--r-- | source/compiler/dttemplate.h | 4 |
4 files changed, 29 insertions, 13 deletions
diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c index 858c0f3eb..cd565a47c 100644 --- a/source/common/dmtbinfo.c +++ b/source/common/dmtbinfo.c @@ -2012,7 +2012,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] = ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] = { {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type", 0}, - {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", DT_NON_ZERO}, /* Value must be 1 */ {ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number", 0}, diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h index f7e9b0091..0e29ec22b 100644 --- a/source/compiler/aslmessages.h +++ b/source/compiler/aslmessages.h @@ -517,7 +517,7 @@ char *AslMessages [] = /* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name", /* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant", /* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents", -/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero", +/* ASL_MSG_RESERVED_VALUE */ "Reserved field", /* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined", /* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type", /* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature", diff --git a/source/compiler/dtfield.c b/source/compiler/dtfield.c index 919ee9d35..46d56f801 100644 --- a/source/compiler/dtfield.c +++ b/source/compiler/dtfield.c @@ -383,21 +383,37 @@ DtCompileInteger ( return; } - /* Ensure that reserved fields are set to zero */ - /* TBD: should we set to zero, or just make this an ERROR? */ - /* TBD: Probably better to use a flag */ + /* + * Ensure that reserved fields are set properly. Note: uses + * the DT_NON_ZERO flag to indicate that the reserved value + * must be exactly one. Otherwise, the value must be zero. + * This is sufficient for now. + */ + + /* TBD: Should use a flag rather than compare "Reserved" */ - if (!ACPI_STRCMP (Field->Name, "Reserved") && - (Value != 0)) + if (!ACPI_STRCMP (Field->Name, "Reserved")) { - DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, - "Setting to zero"); - Value = 0; + if (Flags & DT_NON_ZERO) + { + if (Value != 1) + { + DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, + "Must be one, setting to one"); + Value = 1; + } + } + else if (Value != 0) + { + DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, + "Must be zero, setting to zero"); + Value = 0; + } } /* Check if the value must be non-zero */ - if ((Value == 0) && (Flags & DT_NON_ZERO)) + else if ((Flags & DT_NON_ZERO) && (Value == 0)) { DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL); } diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index b6303dd7f..a1fe9cab1 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -969,10 +969,10 @@ const unsigned char TemplateSpcr[] = const unsigned char TemplateSpmi[] = { 0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */ - 0x04,0xED,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x04,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x14,0x01,0x14,0x20,0x00,0x01,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ |