diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2011-04-13 18:18:52 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2011-04-13 18:18:52 +0000 |
| commit | 997de4e17cf02a81027df8d01a4fcefe25da3796 (patch) | |
| tree | f5abd67cc9e3ada1ae289fe7cf2e23d9abf07fcc /compiler/dtsubtable.c | |
| parent | 4d8fe534b7309d798d941e14e51985eed6b511bc (diff) | |
Diffstat (limited to 'compiler/dtsubtable.c')
| -rw-r--r-- | compiler/dtsubtable.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/compiler/dtsubtable.c b/compiler/dtsubtable.c index 6301492e5025a..40659764e775c 100644 --- a/compiler/dtsubtable.c +++ b/compiler/dtsubtable.c @@ -288,16 +288,58 @@ DtGetSubtableLength ( 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); } |
