tbdata.c (e6e746bfb086d563bf0ad454a33ecbcab8836dbf) | tbdata.c (7cf3e94a41ba78bb319589610ad72bf914dc75c1) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: tbdata - Table manager data structure functions 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2015, Intel Corp. --- 107 unchanged lines hidden (view full) --- 116 case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: 117 118 Table = AcpiOsMapMemory (TableDesc->Address, TableDesc->Length); 119 break; 120 121 case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: 122 case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: 123 | 1/****************************************************************************** 2 * 3 * Module Name: tbdata - Table manager data structure functions 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2015, Intel Corp. --- 107 unchanged lines hidden (view full) --- 116 case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: 117 118 Table = AcpiOsMapMemory (TableDesc->Address, TableDesc->Length); 119 break; 120 121 case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: 122 case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: 123 |
124 Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, TableDesc->Address); | 124 Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, 125 ACPI_PHYSADDR_TO_PTR (TableDesc->Address)); |
125 break; 126 127 default: 128 129 break; 130 } 131 132 /* Table is not valid yet */ --- 89 unchanged lines hidden (view full) --- 222 223 AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader); 224 AcpiOsUnmapMemory (TableHeader, sizeof (ACPI_TABLE_HEADER)); 225 return (AE_OK); 226 227 case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: 228 case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: 229 | 126 break; 127 128 default: 129 130 break; 131 } 132 133 /* Table is not valid yet */ --- 89 unchanged lines hidden (view full) --- 223 224 AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader); 225 AcpiOsUnmapMemory (TableHeader, sizeof (ACPI_TABLE_HEADER)); 226 return (AE_OK); 227 228 case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: 229 case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: 230 |
230 TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, Address); | 231 TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, 232 ACPI_PHYSADDR_TO_PTR (Address)); |
231 if (!TableHeader) 232 { 233 return (AE_NO_MEMORY); 234 } 235 236 AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader); 237 return (AE_OK); 238 --- 193 unchanged lines hidden (view full) --- 432 /* Verify the checksum */ 433 434 if (AcpiGbl_VerifyTableChecksum) 435 { 436 Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length); 437 if (ACPI_FAILURE (Status)) 438 { 439 ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, | 233 if (!TableHeader) 234 { 235 return (AE_NO_MEMORY); 236 } 237 238 AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader); 239 return (AE_OK); 240 --- 193 unchanged lines hidden (view full) --- 434 /* Verify the checksum */ 435 436 if (AcpiGbl_VerifyTableChecksum) 437 { 438 Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length); 439 if (ACPI_FAILURE (Status)) 440 { 441 ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, |
440 "%4.4s " ACPI_PRINTF_UINT | 442 "%4.4s 0x%8.8X%8.8X" |
441 " Attempted table install failed", 442 AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ? 443 TableDesc->Signature.Ascii : "????", | 443 " Attempted table install failed", 444 AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ? 445 TableDesc->Signature.Ascii : "????", |
444 ACPI_FORMAT_TO_UINT (TableDesc->Address))); | 446 ACPI_FORMAT_UINT64 (TableDesc->Address))); |
445 goto InvalidateAndExit; 446 } 447 } 448 449 return_ACPI_STATUS (AE_OK); 450 451InvalidateAndExit: 452 AcpiTbInvalidateTable (TableDesc); --- 71 unchanged lines hidden (view full) --- 524 AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED; 525 526 return_ACPI_STATUS (AE_OK); 527} 528 529 530/******************************************************************************* 531 * | 447 goto InvalidateAndExit; 448 } 449 } 450 451 return_ACPI_STATUS (AE_OK); 452 453InvalidateAndExit: 454 AcpiTbInvalidateTable (TableDesc); --- 71 unchanged lines hidden (view full) --- 526 AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED; 527 528 return_ACPI_STATUS (AE_OK); 529} 530 531 532/******************************************************************************* 533 * |
532 * FUNCTION: AcpiTbGetNextRootIndex | 534 * FUNCTION: AcpiTbGetNextTableDescriptor |
533 * 534 * PARAMETERS: TableIndex - Where table index is returned | 535 * 536 * PARAMETERS: TableIndex - Where table index is returned |
537 * TableDesc - Where table descriptor is returned |
|
535 * | 538 * |
536 * RETURN: Status and table index. | 539 * RETURN: Status and table index/descriptor. |
537 * 538 * DESCRIPTION: Allocate a new ACPI table entry to the global table list 539 * 540 ******************************************************************************/ 541 542ACPI_STATUS | 540 * 541 * DESCRIPTION: Allocate a new ACPI table entry to the global table list 542 * 543 ******************************************************************************/ 544 545ACPI_STATUS |
543AcpiTbGetNextRootIndex ( 544 UINT32 *TableIndex) | 546AcpiTbGetNextTableDescriptor ( 547 UINT32 *TableIndex, 548 ACPI_TABLE_DESC **TableDesc) |
545{ 546 ACPI_STATUS Status; | 549{ 550 ACPI_STATUS Status; |
551 UINT32 i; |
|
547 548 549 /* Ensure that there is room for the table in the Root Table List */ 550 551 if (AcpiGbl_RootTableList.CurrentTableCount >= 552 AcpiGbl_RootTableList.MaxTableCount) 553 { 554 Status = AcpiTbResizeRootTableList(); 555 if (ACPI_FAILURE (Status)) 556 { 557 return (Status); 558 } 559 } 560 | 552 553 554 /* Ensure that there is room for the table in the Root Table List */ 555 556 if (AcpiGbl_RootTableList.CurrentTableCount >= 557 AcpiGbl_RootTableList.MaxTableCount) 558 { 559 Status = AcpiTbResizeRootTableList(); 560 if (ACPI_FAILURE (Status)) 561 { 562 return (Status); 563 } 564 } 565 |
561 *TableIndex = AcpiGbl_RootTableList.CurrentTableCount; | 566 i = AcpiGbl_RootTableList.CurrentTableCount; |
562 AcpiGbl_RootTableList.CurrentTableCount++; | 567 AcpiGbl_RootTableList.CurrentTableCount++; |
568 569 if (TableIndex) 570 { 571 *TableIndex = i; 572 } 573 if (TableDesc) 574 { 575 *TableDesc = &AcpiGbl_RootTableList.Tables[i]; 576 } 577 |
|
563 return (AE_OK); 564} 565 566 567/******************************************************************************* 568 * 569 * FUNCTION: AcpiTbTerminate 570 * --- 283 unchanged lines hidden --- | 578 return (AE_OK); 579} 580 581 582/******************************************************************************* 583 * 584 * FUNCTION: AcpiTbTerminate 585 * --- 283 unchanged lines hidden --- |