iASL: Fix several issues with Data Table Compiler.

Eliminate duplicate field names in the same table.
Do not unnecessarily pad strings with blanks.
Fix a problem when compile Flag fields.
This commit is contained in:
Robert Moore 2010-06-02 14:00:22 -07:00
parent 1ad056a79f
commit 45b2e97735
4 changed files with 25 additions and 30 deletions

View File

@ -810,7 +810,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] =
{
ACPI_DM_HEST_HEADER,
{ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved1", 0},
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags", 0},
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled", 0},
{ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
@ -818,7 +818,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] =
{ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data", 0},
{ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data", 0},
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0},
{ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved", 0},
{ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved2", 0},
ACPI_DMT_TERMINATOR
};
@ -827,14 +827,14 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] =
{
ACPI_DM_HEST_HEADER,
{ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved1", 0},
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags", 0},
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled", 0},
{ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
{ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0},
{ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify", 0},
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0},
{ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved", 0},
{ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved2", 0},
ACPI_DMT_TERMINATOR
};
@ -1427,15 +1427,15 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] =
{
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (ProximityDomain), "Proximity Domain", 0},
{ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved1", 0},
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (BaseAddress), "Base Address", 0},
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Length), "Address Length", 0},
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Reserved1), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Reserved1), "Reserved2", 0},
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Enabled", 0},
{ACPI_DMT_FLAG1, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Hot Pluggable", 0},
{ACPI_DMT_FLAG2, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Non-Volatile", 0},
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Reserved2), "Reserved", 0},
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Reserved2), "Reserved3", 0},
ACPI_DMT_TERMINATOR
};
@ -1443,13 +1443,13 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
{
{ACPI_DMT_UINT16, ACPI_SRAT2_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_SRAT2_OFFSET (Reserved), "Reserved1", 0},
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ProximityDomain), "Proximity Domain", 0},
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ApicId), "Apic ID", 0},
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_SRAT2_FLAG_OFFSET (Flags,0), "Enabled", 0},
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ClockDomain), "Clock Domain", 0},
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved2", 0},
ACPI_DMT_TERMINATOR
};

View File

@ -459,7 +459,6 @@ DtCompileTable (
UINT8 FieldType;
UINT8 *Buffer;
UINT8 *FlagBuffer = NULL;
UINT32 FlagBitPosition = 0;
ACPI_STATUS Status;
@ -530,7 +529,6 @@ DtCompileTable (
LocalField = LocalField->Next;
*Field = LocalField;
FlagBitPosition = 0;
FlagBuffer = Buffer;
break;
@ -540,8 +538,7 @@ DtCompileTable (
if (FlagBuffer)
{
FlagBitPosition = DtCompileFlag (FlagBuffer,
LocalField, Info, FlagBitPosition);
DtCompileFlag (FlagBuffer, LocalField, Info);
}
else
{

View File

@ -290,12 +290,11 @@ DtCompileBuffer (
DT_FIELD *Field,
UINT32 ByteLength);
UINT32
void
DtCompileFlag (
UINT8 *Buffer,
DT_FIELD *Field,
ACPI_DMTABLE_INFO *Info,
UINT32 BitPosition);
ACPI_DMTABLE_INFO *Info);
/* dtutils - Miscellaneous utilities */

View File

@ -225,9 +225,6 @@ DtCompileString (
Length = ByteLength;
}
/* If input string is shorter than ByteLength, pad with blanks */
ACPI_MEMSET (Buffer, 0x20, ByteLength);
ACPI_MEMCPY (Buffer, Field->Value, Length);
}
@ -473,23 +470,22 @@ DtCompilePciPath (
* PARAMETERS: Buffer - Output buffer
* Field - Field to be compiled
* Info - Flag info
* BitPosition - Flag bit position
*
* RETURN: Next flag bit position
* RETURN:
*
* DESCRIPTION: Compile a flag
*
*****************************************************************************/
UINT32
void
DtCompileFlag (
UINT8 *Buffer,
DT_FIELD *Field,
ACPI_DMTABLE_INFO *Info,
UINT32 BitPosition)
ACPI_DMTABLE_INFO *Info)
{
UINT64 Value = 0;
UINT32 BitLength = 1;
UINT8 BitPosition = 0;
ACPI_STATUS Status;
@ -510,12 +506,20 @@ DtCompileFlag (
case ACPI_DMT_FLAG6:
case ACPI_DMT_FLAG7:
BitPosition = Info->Opcode;
BitLength = 1;
break;
case ACPI_DMT_FLAGS0:
BitPosition = 0;
BitLength = 2;
break;
case ACPI_DMT_FLAGS2:
BitPosition = 2;
BitLength = 2;
break;
@ -534,10 +538,5 @@ DtCompileFlag (
Value = 0;
}
/* Insert the flag, return next flag bit position */
Buffer += ACPI_DIV_8 (BitPosition);
*Buffer |= (UINT8) (Value << ACPI_MOD_8 (BitPosition));
return (BitPosition + BitLength);
*Buffer |= (UINT8) (Value << BitPosition);
}