dtcompile.c (217365) | dtcompile.c (218590) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: dtcompile.c - Front-end for data table compiler 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2011, Intel Corp. --- 412 unchanged lines hidden (view full) --- 421 if (!Field || !*Field) 422 { 423 return (AE_BAD_PARAMETER); 424 } 425 426 Length = DtGetSubtableLength (*Field, Info); 427 Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE)); 428 | 1/****************************************************************************** 2 * 3 * Module Name: dtcompile.c - Front-end for data table compiler 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2011, Intel Corp. --- 412 unchanged lines hidden (view full) --- 421 if (!Field || !*Field) 422 { 423 return (AE_BAD_PARAMETER); 424 } 425 426 Length = DtGetSubtableLength (*Field, Info); 427 Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE)); 428 |
429 Subtable->Buffer = UtLocalCalloc (Length); | 429 if (Length > 0) 430 { 431 Subtable->Buffer = UtLocalCalloc (Length); 432 } |
430 Subtable->Length = Length; 431 Subtable->TotalLength = Length; 432 Buffer = Subtable->Buffer; 433 434 LocalField = *Field; 435 436 /* 437 * Main loop walks the info table for this ACPI table or subtable --- 27 unchanged lines hidden (view full) --- 465 } 466 else 467 { 468 Status = AE_NOT_FOUND; 469 goto Error; 470 } 471 } 472 | 433 Subtable->Length = Length; 434 Subtable->TotalLength = Length; 435 Buffer = Subtable->Buffer; 436 437 LocalField = *Field; 438 439 /* 440 * Main loop walks the info table for this ACPI table or subtable --- 27 unchanged lines hidden (view full) --- 468 } 469 else 470 { 471 Status = AE_NOT_FOUND; 472 goto Error; 473 } 474 } 475 |
476 /* Maintain table offsets */ 477 478 LocalField->TableOffset = Gbl_CurrentTableOffset; |
|
473 FieldLength = DtGetFieldLength (LocalField, Info); | 479 FieldLength = DtGetFieldLength (LocalField, Info); |
480 Gbl_CurrentTableOffset += FieldLength; 481 |
|
474 FieldType = DtGetFieldType (Info); 475 Gbl_InputFieldCount++; 476 477 switch (FieldType) 478 { 479 case DT_FIELD_TYPE_FLAGS_INTEGER: 480 /* 481 * Start of the definition of a flags field. --- 50 unchanged lines hidden (view full) --- 532 DtSetSubtableLength (InlineSubtable); 533 534 ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength); 535 ACPI_FREE (InlineSubtable->Buffer); 536 ACPI_FREE (InlineSubtable); 537 LocalField = *Field; 538 break; 539 | 482 FieldType = DtGetFieldType (Info); 483 Gbl_InputFieldCount++; 484 485 switch (FieldType) 486 { 487 case DT_FIELD_TYPE_FLAGS_INTEGER: 488 /* 489 * Start of the definition of a flags field. --- 50 unchanged lines hidden (view full) --- 540 DtSetSubtableLength (InlineSubtable); 541 542 ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength); 543 ACPI_FREE (InlineSubtable->Buffer); 544 ACPI_FREE (InlineSubtable); 545 LocalField = *Field; 546 break; 547 |
548 case DT_FIELD_TYPE_LABEL: 549 550 DtWriteFieldToListing (Buffer, LocalField, 0); 551 LocalField = LocalField->Next; 552 break; 553 |
|
540 default: 541 542 /* Normal case for most field types (Integer, String, etc.) */ 543 544 DtCompileOneField (Buffer, LocalField, 545 FieldLength, FieldType, Info->Flags); 546 547 DtWriteFieldToListing (Buffer, LocalField, FieldLength); --- 25 unchanged lines hidden --- | 554 default: 555 556 /* Normal case for most field types (Integer, String, etc.) */ 557 558 DtCompileOneField (Buffer, LocalField, 559 FieldLength, FieldType, Info->Flags); 560 561 DtWriteFieldToListing (Buffer, LocalField, FieldLength); --- 25 unchanged lines hidden --- |