本文整理汇总了C++中DtFatal函数的典型用法代码示例。如果您正苦于以下问题:C++ DtFatal函数的具体用法?C++ DtFatal怎么用?C++ DtFatal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DtFatal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DtGetSubtableLength
UINT32
DtGetSubtableLength (
DT_FIELD *Field,
ACPI_DMTABLE_INFO *Info)
{
UINT32 ByteLength = 0;
UINT8 Step;
UINT8 i;
/* Walk entire Info table; Null name terminates */
for (; Info->Name; Info++)
{
if (!Field)
{
goto Error;
}
ByteLength += DtGetFieldLength (Field, Info);
switch (Info->Opcode)
{
case ACPI_DMT_GAS:
Step = 5;
break;
case ACPI_DMT_HESTNTFY:
Step = 9;
break;
default:
Step = 1;
break;
}
for (i = 0; i < Step; i++)
{
if (!Field)
{
goto Error;
}
Field = Field->Next;
}
}
return (ByteLength);
Error:
if (!Field)
{
sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed",
Info->Name);
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
}
return (ASL_EOF);
}
示例2: DtCompileSlic
ACPI_STATUS
DtCompileSlic (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_SLIC_HEADER *SlicHeader;
ACPI_DMTABLE_INFO *InfoTable;
while (*PFieldList)
{
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlicHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
SlicHeader = ACPI_CAST_PTR (ACPI_SLIC_HEADER, Subtable->Buffer);
switch (SlicHeader->Type)
{
case ACPI_SLIC_TYPE_PUBLIC_KEY:
InfoTable = AcpiDmTableInfoSlic0;
break;
case ACPI_SLIC_TYPE_WINDOWS_MARKER:
InfoTable = AcpiDmTableInfoSlic1;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SLIC");
return (AE_ERROR);
}
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
}
return (AE_OK);
}
示例3: DtCompileOneField
void
DtCompileOneField (
UINT8 *Buffer,
DT_FIELD *Field,
UINT32 ByteLength,
UINT8 Type,
UINT8 Flags)
{
ACPI_STATUS Status;
switch (Type)
{
case DT_FIELD_TYPE_INTEGER:
DtCompileInteger (Buffer, Field, ByteLength, Flags);
break;
case DT_FIELD_TYPE_STRING:
DtCompileString (Buffer, Field, ByteLength);
break;
case DT_FIELD_TYPE_UUID:
Status = DtCompileUuid (Buffer, Field, ByteLength);
if (ACPI_SUCCESS (Status))
{
break;
}
/* Fall through. */
case DT_FIELD_TYPE_BUFFER:
DtCompileBuffer (Buffer, Field->Value, Field, ByteLength);
break;
case DT_FIELD_TYPE_UNICODE:
DtCompileUnicode (Buffer, Field, ByteLength);
break;
case DT_FIELD_TYPE_DEVICE_PATH:
break;
default:
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid field type");
break;
}
}
示例4: DtCompileFlag
void
DtCompileFlag (
UINT8 *Buffer,
DT_FIELD *Field,
ACPI_DMTABLE_INFO *Info)
{
UINT64 Value = 0;
UINT32 BitLength = 1;
UINT8 BitPosition = 0;
Value = AcpiUtImplicitStrtoul64 (Field->Value);
switch (Info->Opcode)
{
case ACPI_DMT_FLAG0:
case ACPI_DMT_FLAG1:
case ACPI_DMT_FLAG2:
case ACPI_DMT_FLAG3:
case ACPI_DMT_FLAG4:
case ACPI_DMT_FLAG5:
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_FLAGS1:
BitPosition = 1;
BitLength = 2;
break;
case ACPI_DMT_FLAGS2:
BitPosition = 2;
BitLength = 2;
break;
case ACPI_DMT_FLAGS4:
BitPosition = 4;
BitLength = 2;
break;
case ACPI_DMT_FLAGS4_0:
BitPosition = 0;
BitLength = 4;
break;
case ACPI_DMT_FLAGS4_4:
BitPosition = 4;
BitLength = 4;
break;
case ACPI_DMT_FLAGS4_8:
BitPosition = 8;
BitLength = 4;
break;
case ACPI_DMT_FLAGS4_12:
BitPosition = 12;
BitLength = 4;
break;
case ACPI_DMT_FLAGS16_16:
BitPosition = 16;
BitLength = 16;
break;
default:
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid flag opcode");
break;
}
/* Check range of the input flag value */
if (Value >= ((UINT64) 1 << BitLength))
{
sprintf (AslGbl_MsgBuffer, "Maximum %u bit", BitLength);
DtError (ASL_ERROR, ASL_MSG_FLAG_VALUE, Field, AslGbl_MsgBuffer);
Value = 0;
}
*Buffer |= (UINT8) (Value << BitPosition);
//.........这里部分代码省略.........
示例5: DtGetNextLine
//.........这里部分代码省略.........
case DT_SLASH_ASTERISK_COMMENT:
/* Ignore chars until an asterisk-slash is found */
switch (c)
{
case '\n':
Gbl_NextLineOffset = (UINT32) ftell (Handle);
Gbl_CurrentLineNumber++;
break;
case '*':
State = DT_END_COMMENT;
break;
default:
break;
}
break;
case DT_SLASH_SLASH_COMMENT:
/* Ignore chars until end-of-line */
if (c == '\n')
{
/* We will exit via the NORMAL_TEXT path */
ungetc (c, Handle);
State = DT_NORMAL_TEXT;
}
break;
case DT_END_COMMENT:
/* End comment if this char is a slash */
switch (c)
{
case '/':
State = DT_NORMAL_TEXT;
break;
case '\n':
CurrentLineOffset = Gbl_NextLineOffset;
Gbl_NextLineOffset = (UINT32) ftell (Handle);
Gbl_CurrentLineNumber++;
break;
case '*':
/* Consume all adjacent asterisks */
break;
default:
State = DT_SLASH_ASTERISK_COMMENT;
break;
}
break;
case DT_MERGE_LINES:
if (c != '\n')
{
/*
* This is not a continuation backslash, it is a normal
* normal ASL backslash - for example: Scope(\_SB_)
*/
i++; /* Keep the backslash that is already in the buffer */
ungetc (c, Handle);
State = DT_NORMAL_TEXT;
}
else
{
/*
* This is a continuation line -- a backlash followed
* immediately by a newline. Insert a space between the
* lines (overwrite the backslash)
*/
Gbl_CurrentLineBuffer[i] = ' ';
i++;
/* Ignore newline, this will merge the lines */
CurrentLineOffset = Gbl_NextLineOffset;
Gbl_NextLineOffset = (UINT32) ftell (Handle);
Gbl_CurrentLineNumber++;
State = DT_NORMAL_TEXT;
}
break;
default:
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, "Unknown input state");
return (ASL_EOF);
}
}
printf ("ERROR - Input line is too long (max %u)\n", ASL_LINE_BUFFER_SIZE);
return (ASL_EOF);
}
示例6: DtCompileMadt
ACPI_STATUS
DtCompileMadt (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_SUBTABLE_HEADER *MadtHeader;
ACPI_DMTABLE_INFO *InfoTable;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadt,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
while (*PFieldList)
{
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadtHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
MadtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
switch (MadtHeader->Type)
{
case ACPI_MADT_TYPE_LOCAL_APIC:
InfoTable = AcpiDmTableInfoMadt0;
break;
case ACPI_MADT_TYPE_IO_APIC:
InfoTable = AcpiDmTableInfoMadt1;
break;
case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
InfoTable = AcpiDmTableInfoMadt2;
break;
case ACPI_MADT_TYPE_NMI_SOURCE:
InfoTable = AcpiDmTableInfoMadt3;
break;
case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
InfoTable = AcpiDmTableInfoMadt4;
break;
case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
InfoTable = AcpiDmTableInfoMadt5;
break;
case ACPI_MADT_TYPE_IO_SAPIC:
InfoTable = AcpiDmTableInfoMadt6;
break;
case ACPI_MADT_TYPE_LOCAL_SAPIC:
InfoTable = AcpiDmTableInfoMadt7;
break;
case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
InfoTable = AcpiDmTableInfoMadt8;
break;
case ACPI_MADT_TYPE_LOCAL_X2APIC:
InfoTable = AcpiDmTableInfoMadt9;
break;
case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
InfoTable = AcpiDmTableInfoMadt10;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
return (AE_ERROR);
}
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
}
return (AE_OK);
}
示例7: DtCompileLpit
ACPI_STATUS
DtCompileLpit (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_LPIT_HEADER *LpitHeader;
/* Note: Main table consists only of the standard ACPI table header */
while (*PFieldList)
{
SubtableStart = *PFieldList;
/* LPIT Subtable header */
Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer);
switch (LpitHeader->Type)
{
case ACPI_LPIT_TYPE_NATIVE_CSTATE:
InfoTable = AcpiDmTableInfoLpit0;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT");
return (AE_ERROR);
}
/* LPIT Subtable */
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
}
return (AE_OK);
}
示例8: DtDoOperator
//.........这里部分代码省略.........
{
DtError (ASL_ERROR, ASL_MSG_DIVIDE_BY_ZERO,
Gbl_CurrentField, NULL);
return (0);
}
Result = LeftValue % RightValue;
break;
case EXPOP_ADD:
Result = LeftValue + RightValue;
break;
case EXPOP_SUBTRACT:
Result = LeftValue - RightValue;
break;
case EXPOP_SHIFT_RIGHT:
Result = LeftValue >> RightValue;
break;
case EXPOP_SHIFT_LEFT:
Result = LeftValue << RightValue;
break;
case EXPOP_LESS:
Result = LeftValue < RightValue;
break;
case EXPOP_GREATER:
Result = LeftValue > RightValue;
break;
case EXPOP_LESS_EQUAL:
Result = LeftValue <= RightValue;
break;
case EXPOP_GREATER_EQUAL:
Result = LeftValue >= RightValue;
break;
case EXPOP_EQUAL:
Result = LeftValue == RightValue;
break;
case EXPOP_NOT_EQUAL:
Result = LeftValue != RightValue;
break;
case EXPOP_AND:
Result = LeftValue & RightValue;
break;
case EXPOP_XOR:
Result = LeftValue ^ RightValue;
break;
case EXPOP_OR:
Result = LeftValue | RightValue;
break;
case EXPOP_LOGICAL_AND:
Result = LeftValue && RightValue;
break;
case EXPOP_LOGICAL_OR:
Result = LeftValue || RightValue;
break;
default:
/* Unknown operator */
DtFatal (ASL_MSG_INVALID_EXPRESSION,
Gbl_CurrentField, NULL);
return (0);
}
DbgPrint (ASL_DEBUG_OUTPUT,
"IntegerEval: (%8.8X%8.8X %s %8.8X%8.8X) = %8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (LeftValue),
DtGetOpName (Operator),
ACPI_FORMAT_UINT64 (RightValue),
ACPI_FORMAT_UINT64 (Result));
return (Result);
}
示例9: DtCompileIvrs
ACPI_STATUS
DtCompileIvrs (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_IVRS_HEADER *IvrsHeader;
UINT8 EntryType;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
while (*PFieldList)
{
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer);
switch (IvrsHeader->Type)
{
case ACPI_IVRS_TYPE_HARDWARE:
InfoTable = AcpiDmTableInfoIvrs0;
break;
case ACPI_IVRS_TYPE_MEMORY1:
case ACPI_IVRS_TYPE_MEMORY2:
case ACPI_IVRS_TYPE_MEMORY3:
InfoTable = AcpiDmTableInfoIvrs1;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS");
return (AE_ERROR);
}
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE)
{
while (*PFieldList &&
!ACPI_STRCMP ((*PFieldList)->Name, "Entry Type"))
{
SubtableStart = *PFieldList;
DtCompileInteger (&EntryType, *PFieldList, 1, 0);
switch (EntryType)
{
/* 4-byte device entries */
case ACPI_IVRS_TYPE_PAD4:
case ACPI_IVRS_TYPE_ALL:
case ACPI_IVRS_TYPE_SELECT:
case ACPI_IVRS_TYPE_START:
case ACPI_IVRS_TYPE_END:
InfoTable = AcpiDmTableInfoIvrs4;
break;
/* 8-byte entries, type A */
case ACPI_IVRS_TYPE_ALIAS_SELECT:
case ACPI_IVRS_TYPE_ALIAS_START:
InfoTable = AcpiDmTableInfoIvrs8a;
break;
/* 8-byte entries, type B */
case ACPI_IVRS_TYPE_PAD8:
case ACPI_IVRS_TYPE_EXT_SELECT:
case ACPI_IVRS_TYPE_EXT_START:
//.........这里部分代码省略.........
示例10: DtCompileDataTable
//.........这里部分代码省略.........
*/
if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS))
{
Status = DtCompileFacs (FieldList);
if (ACPI_FAILURE (Status))
{
return (Status);
}
DtSetTableLength ();
return (Status);
}
else if (ACPI_VALIDATE_RSDP_SIG (Signature))
{
Status = DtCompileRsdp (FieldList);
return (Status);
}
else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_S3PT))
{
Status = DtCompileS3pt (FieldList);
if (ACPI_FAILURE (Status))
{
return (Status);
}
DtSetTableLength ();
return (Status);
}
/*
* All other tables must use the common ACPI table header. Insert the
* current iASL IDs (name, version), and compile the header now.
*/
DtInsertCompilerIds (*FieldList);
Status = DtCompileTable (FieldList, AcpiDmTableInfoHeader,
&Gbl_RootTable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
DtPushSubtable (Gbl_RootTable);
/* Validate the signature via the ACPI table list */
TableData = AcpiDmGetTableData (Signature);
if (!TableData || Gbl_CompileGeneric)
{
DtCompileGeneric ((void **) FieldList);
goto FinishHeader;
}
/* Dispatch to per-table compile */
if (TableData->CmTableHandler)
{
/* Complex table, has a handler */
Status = TableData->CmTableHandler ((void **) FieldList);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
else if (TableData->TableInfo)
{
/* Simple table, just walk the info table */
Subtable = NULL;
Status = DtCompileTable (FieldList, TableData->TableInfo,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
DtInsertSubtable (Gbl_RootTable, Subtable);
DtPopSubtable ();
}
else
{
DtFatal (ASL_MSG_COMPILER_INTERNAL, *FieldList,
"Missing table dispatch info");
return (AE_ERROR);
}
FinishHeader:
/* Set the final table length and then the checksum */
DtSetTableLength ();
AcpiTableHeader = ACPI_CAST_PTR (
ACPI_TABLE_HEADER, Gbl_RootTable->Buffer);
DtSetTableChecksum (&AcpiTableHeader->Checksum);
DtDumpFieldList (RootField);
DtDumpSubtableList ();
return (AE_OK);
}
示例11: DtCompileSrat
ACPI_STATUS
DtCompileSrat (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_SUBTABLE_HEADER *SratHeader;
ACPI_DMTABLE_INFO *InfoTable;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoSrat,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
while (*PFieldList)
{
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoSratHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
SratHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
switch (SratHeader->Type)
{
case ACPI_SRAT_TYPE_CPU_AFFINITY:
InfoTable = AcpiDmTableInfoSrat0;
break;
case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
InfoTable = AcpiDmTableInfoSrat1;
break;
case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
InfoTable = AcpiDmTableInfoSrat2;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
return (AE_ERROR);
}
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
}
return (AE_OK);
}
示例12: DtCompileDmar
ACPI_STATUS
DtCompileDmar (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_DMAR_HEADER *DmarHeader;
UINT8 *ReservedBuffer;
UINT32 ReservedSize;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
/* DMAR Reserved area */
ReservedSize = (UINT32) sizeof (((ACPI_TABLE_DMAR *) NULL)->Reserved);
ReservedBuffer = UtLocalCalloc (ReservedSize);
DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable);
ACPI_FREE (ReservedBuffer);
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
while (*PFieldList)
{
/* DMAR Header */
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
switch (DmarHeader->Type)
{
case ACPI_DMAR_TYPE_HARDWARE_UNIT:
InfoTable = AcpiDmTableInfoDmar0;
break;
case ACPI_DMAR_TYPE_RESERVED_MEMORY:
InfoTable = AcpiDmTableInfoDmar1;
break;
case ACPI_DMAR_TYPE_ATSR:
InfoTable = AcpiDmTableInfoDmar2;
break;
case ACPI_DMAR_HARDWARE_AFFINITY:
InfoTable = AcpiDmTableInfoDmar3;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
return (AE_ERROR);
}
/* DMAR Subtable */
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
/* Optional Device Scope subtables */
while (*PFieldList)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
&Subtable, FALSE);
if (Status == AE_NOT_FOUND)
{
break;
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
/* Optional PCI Paths */
//.........这里部分代码省略.........
示例13: DtGetNextLine
//.........这里部分代码省略.........
Gbl_CurrentLineBuffer[i] = c;
i++;
if (c == '"')
{
State = DT_NORMAL_TEXT;
}
break;
case DT_START_COMMENT:
/* Open comment if this character is an asterisk or slash */
switch (c)
{
case '*':
State = DT_SLASH_ASTERISK_COMMENT;
break;
case '/':
State = DT_SLASH_SLASH_COMMENT;
break;
default: /* Not a comment */
i++; /* Save the preceeding slash */
Gbl_CurrentLineBuffer[i] = c;
i++;
State = DT_NORMAL_TEXT;
break;
}
break;
case DT_SLASH_ASTERISK_COMMENT:
/* Ignore chars until an asterisk-slash is found */
switch (c)
{
case '\n':
Gbl_NextLineOffset = (UINT32) ftell (Handle);
Gbl_CurrentLineNumber++;
break;
case '*':
State = DT_END_COMMENT;
break;
default:
break;
}
break;
case DT_SLASH_SLASH_COMMENT:
/* Ignore chars until end-of-line */
if (c == '\n')
{
/* We will exit via the NORMAL_TEXT path */
ungetc (c, Handle);
State = DT_NORMAL_TEXT;
}
break;
case DT_END_COMMENT:
/* End comment if this char is a slash */
switch (c)
{
case '/':
State = DT_NORMAL_TEXT;
break;
case '\n':
CurrentLineOffset = Gbl_NextLineOffset;
Gbl_NextLineOffset = (UINT32) ftell (Handle);
Gbl_CurrentLineNumber++;
break;
case '*':
/* Consume all adjacent asterisks */
break;
default:
State = DT_SLASH_ASTERISK_COMMENT;
break;
}
break;
default:
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, "Unknown input state");
return (0);
}
}
printf ("ERROR - Input line is too long (max %u)\n", ASL_LINE_BUFFER_SIZE);
return (0);
}
示例14: DtCompileNfit
ACPI_STATUS
DtCompileNfit (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_NFIT_HEADER *NfitHeader;
ACPI_DMTABLE_INFO *InfoTable;
UINT32 Count;
ACPI_NFIT_INTERLEAVE *Interleave = NULL;
ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
/* Main table */
Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
/* Subtables */
while (*PFieldList)
{
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfitHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer);
switch (NfitHeader->Type)
{
case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
InfoTable = AcpiDmTableInfoNfit0;
break;
case ACPI_NFIT_TYPE_MEMORY_MAP:
InfoTable = AcpiDmTableInfoNfit1;
break;
case ACPI_NFIT_TYPE_INTERLEAVE:
Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable->Buffer);
InfoTable = AcpiDmTableInfoNfit2;
break;
case ACPI_NFIT_TYPE_SMBIOS:
InfoTable = AcpiDmTableInfoNfit3;
break;
case ACPI_NFIT_TYPE_CONTROL_REGION:
InfoTable = AcpiDmTableInfoNfit4;
break;
case ACPI_NFIT_TYPE_DATA_REGION:
InfoTable = AcpiDmTableInfoNfit5;
break;
case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable->Buffer);
InfoTable = AcpiDmTableInfoNfit6;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT");
return (AE_ERROR);
}
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
//.........这里部分代码省略.........
示例15: DtCompileInteger
void
DtCompileInteger (
UINT8 *Buffer,
DT_FIELD *Field,
UINT32 ByteLength,
UINT8 Flags)
{
UINT64 Value;
UINT64 MaxValue;
ACPI_STATUS Status;
/* Output buffer byte length must be in range 1-8 */
if ((ByteLength > 8) || (ByteLength == 0))
{
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field,
"Invalid internal Byte length");
return;
}
/* Resolve integer expression to a single integer value */
Status = DtResolveIntegerExpression (Field, &Value);
if (ACPI_FAILURE (Status))
{
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 */
if (!ACPI_STRCMP (Field->Name, "Reserved") &&
(Value != 0))
{
DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
"Setting to zero");
Value = 0;
}
/* Check if the value must be non-zero */
if ((Value == 0) && (Flags & DT_NON_ZERO))
{
DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL);
}
/*
* Generate the maximum value for the data type (ByteLength)
* Note: construct chosen for maximum portability
*/
MaxValue = ((UINT64) (-1)) >> (64 - (ByteLength * 8));
/* Validate that the input value is within range of the target */
if (Value > MaxValue)
{
snprintf (MsgBuffer, sizeof(MsgBuffer), "%8.8X%8.8X - max %u bytes",
ACPI_FORMAT_UINT64 (Value), ByteLength);
DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
}
ACPI_MEMCPY (Buffer, &Value, ByteLength);
return;
}