Changeset 58459 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi
- Timestamp:
- Oct 28, 2015 8:17:18 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103761
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
-
Property svn:mergeinfo
set to (toggle deleted branches)
/vendor/edk2/current 103735-103757
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
r48674 r58459 2 2 # Sample ACPI Platform Driver 3 3 # 4 # Copyright (c) 2008 - 201 0, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # This program and the accompanying materials 6 6 # are licensed and made available under the terms and conditions of the BSD License … … 16 16 INF_VERSION = 0x00010005 17 17 BASE_NAME = AcpiPlatform 18 MODULE_UNI_FILE = AcpiPlatform.uni 18 19 FILE_GUID = cb933912-df8f-4305-b1f9-7b44fa11395c 19 20 MODULE_TYPE = DXE_DRIVER … … 44 45 45 46 [Protocols] 46 gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED47 gEfiAcpiTableProtocolGuid ## CONSUMES 47 48 48 49 [Pcd] 49 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile 50 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile ## CONSUMES 50 51 51 52 [Depex] 52 53 gEfiAcpiTableProtocolGuid 53 54 55 [UserExtensions.TianoCore."ExtraFiles"] 56 AcpiPlatformExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c
r48674 r58459 2 2 ACPI Sdt Protocol Driver 3 3 4 Copyright (c) 2010 , Intel Corporation. All rights reserved. <BR>4 Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 853 853 EFI_STATUS Status; 854 854 855 Buffer = NULL; 855 856 AmlHandle = (EFI_AML_HANDLE *)HandleIn; 856 857 … … 913 914 VOID *Buffer; 914 915 916 Buffer = NULL; 915 917 AmlHandle = (EFI_AML_HANDLE *)HandleIn; 916 918 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h
r48674 r58459 2 2 ACPI Table Protocol Driver 3 3 4 Copyright (c) 2006 - 201 0, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 106 106 // 107 107 #define EFI_ACPI_MAX_NUM_TABLES 20 108 109 //110 // ACPI table information used to initialize tables.111 //112 #define EFI_ACPI_OEM_ID "INTEL "113 #define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('E', 'D', 'K', '2', ' ', ' ', ' ', ' ')114 #define EFI_ACPI_OEM_REVISION 0x00000002115 #define EFI_ACPI_CREATOR_ID 0x20202020116 #define EFI_ACPI_CREATOR_REVISION 0x01000013117 108 118 109 // -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
r48674 r58459 2 2 # ACPI Table Protocol Driver 3 3 # 4 # Copyright (c) 2006 - 201 0, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # This program and the accompanying materials are 6 6 # licensed and made available under the terms and conditions of the BSD License … … 16 16 INF_VERSION = 0x00010005 17 17 BASE_NAME = AcpiTableDxe 18 MODULE_UNI_FILE = AcpiTableDxe.uni 18 19 FILE_GUID = 9622E42C-8E38-4a08-9E8F-54F784652F6B 19 20 MODULE_TYPE = DXE_DRIVER … … 55 56 56 57 [Guids] 57 gEfiAcpi10TableGuid # ALWAYS_CONSUMED58 gEfiAcpiTableGuid 58 gEfiAcpi10TableGuid ## PRODUCES ## SystemTable 59 gEfiAcpiTableGuid ## PRODUCES ## SystemTable 59 60 60 61 [FeaturePcd] 61 gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol 62 gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol ## CONSUMES 63 64 [Pcd] 65 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId ## CONSUMES 66 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId ## CONSUMES 67 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision ## CONSUMES 68 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId ## CONSUMES 69 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision ## CONSUMES 62 70 63 71 [Protocols] 64 gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_PRODUCED 65 gEfiAcpiSdtProtocolGuid # PROTOCOL ALWAYS_PRODUCED 66 gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_CONSUMED 72 gEfiAcpiTableProtocolGuid ## PRODUCES 73 gEfiAcpiSdtProtocolGuid ## PRODUCES 74 ## NOTIFY 75 ## SOMETIMES_CONSUMES 76 gEfiDxeSmmReadyToLockProtocolGuid 67 77 68 78 [Depex] 69 79 TRUE 70 80 81 [UserExtensions.TianoCore."ExtraFiles"] 82 AcpiTableDxeExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
r48674 r58459 2 2 ACPI Table Protocol Implementation 3 3 4 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 98 98 // Protocol function implementations. 99 99 // 100 101 /**102 This function adds, removes, or updates ACPI tables. If the address is not103 null and the handle value is null, the table is added. If both the address and104 handle are not null, the table at handle is updated with the table at address.105 If the address is null and the handle is not, the table at handle is deleted.106 107 @param AcpiTableInstance Instance of the protocol.108 @param Table Pointer to a table.109 @param Checksum Boolean indicating if the checksum should be calculated.110 @param Version Version(s) to set.111 @param Handle Handle of the table.112 113 @return EFI_SUCCESS The function completed successfully.114 @return EFI_INVALID_PARAMETER Both the Table and *Handle were NULL.115 @return EFI_ABORTED Could not complete the desired request.116 117 **/118 EFI_STATUS119 EFIAPI120 SetAcpiTable (121 IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance,122 IN VOID *Table OPTIONAL,123 IN BOOLEAN Checksum,124 IN EFI_ACPI_TABLE_VERSION Version,125 IN OUT UINTN *Handle126 )127 {128 UINTN SavedHandle;129 EFI_STATUS Status;130 131 //132 // Check for invalid input parameters133 //134 ASSERT (Handle);135 136 //137 // Initialize locals138 //139 //140 // Determine desired action141 //142 if (*Handle == 0) {143 if (Table == NULL) {144 //145 // Invalid parameter combination146 //147 return EFI_INVALID_PARAMETER;148 } else {149 //150 // Add table151 //152 Status = AddTableToList (AcpiTableInstance, Table, Checksum, Version, Handle);153 }154 } else {155 if (Table != NULL) {156 //157 // Update table158 //159 //160 // Delete the table list entry161 //162 Status = RemoveTableFromList (AcpiTableInstance, Version, *Handle);163 if (EFI_ERROR (Status)) {164 //165 // Should not get an error here ever, but abort if we do.166 //167 return EFI_ABORTED;168 }169 //170 // Set the handle to replace the table at the same handle171 //172 SavedHandle = AcpiTableInstance->CurrentHandle;173 AcpiTableInstance->CurrentHandle = *Handle;174 175 //176 // Add the table177 //178 Status = AddTableToList (AcpiTableInstance, Table, Checksum, Version, Handle);179 180 //181 // Restore the saved current handle182 //183 AcpiTableInstance->CurrentHandle = SavedHandle;184 } else {185 //186 // Delete table187 //188 Status = RemoveTableFromList (AcpiTableInstance, Version, *Handle);189 }190 }191 192 if (EFI_ERROR (Status)) {193 //194 // Should not get an error here ever, but abort if we do.195 //196 return EFI_ABORTED;197 }198 //199 // Done200 //201 return EFI_SUCCESS;202 }203 100 204 101 /** … … 304 201 are not in sync. 305 202 @return EFI_OUT_OF_RESOURCES Insufficient resources exist to complete the request. 203 @retval EFI_ACCESS_DENIED The table signature matches a table already 204 present in the system and platform policy 205 does not allow duplicate tables of this type. 306 206 307 207 **/ … … 337 237 AcpiTableBufferConst = AllocateCopyPool (AcpiTableBufferSize,AcpiTableBuffer); 338 238 *TableKey = 0; 339 Status = SetAcpiTable(239 Status = AddTableToList ( 340 240 AcpiTableInstance, 341 241 AcpiTableBufferConst, … … 397 297 // Uninstall the ACPI table 398 298 // 399 Status = SetAcpiTable(299 Status = RemoveTableFromList ( 400 300 AcpiTableInstance, 401 NULL,402 FALSE,403 301 EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0, 404 &TableKey302 TableKey 405 303 ); 406 304 if (!EFI_ERROR (Status)) { … … 529 427 @return EFI_SUCCESS The function completed successfully. 530 428 @return EFI_OUT_OF_RESOURCES Could not allocate a required resource. 531 @return EFI_ABORTED The table is a duplicate of a table that is required 532 to be unique. 429 @retval EFI_ACCESS_DENIED The table signature matches a table already 430 present in the system and platform policy 431 does not allow duplicate tables of this type. 533 432 534 433 **/ … … 666 565 gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages); 667 566 gBS->FreePool (CurrentTableList); 668 return EFI_A BORTED;567 return EFI_ACCESS_DENIED; 669 568 } 670 569 // … … 718 617 // 719 618 // Update pointers in FADT. If tables don't exist this will put NULL pointers there. 720 // 721 AcpiTableInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiTableInstance->Facs3; 722 Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Facs3; 723 CopyMem ( 724 &AcpiTableInstance->Fadt3->XFirmwareCtrl, 725 &Buffer64, 726 sizeof (UINT64) 727 ); 619 // Note: If the FIRMWARE_CTRL is non-zero, then X_FIRMWARE_CTRL must be zero, and 620 // vice-versa. 621 // 622 if ((UINT64)(UINTN)AcpiTableInstance->Facs3 < BASE_4GB) { 623 AcpiTableInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiTableInstance->Facs3; 624 } else { 625 Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Facs3; 626 CopyMem ( 627 &AcpiTableInstance->Fadt3->XFirmwareCtrl, 628 &Buffer64, 629 sizeof (UINT64) 630 ); 631 } 728 632 AcpiTableInstance->Fadt3->Dsdt = (UINT32) (UINTN) AcpiTableInstance->Dsdt3; 729 633 Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Dsdt3; … … 796 700 gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages); 797 701 gBS->FreePool (CurrentTableList); 798 return EFI_A BORTED;702 return EFI_ACCESS_DENIED; 799 703 } 800 704 // … … 841 745 // 842 746 if (AcpiTableInstance->Fadt3 != NULL) { 843 AcpiTableInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiTableInstance->Facs3; 844 Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Facs3; 845 CopyMem ( 846 &AcpiTableInstance->Fadt3->XFirmwareCtrl, 847 &Buffer64, 848 sizeof (UINT64) 849 ); 747 // 748 // Note: If the FIRMWARE_CTRL is non-zero, then X_FIRMWARE_CTRL must be zero, and 749 // vice-versa. 750 // 751 if ((UINT64)(UINTN)AcpiTableInstance->Facs3 < BASE_4GB) { 752 AcpiTableInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiTableInstance->Facs3; 753 } else { 754 Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Facs3; 755 CopyMem ( 756 &AcpiTableInstance->Fadt3->XFirmwareCtrl, 757 &Buffer64, 758 sizeof (UINT64) 759 ); 760 } 850 761 851 762 // … … 873 784 gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages); 874 785 gBS->FreePool (CurrentTableList); 875 return EFI_A BORTED;786 return EFI_ACCESS_DENIED; 876 787 } 877 788 // … … 1784 1695 CurrentData = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE; 1785 1696 CopyMem (&AcpiTableInstance->Rsdp1->Signature, &CurrentData, sizeof (UINT64)); 1786 CopyMem (AcpiTableInstance->Rsdp1->OemId, EFI_ACPI_OEM_ID, 6);1697 CopyMem (AcpiTableInstance->Rsdp1->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdp1->OemId)); 1787 1698 AcpiTableInstance->Rsdp1->Reserved = EFI_ACPI_RESERVED_BYTE; 1788 1699 AcpiTableInstance->Rsdp1->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt1; … … 1790 1701 CurrentData = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE; 1791 1702 CopyMem (&AcpiTableInstance->Rsdp3->Signature, &CurrentData, sizeof (UINT64)); 1792 CopyMem (AcpiTableInstance->Rsdp3->OemId, EFI_ACPI_OEM_ID, 6);1703 CopyMem (AcpiTableInstance->Rsdp3->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdp3->OemId)); 1793 1704 AcpiTableInstance->Rsdp3->Revision = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION; 1794 1705 AcpiTableInstance->Rsdp3->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt3; … … 1808 1719 AcpiTableInstance->Rsdt1->Length = sizeof (EFI_ACPI_DESCRIPTION_HEADER); 1809 1720 AcpiTableInstance->Rsdt1->Revision = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION; 1810 CopyMem (AcpiTableInstance->Rsdt1->OemId, EFI_ACPI_OEM_ID, 6);1811 CurrentData = EFI_ACPI_OEM_TABLE_ID;1721 CopyMem (AcpiTableInstance->Rsdt1->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdt1->OemId)); 1722 CurrentData = PcdGet64 (PcdAcpiDefaultOemTableId); 1812 1723 CopyMem (&AcpiTableInstance->Rsdt1->OemTableId, &CurrentData, sizeof (UINT64)); 1813 AcpiTableInstance->Rsdt1->OemRevision = EFI_ACPI_OEM_REVISION;1814 AcpiTableInstance->Rsdt1->CreatorId = EFI_ACPI_CREATOR_ID;1815 AcpiTableInstance->Rsdt1->CreatorRevision = EFI_ACPI_CREATOR_REVISION;1724 AcpiTableInstance->Rsdt1->OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision); 1725 AcpiTableInstance->Rsdt1->CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId); 1726 AcpiTableInstance->Rsdt1->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision); 1816 1727 // 1817 1728 // We always reserve first one for FADT … … 1823 1734 AcpiTableInstance->Rsdt3->Length = sizeof (EFI_ACPI_DESCRIPTION_HEADER); 1824 1735 AcpiTableInstance->Rsdt3->Revision = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION; 1825 CopyMem (AcpiTableInstance->Rsdt3->OemId, EFI_ACPI_OEM_ID, 6);1826 CurrentData = EFI_ACPI_OEM_TABLE_ID;1736 CopyMem (AcpiTableInstance->Rsdt3->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdt3->OemId)); 1737 CurrentData = PcdGet64 (PcdAcpiDefaultOemTableId); 1827 1738 CopyMem (&AcpiTableInstance->Rsdt3->OemTableId, &CurrentData, sizeof (UINT64)); 1828 AcpiTableInstance->Rsdt3->OemRevision = EFI_ACPI_OEM_REVISION;1829 AcpiTableInstance->Rsdt3->CreatorId = EFI_ACPI_CREATOR_ID;1830 AcpiTableInstance->Rsdt3->CreatorRevision = EFI_ACPI_CREATOR_REVISION;1739 AcpiTableInstance->Rsdt3->OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision); 1740 AcpiTableInstance->Rsdt3->CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId); 1741 AcpiTableInstance->Rsdt3->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision); 1831 1742 // 1832 1743 // We always reserve first one for FADT … … 1841 1752 AcpiTableInstance->Xsdt->Length = sizeof (EFI_ACPI_DESCRIPTION_HEADER); 1842 1753 AcpiTableInstance->Xsdt->Revision = EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION; 1843 CopyMem (AcpiTableInstance->Xsdt->OemId, EFI_ACPI_OEM_ID, 6);1844 CurrentData = EFI_ACPI_OEM_TABLE_ID;1754 CopyMem (AcpiTableInstance->Xsdt->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Xsdt->OemId)); 1755 CurrentData = PcdGet64 (PcdAcpiDefaultOemTableId); 1845 1756 CopyMem (&AcpiTableInstance->Xsdt->OemTableId, &CurrentData, sizeof (UINT64)); 1846 AcpiTableInstance->Xsdt->OemRevision = EFI_ACPI_OEM_REVISION;1847 AcpiTableInstance->Xsdt->CreatorId = EFI_ACPI_CREATOR_ID;1848 AcpiTableInstance->Xsdt->CreatorRevision = EFI_ACPI_CREATOR_REVISION;1757 AcpiTableInstance->Xsdt->OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision); 1758 AcpiTableInstance->Xsdt->CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId); 1759 AcpiTableInstance->Xsdt->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision); 1849 1760 // 1850 1761 // We always reserve first one for FADT -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/AcpiTableDxe/Aml.c
r48674 r58459 2 2 ACPI Sdt Protocol Driver 3 3 4 Copyright (c) 2010 , Intel Corporation. All rights reserved. <BR>4 Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 18 18 AML_BYTE_ENCODING mAmlByteEncoding[] = { 19 19 // OpCode SubOpCode Num 1 2 3 4 5 6 Attribute 20 /* ZeroOp - 0x00 */ {AML_ZERO_OP, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},21 /* OneOp - 0x01 */ {AML_ONE_OP, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},22 /* AliasOp - 0x06 */ {AML_ALIAS_OP, 0, 2, AML_NAME, AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IN_NAMESPACE},23 /* NameOp - 0x08 */ {AML_NAME_OP, 0, 2, AML_NAME, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IN_NAMESPACE},24 /* BytePrefix - 0x0A */ {AML_BYTE_PREFIX, 0, 1, AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},25 /* WordPrefix - 0x0B */ {AML_WORD_PREFIX, 0, 1, AML_UINT16, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},26 /* DWordPrefix - 0x0C */ {AML_DWORD_PREFIX, 0, 1, AML_UINT32, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},27 /* StringPrefix - 0x0D */ {AML_STRING_PREFIX, 0, 1, AML_STRING, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},28 /* QWordPrefix - 0x0E */ {AML_QWORD_PREFIX, 0, 1, AML_UINT64, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},29 /* ScopeOp - 0x10 */ {AML_SCOPE_OP, 0, 1, AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE},30 /* BufferOp - 0x11 */ {AML_BUFFER_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH},31 /* PackageOp - 0x12 */ {AML_PACKAGE_OP, 0, 1, AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ},32 /* VarPackageOp - 0x13 */ {AML_VAR_PACKAGE_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ},33 /* MethodOp - 0x14 */ {AML_METHOD_OP, 0, 2, AML_NAME, AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE},34 /* DualNamePrefix - 0x2F */ {AML_DUAL_NAME_PREFIX, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},35 /* MultiNamePrefix - 0x2F */ {AML_MULTI_NAME_PREFIX, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},36 /* NameChar - 0x41 */ {'A', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},37 /* NameChar - 0x42 */ {'B', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},38 /* NameChar - 0x43 */ {'C', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},39 /* NameChar - 0x44 */ {'D', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},40 /* NameChar - 0x45 */ {'E', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},41 /* NameChar - 0x46 */ {'F', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},42 /* NameChar - 0x47 */ {'G', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},43 /* NameChar - 0x48 */ {'H', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},44 /* NameChar - 0x49 */ {'I', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},45 /* NameChar - 0x4A */ {'J', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},46 /* NameChar - 0x4B */ {'K', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},47 /* NameChar - 0x4C */ {'L', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},48 /* NameChar - 0x4D */ {'M', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},49 /* NameChar - 0x4E */ {'N', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},50 /* NameChar - 0x4F */ {'O', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},51 /* NameChar - 0x50 */ {'P', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},52 /* NameChar - 0x51 */ {'Q', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},53 /* NameChar - 0x52 */ {'R', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},54 /* NameChar - 0x53 */ {'S', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},55 /* NameChar - 0x54 */ {'T', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},56 /* NameChar - 0x55 */ {'U', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},57 /* NameChar - 0x56 */ {'V', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},58 /* NameChar - 0x57 */ {'W', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},59 /* NameChar - 0x58 */ {'X', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},60 /* NameChar - 0x59 */ {'Y', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},61 /* NameChar - 0x5A */ {'Z', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},62 /* MutexOp - 0x5B 0x01 */ {AML_EXT_OP, AML_EXT_MUTEX_OP, 2, AML_NAME, AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IN_NAMESPACE},63 /* EventOp - 0x5B 0x02 */ {AML_EXT_OP, AML_EXT_EVENT_OP, 1, AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IN_NAMESPACE},64 /* CondRefOfOp - 0x5B 0x12 */ {AML_EXT_OP, AML_EXT_COND_REF_OF_OP, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},65 /* CreateFieldOp - 0x5B 0x13 */ {AML_EXT_OP, AML_EXT_CREATE_FIELD_OP,4, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, 0},66 /* LoadTableOp - 0x5B 0x1F */ {AML_EXT_OP, AML_EXT_LOAD_TABLE_OP, 6, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_OBJECT, 0},67 /* LoadOp - 0x5B 0x20 */ {AML_EXT_OP, AML_EXT_LOAD_OP, 2, AML_NAME, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},68 /* StallOp - 0x5B 0x21 */ {AML_EXT_OP, AML_EXT_STALL_OP, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},69 /* SleepOp - 0x5B 0x22 */ {AML_EXT_OP, AML_EXT_SLEEP_OP, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},70 /* AcquireOp - 0x5B 0x23 */ {AML_EXT_OP, AML_EXT_ACQUIRE_OP, 2, AML_OBJECT, AML_UINT16, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},71 /* SignalOp - 0x5B 0x24 */ {AML_EXT_OP, AML_EXT_SIGNAL_OP, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},72 /* WaitOp - 0x5B 0x25 */ {AML_EXT_OP, AML_EXT_WAIT_OP, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},73 /* ResetOp - 0x5B 0x26 */ {AML_EXT_OP, AML_EXT_RESET_OP, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},74 /* ReleaseOp - 0x5B 0x27 */ {AML_EXT_OP, AML_EXT_RELEASE_OP, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},75 /* FromBCDOp - 0x5B 0x28 */ {AML_EXT_OP, AML_EXT_FROM_BCD_OP, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},76 /* ToBCDOp - 0x5B 0x29 */ {AML_EXT_OP, AML_EXT_TO_BCD_OP, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},77 /* UnloadOp - 0x5B 0x2A */ {AML_EXT_OP, AML_EXT_UNLOAD_OP, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},78 /* RevisionOp - 0x5B 0x30 */ {AML_EXT_OP, AML_EXT_REVISION_OP, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},79 /* DebugOp - 0x5B 0x31 */ {AML_EXT_OP, AML_EXT_DEBUG_OP, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},80 /* FatalOp - 0x5B 0x32 */ {AML_EXT_OP, AML_EXT_FATAL_OP, 3, AML_UINT8, AML_UINT32, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},81 /* TimerOp - 0x5B 0x33 */ {AML_EXT_OP, AML_EXT_TIMER_OP, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},82 /* OpRegionOp - 0x5B 0x80 */ {AML_EXT_OP, AML_EXT_REGION_OP, 4, AML_NAME, AML_UINT8, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_IN_NAMESPACE},83 /* FieldOp - 0x5B 0x81 */ {AML_EXT_OP, AML_EXT_FIELD_OP, 2, AML_NAME, AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH},84 /* DeviceOp - 0x5B 0x82 */ {AML_EXT_OP, AML_EXT_DEVICE_OP, 1, AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE},85 /* ProcessorOp - 0x5B 0x83 */ {AML_EXT_OP, AML_EXT_PROCESSOR_OP, 4, AML_NAME, AML_UINT8, AML_UINT32, AML_UINT8, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE},86 /* PowerResOp - 0x5B 0x84 */ {AML_EXT_OP, AML_EXT_POWER_RES_OP, 3, AML_NAME, AML_UINT8, AML_UINT16, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE},87 /* ThermalZoneOp - 0x5B 0x85 */ {AML_EXT_OP, AML_EXT_THERMAL_ZONE_OP,1, AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE},88 /* IndexFieldOp - 0x5B 0x86 */ {AML_EXT_OP, AML_EXT_INDEX_FIELD_OP, 3, AML_NAME, AML_NAME, AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH},89 /* BankFieldOp - 0x5B 0x87 */ {AML_EXT_OP, AML_EXT_BANK_FIELD_OP, 4, AML_NAME, AML_NAME, AML_OBJECT, AML_UINT8, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH},90 /* DataRegionOp - 0x5B 0x88 */ {AML_EXT_OP, AML_EXT_DATA_REGION_OP, 4, AML_NAME, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_IN_NAMESPACE},91 /* RootChar - 0x5C */ {AML_ROOT_CHAR, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},92 /* ParentPrefixChar - 0x5E */ {AML_PARENT_PREFIX_CHAR, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},93 /* NameChar - 0x5F */ {'_', 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_IS_NAME_CHAR},94 /* Local0Op - 0x60 */ {AML_LOCAL0, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},95 /* Local1Op - 0x61 */ {AML_LOCAL1, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},96 /* Local2Op - 0x62 */ {AML_LOCAL2, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},97 /* Local3Op - 0x63 */ {AML_LOCAL3, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},98 /* Local4Op - 0x64 */ {AML_LOCAL4, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},99 /* Local5Op - 0x65 */ {AML_LOCAL5, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},100 /* Local6Op - 0x66 */ {AML_LOCAL6, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},101 /* Local7Op - 0x67 */ {AML_LOCAL7, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},102 /* Arg0Op - 0x68 */ {AML_ARG0, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},103 /* Arg1Op - 0x69 */ {AML_ARG1, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},104 /* Arg2Op - 0x6A */ {AML_ARG2, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},105 /* Arg3Op - 0x6B */ {AML_ARG3, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},106 /* Arg4Op - 0x6C */ {AML_ARG4, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},107 /* Arg5Op - 0x6D */ {AML_ARG5, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},108 /* Arg6Op - 0x6E */ {AML_ARG6, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},109 /* StoreOp - 0x70 */ {AML_STORE_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},110 /* RefOfOp - 0x71 */ {AML_REF_OF_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},111 /* AddOp - 0x72 */ {AML_ADD_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},112 /* ConcatOp - 0x73 */ {AML_CONCAT_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},113 /* SubtractOp - 0x74 */ {AML_SUBTRACT_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},114 /* IncrementOp - 0x75 */ {AML_INCREMENT_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},115 /* DecrementOp - 0x76 */ {AML_DECREMENT_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},116 /* MultiplyOp - 0x77 */ {AML_MULTIPLY_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},117 /* DivideOp - 0x78 */ {AML_DIVIDE_OP, 0, 4, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, 0},118 /* ShiftLeftOp - 0x79 */ {AML_SHIFT_LEFT_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},119 /* ShiftRightOp - 0x7A */ {AML_SHIFT_RIGHT_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},120 /* AndOp - 0x7B */ {AML_AND_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},121 /* NAndOp - 0x7C */ {AML_NAND_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},122 /* OrOp - 0x7D */ {AML_OR_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},123 /* NorOp - 0x7E */ {AML_NOR_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},124 /* XOrOp - 0x7F */ {AML_XOR_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},125 /* NotOp - 0x80 */ {AML_NOT_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},126 /* FindSetLeftBitOp - 0x81 */ {AML_FIND_SET_LEFT_BIT_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},127 /* FindSetRightBitOp - 0x82 */ {AML_FIND_SET_RIGHT_BIT_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},128 /* DerefOfOp - 0x83 */ {AML_DEREF_OF_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},129 /* ConcatResOp - 0x84 */ {AML_CONCAT_RES_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},130 /* ModOp - 0x85 */ {AML_MOD_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},131 /* NotifyOp - 0x86 */ {AML_NOTIFY_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},132 /* SizeOfOp - 0x87 */ {AML_SIZE_OF_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},133 /* IndexOp - 0x88 */ {AML_INDEX_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},134 /* MatchOp - 0x89 */ {AML_MATCH_OP, 0, 6, AML_OBJECT, AML_UINT8, AML_OBJECT, AML_UINT8, AML_OBJECT, AML_OBJECT, 0},135 /* CreateDWordFieldOp - 0x8A */ {AML_CREATE_DWORD_FIELD_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE, 0},136 /* CreateWordFieldOp - 0x8B */ {AML_CREATE_WORD_FIELD_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE, 0},137 /* CreateByteFieldOp - 0x8C */ {AML_CREATE_BYTE_FIELD_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE, 0},138 /* CreateBitFieldOp - 0x8D */ {AML_CREATE_BIT_FIELD_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE, 0},139 /* ObjectTypeOp - 0x8E */ {AML_OBJECT_TYPE_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},140 /* CreateQWordFieldOp - 0x8F */ {AML_CREATE_QWORD_FIELD_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE, 0},141 /* LAndOp - 0x90 */ {AML_LAND_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},142 /* LOrOp - 0x91 */ {AML_LOR_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},143 /* LNotOp - 0x92 */ {AML_LNOT_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},144 /* LEqualOp - 0x93 */ {AML_LEQUAL_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},145 /* LGreaterOp - 0x94 */ {AML_LGREATER_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},146 /* LLessOp - 0x95 */ {AML_LLESS_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},147 /* ToBufferOp - 0x96 */ {AML_TO_BUFFER_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},148 /* ToDecimalStringOp - 0x97 */ {AML_TO_DEC_STRING_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},149 /* ToHexStringOp - 0x98 */ {AML_TO_HEX_STRING_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},150 /* ToIntegerOp - 0x99 */ {AML_TO_INTEGER_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},151 /* ToStringOp - 0x9C */ {AML_TO_STRING_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},152 /* CopyObjectOp - 0x9D */ {AML_COPY_OBJECT_OP, 0, 2, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},153 /* MidOp - 0x9E */ {AML_MID_OP, 0, 3, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, 0},154 /* ContinueOp - 0x9F */ {AML_CONTINUE_OP, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},155 /* IfOp - 0xA0 */ {AML_IF_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ},156 /* ElseOp - 0xA1 */ {AML_ELSE_OP, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ},157 /* WhileOp - 0xA2 */ {AML_WHILE_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ},158 /* NoopOp - 0xA3 */ {AML_NOOP_OP, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},159 /* ReturnOp - 0xA4 */ {AML_RETURN_OP, 0, 1, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},160 /* BreakOp - 0xA5 */ {AML_BREAK_OP, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},161 /* BreakPointOp - 0xCC */ {AML_BREAK_POINT_OP, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},162 /* OnesOp - 0xFF */ {AML_ONES_OP, 0, 0, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, 0},20 /* ZeroOp - 0x00 */ {AML_ZERO_OP, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 21 /* OneOp - 0x01 */ {AML_ONE_OP, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 22 /* AliasOp - 0x06 */ {AML_ALIAS_OP, 0, 2, {AML_NAME, AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IN_NAMESPACE}, 23 /* NameOp - 0x08 */ {AML_NAME_OP, 0, 2, {AML_NAME, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IN_NAMESPACE}, 24 /* BytePrefix - 0x0A */ {AML_BYTE_PREFIX, 0, 1, {AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 25 /* WordPrefix - 0x0B */ {AML_WORD_PREFIX, 0, 1, {AML_UINT16, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 26 /* DWordPrefix - 0x0C */ {AML_DWORD_PREFIX, 0, 1, {AML_UINT32, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 27 /* StringPrefix - 0x0D */ {AML_STRING_PREFIX, 0, 1, {AML_STRING, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 28 /* QWordPrefix - 0x0E */ {AML_QWORD_PREFIX, 0, 1, {AML_UINT64, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 29 /* ScopeOp - 0x10 */ {AML_SCOPE_OP, 0, 1, {AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE}, 30 /* BufferOp - 0x11 */ {AML_BUFFER_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH}, 31 /* PackageOp - 0x12 */ {AML_PACKAGE_OP, 0, 1, {AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ}, 32 /* VarPackageOp - 0x13 */ {AML_VAR_PACKAGE_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ}, 33 /* MethodOp - 0x14 */ {AML_METHOD_OP, 0, 2, {AML_NAME, AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE}, 34 /* DualNamePrefix - 0x2F */ {AML_DUAL_NAME_PREFIX, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 35 /* MultiNamePrefix - 0x2F */ {AML_MULTI_NAME_PREFIX, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 36 /* NameChar - 0x41 */ {'A', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 37 /* NameChar - 0x42 */ {'B', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 38 /* NameChar - 0x43 */ {'C', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 39 /* NameChar - 0x44 */ {'D', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 40 /* NameChar - 0x45 */ {'E', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 41 /* NameChar - 0x46 */ {'F', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 42 /* NameChar - 0x47 */ {'G', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 43 /* NameChar - 0x48 */ {'H', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 44 /* NameChar - 0x49 */ {'I', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 45 /* NameChar - 0x4A */ {'J', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 46 /* NameChar - 0x4B */ {'K', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 47 /* NameChar - 0x4C */ {'L', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 48 /* NameChar - 0x4D */ {'M', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 49 /* NameChar - 0x4E */ {'N', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 50 /* NameChar - 0x4F */ {'O', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 51 /* NameChar - 0x50 */ {'P', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 52 /* NameChar - 0x51 */ {'Q', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 53 /* NameChar - 0x52 */ {'R', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 54 /* NameChar - 0x53 */ {'S', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 55 /* NameChar - 0x54 */ {'T', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 56 /* NameChar - 0x55 */ {'U', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 57 /* NameChar - 0x56 */ {'V', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 58 /* NameChar - 0x57 */ {'W', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 59 /* NameChar - 0x58 */ {'X', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 60 /* NameChar - 0x59 */ {'Y', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 61 /* NameChar - 0x5A */ {'Z', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 62 /* MutexOp - 0x5B 0x01 */ {AML_EXT_OP, AML_EXT_MUTEX_OP, 2, {AML_NAME, AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IN_NAMESPACE}, 63 /* EventOp - 0x5B 0x02 */ {AML_EXT_OP, AML_EXT_EVENT_OP, 1, {AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IN_NAMESPACE}, 64 /* CondRefOfOp - 0x5B 0x12 */ {AML_EXT_OP, AML_EXT_COND_REF_OF_OP, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 65 /* CreateFieldOp - 0x5B 0x13 */ {AML_EXT_OP, AML_EXT_CREATE_FIELD_OP,4, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE}, 0}, 66 /* LoadTableOp - 0x5B 0x1F */ {AML_EXT_OP, AML_EXT_LOAD_TABLE_OP, 6, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_OBJECT}, 0}, 67 /* LoadOp - 0x5B 0x20 */ {AML_EXT_OP, AML_EXT_LOAD_OP, 2, {AML_NAME, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 68 /* StallOp - 0x5B 0x21 */ {AML_EXT_OP, AML_EXT_STALL_OP, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 69 /* SleepOp - 0x5B 0x22 */ {AML_EXT_OP, AML_EXT_SLEEP_OP, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 70 /* AcquireOp - 0x5B 0x23 */ {AML_EXT_OP, AML_EXT_ACQUIRE_OP, 2, {AML_OBJECT, AML_UINT16, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 71 /* SignalOp - 0x5B 0x24 */ {AML_EXT_OP, AML_EXT_SIGNAL_OP, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 72 /* WaitOp - 0x5B 0x25 */ {AML_EXT_OP, AML_EXT_WAIT_OP, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 73 /* ResetOp - 0x5B 0x26 */ {AML_EXT_OP, AML_EXT_RESET_OP, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 74 /* ReleaseOp - 0x5B 0x27 */ {AML_EXT_OP, AML_EXT_RELEASE_OP, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 75 /* FromBCDOp - 0x5B 0x28 */ {AML_EXT_OP, AML_EXT_FROM_BCD_OP, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 76 /* ToBCDOp - 0x5B 0x29 */ {AML_EXT_OP, AML_EXT_TO_BCD_OP, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 77 /* UnloadOp - 0x5B 0x2A */ {AML_EXT_OP, AML_EXT_UNLOAD_OP, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 78 /* RevisionOp - 0x5B 0x30 */ {AML_EXT_OP, AML_EXT_REVISION_OP, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 79 /* DebugOp - 0x5B 0x31 */ {AML_EXT_OP, AML_EXT_DEBUG_OP, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 80 /* FatalOp - 0x5B 0x32 */ {AML_EXT_OP, AML_EXT_FATAL_OP, 3, {AML_UINT8, AML_UINT32, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 81 /* TimerOp - 0x5B 0x33 */ {AML_EXT_OP, AML_EXT_TIMER_OP, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 82 /* OpRegionOp - 0x5B 0x80 */ {AML_EXT_OP, AML_EXT_REGION_OP, 4, {AML_NAME, AML_UINT8, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE}, AML_IN_NAMESPACE}, 83 /* FieldOp - 0x5B 0x81 */ {AML_EXT_OP, AML_EXT_FIELD_OP, 2, {AML_NAME, AML_UINT8, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH}, 84 /* DeviceOp - 0x5B 0x82 */ {AML_EXT_OP, AML_EXT_DEVICE_OP, 1, {AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE}, 85 /* ProcessorOp - 0x5B 0x83 */ {AML_EXT_OP, AML_EXT_PROCESSOR_OP, 4, {AML_NAME, AML_UINT8, AML_UINT32, AML_UINT8, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE}, 86 /* PowerResOp - 0x5B 0x84 */ {AML_EXT_OP, AML_EXT_POWER_RES_OP, 3, {AML_NAME, AML_UINT8, AML_UINT16, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE}, 87 /* ThermalZoneOp - 0x5B 0x85 */ {AML_EXT_OP, AML_EXT_THERMAL_ZONE_OP,1, {AML_NAME, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ | AML_IN_NAMESPACE}, 88 /* IndexFieldOp - 0x5B 0x86 */ {AML_EXT_OP, AML_EXT_INDEX_FIELD_OP, 3, {AML_NAME, AML_NAME, AML_UINT8, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH}, 89 /* BankFieldOp - 0x5B 0x87 */ {AML_EXT_OP, AML_EXT_BANK_FIELD_OP, 4, {AML_NAME, AML_NAME, AML_OBJECT, AML_UINT8, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH}, 90 /* DataRegionOp - 0x5B 0x88 */ {AML_EXT_OP, AML_EXT_DATA_REGION_OP, 4, {AML_NAME, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE}, AML_IN_NAMESPACE}, 91 /* RootChar - 0x5C */ {AML_ROOT_CHAR, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 92 /* ParentPrefixChar - 0x5E */ {AML_PARENT_PREFIX_CHAR, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 93 /* NameChar - 0x5F */ {'_', 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_IS_NAME_CHAR}, 94 /* Local0Op - 0x60 */ {AML_LOCAL0, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 95 /* Local1Op - 0x61 */ {AML_LOCAL1, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 96 /* Local2Op - 0x62 */ {AML_LOCAL2, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 97 /* Local3Op - 0x63 */ {AML_LOCAL3, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 98 /* Local4Op - 0x64 */ {AML_LOCAL4, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 99 /* Local5Op - 0x65 */ {AML_LOCAL5, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 100 /* Local6Op - 0x66 */ {AML_LOCAL6, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 101 /* Local7Op - 0x67 */ {AML_LOCAL7, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 102 /* Arg0Op - 0x68 */ {AML_ARG0, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 103 /* Arg1Op - 0x69 */ {AML_ARG1, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 104 /* Arg2Op - 0x6A */ {AML_ARG2, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 105 /* Arg3Op - 0x6B */ {AML_ARG3, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 106 /* Arg4Op - 0x6C */ {AML_ARG4, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 107 /* Arg5Op - 0x6D */ {AML_ARG5, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 108 /* Arg6Op - 0x6E */ {AML_ARG6, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 109 /* StoreOp - 0x70 */ {AML_STORE_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 110 /* RefOfOp - 0x71 */ {AML_REF_OF_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 111 /* AddOp - 0x72 */ {AML_ADD_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 112 /* ConcatOp - 0x73 */ {AML_CONCAT_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 113 /* SubtractOp - 0x74 */ {AML_SUBTRACT_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 114 /* IncrementOp - 0x75 */ {AML_INCREMENT_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 115 /* DecrementOp - 0x76 */ {AML_DECREMENT_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 116 /* MultiplyOp - 0x77 */ {AML_MULTIPLY_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 117 /* DivideOp - 0x78 */ {AML_DIVIDE_OP, 0, 4, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE}, 0}, 118 /* ShiftLeftOp - 0x79 */ {AML_SHIFT_LEFT_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 119 /* ShiftRightOp - 0x7A */ {AML_SHIFT_RIGHT_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 120 /* AndOp - 0x7B */ {AML_AND_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 121 /* NAndOp - 0x7C */ {AML_NAND_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 122 /* OrOp - 0x7D */ {AML_OR_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 123 /* NorOp - 0x7E */ {AML_NOR_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 124 /* XOrOp - 0x7F */ {AML_XOR_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 125 /* NotOp - 0x80 */ {AML_NOT_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 126 /* FindSetLeftBitOp - 0x81 */ {AML_FIND_SET_LEFT_BIT_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 127 /* FindSetRightBitOp - 0x82 */ {AML_FIND_SET_RIGHT_BIT_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 128 /* DerefOfOp - 0x83 */ {AML_DEREF_OF_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 129 /* ConcatResOp - 0x84 */ {AML_CONCAT_RES_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 130 /* ModOp - 0x85 */ {AML_MOD_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 131 /* NotifyOp - 0x86 */ {AML_NOTIFY_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 132 /* SizeOfOp - 0x87 */ {AML_SIZE_OF_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 133 /* IndexOp - 0x88 */ {AML_INDEX_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 134 /* MatchOp - 0x89 */ {AML_MATCH_OP, 0, 6, {AML_OBJECT, AML_UINT8, AML_OBJECT, AML_UINT8, AML_OBJECT, AML_OBJECT}, 0}, 135 /* CreateDWordFieldOp - 0x8A */ {AML_CREATE_DWORD_FIELD_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE}, 0}, 136 /* CreateWordFieldOp - 0x8B */ {AML_CREATE_WORD_FIELD_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE}, 0}, 137 /* CreateByteFieldOp - 0x8C */ {AML_CREATE_BYTE_FIELD_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE}, 0}, 138 /* CreateBitFieldOp - 0x8D */ {AML_CREATE_BIT_FIELD_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE}, 0}, 139 /* ObjectTypeOp - 0x8E */ {AML_OBJECT_TYPE_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 140 /* CreateQWordFieldOp - 0x8F */ {AML_CREATE_QWORD_FIELD_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_NAME, AML_NONE, AML_NONE, AML_NONE}, 0}, 141 /* LAndOp - 0x90 */ {AML_LAND_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 142 /* LOrOp - 0x91 */ {AML_LOR_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 143 /* LNotOp - 0x92 */ {AML_LNOT_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 144 /* LEqualOp - 0x93 */ {AML_LEQUAL_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 145 /* LGreaterOp - 0x94 */ {AML_LGREATER_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 146 /* LLessOp - 0x95 */ {AML_LLESS_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 147 /* ToBufferOp - 0x96 */ {AML_TO_BUFFER_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 148 /* ToDecimalStringOp - 0x97 */ {AML_TO_DEC_STRING_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 149 /* ToHexStringOp - 0x98 */ {AML_TO_HEX_STRING_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 150 /* ToIntegerOp - 0x99 */ {AML_TO_INTEGER_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 151 /* ToStringOp - 0x9C */ {AML_TO_STRING_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 152 /* CopyObjectOp - 0x9D */ {AML_COPY_OBJECT_OP, 0, 2, {AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 153 /* MidOp - 0x9E */ {AML_MID_OP, 0, 3, {AML_OBJECT, AML_OBJECT, AML_OBJECT, AML_NONE, AML_NONE, AML_NONE}, 0}, 154 /* ContinueOp - 0x9F */ {AML_CONTINUE_OP, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 155 /* IfOp - 0xA0 */ {AML_IF_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ}, 156 /* ElseOp - 0xA1 */ {AML_ELSE_OP, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ}, 157 /* WhileOp - 0xA2 */ {AML_WHILE_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, AML_HAS_PKG_LENGTH | AML_HAS_CHILD_OBJ}, 158 /* NoopOp - 0xA3 */ {AML_NOOP_OP, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 159 /* ReturnOp - 0xA4 */ {AML_RETURN_OP, 0, 1, {AML_OBJECT, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 160 /* BreakOp - 0xA5 */ {AML_BREAK_OP, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 161 /* BreakPointOp - 0xCC */ {AML_BREAK_POINT_OP, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 162 /* OnesOp - 0xFF */ {AML_ONES_OP, 0, 0, {AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE, AML_NONE}, 0}, 163 163 }; 164 164 … … 283 283 case 2: 284 284 RealLength = *(Buffer + 1); 285 RealLength |= ( *(Buffer + 2)) << 8;285 RealLength |= (UINTN)((*(Buffer + 2)) << 8); 286 286 RealLength = (RealLength << 4) | (LeadByte & 0xF); 287 287 break; 288 288 case 3: 289 289 RealLength = *(Buffer + 1); 290 RealLength |= ( *(Buffer + 2)) << 8;291 RealLength |= ( *(Buffer + 3)) << 16;290 RealLength |= (UINTN)((*(Buffer + 2)) << 8); 291 RealLength |= (UINTN)((*(Buffer + 3)) << 16); 292 292 RealLength = (RealLength << 4) | (LeadByte & 0xF); 293 293 break; -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlChild.c
r48674 r58459 2 2 ACPI Sdt Protocol Driver 3 3 4 Copyright (c) 2010 , Intel Corporation. All rights reserved. <BR>4 Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 190 190 UINT8 *CurrentBuffer; 191 191 192 CurrentBuffer = NULL; 193 192 194 if ((AmlParentHandle->AmlByteEncoding->Attribute & AML_HAS_CHILD_OBJ) == 0) { 193 195 // -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c
r48674 r58459 2 2 ACPI Sdt Protocol Driver 3 3 4 Copyright (c) 2010 , Intel Corporation. All rights reserved. <BR>4 Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 301 301 EFI_STATUS Status; 302 302 303 CurrentBuffer = NULL; 304 AmlChildHandle = NULL; 303 305 AmlByteEncoding = AmlHandle->AmlByteEncoding; 304 306 Buffer = AmlHandle->Buffer; -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
r48674 r58459 2 2 This module install ACPI Boot Graphics Resource Table (BGRT). 3 3 4 Copyright (c) 2011 - 201 2, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 14 14 #include <Uefi.h> 15 15 16 #include <IndustryStandard/Acpi 50.h>16 #include <IndustryStandard/Acpi.h> 17 17 #include <IndustryStandard/Bmp.h> 18 18 … … 28 28 #include <Library/UefiBootServicesTableLib.h> 29 29 #include <Library/DebugLib.h> 30 31 // 32 // ACPI table information used to initialize tables. 33 // 34 #define EFI_ACPI_OEM_ID "INTEL" 35 #define EFI_ACPI_OEM_TABLE_ID 0x2020204F4E414954ULL // "TIANO " 36 #define EFI_ACPI_OEM_REVISION 0x00000001 37 #define EFI_ACPI_CREATOR_ID 0x5446534D // TBD "MSFT" 38 #define EFI_ACPI_CREATOR_REVISION 0x01000013 // TBD 30 #include <Library/PcdLib.h> 39 31 40 32 // … … 82 74 0x00, // Checksum will be updated at runtime 83 75 // 84 // It is expected that these values will be updated at runtime.85 // 86 EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field87 EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)88 EFI_ACPI_OEM_REVISION, // OEM revision number89 EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID90 EFI_ACPI_CREATOR_REVISION, // ASL compiler revision number76 // It is expected that these values will be updated at EntryPoint. 77 // 78 {0x00}, // OEM ID is a 6 bytes long field 79 0x00, // OEM Table ID(8 bytes long) 80 0x00, // OEM Revision 81 0x00, // Creator ID 82 0x00, // Creator Revision 91 83 }, 92 84 EFI_ACPI_5_0_BGRT_VERSION, // Version … … 236 228 237 229 /** 238 Allocate Efi ReservedMemoryTypebelow 4G memory address.239 240 This function allocates Efi ReservedMemoryTypebelow 4G memory address.230 Allocate EfiBootServicesData below 4G memory address. 231 232 This function allocates EfiBootServicesData below 4G memory address. 241 233 242 234 @param[in] Size Size of memory to allocate. … … 246 238 **/ 247 239 VOID * 248 BgrtAllocate ReservedMemoryBelow4G (240 BgrtAllocateBsDataMemoryBelow4G ( 249 241 IN UINTN Size 250 242 ) … … 260 252 Status = gBS->AllocatePages ( 261 253 AllocateMaxAddress, 262 Efi ReservedMemoryType,254 EfiBootServicesData, 263 255 Pages, 264 256 &Address … … 362 354 return EFI_UNSUPPORTED; 363 355 } 364 356 357 // 358 // The image should be stored in EfiBootServicesData, allowing the system to reclaim the memory 359 // 365 360 BmpSize = (mLogoWidth * 3 + PaddingSize) * mLogoHeight + sizeof (BMP_IMAGE_HEADER); 366 ImageBuffer = BgrtAllocate ReservedMemoryBelow4G (BmpSize);361 ImageBuffer = BgrtAllocateBsDataMemoryBelow4G (BmpSize); 367 362 if (ImageBuffer == NULL) { 368 363 return EFI_OUT_OF_RESOURCES; … … 465 460 { 466 461 EFI_STATUS Status; 462 UINT64 OemTableId; 463 464 CopyMem ( 465 mBootGraphicsResourceTableTemplate.Header.OemId, 466 PcdGetPtr (PcdAcpiDefaultOemId), 467 sizeof (mBootGraphicsResourceTableTemplate.Header.OemId) 468 ); 469 OemTableId = PcdGet64 (PcdAcpiDefaultOemTableId); 470 CopyMem (&mBootGraphicsResourceTableTemplate.Header.OemTableId, &OemTableId, sizeof (UINT64)); 471 mBootGraphicsResourceTableTemplate.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision); 472 mBootGraphicsResourceTableTemplate.Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId); 473 mBootGraphicsResourceTableTemplate.Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision); 467 474 468 475 // -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
r48674 r58459 2 2 # This module install ACPI Boot Graphics Resource Table (BGRT). 3 3 # 4 # Copyright (c) 2011 , Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # This program and the accompanying materials 6 6 # are licensed and made available under the terms and conditions of the BSD License … … 16 16 INF_VERSION = 0x00010005 17 17 BASE_NAME = BootGraphicsResourceTableDxe 18 MODULE_UNI_FILE = BootGraphicsResourceTableDxe.uni 18 19 FILE_GUID = B8E62775-BB0A-43f0-A843-5BE8B14F8CCD 19 20 MODULE_TYPE = UEFI_DRIVER … … 42 43 UefiBootServicesTableLib 43 44 DebugLib 45 PcdLib 44 46 45 47 [Protocols] 46 gEfiAcpiTableProtocolGuid ## SOMETIMES_CONSUMES 47 gEfiBootLogoProtocolGuid ## SOMETIMES_CONSUMES 48 gEfiAcpiTableProtocolGuid ## CONSUMES 49 gEfiBootLogoProtocolGuid ## PRODUCES 50 51 [Pcd] 52 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId ## CONSUMES 53 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId ## CONSUMES 54 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision ## CONSUMES 55 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId ## CONSUMES 56 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision ## CONSUMES 48 57 49 58 [Guids] 50 gEfiEventReadyToBootGuid ## CONSUMES 59 gEfiEventReadyToBootGuid ## CONSUMES ## Event 60 61 [UserExtensions.TianoCore."ExtraFiles"] 62 BootGraphicsResourceTableDxeExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf
r48674 r58459 5 5 # depends on any PEI or DXE service. 6 6 # 7 # Copyright (c) 2006 - 201 0, Intel Corporation. All rights reserved.<BR>7 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 8 8 # 9 9 # This program and the accompanying materials are … … 20 20 INF_VERSION = 0x00010005 21 21 BASE_NAME = BootScriptExecutorDxe 22 MODULE_UNI_FILE = BootScriptExecutorDxe.uni 22 23 FILE_GUID = FA20568B-548B-4b2b-81EF-1BA08D4A3CEC 23 24 MODULE_TYPE = DXE_DRIVER … … 51 52 52 53 [LibraryClasses] 53 TimerLib54 54 PcdLib 55 55 BaseMemoryLib 56 SmbusLib57 56 UefiDriverEntryPoint 58 57 BaseLib 59 PciLib60 IoLib61 58 S3BootScriptLib 62 59 PeCoffLib 63 60 DxeServicesLib 64 61 UefiBootServicesTableLib 65 UefiRuntimeServicesTableLib66 62 CacheMaintenanceLib 67 PerformanceLib68 63 UefiLib 69 64 DebugAgentLib 70 65 LockBoxLib 66 CpuExceptionHandlerLib 67 DevicePathLib 71 68 72 69 [Guids] 73 gEfiBootScriptExecutorVariableGuid 74 gEfiBootScriptExecutorContextGuid 75 gPerformanceProtocolGuid 76 gEfiEventExitBootServicesGuid 70 gEfiBootScriptExecutorVariableGuid ## PRODUCES ## UNDEFINED # SaveLockBox 71 gEfiBootScriptExecutorContextGuid ## PRODUCES ## UNDEFINED # SaveLockBox 72 gEdkiiMemoryProfileGuid ## SOMETIMES_CONSUMES ## GUID # Locate protocol 73 74 [Protocols] 75 ## NOTIFY 76 ## CONSUMES 77 gEfiDxeSmmReadyToLockProtocolGuid 77 78 78 79 [FeaturePcd] 79 gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode 80 gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ## CONSUMES 81 82 [Pcd] 83 gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ## SOMETIMES_CONSUMES 84 gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfilePropertyMask ## CONSUMES 80 85 81 86 [Depex] 82 87 gEfiLockBoxProtocolGuid 83 88 89 [UserExtensions.TianoCore."ExtraFiles"] 90 BootScriptExecutorDxeExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c
r48674 r58459 4 4 Set a IDT entry for interrupt vector 3 for debug purpose for IA32 platform 5 5 6 Copyright (c) 2006 - 201 0, Intel Corporation. All rights reserved.<BR>6 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 7 7 8 8 This program and the accompanying materials … … 16 16 **/ 17 17 #include "ScriptExecute.h" 18 //19 // INTERRUPT_GATE_DESCRIPTOR and SetIdtEntry () are used to setup IDT to do debug20 //21 18 22 #pragma pack(1)23 24 typedef struct {25 UINT16 OffsetLow;26 UINT16 SegmentSelector;27 UINT16 Attributes;28 UINT16 OffsetHigh;29 } INTERRUPT_GATE_DESCRIPTOR;30 31 #define INTERRUPT_GATE_ATTRIBUTE 0x8e0032 33 #pragma pack()34 19 /** 35 20 Set a IDT entry for interrupt vector 3 for debug purpose. … … 43 28 ) 44 29 { 45 I NTERRUPT_GATE_DESCRIPTOR*IdtEntry;30 IA32_IDT_GATE_DESCRIPTOR *IdtEntry; 46 31 IA32_DESCRIPTOR *IdtDescriptor; 47 32 UINTN S3DebugBuffer; 33 EFI_STATUS Status; 48 34 49 35 // … … 51 37 // 52 38 IdtDescriptor = (IA32_DESCRIPTOR *) (UINTN) (AcpiS3Context->IdtrProfile); 53 IdtEntry = (INTERRUPT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (INTERRUPT_GATE_DESCRIPTOR))); 54 S3DebugBuffer = (UINTN) (AcpiS3Context->S3DebugBufferAddress); 39 AsmWriteIdtr (IdtDescriptor); 55 40 56 IdtEntry->OffsetLow = (UINT16)S3DebugBuffer; 57 IdtEntry->SegmentSelector = (UINT16)AsmReadCs ();; 58 IdtEntry->Attributes = (UINT16)INTERRUPT_GATE_ATTRIBUTE; 59 IdtEntry->OffsetHigh = (UINT16)(S3DebugBuffer >> 16); 41 // 42 // Setup the default CPU exception handlers 43 // 44 Status = InitializeCpuExceptionHandlers (NULL); 45 ASSERT_EFI_ERROR (Status); 60 46 61 AsmWriteIdtr (IdtDescriptor); 47 DEBUG_CODE ( 48 // 49 // Update IDT entry INT3 if the instruction is valid in it 50 // 51 S3DebugBuffer = (UINTN) (AcpiS3Context->S3DebugBufferAddress); 52 if (*(UINTN *)S3DebugBuffer != (UINTN) -1) { 53 IdtEntry = (IA32_IDT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (IA32_IDT_GATE_DESCRIPTOR))); 54 IdtEntry->Bits.OffsetLow = (UINT16)S3DebugBuffer; 55 IdtEntry->Bits.Selector = (UINT16)AsmReadCs (); 56 IdtEntry->Bits.Reserved_0 = 0; 57 IdtEntry->Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32; 58 IdtEntry->Bits.OffsetHigh = (UINT16)(S3DebugBuffer >> 16); 59 } 60 ); 62 61 } 63 62 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c
r48674 r58459 2 2 This is the code for Boot Script Executer module. 3 3 4 This driver is dispatched by Dxe core and the driver will reload itself to ACPI NVSmemory4 This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory 5 5 in the entry point. The functionality is to interpret and restore the S3 boot script 6 6 7 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>7 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 8 8 9 9 This program and the accompanying materials … … 19 19 #include "ScriptExecute.h" 20 20 21 EFI_PHYSICAL_ADDRESS mPerfDataMemAddress;22 UINT64 mS3BootScriptEntryTick;23 UINT64 mScriptStartTick;24 UINT64 mScriptEndTick;25 26 21 EFI_GUID mBootScriptExecutorImageGuid = { 27 0x9a8d3433, 0x9fe8, 0x42b6, 0x87, 0xb, 0x1e, 0x31, 0xc8, 0x4e, 0xbe, 0x3b22 0x9a8d3433, 0x9fe8, 0x42b6, { 0x87, 0xb, 0x1e, 0x31, 0xc8, 0x4e, 0xbe, 0x3b } 28 23 }; 29 24 30 /** 31 The event callback is used to get the base address of boot performance data structure on 32 LegacyBoot event and ExitBootServices event. 33 34 @param Event The event handle. 35 @param Context The event context. 36 37 **/ 38 VOID 39 EFIAPI 40 OnBootEvent ( 41 IN EFI_EVENT Event, 42 IN VOID *Context 43 ) 44 { 45 EFI_STATUS Status; 46 UINTN VarSize; 47 48 VarSize = sizeof (EFI_PHYSICAL_ADDRESS); 49 Status = gRT->GetVariable ( 50 L"PerfDataMemAddr", 51 &gPerformanceProtocolGuid, 52 NULL, 53 &VarSize, 54 &mPerfDataMemAddress 55 ); 56 if (EFI_ERROR (Status)) { 57 mPerfDataMemAddress = 0; 58 } 59 } 60 61 /** 62 Record S3 Script execution time and adjust total S3 resume time for script running. 63 **/ 64 VOID 65 WriteToOsS3PerformanceData ( 66 VOID 67 ) 68 { 69 UINT64 Ticker; 70 UINT64 StartValue; 71 UINT64 EndValue; 72 UINT64 Freq; 73 UINT64 ScriptExecuteTicks; 74 PERF_HEADER *PerfHeader; 75 PERF_DATA *PerfData; 76 77 Ticker = GetPerformanceCounter (); 78 79 PerfHeader = (PERF_HEADER *)(UINTN)mPerfDataMemAddress; 80 if (PerfHeader == NULL) { 81 return; 82 } 83 84 Freq = GetPerformanceCounterProperties (&StartValue, &EndValue); 85 Freq = DivU64x32 (Freq, 1000); 86 87 if (EndValue >= StartValue) { 88 ScriptExecuteTicks = mScriptEndTick - mScriptStartTick; 89 PerfHeader->S3Resume += Ticker - mS3BootScriptEntryTick; 90 } else { 91 ScriptExecuteTicks = mScriptStartTick - mScriptEndTick; 92 PerfHeader->S3Resume += mS3BootScriptEntryTick - Ticker; 93 } 94 if (PerfHeader->S3EntryNum < PERF_PEI_ENTRY_MAX_NUM) { 95 PerfData = &PerfHeader->S3Entry[PerfHeader->S3EntryNum]; 96 PerfData->Duration = (UINT32) DivU64x32 (ScriptExecuteTicks, (UINT32) Freq);; 97 AsciiStrnCpy (PerfData->Token, "ScriptExec", PERF_TOKEN_LENGTH); 98 PerfHeader->S3EntryNum++; 99 } 100 } 25 BOOLEAN mPage1GSupport = FALSE; 101 26 102 27 /** … … 123 48 UINTN TempStack[0x10]; 124 49 UINTN AsmTransferControl16Address; 125 126 PERF_CODE ( 127 mS3BootScriptEntryTick = GetPerformanceCounter (); 128 ); 50 IA32_DESCRIPTOR IdtDescriptor; 129 51 130 52 // … … 133 55 SaveAndSetDebugTimerInterrupt (FALSE); 134 56 57 AsmReadIdtr (&IdtDescriptor); 135 58 // 136 59 // Restore IDT for debug … … 139 62 140 63 // 141 // Initialize Debug Agent to support source level debug in S3 path .142 // 143 InitializeDebugAgent (DEBUG_AGENT_INIT_S3, NULL, NULL);64 // Initialize Debug Agent to support source level debug in S3 path, it will disable interrupt and Debug Timer. 65 // 66 InitializeDebugAgent (DEBUG_AGENT_INIT_S3, (VOID *)&IdtDescriptor, NULL); 144 67 145 68 // … … 147 70 // for that parameter. 148 71 // 149 PERF_CODE (150 mScriptStartTick = GetPerformanceCounter ();151 );152 72 Status = S3BootScriptExecute (); 153 PERF_CODE ( 154 mScriptEndTick = GetPerformanceCounter (); 155 ); 73 74 // 75 // If invalid script table or opcode in S3 boot script table. 76 // 77 ASSERT_EFI_ERROR (Status); 78 156 79 if (EFI_ERROR (Status)) { 80 CpuDeadLoop (); 157 81 return Status; 158 82 } … … 165 89 Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN) (AcpiS3Context->AcpiFacsTable)); 166 90 167 if ((Facs == NULL) ||168 (Facs->Signature != EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) ||169 ((Facs->FirmwareWakingVector == 0) && (Facs->XFirmwareWakingVector == 0)) ) {170 CpuDeadLoop();171 return EFI_INVALID_PARAMETER;172 }173 174 91 // 175 92 // We need turn back to S3Resume - install boot script done ppi and report status code on S3resume. 176 93 // 177 94 if (PeiS3ResumeState != 0) { 95 // 96 // Need report status back to S3ResumePeim. 97 // If boot script execution is failed, S3ResumePeim wil report the error status code. 98 // 99 PeiS3ResumeState->ReturnStatus = (UINT64)(UINTN)Status; 178 100 if (FeaturePcdGet (PcdDxeIplSwitchToLongMode)) { 179 101 // … … 183 105 PeiS3ResumeState->AsmTransferControl = (EFI_PHYSICAL_ADDRESS)(UINTN)AsmTransferControl32; 184 106 185 // 186 // more step needed - because relative address is handled differently between X64 and IA32. 187 // 188 AsmTransferControl16Address = (UINTN)AsmTransferControl16; 189 AsmFixAddress16 = (UINT32)AsmTransferControl16Address; 190 AsmJmpAddr32 = (UINT32)((Facs->FirmwareWakingVector & 0xF) | ((Facs->FirmwareWakingVector & 0xFFFF0) << 12)); 107 if ((Facs != NULL) && 108 (Facs->Signature == EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) && 109 (Facs->FirmwareWakingVector != 0) ) { 110 // 111 // more step needed - because relative address is handled differently between X64 and IA32. 112 // 113 AsmTransferControl16Address = (UINTN)AsmTransferControl16; 114 AsmFixAddress16 = (UINT32)AsmTransferControl16Address; 115 AsmJmpAddr32 = (UINT32)((Facs->FirmwareWakingVector & 0xF) | ((Facs->FirmwareWakingVector & 0xFFFF0) << 12)); 116 } 191 117 192 118 AsmDisablePaging64 ( … … 218 144 return EFI_UNSUPPORTED; 219 145 } 220 221 PERF_CODE ( 222 WriteToOsS3PerformanceData (); 223 ); 224 146 147 // 148 // S3ResumePeim does not provide a way to jump back to itself, so resume to OS here directly 149 // 225 150 if (Facs->XFirmwareWakingVector != 0) { 226 151 // … … 283 208 return EFI_UNSUPPORTED; 284 209 } 210 211 /** 212 Register image to memory profile. 213 214 @param FileName File name of the image. 215 @param ImageBase Image base address. 216 @param ImageSize Image size. 217 @param FileType File type of the image. 218 219 **/ 220 VOID 221 RegisterMemoryProfileImage ( 222 IN EFI_GUID *FileName, 223 IN PHYSICAL_ADDRESS ImageBase, 224 IN UINT64 ImageSize, 225 IN EFI_FV_FILETYPE FileType 226 ) 227 { 228 EFI_STATUS Status; 229 EDKII_MEMORY_PROFILE_PROTOCOL *ProfileProtocol; 230 MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FilePath; 231 UINT8 TempBuffer[sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH) + sizeof (EFI_DEVICE_PATH_PROTOCOL)]; 232 233 if ((PcdGet8 (PcdMemoryProfilePropertyMask) & BIT0) != 0) { 234 235 FilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)TempBuffer; 236 Status = gBS->LocateProtocol (&gEdkiiMemoryProfileGuid, NULL, (VOID **) &ProfileProtocol); 237 if (!EFI_ERROR (Status)) { 238 EfiInitializeFwVolDevicepathNode (FilePath, FileName); 239 SetDevicePathEndNode (FilePath + 1); 240 241 Status = ProfileProtocol->RegisterImage ( 242 ProfileProtocol, 243 (EFI_DEVICE_PATH_PROTOCOL *) FilePath, 244 ImageBase, 245 ImageSize, 246 FileType 247 ); 248 } 249 } 250 } 251 252 /** 253 This is the Event notification function to reload BootScriptExecutor image 254 to RESERVED mem and save it to LockBox. 255 256 @param Event Pointer to this event 257 @param Context Event handler private data 258 **/ 259 VOID 260 EFIAPI 261 ReadyToLockEventNotify ( 262 IN EFI_EVENT Event, 263 IN VOID *Context 264 ) 265 { 266 EFI_STATUS Status; 267 VOID *Interface; 268 UINT8 *Buffer; 269 UINTN BufferSize; 270 EFI_HANDLE NewImageHandle; 271 UINTN Pages; 272 EFI_PHYSICAL_ADDRESS FfsBuffer; 273 PE_COFF_LOADER_IMAGE_CONTEXT ImageContext; 274 275 Status = gBS->LocateProtocol (&gEfiDxeSmmReadyToLockProtocolGuid, NULL, &Interface); 276 if (EFI_ERROR (Status)) { 277 return; 278 } 279 280 // 281 // A workaround: Here we install a dummy handle 282 // 283 NewImageHandle = NULL; 284 Status = gBS->InstallProtocolInterface ( 285 &NewImageHandle, 286 &gEfiCallerIdGuid, 287 EFI_NATIVE_INTERFACE, 288 NULL 289 ); 290 ASSERT_EFI_ERROR (Status); 291 292 // 293 // Reload BootScriptExecutor image itself to RESERVED mem 294 // 295 Status = GetSectionFromAnyFv ( 296 &gEfiCallerIdGuid, 297 EFI_SECTION_PE32, 298 0, 299 (VOID **) &Buffer, 300 &BufferSize 301 ); 302 ASSERT_EFI_ERROR (Status); 303 ImageContext.Handle = Buffer; 304 ImageContext.ImageRead = PeCoffLoaderImageReadFromMemory; 305 // 306 // Get information about the image being loaded 307 // 308 Status = PeCoffLoaderGetImageInfo (&ImageContext); 309 ASSERT_EFI_ERROR (Status); 310 Pages = EFI_SIZE_TO_PAGES(BufferSize + ImageContext.SectionAlignment); 311 FfsBuffer = 0xFFFFFFFF; 312 Status = gBS->AllocatePages ( 313 AllocateMaxAddress, 314 EfiReservedMemoryType, 315 Pages, 316 &FfsBuffer 317 ); 318 ASSERT_EFI_ERROR (Status); 319 ImageContext.ImageAddress = (PHYSICAL_ADDRESS)(UINTN)FfsBuffer; 320 // 321 // Align buffer on section boundry 322 // 323 ImageContext.ImageAddress += ImageContext.SectionAlignment - 1; 324 ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1)); 325 // 326 // Load the image to our new buffer 327 // 328 Status = PeCoffLoaderLoadImage (&ImageContext); 329 ASSERT_EFI_ERROR (Status); 330 331 // 332 // Relocate the image in our new buffer 333 // 334 Status = PeCoffLoaderRelocateImage (&ImageContext); 335 ASSERT_EFI_ERROR (Status); 336 337 // 338 // Free the buffer allocated by ReadSection since the image has been relocated in the new buffer 339 // 340 gBS->FreePool (Buffer); 341 342 // 343 // Flush the instruction cache so the image data is written before we execute it 344 // 345 InvalidateInstructionCacheRange ((VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize); 346 347 RegisterMemoryProfileImage ( 348 &gEfiCallerIdGuid, 349 ImageContext.ImageAddress, 350 ImageContext.ImageSize, 351 EFI_FV_FILETYPE_DRIVER 352 ); 353 354 Status = ((EFI_IMAGE_ENTRY_POINT)(UINTN)(ImageContext.EntryPoint)) (NewImageHandle, gST); 355 ASSERT_EFI_ERROR (Status); 356 357 // 358 // Additional step for BootScript integrity 359 // Save BootScriptExecutor image 360 // 361 Status = SaveLockBox ( 362 &mBootScriptExecutorImageGuid, 363 (VOID *)(UINTN)ImageContext.ImageAddress, 364 (UINTN)ImageContext.ImageSize 365 ); 366 ASSERT_EFI_ERROR (Status); 367 368 Status = SetLockBoxAttributes (&mBootScriptExecutorImageGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); 369 ASSERT_EFI_ERROR (Status); 370 371 gBS->CloseEvent (Event); 372 } 373 285 374 /** 286 375 Entrypoint of Boot script exector driver, this function will be executed in … … 300 389 ) 301 390 { 302 UINT8 *Buffer;303 391 UINTN BufferSize; 304 392 UINTN Pages; 305 EFI_PHYSICAL_ADDRESS FfsBuffer;306 PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;307 393 BOOT_SCRIPT_EXECUTOR_VARIABLE *EfiBootScriptExecutorVariable; 308 394 EFI_PHYSICAL_ADDRESS BootScriptExecutorBuffer; 309 395 EFI_STATUS Status; 310 396 VOID *DevicePath; 311 EFI_HANDLE NewImageHandle; 397 EFI_EVENT ReadyToLockEvent; 398 VOID *Registration; 399 UINT32 RegEax; 400 UINT32 RegEdx; 312 401 313 402 // … … 318 407 Status = gBS->LocateProtocol (&gEfiCallerIdGuid, NULL, &DevicePath); 319 408 if (EFI_ERROR (Status)) { 320 321 // 322 // This is the first-time loaded by DXE core. reload itself to NVS mem 323 // 324 // 325 // A workarouond: Here we install a dummy handle 326 // 327 NewImageHandle = NULL; 328 Status = gBS->InstallProtocolInterface ( 329 &NewImageHandle, 330 &gEfiCallerIdGuid, 331 EFI_NATIVE_INTERFACE, 332 NULL 333 ); 334 335 Status = GetSectionFromAnyFv ( 336 &gEfiCallerIdGuid, 337 EFI_SECTION_PE32, 338 0, 339 (VOID **) &Buffer, 340 &BufferSize 341 ); 342 ImageContext.Handle = Buffer; 343 ImageContext.ImageRead = PeCoffLoaderImageReadFromMemory; 344 // 345 // Get information about the image being loaded 346 // 347 Status = PeCoffLoaderGetImageInfo (&ImageContext); 348 if (EFI_ERROR (Status)) { 349 return Status; 409 // 410 // Create ReadyToLock event to reload BootScriptExecutor image 411 // to RESERVED mem and save it to LockBox. 412 // 413 ReadyToLockEvent = EfiCreateProtocolNotifyEvent ( 414 &gEfiDxeSmmReadyToLockProtocolGuid, 415 TPL_NOTIFY, 416 ReadyToLockEventNotify, 417 NULL, 418 &Registration 419 ); 420 ASSERT (ReadyToLockEvent != NULL); 421 } else { 422 // 423 // the entry point is invoked after reloading. following code only run in RESERVED mem 424 // 425 if (PcdGetBool(PcdUse1GPageTable)) { 426 AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL); 427 if (RegEax >= 0x80000001) { 428 AsmCpuid (0x80000001, NULL, NULL, NULL, &RegEdx); 429 if ((RegEdx & BIT26) != 0) { 430 mPage1GSupport = TRUE; 431 } 432 } 350 433 } 351 Pages = EFI_SIZE_TO_PAGES(BufferSize + ImageContext.SectionAlignment); 352 FfsBuffer = 0xFFFFFFFF; 353 Status = gBS->AllocatePages ( 354 AllocateMaxAddress, 355 EfiACPIMemoryNVS, 356 Pages, 357 &FfsBuffer 358 ); 359 if (EFI_ERROR (Status)) { 360 return EFI_OUT_OF_RESOURCES; 361 } 362 ImageContext.ImageAddress = (PHYSICAL_ADDRESS)(UINTN)FfsBuffer; 363 // 364 // Align buffer on section boundry 365 // 366 ImageContext.ImageAddress += ImageContext.SectionAlignment - 1; 367 ImageContext.ImageAddress &= ~(ImageContext.SectionAlignment - 1); 368 // 369 // Load the image to our new buffer 370 // 371 Status = PeCoffLoaderLoadImage (&ImageContext); 372 if (EFI_ERROR (Status)) { 373 gBS->FreePages (FfsBuffer, Pages); 374 return Status; 375 } 376 377 // 378 // Relocate the image in our new buffer 379 // 380 Status = PeCoffLoaderRelocateImage (&ImageContext); 381 382 if (EFI_ERROR (Status)) { 383 PeCoffLoaderUnloadImage (&ImageContext); 384 gBS->FreePages (FfsBuffer, Pages); 385 return Status; 386 } 387 // 388 // Flush the instruction cache so the image data is written before we execute it 389 // 390 InvalidateInstructionCacheRange ((VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize); 391 Status = ((EFI_IMAGE_ENTRY_POINT)(UINTN)(ImageContext.EntryPoint)) (NewImageHandle, SystemTable); 392 if (EFI_ERROR (Status)) { 393 gBS->FreePages (FfsBuffer, Pages); 394 return Status; 395 } 396 // 397 // Additional step for BootScript integrity 398 // Save BootScriptExecutor image 399 // 400 Status = SaveLockBox ( 401 &mBootScriptExecutorImageGuid, 402 (VOID *)(UINTN)ImageContext.ImageAddress, 403 (UINTN)ImageContext.ImageSize 404 ); 405 ASSERT_EFI_ERROR (Status); 406 407 Status = SetLockBoxAttributes (&mBootScriptExecutorImageGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); 408 ASSERT_EFI_ERROR (Status); 409 410 } else { 411 // 412 // the entry point is invoked after reloading. following code only run in ACPI NVS 413 // 434 414 435 BufferSize = sizeof (BOOT_SCRIPT_EXECUTOR_VARIABLE); 415 436 … … 418 439 Status = gBS->AllocatePages ( 419 440 AllocateMaxAddress, 420 Efi ACPIMemoryNVS,441 EfiReservedMemoryType, 421 442 Pages, 422 443 &BootScriptExecutorBuffer 423 444 ); 424 if (EFI_ERROR (Status)) { 425 return EFI_OUT_OF_RESOURCES; 426 } 445 ASSERT_EFI_ERROR (Status); 427 446 428 447 EfiBootScriptExecutorVariable = (BOOT_SCRIPT_EXECUTOR_VARIABLE *)(UINTN)BootScriptExecutorBuffer; … … 449 468 Status = SetLockBoxAttributes (&gEfiBootScriptExecutorContextGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE); 450 469 ASSERT_EFI_ERROR (Status); 451 452 PERF_CODE (453 EFI_EVENT Event;454 455 gBS->CreateEventEx (456 EVT_NOTIFY_SIGNAL,457 TPL_NOTIFY,458 OnBootEvent,459 NULL,460 &gEfiEventExitBootServicesGuid,461 &Event462 );463 464 EfiCreateEventLegacyBootEx(465 TPL_NOTIFY,466 OnBootEvent,467 NULL,468 &Event469 );470 );471 470 } 472 471 … … 474 473 } 475 474 476 477 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.h
r48674 r58459 2 2 The header file for Boot Script Executer module. 3 3 4 This driver is dispatched by Dxe core and the driver will reload itself to ACPI NVSmemory4 This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory 5 5 in the entry point. The functionality is to interpret and restore the S3 boot script 6 6 7 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>7 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 8 8 9 9 This program and the accompanying materials … … 32 32 #include <Library/PcdLib.h> 33 33 #include <Library/CacheMaintenanceLib.h> 34 #include <Library/PerformanceLib.h>35 34 #include <Library/TimerLib.h> 36 35 #include <Library/UefiLib.h> 37 36 #include <Library/DebugAgentLib.h> 38 37 #include <Library/LockBoxLib.h> 38 #include <Library/CpuExceptionHandlerLib.h> 39 #include <Library/DevicePathLib.h> 39 40 40 41 #include <Guid/AcpiS3Context.h> 41 42 #include <Guid/BootScriptExecutorVariable.h> 42 #include <Guid/EventGroup.h> 43 #include <Guid/Performance.h> 43 #include <Guid/MemoryProfile.h> 44 45 #include <Protocol/DxeSmmReadyToLock.h> 44 46 #include <IndustryStandard/Acpi.h> 45 47 /** … … 85 87 extern UINT32 AsmFixAddress16; 86 88 extern UINT32 AsmJmpAddr32; 89 extern BOOLEAN mPage1GSupport; 87 90 88 91 #endif //_BOOT_SCRIPT_EXECUTOR_H_ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S3Asm.S
r48674 r58459 3 3 # for X64 platform 4 4 # 5 # Copyright (c) 2006 , Intel Corporation. All rights reserved.<BR>5 # Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 6 6 # 7 7 # This program and the accompanying materials are … … 19 19 # rcx S3WakingVector :DWORD 20 20 # rdx AcpiLowMemoryBase :DWORD 21 lea _AsmTransferControl_al_0000 , %eax21 lea _AsmTransferControl_al_0000(%rip), %eax 22 22 movq $0x2800000000, %r8 23 23 orq %r8, %rax … … 26 26 andl $0x0f, %ecx 27 27 movw %cx, %bx 28 movl %ebx, jmp_addr 28 movl %ebx, jmp_addr(%rip) 29 29 lret 30 30 _AsmTransferControl_al_0000: … … 81 81 ASM_PFX(AsmJmpAddr32): 82 82 .long 0 83 84 ASM_GLOBAL ASM_PFX(PageFaultHandlerHook) 85 ASM_PFX(PageFaultHandlerHook): 86 pushq %rax # save all volatile registers 87 pushq %rcx 88 pushq %rdx 89 pushq %r8 90 pushq %r9 91 pushq %r10 92 pushq %r11 93 # save volatile fp registers 94 addq $-0x68, %rsp 95 stmxcsr 0x60(%rsp) 96 movdqa %xmm0, 0x0(%rsp) 97 movdqa %xmm1, 0x10(%rsp) 98 movdqa %xmm2, 0x20(%rsp) 99 movdqa %xmm3, 0x30(%rsp) 100 movdqa %xmm4, 0x40(%rsp) 101 movdqa %xmm5, 0x50(%rsp) 102 103 addq $-0x20, %rsp 104 call ASM_PFX(PageFaultHandler) 105 addq $0x20, %rsp 106 107 # load volatile fp registers 108 ldmxcsr 0x60(%rsp) 109 movdqa 0x0(%rsp), %xmm0 110 movdqa 0x10(%rsp), %xmm1 111 movdqa 0x20(%rsp), %xmm2 112 movdqa 0x30(%rsp), %xmm3 113 movdqa 0x40(%rsp), %xmm4 114 movdqa 0x50(%rsp), %xmm5 115 addq $0x68, %rsp 116 117 testb %al, %al 118 119 popq %r11 120 popq %r10 121 popq %r9 122 popq %r8 123 popq %rdx 124 popq %rcx 125 popq %rax # restore all volatile registers 126 jnz L1 127 jmpq *ASM_PFX(mOriginalHandler)(%rip) 128 L1: 129 addq $0x08, %rsp # skip error code for PF 130 iretq -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S3Asm.asm
r48674 r58459 3 3 ; for X64 platform 4 4 ; 5 ; Copyright (c) 2006 , Intel Corporation. All rights reserved.<BR>5 ; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> 6 6 ; 7 7 ; This program and the accompanying materials … … 14 14 ; 15 15 ;; 16 17 EXTERN mOriginalHandler:QWORD 18 EXTERN PageFaultHandler:PROC 16 19 17 20 .code … … 82 85 AsmTransferControl16 ENDP 83 86 87 PageFaultHandlerHook PROC 88 push rax ; save all volatile registers 89 push rcx 90 push rdx 91 push r8 92 push r9 93 push r10 94 push r11 95 ; save volatile fp registers 96 add rsp, -68h 97 stmxcsr [rsp + 60h] 98 movdqa [rsp + 0h], xmm0 99 movdqa [rsp + 10h], xmm1 100 movdqa [rsp + 20h], xmm2 101 movdqa [rsp + 30h], xmm3 102 movdqa [rsp + 40h], xmm4 103 movdqa [rsp + 50h], xmm5 104 105 add rsp, -20h 106 call PageFaultHandler 107 add rsp, 20h 108 109 ; load volatile fp registers 110 ldmxcsr [rsp + 60h] 111 movdqa xmm0, [rsp + 0h] 112 movdqa xmm1, [rsp + 10h] 113 movdqa xmm2, [rsp + 20h] 114 movdqa xmm3, [rsp + 30h] 115 movdqa xmm4, [rsp + 40h] 116 movdqa xmm5, [rsp + 50h] 117 add rsp, 68h 118 119 test al, al 120 121 pop r11 122 pop r10 123 pop r9 124 pop r8 125 pop rdx 126 pop rcx 127 pop rax ; restore all volatile registers 128 jnz @F 129 jmp mOriginalHandler 130 @@: 131 add rsp, 08h ; skip error code for PF 132 iretq 133 PageFaultHandlerHook ENDP 134 84 135 END -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c
r48674 r58459 4 4 Set a IDT entry for interrupt vector 3 for debug purpose for x64 platform 5 5 6 Copyright (c) 2006 - 201 0, Intel Corporation. All rights reserved.<BR>6 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 7 7 8 8 This program and the accompanying materials … … 16 16 **/ 17 17 #include "ScriptExecute.h" 18 //19 // INTERRUPT_GATE_DESCRIPTOR and SetIdtEntry () are used to setup IDT to do debug20 //21 18 22 #pragma pack(1) 19 #define IA32_PG_P BIT0 20 #define IA32_PG_RW BIT1 21 #define IA32_PG_PS BIT7 23 22 24 typedef struct { 25 UINT16 Offset15To0; 26 UINT16 SegmentSelector; 27 UINT16 Attributes; 28 UINT16 Offset31To16; 29 UINT32 Offset63To32; 30 UINT32 Reserved; 31 } INTERRUPT_GATE_DESCRIPTOR; 23 UINT64 mPhyMask; 24 VOID *mOriginalHandler; 25 UINTN mS3NvsPageTableAddress; 32 26 33 #define INTERRUPT_GATE_ATTRIBUTE 0x8e00 27 /** 28 Page fault handler. 34 29 35 #pragma pack() 30 **/ 31 VOID 32 EFIAPI 33 PageFaultHandlerHook ( 34 VOID 35 ); 36 37 /** 38 Hook IDT with our page fault handler so that the on-demand paging works on page fault. 39 40 @param IdtEntry a pointer to IDT entry 41 42 **/ 43 VOID 44 HookPageFaultHandler ( 45 IN IA32_IDT_GATE_DESCRIPTOR *IdtEntry 46 ) 47 { 48 UINT32 RegEax; 49 UINT8 PhysicalAddressBits; 50 UINTN PageFaultHandlerHookAddress; 51 52 AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL); 53 if (RegEax >= 0x80000008) { 54 AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL); 55 PhysicalAddressBits = (UINT8) RegEax; 56 } else { 57 PhysicalAddressBits = 36; 58 } 59 mPhyMask = LShiftU64 (1, PhysicalAddressBits) - 1; 60 mPhyMask &= (1ull << 48) - SIZE_4KB; 61 62 // 63 // Set Page Fault entry to catch >4G access 64 // 65 PageFaultHandlerHookAddress = (UINTN)PageFaultHandlerHook; 66 mOriginalHandler = (VOID *)(UINTN)(LShiftU64 (IdtEntry->Bits.OffsetUpper, 32) + IdtEntry->Bits.OffsetLow + (IdtEntry->Bits.OffsetHigh << 16)); 67 IdtEntry->Bits.OffsetLow = (UINT16)PageFaultHandlerHookAddress; 68 IdtEntry->Bits.Selector = (UINT16)AsmReadCs (); 69 IdtEntry->Bits.Reserved_0 = 0; 70 IdtEntry->Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32; 71 IdtEntry->Bits.OffsetHigh = (UINT16)(PageFaultHandlerHookAddress >> 16); 72 IdtEntry->Bits.OffsetUpper = (UINT32)(PageFaultHandlerHookAddress >> 32); 73 IdtEntry->Bits.Reserved_1 = 0; 74 75 if (mPage1GSupport) { 76 mS3NvsPageTableAddress = (UINTN)(AsmReadCr3 () & mPhyMask) + EFI_PAGES_TO_SIZE(2); 77 }else { 78 mS3NvsPageTableAddress = (UINTN)(AsmReadCr3 () & mPhyMask) + EFI_PAGES_TO_SIZE(6); 79 } 80 } 81 36 82 /** 37 83 Set a IDT entry for interrupt vector 3 for debug purpose. … … 45 91 ) 46 92 { 47 I NTERRUPT_GATE_DESCRIPTOR*IdtEntry;93 IA32_IDT_GATE_DESCRIPTOR *IdtEntry; 48 94 IA32_DESCRIPTOR *IdtDescriptor; 49 95 UINTN S3DebugBuffer; 96 EFI_STATUS Status; 50 97 51 98 // … … 53 100 // 54 101 IdtDescriptor = (IA32_DESCRIPTOR *) (UINTN) (AcpiS3Context->IdtrProfile); 55 IdtEntry = (INTERRUPT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (INTERRUPT_GATE_DESCRIPTOR))); 56 S3DebugBuffer = (UINTN) (AcpiS3Context->S3DebugBufferAddress); 102 AsmWriteIdtr (IdtDescriptor); 57 103 58 IdtEntry->Offset15To0 = (UINT16)S3DebugBuffer; 59 IdtEntry->SegmentSelector = (UINT16)AsmReadCs ();; 60 IdtEntry->Attributes = (UINT16)INTERRUPT_GATE_ATTRIBUTE; 61 IdtEntry->Offset31To16 = (UINT16)(S3DebugBuffer >> 16); 62 IdtEntry->Offset63To32 = (UINT32)(S3DebugBuffer >> 32); 63 IdtEntry->Reserved = 0; 104 // 105 // Setup the default CPU exception handlers 106 // 107 Status = InitializeCpuExceptionHandlers (NULL); 108 ASSERT_EFI_ERROR (Status); 64 109 65 AsmWriteIdtr (IdtDescriptor); 110 DEBUG_CODE ( 111 // 112 // Update IDT entry INT3 if the instruction is valid in it 113 // 114 S3DebugBuffer = (UINTN) (AcpiS3Context->S3DebugBufferAddress); 115 if (*(UINTN *)S3DebugBuffer != (UINTN) -1) { 116 IdtEntry = (IA32_IDT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (IA32_IDT_GATE_DESCRIPTOR))); 117 IdtEntry->Bits.OffsetLow = (UINT16)S3DebugBuffer; 118 IdtEntry->Bits.Selector = (UINT16)AsmReadCs (); 119 IdtEntry->Bits.Reserved_0 = 0; 120 IdtEntry->Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32; 121 IdtEntry->Bits.OffsetHigh = (UINT16)(S3DebugBuffer >> 16); 122 IdtEntry->Bits.OffsetUpper = (UINT32)(S3DebugBuffer >> 32); 123 IdtEntry->Bits.Reserved_1 = 0; 124 } 125 ); 126 127 IdtEntry = (IA32_IDT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (14 * sizeof (IA32_IDT_GATE_DESCRIPTOR))); 128 HookPageFaultHandler (IdtEntry); 66 129 } 67 130 131 /** 132 Get new page address. 133 134 @param PageNum new page number needed 135 136 @return new page address 137 **/ 138 UINTN 139 GetNewPage ( 140 IN UINTN PageNum 141 ) 142 { 143 UINTN NewPage; 144 NewPage = mS3NvsPageTableAddress; 145 ZeroMem ((VOID *)NewPage, EFI_PAGES_TO_SIZE(PageNum)); 146 mS3NvsPageTableAddress += EFI_PAGES_TO_SIZE(PageNum); 147 return NewPage; 148 } 149 150 /** 151 The page fault handler that on-demand read >4G memory/MMIO. 152 153 @retval TRUE The page fault is correctly handled. 154 @retval FALSE The page fault is not handled and is passed through to original handler. 155 156 **/ 157 BOOLEAN 158 EFIAPI 159 PageFaultHandler ( 160 VOID 161 ) 162 { 163 UINT64 *PageTable; 164 UINT64 PFAddress; 165 UINTN PTIndex; 166 167 PFAddress = AsmReadCr2 (); 168 DEBUG ((EFI_D_ERROR, "BootScript - PageFaultHandler: Cr2 - %lx\n", PFAddress)); 169 170 if (PFAddress >= mPhyMask + SIZE_4KB) { 171 return FALSE; 172 } 173 PFAddress &= mPhyMask; 174 175 PageTable = (UINT64*)(UINTN)(AsmReadCr3 () & mPhyMask); 176 177 PTIndex = BitFieldRead64 (PFAddress, 39, 47); 178 // PML4E 179 if ((PageTable[PTIndex] & IA32_PG_P) == 0) { 180 PageTable[PTIndex] = GetNewPage (1) | IA32_PG_P | IA32_PG_RW; 181 } 182 PageTable = (UINT64*)(UINTN)(PageTable[PTIndex] & mPhyMask); 183 PTIndex = BitFieldRead64 (PFAddress, 30, 38); 184 // PDPTE 185 if (mPage1GSupport) { 186 PageTable[PTIndex] = PFAddress | IA32_PG_P | IA32_PG_RW | IA32_PG_PS; 187 } else { 188 if ((PageTable[PTIndex] & IA32_PG_P) == 0) { 189 PageTable[PTIndex] = GetNewPage (1) | IA32_PG_P | IA32_PG_RW; 190 } 191 PageTable = (UINT64*)(UINTN)(PageTable[PTIndex] & mPhyMask); 192 PTIndex = BitFieldRead64 (PFAddress, 21, 29); 193 // PD 194 PageTable[PTIndex] = PFAddress | IA32_PG_P | IA32_PG_RW | IA32_PG_PS; 195 } 196 197 return TRUE; 198 } -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c
r48674 r58459 6 6 and install FPDT to ACPI table. 7 7 8 Copyright (c) 2011 - 201 2, Intel Corporation. All rights reserved.<BR>8 Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR> 9 9 This program and the accompanying materials 10 10 are licensed and made available under the terms and conditions of the BSD License … … 19 19 #include <PiDxe.h> 20 20 21 #include <IndustryStandard/Acpi50.h>22 23 21 #include <Protocol/ReportStatusCodeHandler.h> 24 22 #include <Protocol/AcpiTable.h> 25 23 #include <Protocol/SmmCommunication.h> 24 #include <Protocol/LockBox.h> 25 #include <Protocol/Variable.h> 26 26 27 27 #include <Guid/Acpi.h> … … 39 39 #include <Library/PcdLib.h> 40 40 #include <Library/HobLib.h> 41 #include <Library/PcdLib.h> 42 43 // 44 // ACPI table information used to initialize tables. 45 // 46 #define EFI_ACPI_OEM_ID "INTEL" 47 #define EFI_ACPI_OEM_TABLE_ID 0x2020204F4E414954ULL // "TIANO " 48 #define EFI_ACPI_OEM_REVISION 0x00000001 49 #define EFI_ACPI_CREATOR_ID 0x5446534D // TBD "MSFT" 50 #define EFI_ACPI_CREATOR_REVISION 0x01000013 // TBD 41 #include <Library/LockBoxLib.h> 42 #include <Library/UefiLib.h> 43 51 44 #define EXTENSION_RECORD_SIZE 0x10000 52 45 #define SMM_BOOT_RECORD_COMM_SIZE OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + sizeof(SMM_BOOT_RECORD_COMMUNICATE) … … 54 47 EFI_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol = NULL; 55 48 49 BOOLEAN mLockBoxReady = FALSE; 56 50 EFI_EVENT mReadyToBootEvent; 57 51 EFI_EVENT mLegacyBootEvent; … … 61 55 UINT32 mBootRecordMaxSize = 0; 62 56 UINT8 *mBootRecordBuffer = NULL; 57 BOOLEAN mDxeCoreReportStatusCodeEnable = FALSE; 63 58 64 59 BOOT_PERFORMANCE_TABLE *mAcpiBootPerformanceTable = NULL; … … 72 67 0x00, // Checksum will be updated at runtime 73 68 // 74 // It is expected that these values will be updated at runtime.75 // 76 EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field77 EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)78 EFI_ACPI_OEM_REVISION, // OEM revision number79 EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID80 EFI_ACPI_CREATOR_REVISION, // ASL compiler revision number69 // It is expected that these values will be updated at EntryPoint. 70 // 71 {0x00}, // OEM ID is a 6 bytes long field 72 0x00, // OEM Table ID(8 bytes long) 73 0x00, // OEM Revision 74 0x00, // Creator ID 75 0x00, // Creator Revision 81 76 }, 82 77 // … … 209 204 VOID *Buffer; 210 205 206 Buffer = NULL; 211 207 Pages = EFI_SIZE_TO_PAGES (Size); 212 208 Address = 0xffffffff; … … 220 216 ASSERT_EFI_ERROR (Status); 221 217 222 Buffer = (VOID *) (UINTN) Address; 223 ZeroMem (Buffer, Size); 218 if (!EFI_ERROR (Status)) { 219 Buffer = (VOID *) (UINTN) Address; 220 ZeroMem (Buffer, Size); 221 } 224 222 225 223 return Buffer; 224 } 225 226 /** 227 Callback function upon VariableArchProtocol and LockBoxProtocol 228 to allocate S3 performance table memory and save the pointer to LockBox. 229 230 @param[in] Event Event whose notification function is being invoked. 231 @param[in] Context Pointer to the notification function's context. 232 **/ 233 VOID 234 EFIAPI 235 FpdtAllocateS3PerformanceTableMemory ( 236 IN EFI_EVENT Event, 237 IN VOID *Context 238 ) 239 { 240 EFI_STATUS Status; 241 VOID *Interface; 242 FIRMWARE_PERFORMANCE_VARIABLE PerformanceVariable; 243 UINTN Size; 244 EFI_PHYSICAL_ADDRESS S3PerformanceTablePointer; 245 246 if (mLockBoxReady && (mAcpiS3PerformanceTable != NULL)) { 247 // 248 // The memory for S3 performance table should have been ready, 249 // and the pointer should have been saved to LockBox, just return. 250 // 251 return; 252 } 253 254 if (!mLockBoxReady) { 255 Status = gBS->LocateProtocol (&gEfiLockBoxProtocolGuid, NULL, &Interface); 256 if (!EFI_ERROR (Status)) { 257 // 258 // LockBox services has been ready. 259 // 260 mLockBoxReady = TRUE; 261 } 262 } 263 264 if (mAcpiS3PerformanceTable == NULL) { 265 Status = gBS->LocateProtocol (&gEfiVariableArchProtocolGuid, NULL, &Interface); 266 if (!EFI_ERROR (Status)) { 267 // 268 // Try to allocate the same runtime buffer as last time boot. 269 // 270 ZeroMem (&PerformanceVariable, sizeof (PerformanceVariable)); 271 Size = sizeof (PerformanceVariable); 272 Status = gRT->GetVariable ( 273 EFI_FIRMWARE_PERFORMANCE_VARIABLE_NAME, 274 &gEfiFirmwarePerformanceGuid, 275 NULL, 276 &Size, 277 &PerformanceVariable 278 ); 279 if (!EFI_ERROR (Status)) { 280 Status = gBS->AllocatePages ( 281 AllocateAddress, 282 EfiReservedMemoryType, 283 EFI_SIZE_TO_PAGES (sizeof (S3_PERFORMANCE_TABLE)), 284 &PerformanceVariable.S3PerformanceTablePointer 285 ); 286 if (!EFI_ERROR (Status)) { 287 mAcpiS3PerformanceTable = (S3_PERFORMANCE_TABLE *) (UINTN) PerformanceVariable.S3PerformanceTablePointer; 288 } 289 } 290 if (mAcpiS3PerformanceTable == NULL) { 291 // 292 // Fail to allocate at specified address, continue to allocate at any address. 293 // 294 mAcpiS3PerformanceTable = (S3_PERFORMANCE_TABLE *) FpdtAllocateReservedMemoryBelow4G (sizeof (S3_PERFORMANCE_TABLE)); 295 } 296 DEBUG ((EFI_D_INFO, "FPDT: ACPI S3 Performance Table address = 0x%x\n", mAcpiS3PerformanceTable)); 297 if (mAcpiS3PerformanceTable != NULL) { 298 CopyMem (mAcpiS3PerformanceTable, &mS3PerformanceTableTemplate, sizeof (mS3PerformanceTableTemplate)); 299 } 300 } 301 } 302 303 if (mLockBoxReady && (mAcpiS3PerformanceTable != NULL)) { 304 // 305 // If LockBox services has been ready and memory for FPDT S3 performance table has been allocated, 306 // save the pointer to LockBox for use in S3 resume. 307 // 308 S3PerformanceTablePointer = (EFI_PHYSICAL_ADDRESS) (UINTN) mAcpiS3PerformanceTable; 309 Status = SaveLockBox ( 310 &gFirmwarePerformanceS3PointerGuid, 311 &S3PerformanceTablePointer, 312 sizeof (EFI_PHYSICAL_ADDRESS) 313 ); 314 ASSERT_EFI_ERROR (Status); 315 } 226 316 } 227 317 … … 239 329 EFI_STATUS Status; 240 330 EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol; 241 EFI_PHYSICAL_ADDRESS Address;242 331 UINTN Size; 243 UINT8 SmmBootRecordCommBuffer[SMM_BOOT_RECORD_COMM_SIZE];332 UINT8 *SmmBootRecordCommBuffer; 244 333 EFI_SMM_COMMUNICATE_HEADER *SmmCommBufferHeader; 245 334 SMM_BOOT_RECORD_COMMUNICATE *SmmCommData; 246 335 UINTN CommSize; 247 UINTN PerformanceRuntimeDataSize; 248 UINT8 *PerformanceRuntimeData; 249 UINT8 *PerformanceRuntimeDataHead; 336 UINTN BootPerformanceDataSize; 337 UINT8 *BootPerformanceData; 250 338 EFI_SMM_COMMUNICATION_PROTOCOL *Communication; 251 339 FIRMWARE_PERFORMANCE_VARIABLE PerformanceVariable; … … 262 350 // Collect boot records from SMM drivers. 263 351 // 264 SmmCommData = NULL; 352 SmmBootRecordCommBuffer = NULL; 353 SmmCommData = NULL; 265 354 Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &Communication); 266 355 if (!EFI_ERROR (Status)) { … … 268 357 // Initialize communicate buffer 269 358 // 359 SmmBootRecordCommBuffer = AllocateZeroPool (SMM_BOOT_RECORD_COMM_SIZE); 360 ASSERT (SmmBootRecordCommBuffer != NULL); 270 361 SmmCommBufferHeader = (EFI_SMM_COMMUNICATE_HEADER*)SmmBootRecordCommBuffer; 271 362 SmmCommData = (SMM_BOOT_RECORD_COMMUNICATE*)SmmCommBufferHeader->Data; … … 299 390 300 391 // 301 // Prepare memory for runtime Performance Record. 302 // Runtime performance records includes two tables S3 performance table and Boot performance table. 303 // S3 Performance table includes S3Resume and S3Suspend records. 392 // Prepare memory for Boot Performance table. 304 393 // Boot Performance table includes BasicBoot record, and one or more appended Boot Records. 305 394 // 306 PerformanceRuntimeData = NULL; 307 PerformanceRuntimeDataSize = sizeof (S3_PERFORMANCE_TABLE) + sizeof (BOOT_PERFORMANCE_TABLE) + mBootRecordSize + PcdGet32 (PcdExtFpdtBootRecordPadSize); 395 BootPerformanceDataSize = sizeof (BOOT_PERFORMANCE_TABLE) + mBootRecordSize + PcdGet32 (PcdExtFpdtBootRecordPadSize); 308 396 if (SmmCommData != NULL) { 309 PerformanceRuntimeDataSize += SmmCommData->BootRecordSize;397 BootPerformanceDataSize += SmmCommData->BootRecordSize; 310 398 } 311 399 … … 323 411 ); 324 412 if (!EFI_ERROR (Status)) { 325 Address = PerformanceVariable.S3PerformanceTablePointer;326 413 Status = gBS->AllocatePages ( 327 414 AllocateAddress, 328 415 EfiReservedMemoryType, 329 EFI_SIZE_TO_PAGES ( PerformanceRuntimeDataSize),330 & Address416 EFI_SIZE_TO_PAGES (BootPerformanceDataSize), 417 &PerformanceVariable.BootPerformanceTablePointer 331 418 ); 332 419 if (!EFI_ERROR (Status)) { 333 PerformanceRuntimeData = (UINT8 *) (UINTN) Address;334 } 335 } 336 337 if ( PerformanceRuntimeData== NULL) {420 mAcpiBootPerformanceTable = (BOOT_PERFORMANCE_TABLE *) (UINTN) PerformanceVariable.BootPerformanceTablePointer; 421 } 422 } 423 424 if (mAcpiBootPerformanceTable == NULL) { 338 425 // 339 426 // Fail to allocate at specified address, continue to allocate at any address. 340 427 // 341 PerformanceRuntimeData = FpdtAllocateReservedMemoryBelow4G (PerformanceRuntimeDataSize);342 } 343 DEBUG ((EFI_D_INFO, "FPDT: Performance Runtime Data address = 0x%x\n", PerformanceRuntimeData));344 345 if ( PerformanceRuntimeData== NULL) {428 mAcpiBootPerformanceTable = (BOOT_PERFORMANCE_TABLE *) FpdtAllocateReservedMemoryBelow4G (BootPerformanceDataSize); 429 } 430 DEBUG ((EFI_D_INFO, "FPDT: ACPI Boot Performance Table address = 0x%x\n", mAcpiBootPerformanceTable)); 431 432 if (mAcpiBootPerformanceTable == NULL) { 346 433 if (SmmCommData != NULL && SmmCommData->BootRecordData != NULL) { 347 434 FreePool (SmmCommData->BootRecordData); 348 435 } 436 if (SmmBootRecordCommBuffer != NULL) { 437 FreePool (SmmBootRecordCommBuffer); 438 } 439 if (mAcpiS3PerformanceTable != NULL) { 440 FreePages (mAcpiS3PerformanceTable, EFI_SIZE_TO_PAGES (sizeof (S3_PERFORMANCE_TABLE))); 441 } 349 442 return EFI_OUT_OF_RESOURCES; 350 443 } 351 352 PerformanceRuntimeDataHead = PerformanceRuntimeData;353 354 if (FeaturePcdGet (PcdFirmwarePerformanceDataTableS3Support)) {355 //356 // Prepare S3 Performance Table.357 //358 mAcpiS3PerformanceTable = (S3_PERFORMANCE_TABLE *) PerformanceRuntimeData;359 CopyMem (mAcpiS3PerformanceTable, &mS3PerformanceTableTemplate, sizeof (mS3PerformanceTableTemplate));360 PerformanceRuntimeData = PerformanceRuntimeData + mAcpiS3PerformanceTable->Header.Length;361 DEBUG ((EFI_D_INFO, "FPDT: ACPI S3 Performance Table address = 0x%x\n", mAcpiS3PerformanceTable));362 //363 // Save S3 Performance Table address to Variable for use in Firmware Performance PEIM.364 //365 PerformanceVariable.S3PerformanceTablePointer = (EFI_PHYSICAL_ADDRESS) (UINTN) mAcpiS3PerformanceTable;366 //367 // Update S3 Performance Table Pointer in template.368 //369 mFirmwarePerformanceTableTemplate.S3PointerRecord.S3PerformanceTablePointer = (UINT64) PerformanceVariable.S3PerformanceTablePointer;370 } else {371 //372 // Exclude S3 Performance Table Pointer from FPDT table template.373 //374 mFirmwarePerformanceTableTemplate.Header.Length -= sizeof (EFI_ACPI_5_0_FPDT_S3_PERFORMANCE_TABLE_POINTER_RECORD);375 }376 444 377 445 // 378 446 // Prepare Boot Performance Table. 379 447 // 380 mAcpiBootPerformanceTable = (BOOT_PERFORMANCE_TABLE *) PerformanceRuntimeData;448 BootPerformanceData = (UINT8 *) mAcpiBootPerformanceTable; 381 449 // 382 450 // Fill Basic Boot record to Boot Performance Table. 383 451 // 384 CopyMem ( PerformanceRuntimeData, &mBootPerformanceTableTemplate, sizeof (mBootPerformanceTableTemplate));385 PerformanceRuntimeData = PerformanceRuntimeData + mAcpiBootPerformanceTable->Header.Length;452 CopyMem (mAcpiBootPerformanceTable, &mBootPerformanceTableTemplate, sizeof (mBootPerformanceTableTemplate)); 453 BootPerformanceData = BootPerformanceData + mAcpiBootPerformanceTable->Header.Length; 386 454 // 387 455 // Fill Boot records from boot drivers. 388 456 // 389 CopyMem ( PerformanceRuntimeData, mBootRecordBuffer, mBootRecordSize);457 CopyMem (BootPerformanceData, mBootRecordBuffer, mBootRecordSize); 390 458 mAcpiBootPerformanceTable->Header.Length += mBootRecordSize; 391 PerformanceRuntimeData = PerformanceRuntimeData + mBootRecordSize;459 BootPerformanceData = BootPerformanceData + mBootRecordSize; 392 460 if (SmmCommData != NULL && SmmCommData->BootRecordData != NULL) { 393 461 // 394 462 // Fill Boot records from SMM drivers. 395 463 // 396 CopyMem ( PerformanceRuntimeData, SmmCommData->BootRecordData, SmmCommData->BootRecordSize);464 CopyMem (BootPerformanceData, SmmCommData->BootRecordData, SmmCommData->BootRecordSize); 397 465 FreePool (SmmCommData->BootRecordData); 398 466 mAcpiBootPerformanceTable->Header.Length = (UINT32) (mAcpiBootPerformanceTable->Header.Length + SmmCommData->BootRecordSize); 399 PerformanceRuntimeData = PerformanceRuntimeData + SmmCommData->BootRecordSize; 400 } 401 // 402 // Reserve space for boot records after ReadyToBoot. 403 // 404 PerformanceRuntimeData = PerformanceRuntimeData + PcdGet32 (PcdExtFpdtBootRecordPadSize); 405 DEBUG ((EFI_D_INFO, "FPDT: ACPI Boot Performance Table address = 0x%x\n", mAcpiBootPerformanceTable)); 467 BootPerformanceData = BootPerformanceData + SmmCommData->BootRecordSize; 468 } 469 if (SmmBootRecordCommBuffer != NULL) { 470 FreePool (SmmBootRecordCommBuffer); 471 } 472 406 473 // 407 474 // Save Boot Performance Table address to Variable for use in S4 resume. … … 414 481 415 482 // 483 // Save S3 Performance Table address to Variable for use in S4 resume. 484 // 485 PerformanceVariable.S3PerformanceTablePointer = (EFI_PHYSICAL_ADDRESS) (UINTN) mAcpiS3PerformanceTable; 486 // 487 // Update S3 Performance Table Pointer in template. 488 // 489 mFirmwarePerformanceTableTemplate.S3PointerRecord.S3PerformanceTablePointer = (UINT64) (UINTN) mAcpiS3PerformanceTable; 490 // 416 491 // Save Runtime Performance Table pointers to Variable. 417 // 418 Status = gRT->SetVariable (419 EFI_FIRMWARE_PERFORMANCE_VARIABLE_NAME,420 &gEfiFirmwarePerformanceGuid,421 EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,422 sizeof (PerformanceVariable),423 &PerformanceVariable424 );425 ASSERT_EFI_ERROR (Status);492 // Don't check SetVariable return status. It doesn't impact FPDT table generation. 493 // 494 gRT->SetVariable ( 495 EFI_FIRMWARE_PERFORMANCE_VARIABLE_NAME, 496 &gEfiFirmwarePerformanceGuid, 497 EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, 498 sizeof (PerformanceVariable), 499 &PerformanceVariable 500 ); 426 501 427 502 // … … 436 511 ); 437 512 if (EFI_ERROR (Status)) { 438 FreePool (PerformanceRuntimeDataHead); 513 FreePages (mAcpiBootPerformanceTable, EFI_SIZE_TO_PAGES (BootPerformanceDataSize)); 514 if (mAcpiS3PerformanceTable != NULL) { 515 FreePages (mAcpiS3PerformanceTable, EFI_SIZE_TO_PAGES (sizeof (S3_PERFORMANCE_TABLE))); 516 } 439 517 mAcpiBootPerformanceTable = NULL; 440 518 mAcpiS3PerformanceTable = NULL; … … 516 594 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesEntry = 0\n")); 517 595 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesExit = 0\n")); 518 }519 520 /**521 Notify function for event EVT_SIGNAL_EXIT_BOOT_SERVICES. This is used to record522 performance data for ExitBootServicesEntry in FPDT.523 524 @param[in] Event The Event that is being processed.525 @param[in] Context The Event Context.526 527 **/528 VOID529 EFIAPI530 FpdtExitBootServicesEventNotify (531 IN EFI_EVENT Event,532 IN VOID *Context533 )534 {535 if (mAcpiBootPerformanceTable == NULL) {536 //537 // Firmware Performance Data Table not installed, do nothing.538 //539 return ;540 }541 542 //543 // Update Firmware Basic Boot Performance Record for UEFI boot.544 //545 mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesEntry = GetTimeInNanoSecond (GetPerformanceCounter ());546 547 //548 // Dump FPDT Boot Performance record.549 //550 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ResetEnd = %ld\n", mAcpiBootPerformanceTable->BasicBoot.ResetEnd));551 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderLoadImageStart = %ld\n", mAcpiBootPerformanceTable->BasicBoot.OsLoaderLoadImageStart));552 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderStartImageStart = %ld\n", mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart));553 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesEntry = %ld\n", mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesEntry));554 //555 // ExitBootServicesExit will be updated later, so don't dump it here.556 //557 596 } 558 597 … … 594 633 return EFI_UNSUPPORTED; 595 634 } 635 636 if (Value == (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT)) { 637 // 638 // DxeCore ReportStatusCode Enable so that the capability can be supported. 639 // 640 mDxeCoreReportStatusCodeEnable = TRUE; 641 } 596 642 597 643 Status = EFI_SUCCESS; … … 622 668 } else if (Value == (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES)) { 623 669 // 670 // Unregister boot time report status code listener. 671 // 672 mRscHandlerProtocol->Unregister (FpdtStatusCodeListenerDxe); 673 674 // 624 675 // Progress code for ExitBootServices. 625 676 // … … 632 683 // 633 684 mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesExit = GetTimeInNanoSecond (GetPerformanceCounter ()); 634 635 //636 // Unregister boot time report status code listener.637 //638 mRscHandlerProtocol->Unregister (FpdtStatusCodeListenerDxe);639 685 } else if (Data != NULL && CompareGuid (&Data->Type, &gEfiFirmwarePerformanceGuid)) { 640 686 // … … 683 729 } 684 730 731 732 /** 733 Notify function for event EVT_SIGNAL_EXIT_BOOT_SERVICES. This is used to record 734 performance data for ExitBootServicesEntry in FPDT. 735 736 @param[in] Event The Event that is being processed. 737 @param[in] Context The Event Context. 738 739 **/ 740 VOID 741 EFIAPI 742 FpdtExitBootServicesEventNotify ( 743 IN EFI_EVENT Event, 744 IN VOID *Context 745 ) 746 { 747 if (!mDxeCoreReportStatusCodeEnable) { 748 // 749 // When DxeCore Report Status Code is disabled, 750 // Unregister boot time report status code listener at ExitBootService Event. 751 // 752 mRscHandlerProtocol->Unregister (FpdtStatusCodeListenerDxe); 753 } 754 755 if (mAcpiBootPerformanceTable == NULL) { 756 // 757 // Firmware Performance Data Table not installed, do nothing. 758 // 759 return ; 760 } 761 762 // 763 // Update Firmware Basic Boot Performance Record for UEFI boot. 764 // 765 mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesEntry = GetTimeInNanoSecond (GetPerformanceCounter ()); 766 767 // 768 // Dump FPDT Boot Performance record. 769 // 770 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ResetEnd = %ld\n", mAcpiBootPerformanceTable->BasicBoot.ResetEnd)); 771 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderLoadImageStart = %ld\n", mAcpiBootPerformanceTable->BasicBoot.OsLoaderLoadImageStart)); 772 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderStartImageStart = %ld\n", mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart)); 773 DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesEntry = %ld\n", mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesEntry)); 774 // 775 // ExitBootServicesExit will be updated later, so don't dump it here. 776 // 777 } 778 685 779 /** 686 780 The module Entry Point of the Firmware Performance Data Table DXE driver. … … 703 797 EFI_HOB_GUID_TYPE *GuidHob; 704 798 FIRMWARE_SEC_PERFORMANCE *Performance; 799 VOID *Registration; 800 UINT64 OemTableId; 801 802 CopyMem ( 803 mFirmwarePerformanceTableTemplate.Header.OemId, 804 PcdGetPtr (PcdAcpiDefaultOemId), 805 sizeof (mFirmwarePerformanceTableTemplate.Header.OemId) 806 ); 807 OemTableId = PcdGet64 (PcdAcpiDefaultOemTableId); 808 CopyMem (&mFirmwarePerformanceTableTemplate.Header.OemTableId, &OemTableId, sizeof (UINT64)); 809 mFirmwarePerformanceTableTemplate.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision); 810 mFirmwarePerformanceTableTemplate.Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId); 811 mFirmwarePerformanceTableTemplate.Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision); 705 812 706 813 // … … 769 876 } 770 877 878 if (FeaturePcdGet (PcdFirmwarePerformanceDataTableS3Support)) { 879 // 880 // Register callback function upon VariableArchProtocol and LockBoxProtocol 881 // to allocate S3 performance table memory and save the pointer to LockBox. 882 // 883 EfiCreateProtocolNotifyEvent ( 884 &gEfiVariableArchProtocolGuid, 885 TPL_CALLBACK, 886 FpdtAllocateS3PerformanceTableMemory, 887 NULL, 888 &Registration 889 ); 890 EfiCreateProtocolNotifyEvent ( 891 &gEfiLockBoxProtocolGuid, 892 TPL_CALLBACK, 893 FpdtAllocateS3PerformanceTableMemory, 894 NULL, 895 &Registration 896 ); 897 } else { 898 // 899 // Exclude S3 Performance Table Pointer from FPDT table template. 900 // 901 mFirmwarePerformanceTableTemplate.Header.Length -= sizeof (EFI_ACPI_5_0_FPDT_S3_PERFORMANCE_TABLE_POINTER_RECORD); 902 } 903 771 904 return EFI_SUCCESS; 772 905 } -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
r48674 r58459 6 6 # and install FPDT to ACPI table. 7 7 # 8 # Copyright (c) 2011 - 201 2, Intel Corporation. All rights reserved.<BR>8 # Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR> 9 9 # This program and the accompanying materials 10 10 # are licensed and made available under the terms and conditions of the BSD License … … 20 20 INF_VERSION = 0x00010005 21 21 BASE_NAME = FirmwarePerformanceDxe 22 MODULE_UNI_FILE = FirmwarePerformanceDxe.uni 22 23 FILE_GUID = 00160F8D-2B35-4df2-BBE0-B272A8D631F0 23 24 MODULE_TYPE = DXE_DRIVER … … 49 50 PcdLib 50 51 HobLib 51 PcdLib 52 LockBoxLib 53 UefiLib 52 54 53 55 [Protocols] 54 gEfiAcpiTableProtocolGuid ## SOMETIMES_CONSUMES56 gEfiAcpiTableProtocolGuid ## CONSUMES 55 57 gEfiRscHandlerProtocolGuid ## CONSUMES 56 58 gEfiSmmCommunicationProtocolGuid ## SOMETIMES_CONSUMES 59 gEfiVariableArchProtocolGuid ## CONSUMES 60 gEfiLockBoxProtocolGuid ## CONSUMES 57 61 58 62 [Guids] 59 gEfiEventExitBootServicesGuid ## CONSUMES 60 gEfiEventReadyToBootGuid ## CONSUMES 61 gEfiEventLegacyBootGuid ## CONSUMES62 gEfiAcpiTableGuid ## SOMETIMES_CONSUMES63 gEfiAcpi10TableGuid ## SOMETIMES_CONSUMES64 gEfiAcpi20TableGuid ## SOMETIMES_CONSUMES65 gEfiFirmwarePerformanceGuid ## PRODUCES ## Variable:L"FirmwarePerformance"66 gEfiFirmwarePerformanceGuid ## SOMETIMES_CONSUMES ## Hob67 gEfiFirmwarePerformanceGuid ## SOMETIMES_CONSUMES ## SmiHandler68 g EfiFirmwarePerformanceGuid ## SOMETIMES_CONSUMES ## StatusCode Data63 gEfiEventExitBootServicesGuid ## CONSUMES ## Event 64 gEfiEventReadyToBootGuid ## CONSUMES ## Event 65 gEfiEventLegacyBootGuid ## SOMETIMES_CONSUMES ## Event 66 ## SOMETIMES_CONSUMES ## HOB 67 ## SOMETIMES_CONSUMES ## Variable:L"FirmwarePerformance" 68 ## PRODUCES ## Variable:L"FirmwarePerformance" 69 ## SOMETIMES_CONSUMES ## UNDEFINED # Used to do smm communication 70 ## SOMETIMES_CONSUMES ## UNDEFINED # StatusCode Data 71 gEfiFirmwarePerformanceGuid 72 gFirmwarePerformanceS3PointerGuid ## PRODUCES ## UNDEFINED # SaveLockBox 69 73 70 74 [Pcd] 71 gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad 72 gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart 73 gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize 75 gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad ## CONSUMES 76 gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart ## CONSUMES 77 gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize ## CONSUMES 78 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId ## CONSUMES 79 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId ## CONSUMES 80 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision ## CONSUMES 81 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId ## CONSUMES 82 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision ## CONSUMES 74 83 75 84 [FeaturePcd] 76 gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwarePerformanceDataTableS3Support 85 gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwarePerformanceDataTableS3Support ## CONSUMES 77 86 78 87 [Depex] 79 88 gEfiRscHandlerProtocolGuid 89 90 [UserExtensions.TianoCore."ExtraFiles"] 91 FirmwarePerformanceDxeExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c
r48674 r58459 8 8 for S3 Resume Performance Record on S3 resume boot path. 9 9 10 Copyright (c) 2011 , Intel Corporation. All rights reserved.<BR>10 Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR> 11 11 This program and the accompanying materials 12 12 are licensed and made available under the terms and conditions of the BSD License … … 21 21 #include <PiPei.h> 22 22 23 #include <IndustryStandard/Acpi50.h>24 25 #include <Ppi/ReadOnlyVariable2.h>26 23 #include <Ppi/ReportStatusCodeHandler.h> 27 24 #include <Ppi/SecPerformance.h> … … 71 68 EFI_STATUS Status; 72 69 UINT64 CurrentTime; 73 EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices;74 70 UINTN VarSize; 75 FIRMWARE_PERFORMANCE_VARIABLE PerformanceVariable;71 EFI_PHYSICAL_ADDRESS S3PerformanceTablePointer; 76 72 S3_PERFORMANCE_TABLE *AcpiS3PerformanceTable; 77 73 EFI_ACPI_5_0_FPDT_S3_RESUME_RECORD *AcpiS3ResumeRecord; … … 93 89 CurrentTime = GetTimeInNanoSecond (GetPerformanceCounter ()); 94 90 95 Status = PeiServicesLocatePpi (96 &gEfiPeiReadOnlyVariable2PpiGuid,97 0,98 NULL,99 (VOID **) &VariableServices100 91 // 92 // Update S3 Resume Performance Record. 93 // 94 S3PerformanceTablePointer = 0; 95 VarSize = sizeof (EFI_PHYSICAL_ADDRESS); 96 Status = RestoreLockBox (&gFirmwarePerformanceS3PointerGuid, &S3PerformanceTablePointer, &VarSize); 101 97 ASSERT_EFI_ERROR (Status); 102 98 103 // 104 // Update S3 Resume Performance Record. 105 // 106 VarSize = sizeof (FIRMWARE_PERFORMANCE_VARIABLE); 107 Status = VariableServices->GetVariable ( 108 VariableServices, 109 EFI_FIRMWARE_PERFORMANCE_VARIABLE_NAME, 110 &gEfiFirmwarePerformanceGuid, 111 NULL, 112 &VarSize, 113 &PerformanceVariable 114 ); 115 if (EFI_ERROR (Status)) { 116 return Status; 99 AcpiS3PerformanceTable = (S3_PERFORMANCE_TABLE *) (UINTN) S3PerformanceTablePointer; 100 ASSERT (AcpiS3PerformanceTable != NULL); 101 if (AcpiS3PerformanceTable->Header.Signature != EFI_ACPI_5_0_FPDT_S3_PERFORMANCE_TABLE_SIGNATURE) { 102 DEBUG ((EFI_D_ERROR, "FPDT S3 performance data in ACPI memory get corrupted\n")); 103 return EFI_ABORTED; 117 104 } 118 119 AcpiS3PerformanceTable = (S3_PERFORMANCE_TABLE *) (UINTN) PerformanceVariable.S3PerformanceTablePointer;120 ASSERT (AcpiS3PerformanceTable != NULL);121 ASSERT (AcpiS3PerformanceTable->Header.Signature == EFI_ACPI_5_0_FPDT_S3_PERFORMANCE_TABLE_SIGNATURE);122 105 AcpiS3ResumeRecord = &AcpiS3PerformanceTable->S3Resume; 123 106 AcpiS3ResumeRecord->FullResume = CurrentTime; -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.inf
r48674 r58459 1 1 ## @file 2 # This module updates S3 Resume Performance Record in ACPI Firmware Performance 3 # Data Table in S3 resume boot mode. In normal boot mode, this module consumes 4 # SecPerformance PPI produced by SEC phase and build Hob to convey the SEC 5 # performance data to DXE phase. 2 # Firmware Performance Pei Module. 3 # 4 # In S3 resume boot mode, it updates S3 Resume Performance Record in ACPI Firmware Performance Data Table. 5 # In normal boot mode, it consumes SecPerformance PPI produced by SEC phase 6 # and build Hob to convey the SEC performance data to DXE phase. 6 7 # 7 8 # This module register report status code listener to collect performance data 8 9 # for S3 Resume Performance Record on S3 resume boot path. 9 10 # 10 # Copyright (c) 2011 , Intel Corporation. All rights reserved.<BR>11 # Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR> 11 12 # This program and the accompanying materials 12 13 # are licensed and made available under the terms and conditions of the BSD License … … 22 23 INF_VERSION = 0x00010005 23 24 BASE_NAME = FirmwarePerformancePei 25 MODULE_UNI_FILE = FirmwarePerformancePei.uni 24 26 FILE_GUID = ADF01BF6-47D6-495d-B95B-687777807214 25 27 MODULE_TYPE = PEIM … … 53 55 [Ppis] 54 56 gEfiPeiRscHandlerPpiGuid ## CONSUMES 55 gEfiPeiReadOnlyVariable2PpiGuid ## SOMETIMES_CONSUMES 56 gPeiSecPerformancePpiGuid ## CONSUMES 57 gPeiSecPerformancePpiGuid ## SOMETIMES_CONSUMES 57 58 58 59 [Guids] 59 gEfiFirmwarePerformanceGuid ## CONSUMES 60 ## SOMETIMES_CONSUMES ## UNDEFINED # RestoreLockBox 61 ## SOMETIMES_PRODUCES ## HOB 62 ## SOMETIMES_CONSUMES ## Variable:L"FirmwarePerformance" 63 gEfiFirmwarePerformanceGuid 64 gFirmwarePerformanceS3PointerGuid ## SOMETIMES_CONSUMES ## UNDEFINED # RestoreLockBox 60 65 61 66 [FeaturePcd] 62 gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwarePerformanceDataTableS3Support 67 gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwarePerformanceDataTableS3Support ## CONSUMES 63 68 64 69 [Depex] 65 70 gEfiPeiMasterBootModePpiGuid AND gEfiPeiRscHandlerPpiGuid 71 72 # [BootMode] 73 # S3_RESUME ## SOMETIMES_CONSUMES 74 75 [UserExtensions.TianoCore."ExtraFiles"] 76 FirmwarePerformancePeiExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c
r48674 r58459 5 5 for SMM driver boot records and S3 Suspend Performance Record. 6 6 7 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR> 7 Caution: This module requires additional review when modified. 8 This driver will have external input - communicate buffer in SMM mode. 9 This external input must be validated carefully to avoid security issue like 10 buffer overflow, integer overflow. 11 12 FpdtSmiHandler() will receive untrusted input and do basic validation. 13 14 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR> 8 15 This program and the accompanying materials 9 16 are licensed and made available under the terms and conditions of the BSD License … … 18 25 #include <PiSmm.h> 19 26 20 #include <IndustryStandard/Acpi50.h>21 22 27 #include <Protocol/SmmReportStatusCodeHandler.h> 23 #include <Protocol/SmmAccess2.h>24 28 25 29 #include <Guid/FirmwarePerformance.h> … … 35 39 #include <Library/UefiBootServicesTableLib.h> 36 40 #include <Library/SynchronizationLib.h> 41 #include <Library/SmmMemLib.h> 37 42 38 43 #define EXTENSION_RECORD_SIZE 0x1000 … … 45 50 UINT8 *mBootRecordBuffer = NULL; 46 51 47 EFI_SMRAM_DESCRIPTOR *mSmramRanges;48 UINTN mSmramRangeCount;49 52 SPIN_LOCK mSmmFpdtLock; 50 53 BOOLEAN mSmramIsOutOfResource = FALSE; … … 102 105 // 103 106 if (mSmramIsOutOfResource) { 107 ReleaseSpinLock (&mSmmFpdtLock); 104 108 return EFI_OUT_OF_RESOURCES; 105 109 } 106 NewRecordBuffer = AllocatePool (mBootRecordSize + Data->Size + EXTENSION_RECORD_SIZE);110 NewRecordBuffer = ReallocatePool (mBootRecordSize, mBootRecordSize + Data->Size + EXTENSION_RECORD_SIZE, mBootRecordBuffer); 107 111 if (NewRecordBuffer == NULL) { 112 ReleaseSpinLock (&mSmmFpdtLock); 108 113 mSmramIsOutOfResource = TRUE; 109 114 return EFI_OUT_OF_RESOURCES; 110 115 } 111 CopyMem (NewRecordBuffer, mBootRecordBuffer, mBootRecordSize);112 116 mBootRecordBuffer = NewRecordBuffer; 113 117 mBootRecordMaxSize = mBootRecordSize + Data->Size + EXTENSION_RECORD_SIZE; … … 173 177 174 178 /** 175 This function check if the address is in SMRAM.176 177 @param Buffer the buffer address to be checked.178 @param Length the buffer length to be checked.179 180 @retval TRUE this address is in SMRAM.181 @retval FALSE this address is NOT in SMRAM.182 **/183 BOOLEAN184 InternalIsAddressInSmram (185 IN EFI_PHYSICAL_ADDRESS Buffer,186 IN UINT64 Length187 )188 {189 UINTN Index;190 191 for (Index = 0; Index < mSmramRangeCount; Index ++) {192 if (((Buffer >= mSmramRanges[Index].CpuStart) && (Buffer < mSmramRanges[Index].CpuStart + mSmramRanges[Index].PhysicalSize)) ||193 ((mSmramRanges[Index].CpuStart >= Buffer) && (mSmramRanges[Index].CpuStart < Buffer + Length))) {194 return TRUE;195 }196 }197 198 return FALSE;199 }200 201 /**202 179 Communication service SMI Handler entry. 203 180 204 181 This SMI handler provides services for report SMM boot records. 182 183 Caution: This function may receive untrusted input. 184 Communicate buffer and buffer size are external input, so this function will do basic validation. 205 185 206 186 @param[in] DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister(). … … 211 191 @param[in, out] CommBufferSize The size of the CommBuffer. 212 192 213 @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers should still be called. 214 @retval EFI_INVALID_PARAMETER The interrupt parameter is not valid. 215 @retval EFI_ACCESS_DENIED The interrupt buffer can't be written. 216 @retval EFI_UNSUPPORTED The interrupt is not supported. 193 @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers 194 should still be called. 195 @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quiesced but other handlers should 196 still be called. 197 @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pending and other handlers should still 198 be called. 199 @retval EFI_INTERRUPT_PENDING The interrupt could not be quiesced. 200 217 201 **/ 218 202 EFI_STATUS … … 227 211 EFI_STATUS Status; 228 212 SMM_BOOT_RECORD_COMMUNICATE *SmmCommData; 213 UINTN BootRecordSize; 214 VOID *BootRecordData; 215 UINTN TempCommBufferSize; 216 217 // 218 // If input is invalid, stop processing this SMI 219 // 220 if (CommBuffer == NULL || CommBufferSize == NULL) { 221 return EFI_SUCCESS; 222 } 223 224 TempCommBufferSize = *CommBufferSize; 225 226 if(TempCommBufferSize < sizeof (SMM_BOOT_RECORD_COMMUNICATE)) { 227 return EFI_SUCCESS; 228 } 229 229 230 ASSERT (CommBuffer != NULL); 231 if (CommBuffer == NULL || *CommBufferSize < sizeof (SMM_BOOT_RECORD_COMMUNICATE)) { 232 return EFI_INVALID_PARAMETER; 233 } 230 if (!SmmIsBufferOutsideSmmValid ((UINTN)CommBuffer, TempCommBufferSize)) { 231 DEBUG ((EFI_D_ERROR, "FpdtSmiHandler: SMM communication data buffer in SMRAM or overflow!\n")); 232 return EFI_SUCCESS; 233 } 234 235 SmmCommData = (SMM_BOOT_RECORD_COMMUNICATE*)CommBuffer; 234 236 235 237 Status = EFI_SUCCESS; 236 SmmCommData = (SMM_BOOT_RECORD_COMMUNICATE*)CommBuffer;237 238 238 239 switch (SmmCommData->Function) { … … 242 243 243 244 case SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA : 244 if (SmmCommData->BootRecordData == NULL || SmmCommData->BootRecordSize < mBootRecordSize) { 245 BootRecordData = SmmCommData->BootRecordData; 246 BootRecordSize = SmmCommData->BootRecordSize; 247 if (BootRecordData == NULL || BootRecordSize < mBootRecordSize) { 245 248 Status = EFI_INVALID_PARAMETER; 246 249 break; 247 250 } 248 251 249 252 // 250 253 // Sanity check 251 254 // 252 255 SmmCommData->BootRecordSize = mBootRecordSize; 253 if ( InternalIsAddressInSmram ((EFI_PHYSICAL_ADDRESS)(UINTN)SmmCommData->BootRecordData, mBootRecordSize)) {254 DEBUG ((EFI_D_ERROR, " Smm Data buffer is in SMRAM!\n"));256 if (!SmmIsBufferOutsideSmmValid ((UINTN)BootRecordData, mBootRecordSize)) { 257 DEBUG ((EFI_D_ERROR, "FpdtSmiHandler: SMM Data buffer in SMRAM or overflow!\n")); 255 258 Status = EFI_ACCESS_DENIED; 256 259 break; … … 258 261 259 262 CopyMem ( 260 (UINT8*) SmmCommData->BootRecordData,263 (UINT8*)BootRecordData, 261 264 mBootRecordBuffer, 262 265 mBootRecordSize … … 265 268 266 269 default: 267 ASSERT (FALSE);268 270 Status = EFI_UNSUPPORTED; 269 271 } 270 272 271 273 SmmCommData->ReturnStatus = Status; 274 272 275 return EFI_SUCCESS; 273 276 } … … 292 295 EFI_STATUS Status; 293 296 EFI_HANDLE Handle; 294 EFI_SMM_ACCESS2_PROTOCOL *SmmAccess;295 UINTN Size;296 297 297 298 // … … 317 318 318 319 // 319 // Get SMRAM information320 //321 Status = gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (VOID **)&SmmAccess);322 ASSERT_EFI_ERROR (Status);323 324 Size = 0;325 Status = SmmAccess->GetCapabilities (SmmAccess, &Size, NULL);326 ASSERT (Status == EFI_BUFFER_TOO_SMALL);327 328 Status = gSmst->SmmAllocatePool (329 EfiRuntimeServicesData,330 Size,331 (VOID **)&mSmramRanges332 );333 ASSERT_EFI_ERROR (Status);334 335 Status = SmmAccess->GetCapabilities (SmmAccess, &Size, mSmramRanges);336 ASSERT_EFI_ERROR (Status);337 338 mSmramRangeCount = Size / sizeof (EFI_SMRAM_DESCRIPTOR);339 340 //341 320 // Register SMI handler. 342 321 // -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.inf
r48674 r58459 5 5 # for SMM boot performance records and S3 Suspend Performance Record. 6 6 # 7 # Copyright (c) 2011 - 201 2, Intel Corporation. All rights reserved.<BR>7 # Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR> 8 8 # This program and the accompanying materials 9 9 # are licensed and made available under the terms and conditions of the BSD License … … 19 19 INF_VERSION = 0x00010005 20 20 BASE_NAME = FirmwarePerformanceSmm 21 MODULE_UNI_FILE = FirmwarePerformanceSmm.uni 21 22 FILE_GUID = 044310AB-77FD-402a-AF1A-87D4120E7329 22 23 MODULE_TYPE = DXE_SMM_DRIVER … … 50 51 UefiBootServicesTableLib 51 52 SynchronizationLib 53 SmmMemLib 52 54 53 55 [Protocols] 54 56 gEfiSmmRscHandlerProtocolGuid ## CONSUMES 55 gEfiSmmAccess2ProtocolGuid ## CONSUMES56 57 57 58 [Guids] 58 gEfiFirmwarePerformanceGuid ## CONSUMES ## LockBox 59 gEfiFirmwarePerformanceGuid ## PRODUCES ## SmiHandler 60 gEfiFirmwarePerformanceGuid ## SOMETIMES_CONSUMES ## StatusCode Data 59 ## SOMETIMES_PRODUCES ## UNDEFINED # SaveLockBox 60 ## PRODUCES ## UNDEFINED # SmiHandlerRegister 61 ## SOMETIMES_CONSUMES ## UNDEFINED # StatusCode Data 62 gEfiFirmwarePerformanceGuid 61 63 62 64 [Pcd] 63 gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendStart 64 gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendEnd 65 gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendStart ## CONSUMES 66 gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendEnd ## CONSUMES 65 67 66 68 [Depex] 67 69 gEfiSmmRscHandlerProtocolGuid 70 71 [UserExtensions.TianoCore."ExtraFiles"] 72 FirmwarePerformanceSmmExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/InternalS3SaveState.h
r48674 r58459 26 26 #include <Library/UefiRuntimeServicesTableLib.h> 27 27 #include <Library/S3BootScriptLib.h> 28 #include <Library/PcdLib.h>29 28 #include <Library/SmbusLib.h> 30 29 #include <IndustryStandard/SmBus.h> -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c
r48674 r58459 2 2 Implementation for S3 Boot Script Saver state driver. 3 3 4 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 345 345 VOID *DataMask; 346 346 UINTN Delay; 347 347 UINTN LoopTimes; 348 UINT32 Remainder; 349 348 350 Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); 349 351 Address = VA_ARG (Marker, UINT64); … … 352 354 Delay = (UINTN)VA_ARG (Marker, UINT64); 353 355 // 354 // According to the spec, the interval between 2 pools is 100ns 355 // 356 return S3BootScriptSaveMemPoll (Width, Address, DataMask, Data, 100, Delay); 356 // According to the spec, the interval between 2 polls is 100ns, 357 // but the unit of Duration for S3BootScriptSaveMemPoll() is microsecond(1000ns). 358 // Duration * 1000ns * LoopTimes = Delay * 100ns 359 // Duration will be minimum 1(microsecond) to be minimum deviation, 360 // so LoopTimes = Delay / 10. 361 // 362 LoopTimes = (UINTN) DivU64x32Remainder ( 363 Delay, 364 10, 365 &Remainder 366 ); 367 if (Remainder != 0) { 368 // 369 // If Remainder is not zero, LoopTimes will be rounded up by 1. 370 // 371 LoopTimes +=1; 372 } 373 return S3BootScriptSaveMemPoll (Width, Address, DataMask, Data, 1, LoopTimes); 357 374 358 375 } -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf
r48674 r58459 1 1 ## @file 2 # Component description file for ScriptSave module.2 # S3 Boot Script Save State driver. 3 3 # 4 # Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 4 # It will install S3 Save State protocol to store or record various IO operations to be replayed during an S3 resume. 5 # 6 # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> 5 7 # 6 8 # This program and the accompanying materials are … … 17 19 INF_VERSION = 0x00010005 18 20 BASE_NAME = S3SaveStateDxe 21 MODULE_UNI_FILE = S3SaveStateDxe.uni 19 22 FILE_GUID = BDCE85BB-FBAA-4f4e-9264-501A2C249581 20 23 MODULE_TYPE = DXE_DRIVER … … 39 42 40 43 [LibraryClasses] 41 PcdLib42 UefiRuntimeServicesTableLib43 44 UefiBootServicesTableLib 44 45 MemoryAllocationLib 45 46 UefiDriverEntryPoint 46 47 BaseMemoryLib 47 DebugLib48 48 BaseLib 49 49 S3BootScriptLib 50 50 51 51 [Protocols] 52 gEfiS3SaveStateProtocolGuid # PROTOCOL ALWAYS_PRODUCED52 gEfiS3SaveStateProtocolGuid ## PRODUCES 53 53 54 54 55 55 [Depex] 56 TRUE 57 56 TRUE 57 58 [UserExtensions.TianoCore."ExtraFiles"] 59 S3SaveStateDxeExtra.uni -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c
r48674 r58459 2 2 Implementation for S3 SMM Boot Script Saver state driver. 3 3 4 Copyright (c) 2010 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 344 344 VOID *DataMask; 345 345 UINTN Delay; 346 346 UINTN LoopTimes; 347 UINT32 Remainder; 348 347 349 Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); 348 350 Address = VA_ARG (Marker, UINT64); … … 351 353 Delay = (UINTN)VA_ARG (Marker, UINT64); 352 354 // 353 // According to the spec, the interval between 2 pools is 100ns 354 // 355 return S3BootScriptSaveMemPoll (Width, Address, DataMask, Data, 100, Delay); 355 // According to the spec, the interval between 2 polls is 100ns, 356 // but the unit of Duration for S3BootScriptSaveMemPoll() is microsecond(1000ns). 357 // Duration * 1000ns * LoopTimes = Delay * 100ns 358 // Duration will be minimum 1(microsecond) to be minimum deviation, 359 // so LoopTimes = Delay / 10. 360 // 361 LoopTimes = (UINTN) DivU64x32Remainder ( 362 Delay, 363 10, 364 &Remainder 365 ); 366 if (Remainder != 0) { 367 // 368 // If Remainder is not zero, LoopTimes will be rounded up by 1. 369 // 370 LoopTimes +=1; 371 } 372 return S3BootScriptSaveMemPoll (Width, Address, DataMask, Data, 1, LoopTimes); 356 373 357 374 } -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.inf
r48674 r58459 1 1 ## @file 2 # Component description file for ScriptSave Lite module.2 # S3 SMM Boot Script Save State driver. 3 3 # 4 # This is an implementation of the Boot Script Save protocol.4 # It will install S3 SMM Save State protocol to store or record various IO operations to be replayed during an S3 resume. 5 5 # 6 # Copyright (c) 2009 - 201 0, Intel Corporation. All rights reserved.<BR>6 # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> 7 7 # 8 8 # This program and the accompanying materials are … … 19 19 INF_VERSION = 0x00010005 20 20 BASE_NAME = SmmS3SaveState 21 MODULE_UNI_FILE = SmmS3SaveState.uni 21 22 FILE_GUID = 2D59F041-53A4-40d0-A6CD-844DC0DFEF17 22 23 MODULE_TYPE = DXE_SMM_DRIVER … … 45 46 UefiDriverEntryPoint 46 47 BaseMemoryLib 47 DebugLib48 48 BaseLib 49 49 S3BootScriptLib 50 50 51 51 [Protocols] 52 gEfiS3SmmSaveStateProtocolGuid # PROTOCOL ALWAYS_PRODUCED52 gEfiS3SmmSaveStateProtocolGuid ## PRODUCES 53 53 54 54 [Depex] 55 55 TRUE 56 56 57 [UserExtensions.TianoCore."ExtraFiles"] 58 SmmS3SaveStateExtra.uni
Note:
See TracChangeset
for help on using the changeset viewer.