Changeset 85718 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library
- Timestamp:
- Aug 12, 2020 4:09:12 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139865
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 24 added
- 1 deleted
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-133213 /vendor/edk2/current 103735-103757,103769-103776,129194-139864
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
r80721 r85718 7 7 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> 8 8 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 9 # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 9 10 # 10 11 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 42 43 ArmCache.c 43 44 45 [Sources.RISCV64] 46 RiscVCache.c 47 44 48 [Packages] 45 49 MdePkg/MdePkg.dec -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
r80721 r85718 8 8 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 9 9 # Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR> 10 # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 10 11 # 11 12 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 25 26 26 27 # 27 # VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 28 # VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 RISCV64 28 29 # 29 30 … … 60 61 AArch64/CpuSleep.asm | MSFT 61 62 63 [Sources.RISCV64] 64 RiscV/Cpu.S 65 62 66 [Packages] 63 67 MdePkg/MdePkg.dec -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseCpuLib/BaseCpuLib.uni
r80721 r85718 2 2 // Instance of CPU Library for various architecture. 3 3 // 4 // CPU Library implemented using ASM functions for IA-32 and X64,4 // CPU Library implemented using ASM functions for IA-32, X64 and RISCV64, 5 5 // PAL CALLs for IPF, and empty functions for EBC. 6 6 // … … 8 8 // Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 9 9 // Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR> 10 // Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 10 11 // 11 12 // SPDX-License-Identifier: BSD-2-Clause-Patent … … 16 17 #string STR_MODULE_ABSTRACT #language en-US "Instance of CPU Library for various architectures" 17 18 18 #string STR_MODULE_DESCRIPTION #language en-US "CPU Library implemented using ASM functions for IA-32 and X64, PAL CALLs for IPF, and empty functions for EBC."19 #string STR_MODULE_DESCRIPTION #language en-US "CPU Library implemented using ASM functions for IA-32, X64 and RISCV64, PAL CALLs for IPF, and empty functions for EBC." 19 20 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
r80721 r85718 5 5 # for IA-32 and x64. On IPF, I/O port requests are translated into MMIO requests. 6 6 # MMIO requests are forwarded directly to memory. For EBC, I/O port requests 7 # ASSERT(). 7 # ASSERT(). For ARM, AARCH64 and RISCV64, this I/O library only provides non I/O 8 # read and write. 8 9 # 9 10 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> 10 11 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 11 12 # Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR> 13 # Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 12 14 # 13 15 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 26 28 27 29 # 28 # VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 30 # VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 RISCV64 29 31 # 30 32 … … 51 53 52 54 [Sources.ARM] 53 IoLib Arm.c55 IoLibNoIo.c 54 56 55 57 [Sources.AARCH64] 56 IoLibArm.c 58 IoLibNoIo.c 59 60 [Sources.RISCV64] 61 IoLibNoIo.c 57 62 58 63 [Packages] -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
r80721 r85718 33 33 34 34 **/ 35 __inline__36 35 UINT8 37 36 EFIAPI … … 61 60 62 61 **/ 63 __inline__64 62 UINT8 65 63 EFIAPI … … 88 86 89 87 **/ 90 __inline__91 88 UINT16 92 89 EFIAPI … … 118 115 119 116 **/ 120 __inline__121 117 UINT16 122 118 EFIAPI … … 146 142 147 143 **/ 148 __inline__149 144 UINT32 150 145 EFIAPI … … 176 171 177 172 **/ 178 __inline__179 173 UINT32 180 174 EFIAPI -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseLib/BaseLib.inf
r80721 r85718 5 5 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 6 6 # Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR> 7 # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 7 8 # 8 9 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 21 22 22 23 # 23 # VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 24 # VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 RISCV64 24 25 # 25 26 … … 395 396 AArch64/SpeculationBarrier.asm | MSFT 396 397 398 [Sources.RISCV64] 399 Math64.c 400 Unaligned.c 401 RiscV64/InternalSwitchStack.c 402 RiscV64/CpuBreakpoint.c 403 RiscV64/GetInterruptState.c 404 RiscV64/DisableInterrupts.c 405 RiscV64/EnableInterrupts.c 406 RiscV64/CpuPause.c 407 RiscV64/RiscVSetJumpLongJump.S | GCC 408 RiscV64/RiscVCpuBreakpoint.S | GCC 409 RiscV64/RiscVCpuPause.S | GCC 410 RiscV64/RiscVInterrupt.S | GCC 411 RiscV64/FlushCache.S | GCC 412 397 413 [Packages] 398 414 MdePkg/MdePkg.dec -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseLib/SafeString.c
r80721 r85718 15 15 #define SAFE_STRING_CONSTRAINT_CHECK(Expression, Status) \ 16 16 do { \ 17 ASSERT (Expression); \18 17 if (!(Expression)) { \ 18 DEBUG ((DEBUG_VERBOSE, \ 19 "%a(%d) %a: SAFE_STRING_CONSTRAINT_CHECK(%a) failed. Return %r\n", \ 20 __FILE__, __LINE__, __FUNCTION__, #Expression, Status)); \ 19 21 return Status; \ 20 22 } \ … … 198 200 If Destination is not aligned on a 16-bit boundary, then ASSERT(). 199 201 If Source is not aligned on a 16-bit boundary, then ASSERT(). 200 If an error would be returned, then the function will also ASSERT().201 202 202 203 If an error is returned, then the Destination is unmodified. … … 280 281 If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT(). 281 282 If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT(). 282 If an error would be returned, then the function will also ASSERT().283 283 284 284 If an error is returned, then the Destination is unmodified. … … 373 373 If Destination is not aligned on a 16-bit boundary, then ASSERT(). 374 374 If Source is not aligned on a 16-bit boundary, then ASSERT(). 375 If an error would be returned, then the function will also ASSERT().376 375 377 376 If an error is returned, then the Destination is unmodified. … … 474 473 If Destination is not aligned on a 16-bit boundary, then ASSERT(). 475 474 If Source is not aligned on a 16-bit boundary, then ASSERT(). 476 If an error would be returned, then the function will also ASSERT().477 475 478 476 If an error is returned, then the Destination is unmodified. … … 591 589 valid decimal character or a Null-terminator, whichever one comes first. 592 590 593 If String is NULL, then ASSERT().594 If Data is NULL, then ASSERT().595 591 If String is not aligned in a 16-bit boundary, then ASSERT(). 596 If PcdMaximumUnicodeStringLength is not zero, and String contains more than597 PcdMaximumUnicodeStringLength Unicode characters, not including the598 Null-terminator, then ASSERT().599 592 600 593 If String has no valid decimal digits in the above format, then 0 is stored … … 706 699 valid decimal character or a Null-terminator, whichever one comes first. 707 700 708 If String is NULL, then ASSERT().709 If Data is NULL, then ASSERT().710 701 If String is not aligned in a 16-bit boundary, then ASSERT(). 711 If PcdMaximumUnicodeStringLength is not zero, and String contains more than712 PcdMaximumUnicodeStringLength Unicode characters, not including the713 Null-terminator, then ASSERT().714 702 715 703 If String has no valid decimal digits in the above format, then 0 is stored … … 826 814 whichever one comes first. 827 815 828 If String is NULL, then ASSERT().829 If Data is NULL, then ASSERT().830 816 If String is not aligned in a 16-bit boundary, then ASSERT(). 831 If PcdMaximumUnicodeStringLength is not zero, and String contains more than832 PcdMaximumUnicodeStringLength Unicode characters, not including the833 Null-terminator, then ASSERT().834 817 835 818 If String has no valid hexadecimal digits in the above format, then 0 is … … 957 940 whichever one comes first. 958 941 959 If String is NULL, then ASSERT().960 If Data is NULL, then ASSERT().961 942 If String is not aligned in a 16-bit boundary, then ASSERT(). 962 If PcdMaximumUnicodeStringLength is not zero, and String contains more than963 PcdMaximumUnicodeStringLength Unicode characters, not including the964 Null-terminator, then ASSERT().965 943 966 944 If String has no valid hexadecimal digits in the above format, then 0 is … … 1092 1070 The "::" can only appear once in the String. 1093 1071 1094 If String is NULL, then ASSERT().1095 1096 If Address is NULL, then ASSERT().1097 1098 1072 If String is not aligned in a 16-bit boundary, then ASSERT(). 1099 1100 If PcdMaximumUnicodeStringLength is not zero, and String contains more than1101 PcdMaximumUnicodeStringLength Unicode characters, not including the1102 Null-terminator, then ASSERT().1103 1073 1104 1074 If EndPointer is not NULL and Address is translated from String, a pointer … … 1318 1288 a valid decimal digit character after P is converted. 1319 1289 1320 If String is NULL, then ASSERT().1321 1322 If Address is NULL, then ASSERT().1323 1324 1290 If String is not aligned in a 16-bit boundary, then ASSERT(). 1325 1326 If PcdMaximumUnicodeStringLength is not zero, and String contains more than1327 PcdMaximumUnicodeStringLength Unicode characters, not including the1328 Null-terminator, then ASSERT().1329 1291 1330 1292 If EndPointer is not NULL and Address is translated from String, a pointer … … 1483 1445 pp Data4[56:63] 1484 1446 1485 If String is NULL, then ASSERT().1486 If Guid is NULL, then ASSERT().1487 1447 If String is not aligned in a 16-bit boundary, then ASSERT(). 1488 1448 … … 1589 1549 1590 1550 If String is not aligned in a 16-bit boundary, then ASSERT(). 1591 1592 If String is NULL, then ASSERT().1593 1594 If Buffer is NULL, then ASSERT().1595 1596 If Length is not multiple of 2, then ASSERT().1597 1598 If PcdMaximumUnicodeStringLength is not zero and Length is greater than1599 PcdMaximumUnicodeStringLength, then ASSERT().1600 1601 If MaxBufferSize is less than (Length / 2), then ASSERT().1602 1551 1603 1552 @param String Pointer to a Null-terminated Unicode string. … … 1780 1729 This function is similar as strcpy_s defined in C11. 1781 1730 1782 If an error would be returned, then the function will also ASSERT().1783 1784 1731 If an error is returned, then the Destination is unmodified. 1785 1732 … … 1856 1803 1857 1804 This function is similar as strncpy_s defined in C11. 1858 1859 If an error would be returned, then the function will also ASSERT().1860 1805 1861 1806 If an error is returned, then the Destination is unmodified. … … 1944 1889 1945 1890 This function is similar as strcat_s defined in C11. 1946 1947 If an error would be returned, then the function will also ASSERT().1948 1891 1949 1892 If an error is returned, then the Destination is unmodified. … … 2040 1983 2041 1984 This function is similar as strncat_s defined in C11. 2042 2043 If an error would be returned, then the function will also ASSERT().2044 1985 2045 1986 If an error is returned, then the Destination is unmodified. … … 2155 2096 valid decimal character or a Null-terminator, whichever one comes first. 2156 2097 2157 If String is NULL, then ASSERT().2158 If Data is NULL, then ASSERT().2159 If PcdMaximumAsciiStringLength is not zero, and String contains more than2160 PcdMaximumAsciiStringLength Ascii characters, not including the2161 Null-terminator, then ASSERT().2162 2163 2098 If String has no valid decimal digits in the above format, then 0 is stored 2164 2099 at the location pointed to by Data. … … 2267 2202 valid decimal character or a Null-terminator, whichever one comes first. 2268 2203 2269 If String is NULL, then ASSERT().2270 If Data is NULL, then ASSERT().2271 If PcdMaximumAsciiStringLength is not zero, and String contains more than2272 PcdMaximumAsciiStringLength Ascii characters, not including the2273 Null-terminator, then ASSERT().2274 2275 2204 If String has no valid decimal digits in the above format, then 0 is stored 2276 2205 at the location pointed to by Data. … … 2383 2312 whichever on comes first. 2384 2313 2385 If String is NULL, then ASSERT().2386 If Data is NULL, then ASSERT().2387 If PcdMaximumAsciiStringLength is not zero, and String contains more than2388 PcdMaximumAsciiStringLength Ascii characters, not including the2389 Null-terminator, then ASSERT().2390 2391 2314 If String has no valid hexadecimal digits in the above format, then 0 is 2392 2315 stored at the location pointed to by Data. … … 2510 2433 whichever on comes first. 2511 2434 2512 If String is NULL, then ASSERT().2513 If Data is NULL, then ASSERT().2514 If PcdMaximumAsciiStringLength is not zero, and String contains more than2515 PcdMaximumAsciiStringLength Ascii characters, not including the2516 Null-terminator, then ASSERT().2517 2518 2435 If String has no valid hexadecimal digits in the above format, then 0 is 2519 2436 stored at the location pointed to by Data. … … 2636 2553 2637 2554 If Source is not aligned on a 16-bit boundary, then ASSERT(). 2638 If an error would be returned, then the function will also ASSERT().2639 2555 2640 2556 If an error is returned, then the Destination is unmodified. … … 2736 2652 bits, then ASSERT(). 2737 2653 If Source is not aligned on a 16-bit boundary, then ASSERT(). 2738 If an error would be returned, then the function will also ASSERT().2739 2654 2740 2655 If an error is returned, then Destination and DestinationLength are … … 2856 2771 2857 2772 If Destination is not aligned on a 16-bit boundary, then ASSERT(). 2858 If an error would be returned, then the function will also ASSERT().2859 2773 2860 2774 If an error is returned, then the Destination is unmodified. … … 2949 2863 2950 2864 If Destination is not aligned on a 16-bit boundary, then ASSERT(). 2951 If an error would be returned, then the function will also ASSERT().2952 2865 2953 2866 If an error is returned, then Destination and DestinationLength are … … 3072 2985 "::" can be used to compress one or more groups of X when X contains only 0. 3073 2986 The "::" can only appear once in the String. 3074 3075 If String is NULL, then ASSERT().3076 3077 If Address is NULL, then ASSERT().3078 2987 3079 2988 If EndPointer is not NULL and Address is translated from String, a pointer … … 3291 3200 When /P is in the String, the function stops at the first character that is not 3292 3201 a valid decimal digit character after P is converted. 3293 3294 If String is NULL, then ASSERT().3295 3296 If Address is NULL, then ASSERT().3297 3202 3298 3203 If EndPointer is not NULL and Address is translated from String, a pointer … … 3449 3354 pp Data4[56:63] 3450 3355 3451 If String is NULL, then ASSERT().3452 If Guid is NULL, then ASSERT().3453 3454 3356 @param String Pointer to a Null-terminated ASCII string. 3455 3357 @param Guid Pointer to the converted GUID. … … 3550 3452 decoding stops after Length of characters and outputs Buffer containing 3551 3453 (Length / 2) bytes. 3552 3553 If String is NULL, then ASSERT().3554 3555 If Buffer is NULL, then ASSERT().3556 3557 If Length is not multiple of 2, then ASSERT().3558 3559 If PcdMaximumAsciiStringLength is not zero and Length is greater than3560 PcdMaximumAsciiStringLength, then ASSERT().3561 3562 If MaxBufferSize is less than (Length / 2), then ASSERT().3563 3454 3564 3455 @param String Pointer to a Null-terminated ASCII string. -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
r80721 r85718 1 1 /** @file 2 2 Base PE/COFF loader supports loading any PE32/PE32+ or TE image, but 3 only supports relocating IA32, x64, IPF, and EBC images.3 only supports relocating IA32, x64, IPF, ARM, RISC-V and EBC images. 4 4 5 5 Caution: This file requires additional review when modified. … … 18 18 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR> 19 19 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 20 Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 20 21 SPDX-License-Identifier: BSD-2-Clause-Patent 21 22 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
r80721 r85718 4 4 # The IA32 version library support loading IA32, X64 and EBC PE/COFF images. 5 5 # The X64 version library support loading IA32, X64 and EBC PE/COFF images. 6 # The RISC-V version library support loading RISC-V images. 6 7 # 7 8 # Caution: This module requires additional review when modified. … … 12 13 # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> 13 14 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 15 # Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 14 16 # 15 17 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 42 44 Arm/PeCoffLoaderEx.c 43 45 46 [Sources.RISCV64] 47 RiscV/PeCoffLoaderEx.c 48 44 49 [Packages] 45 50 MdePkg/MdePkg.dec -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.uni
r80721 r85718 5 5 // The IA32 version library support loading IA32, X64 and EBC PE/COFF images. 6 6 // The X64 version library support loading IA32, X64 and EBC PE/COFF images. 7 // The RISC-V version library support loading RISC-V32 and RISC-V64 PE/COFF images. 7 8 // 8 9 // Caution: This module requires additional review when modified. … … 13 14 // Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> 14 15 // Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 16 // Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 15 17 // 16 18 // SPDX-License-Identifier: BSD-2-Clause-Patent -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BasePeCoffLib/BasePeCoffLibInternals.h
r80721 r85718 3 3 4 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 5 Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 5 6 SPDX-License-Identifier: BSD-2-Clause-Patent 6 7 … … 17 18 #include <IndustryStandard/PeImage.h> 18 19 20 // 21 // Macro definitions for RISC-V architecture. 22 // 23 #define RV_X(x, s, n) (((x) >> (s)) & ((1<<(n))-1)) 24 #define RISCV_IMM_BITS 12 25 #define RISCV_IMM_REACH (1LL<<RISCV_IMM_BITS) 26 #define RISCV_CONST_HIGH_PART(VALUE) \ 27 (((VALUE) + (RISCV_IMM_REACH/2)) & ~(RISCV_IMM_REACH-1)) 19 28 20 29 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
r80721 r85718 7 7 # Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> 8 8 # Copyright (c) 2017, Microsoft Corporation 9 # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 10 9 11 # 10 12 # All rights reserved. … … 24 26 # The following information is for reference only and not required by the build tools. 25 27 # 26 # VALID_ARCHITECTURES = IA32 X64 28 # VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64 27 29 # 28 30 … … 33 35 SafeIntLib32.c 34 36 35 [Sources.X64, Sources.AARCH64 ]37 [Sources.X64, Sources.AARCH64, Sources.RISCV64] 36 38 SafeIntLib64.c 37 39 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseSafeIntLib/SafeIntLib.c
r80721 r85718 3381 3381 // a * d must be less than 2^32 or there would be bits set in the high 64-bits 3382 3382 // 3383 ProductAD = (((UINT64)DwordA) *(UINT64)DwordD);3383 ProductAD = MultU64x64 ((UINT64)DwordA, (UINT64)DwordD); 3384 3384 if ((ProductAD & 0xffffffff00000000) == 0) { 3385 3385 DwordB = (UINT32)Multiplicand; … … 3388 3388 // b * c must be less than 2^32 or there would be bits set in the high 64-bits 3389 3389 // 3390 ProductBC = (((UINT64)DwordB) *(UINT64)DwordC);3390 ProductBC = MultU64x64 ((UINT64)DwordB, (UINT64)DwordC); 3391 3391 if ((ProductBC & 0xffffffff00000000) == 0) { 3392 3392 // … … 3398 3398 // b * d 3399 3399 // 3400 ProductBD = (((UINT64)DwordB) *(UINT64)DwordD);3400 ProductBD = MultU64x64 ((UINT64)DwordB, (UINT64)DwordD); 3401 3401 3402 3402 if (!RETURN_ERROR (SafeUint64Add (UnsignedResult, ProductBD, &UnsignedResult))) { -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
r80721 r85718 4 4 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> 5 5 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 6 # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 6 7 # 7 8 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 79 80 AArch64/Synchronization.asm | MSFT 80 81 82 [Sources.RISCV64] 83 Synchronization.c 84 RiscV64/Synchronization.S 85 81 86 [Packages] 82 87 MdePkg/MdePkg.dec -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
r80721 r85718 151 151 If DecodeHandler is NULL, then ASSERT(). 152 152 153 @param[in] SectionGuid A pointer to the GUID associated with the thehandlers153 @param[in] SectionGuid A pointer to the GUID associated with the handlers 154 154 of the GUIDed section type being registered. 155 155 @param[in] GetInfoHandler The pointer to a function that examines a GUIDed section and returns the … … 232 232 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(), 233 233 then RETURN_UNSUPPORTED is returned. 234 If the GUID of InputSection does match the GUID that this handler supports, then the theassociated handler234 If the GUID of InputSection does match the GUID that this handler supports, then the associated handler 235 235 of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers() 236 is used to retrieve the Out utBufferSize, ScratchSize, and Attributes values. The return status from the handler of236 is used to retrieve the OutputBufferSize, ScratchSize, and Attributes values. The return status from the handler of 237 237 type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER is returned. 238 238 … … 312 312 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(), 313 313 then RETURN_UNSUPPORTED is returned. 314 If the GUID of InputSection does match the GUID that this handler supports, then the theassociated handler314 If the GUID of InputSection does match the GUID that this handler supports, then the associated handler 315 315 of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers() 316 316 is used to decode InputSection into the buffer specified by OutputBuffer and the authentication status of this … … 398 398 If SectionGuid is NULL, then ASSERT(). 399 399 400 @param[in] SectionGuid A pointer to the GUID associated with the handlers of the GUIDed400 @param[in] SectionGuid A pointer to the GUID associated with the handlers of the GUIDed 401 401 section type being retrieved. 402 402 @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeHobLib/HobLib.c
r80721 r85718 1 1 /** @file 2 HOB Library implemen ation for Dxe Phase.2 HOB Library implementation for Dxe Phase. 3 3 4 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeHstiLib/HstiDxe.c
r80721 r85718 78 78 &InfoTypesBufferCount 79 79 ); 80 if (EFI_ERROR (Status) ) {80 if (EFI_ERROR (Status) || (InfoTypesBuffer == NULL) || (InfoTypesBufferCount == 0)) { 81 81 continue; 82 82 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeIoLibCpuIo2/IoLib.c
r80721 r85718 12 12 13 13 // 14 // Glob le varible to cache pointer to CpuIo2 protocol.14 // Global variable to cache pointer to CpuIo2 protocol. 15 15 // 16 16 EFI_CPU_IO2_PROTOCOL *mCpuIo = NULL; -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxePcdLib/DxePcdLib.inf
r80721 r85718 17 17 # in their initialization without any issues to access Dynamic and DynamicEx PCD. They can't 18 18 # access Dynamic and DynamicEx PCD in the implementation of runtime services and SMI handlers. 19 # Because EFI_PCD_PROTOCOL is DXE protocol that is not av iable in OS runtime phase.19 # Because EFI_PCD_PROTOCOL is DXE protocol that is not available in OS runtime phase. 20 20 # 21 21 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxePcdLib/DxePcdLib.uni
r80721 r85718 23 23 #string STR_MODULE_ABSTRACT #language en-US "PCD Library using PCD Protocol" 24 24 25 #string STR_MODULE_DESCRIPTION #language en-US "There are two PCD protocols: 1) PCD_PROTOCOL It is an EDKII implementation that suppor stDynamic/DynamicEx PCDs. 2) EFI_PCD_PROTOCOL It is defined by PI Specification 1.2, Vol 3, which only support dynamicEx type PCD. For dynamicEx type PCDs, it is compatible between PCD_PROTOCOL and EFI_PCD_PROTOCOL. This library instance uses the PCD_PROTOCOL to handle dynamic PCD requests and uses EFI_PCD_PROTOCOL to handle DynamicEx type PCDs."25 #string STR_MODULE_DESCRIPTION #language en-US "There are two PCD protocols: 1) PCD_PROTOCOL It is an EDKII implementation that supports Dynamic/DynamicEx PCDs. 2) EFI_PCD_PROTOCOL It is defined by PI Specification 1.2, Vol 3, which only support dynamicEx type PCD. For dynamicEx type PCDs, it is compatible between PCD_PROTOCOL and EFI_PCD_PROTOCOL. This library instance uses the PCD_PROTOCOL to handle dynamic PCD requests and uses EFI_PCD_PROTOCOL to handle DynamicEx type PCDs." 26 26 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
r80721 r85718 78 78 } 79 79 80 return SystemTable->BootServices->CreateEvent Ex (EVT_NOTIFY_SIGNAL,80 return SystemTable->BootServices->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, 81 81 TPL_NOTIFY, ExitBootServicesEvent, NULL, 82 &gEfiEventExitBootServicesGuid,83 82 &mEfiExitBootServicesEvent); 84 83 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf
r80721 r85718 42 42 SerialPortLib 43 43 44 [Guids]45 gEfiEventExitBootServicesGuid ## CONSUMES ## Event46 47 44 [Pcd] 48 45 gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib.inf
r80721 r85718 48 48 [Pcd] 49 49 gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## CONSUMES 50 51 [Guids]52 gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event53 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c
r80721 r85718 125 125 // Register SetVirtualAddressMap () notify function 126 126 // 127 Status = gBS->CreateEvent Ex(128 EVT_ NOTIFY_SIGNAL,127 Status = gBS->CreateEvent ( 128 EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, 129 129 TPL_NOTIFY, 130 130 DxeRuntimePciExpressLibVirtualNotify, 131 131 NULL, 132 &gEfiEventVirtualAddressChangeGuid,133 132 &mDxeRuntimePciExpressLibVirtualNotifyEvent 134 133 ); … … 300 299 301 300 // 302 // See if Address has already been register d for runtime access301 // See if Address has already been registered for runtime access 303 302 // 304 303 for (Index = 0; Index < mDxeRuntimePciExpressLibNumberOfRuntimeRanges; Index++) { … … 1458 1457 configuration registers from a single PCI function to be read. Size is 1459 1458 returned. When possible 32-bit PCI configuration read cycles are used to read 1460 from StartAd ress to StartAddress + Size. Due to alignment restrictions, 8-bit1459 from StartAddress to StartAddress + Size. Due to alignment restrictions, 8-bit 1461 1460 and 16-bit PCI configuration read cycles may be used at the beginning and the 1462 1461 end of the range. … … 1561 1560 configuration registers from a single PCI function to be written. Size is 1562 1561 returned. When possible 32-bit PCI configuration write cycles are used to 1563 write from StartAd ress to StartAddress + Size. Due to alignment restrictions,1562 write from StartAddress to StartAddress + Size. Due to alignment restrictions, 1564 1563 8-bit and 16-bit PCI configuration write cycles may be used at the beginning 1565 1564 and the end of the range. -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeServicesLib/DxeServicesLib.c
r80721 r85718 26 26 Identify the device handle from which the Image is loaded from. As this device handle is passed to 27 27 GetSectionFromFv as the identifier for a Firmware Volume, an EFI_FIRMWARE_VOLUME2_PROTOCOL 28 protocol instance should be located succes fully by calling gBS->HandleProtocol ().28 protocol instance should be located successfully by calling gBS->HandleProtocol (). 29 29 30 30 This function locates the EFI_LOADED_IMAGE_PROTOCOL instance installed … … 50 50 51 51 Status = gBS->HandleProtocol ( 52 (EFI_HANDLE *)ImageHandle,52 ImageHandle, 53 53 &gEfiLoadedImageProtocolGuid, 54 54 (VOID **) &LoadedImage … … 72 72 73 73 This functions first locate the EFI_FIRMWARE_VOLUME2_PROTOCOL protocol instance on FvHandle in order to 74 carry out the Firmware Volume read operation. The function then reads the Firmware Section found s epcifed74 carry out the Firmware Volume read operation. The function then reads the Firmware Section found specified 75 75 by NameGuid, SectionType and SectionInstance. 76 76 … … 95 95 @param SectionInstance The instance number of Firmware Section to 96 96 read from starting from 0. 97 @param Buffer On output, Buffer contains the thedata read97 @param Buffer On output, Buffer contains the data read 98 98 from the section in the Firmware File found. 99 99 @param Size On output, the size of Buffer. … … 518 518 519 519 /** 520 Searches the FFS file the thecurrently executing module was loaded from and returns the first matching FFS section.520 Searches the FFS file the currently executing module was loaded from and returns the first matching FFS section. 521 521 522 522 This function searches the FFS file that the currently executing module was loaded from for a FFS sections of type SectionType. … … 598 598 match an exact file to be loaded. 599 599 @param[in] FilePath The pointer to the device path of the file 600 that is abs racted to the file buffer.600 that is abstracted to the file buffer. 601 601 @param[out] FileSize The pointer to the size of the abstracted 602 602 file buffer. … … 746 746 // 747 747 // Parse each MEDIA_FILEPATH_DP node. There may be more than one, since the 748 // directory information and filename can be sep erate. The goal is to inch748 // directory information and filename can be separate. The goal is to inch 749 749 // our way down each device path node and close the previous node 750 750 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
r80721 r85718 23 23 24 24 # 25 # VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 25 # VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 RISCV64 26 26 # 27 27 … … 29 29 DxeServicesLib.c 30 30 31 [Sources.IA32, Sources.EBC, Sources.ARM, Sources.AARCH64 ]31 [Sources.IA32, Sources.EBC, Sources.ARM, Sources.AARCH64, Sources.RISCV64] 32 32 Allocate.c 33 33 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c
r80721 r85718 10 10 initialized. 11 11 12 This library contains con truct function to retrieve EFI_DXE_SERIVCE, this construct12 This library contains construct function to retrieve EFI_DXE_SERVICE, this construct 13 13 function will be invoked in DXE driver's autogen file. 14 14 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c
r80721 r85718 13 13 14 14 // 15 // Glob le varible to cache pointer to Smbus protocol.15 // Global variable to cache pointer to Smbus protocol. 16 16 // 17 17 EFI_SMBUS_HC_PROTOCOL *mSmbus = NULL; -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c
r80721 r85718 110 110 // Register SetVirtualAddressMap () notify function 111 111 // 112 Status = gBS->CreateEvent Ex(113 EVT_ NOTIFY_SIGNAL,112 Status = gBS->CreateEvent ( 113 EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, 114 114 TPL_NOTIFY, 115 115 DxeRuntimePciSegmentLibVirtualNotify, 116 116 NULL, 117 &gEfiEventVirtualAddressChangeGuid,118 117 &mDxeRuntimePciSegmentLibVirtualNotifyEvent 119 118 ); … … 212 211 213 212 // 214 // See if Address has already been register d for runtime access213 // See if Address has already been registered for runtime access 215 214 // 216 215 for (Index = 0; Index < mDxeRuntimePciSegmentLibNumberOfRuntimeRanges; Index++) { -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLibSegmentInfo.inf
r80721 r85718 46 46 DxeServicesTableLib 47 47 UefiBootServicesTableLib 48 49 [Guids]50 gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/PciSegmentLibSegmentInfo/PciSegmentLibCommon.c
r80721 r85718 1170 1170 configuration registers from a single PCI function to be read. Size is 1171 1171 returned. When possible 32-bit PCI configuration read cycles are used to read 1172 from StartAd ress to StartAddress + Size. Due to alignment restrictions, 8-bit1172 from StartAddress to StartAddress + Size. Due to alignment restrictions, 8-bit 1173 1173 and 16-bit PCI configuration read cycles may be used at the beginning and the 1174 1174 end of the range. … … 1273 1273 configuration registers from a single PCI function to be written. Size is 1274 1274 returned. When possible 32-bit PCI configuration write cycles are used to 1275 write from StartAd ress to StartAddress + Size. Due to alignment restrictions,1275 write from StartAddress to StartAddress + Size. Due to alignment restrictions, 1276 1276 8-bit and 16-bit PCI configuration write cycles may be used at the beginning 1277 1277 and the end of the range. -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/SmmMemLib/SmmMemLib.c
r80721 r85718 276 276 @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer. 277 277 278 @retval EFI_SECURITY_VIOLATION The Des inationBuffer is invalid per processor architecture or overlap with SMRAM.278 @retval EFI_SECURITY_VIOLATION The DestinationBuffer is invalid per processor architecture or overlap with SMRAM. 279 279 @retval EFI_SUCCESS Memory is copied. 280 280 … … 309 309 @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer. 310 310 311 @retval EFI_SECURITY_VIOLATION The Des inationBuffer is invalid per processor architecture or overlap with SMRAM.311 @retval EFI_SECURITY_VIOLATION The DestinationBuffer is invalid per processor architecture or overlap with SMRAM. 312 312 @retval EFI_SECURITY_VIOLATION The SourceBuffer is invalid per processor architecture or overlap with SMRAM. 313 313 @retval EFI_SUCCESS Memory is copied. -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/SmmPciExpressLib/PciExpressLib.c
r80721 r85718 1227 1227 configuration registers from a single PCI function to be read. Size is 1228 1228 returned. When possible 32-bit PCI configuration read cycles are used to read 1229 from StartAd ress to StartAddress + Size. Due to alignment restrictions, 8-bit1229 from StartAddress to StartAddress + Size. Due to alignment restrictions, 8-bit 1230 1230 and 16-bit PCI configuration read cycles may be used at the beginning and the 1231 1231 end of the range. … … 1330 1330 configuration registers from a single PCI function to be written. Size is 1331 1331 returned. When possible 32-bit PCI configuration write cycles are used to 1332 write from StartAd ress to StartAddress + Size. Due to alignment restrictions,1332 write from StartAddress to StartAddress + Size. Due to alignment restrictions, 1333 1333 8-bit and 16-bit PCI configuration write cycles may be used at the beginning 1334 1334 and the end of the range. -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/SmmPciLibPciRootBridgeIo/PciLib.c
r80721 r85718 36 36 37 37 // 38 // Global vari ble to cache pointer to PCI Root Bridge I/O protocol.38 // Global variable to cache pointer to PCI Root Bridge I/O protocol. 39 39 // 40 40 EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL *mSmmPciRootBridgeIo = NULL; … … 1239 1239 configuration registers from a single PCI function to be read. Size is 1240 1240 returned. When possible 32-bit PCI configuration read cycles are used to read 1241 from StartAd ress to StartAddress + Size. Due to alignment restrictions, 8-bit1241 from StartAddress to StartAddress + Size. Due to alignment restrictions, 8-bit 1242 1242 and 16-bit PCI configuration read cycles may be used at the beginning and the 1243 1243 end of the range. … … 1337 1337 configuration registers from a single PCI function to be written. Size is 1338 1338 returned. When possible 32-bit PCI configuration write cycles are used to 1339 write from StartAd ress to StartAddress + Size. Due to alignment restrictions,1339 write from StartAddress to StartAddress + Size. Due to alignment restrictions, 1340 1340 8-bit and 16-bit PCI configuration write cycles may be used at the beginning 1341 1341 and the end of the range. -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c
r80721 r85718 108 108 /// 109 109 /// The performance counter value that was captured the last time that the 110 /// periodic SMI handler called Period cSmiExecutionTime(). This allows the111 /// time value returned by Period cSmiExecutionTime() to be accurate even when110 /// periodic SMI handler called PeriodicSmiExecutionTime(). This allows the 111 /// time value returned by PeriodicSmiExecutionTime() to be accurate even when 112 112 /// the performance counter rolls over. 113 113 /// … … 128 128 /// Buffer used to save the context when a periodic SMI handler requests to 129 129 /// yield using PeriodicSmiYield(). This context is used to resume the 130 /// execution of a periodic SMI handler the next time control is transfer d130 /// execution of a periodic SMI handler the next time control is transferred 131 131 /// to the periodic SMI handler that yielded. 132 132 /// … … 153 153 154 154 /// 155 /// Pointer to the SMM Periodic Timer Dis atch Protocol that was located in the constuctor.155 /// Pointer to the SMM Periodic Timer Dispatch Protocol that was located in the constructor. 156 156 /// 157 157 EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *gSmmPeriodicTimerDispatch2 = NULL; … … 523 523 periodic SMI for the currently executing handler is triggered, the periodic 524 524 SMI handler will be resumed and this function will return. Use of this 525 function requires a sep erate stack for the periodic SMI handler. A non zero525 function requires a separate stack for the periodic SMI handler. A non zero 526 526 stack size must be specified in PeriodicSmiEnable() for this function to be 527 527 used. … … 573 573 if (SetJumpFlag == 0) { 574 574 // 575 // The in tial call to SetJump() always returns 0.575 // The initial call to SetJump() always returns 0. 576 576 // If this is the initial call, then exit the current periodic SMI handler 577 577 // … … 589 589 590 590 // 591 // Return the amount elapsed time that occur ed while yielded591 // Return the amount elapsed time that occurred while yielded 592 592 // 593 593 return PeriodicSmiLibraryHandler->ElapsedTime; … … 621 621 // Dispatch the registered handler passing in the context that was registered 622 622 // and the amount of time that has elapsed since the previous time this 623 // periodic SMI handler was dispa cthed.623 // periodic SMI handler was dispatched. 624 624 // 625 625 PeriodicSmiLibraryHandler->DispatchFunction ( … … 629 629 630 630 // 631 // If this DispatchFunction() returns, then unconditi ally call PeriodicSmiExit()631 // If this DispatchFunction() returns, then unconditionally call PeriodicSmiExit() 632 632 // to perform a LongJump() back to PeriodicSmiDispatchFunctionOnCpu(). The 633 // LongJump() will resume exec tion on the original stack.633 // LongJump() will resume execution on the original stack. 634 634 // 635 635 PeriodicSmiExit (); … … 638 638 /** 639 639 Internal worker function that transfers control to an enabled periodic SMI 640 handler on the specified logi al CPU. This function determines if the periodic640 handler on the specified logical CPU. This function determines if the periodic 641 641 SMI handler yielded and needs to be resumed. It also and switches to an 642 642 allocated stack if one was allocated in PeriodicSmiEnable(). … … 653 653 { 654 654 // 655 // Save context in DispatchJumpBuffer. The in tial call to SetJump() always655 // Save context in DispatchJumpBuffer. The initial call to SetJump() always 656 656 // returns 0. If this is the initial call, then either resume from a prior 657 // call to PeriodicSmiYield() or call the DispatchFunction register d in657 // call to PeriodicSmiYield() or call the DispatchFunction registered in 658 658 // PeriodicSmiEnable() using an allocated stack if one was specified. 659 659 // … … 680 680 // If Stack is NULL then call DispatchFunction using current stack passing 681 681 // in the context that was registered and the amount of time that has 682 // elapsed since the previous time this periodic SMI handler was dispa cthed.682 // elapsed since the previous time this periodic SMI handler was dispatched. 683 683 // 684 684 PeriodicSmiLibraryHandler->DispatchFunction ( … … 688 688 689 689 // 690 // If this DispatchFunction() returns, then unconditi ally call PeriodicSmiExit()690 // If this DispatchFunction() returns, then unconditionally call PeriodicSmiExit() 691 691 // to perform a LongJump() back to this function. 692 692 // … … 713 713 /** 714 714 Internal worker function that transfers control to an enabled periodic SMI 715 handler on the specified logi al CPU. This worker function is only called715 handler on the specified logical CPU. This worker function is only called 716 716 using the SMM Services Table function SmmStartupThisAp() to execute the 717 717 periodic SMI handler on a logical CPU that is different than the one that is … … 737 737 738 738 // 739 // Execute dispatch function on the currently ex cuting logical CPU739 // Execute dispatch function on the currently executing logical CPU 740 740 // 741 741 PeriodicSmiDispatchFunctionOnCpu (PeriodicSmiLibraryHandler); … … 806 806 // 807 807 // Dispatch on the currently execution CPU if the CPU specified in PeriodicSmiEnable() 808 // was PERIODIC_SMI_LIB ARRY_ANY_CPU or the currently executing CPU matches the CPU808 // was PERIODIC_SMI_LIBRARY_ANY_CPU or the currently executing CPU matches the CPU 809 809 // that was specified in PeriodicSmiEnable(). 810 810 // … … 868 868 @param[in] Context Optional content to pass into DispatchFunction. 869 869 @param[in] TickPeriod The requested tick period in 100ns units that 870 control should be giv ien to the periodic SMI870 control should be given to the periodic SMI 871 871 handler. Must be one of the supported values 872 872 returned by PeriodicSmiSupportedPickPeriod(). … … 892 892 periodic SMI handler. 893 893 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the 894 stack spe ficied by StackSize.894 stack specified by StackSize. 895 895 @retval EFI_SUCCESS The periodic SMI handler was enabled. 896 896 … … 1078 1078 // 1079 1079 // Count the number of periodic SMI tick intervals that the SMM Periodic Timer 1080 // Di patch 2 Protocol supports.1080 // Dispatch 2 Protocol supports. 1081 1081 // 1082 1082 SmiTickInterval = NULL; -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c
r80721 r85718 37 37 // Retrieve SMM Base2 Protocol, Do not use gBS from UefiBootServicesTableLib on purpose 38 38 // to prevent inclusion of gBS, gST, and gImageHandle from SMM Drivers unless the 39 // SMM driver explicit y declares that dependency.39 // SMM driver explicitly declares that dependency. 40 40 // 41 41 Status = SystemTable->BootServices->LocateProtocol ( -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
r80721 r85718 105 105 // 106 106 if (BaseListMarker == NULL) { 107 UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH,Format, VaListMarker);107 UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, VaListMarker); 108 108 } else { 109 UnicodeBSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH,Format, BaseListMarker);109 UnicodeBSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, BaseListMarker); 110 110 } 111 111 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiDebugLibConOut/DebugLibConstructor.c
r80721 r85718 65 65 mDebugST = SystemTable; 66 66 67 SystemTable->BootServices->CreateEvent Ex(68 EVT_ NOTIFY_SIGNAL,67 SystemTable->BootServices->CreateEvent ( 68 EVT_SIGNAL_EXIT_BOOT_SERVICES, 69 69 TPL_NOTIFY, 70 70 ExitBootServicesCallback, 71 71 NULL, 72 &gEfiEventExitBootServicesGuid,73 72 &mExitBootServicesEvent 74 73 ); -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
r80721 r85718 47 47 DebugPrintErrorLevelLib 48 48 49 [Guids]50 gEfiEventExitBootServicesGuid ## CONSUMES51 52 49 [Pcd] 53 50 gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c
r80721 r85718 65 65 mDebugBS = SystemTable->BootServices; 66 66 67 mDebugBS->CreateEvent Ex(68 EVT_ NOTIFY_SIGNAL,67 mDebugBS->CreateEvent ( 68 EVT_SIGNAL_EXIT_BOOT_SERVICES, 69 69 TPL_NOTIFY, 70 70 ExitBootServicesCallback, 71 71 NULL, 72 &gEfiEventExitBootServicesGuid,73 72 &mExitBootServicesEvent 74 73 ); -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf
r80721 r85718 47 47 DebugPrintErrorLevelLib 48 48 49 [Guids]50 gEfiEventExitBootServicesGuid ## CONSUMES51 52 49 [Protocols] 53 50 gEfiDebugPortProtocolGuid ## CONSUMES -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
r80721 r85718 107 107 // 108 108 if (BaseListMarker == NULL) { 109 UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, VaListMarker);109 UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, VaListMarker); 110 110 } else { 111 UnicodeBSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, BaseListMarker);111 UnicodeBSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, BaseListMarker); 112 112 } 113 113 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c
r80721 r85718 65 65 mDebugST = SystemTable; 66 66 67 SystemTable->BootServices->CreateEvent Ex(68 EVT_ NOTIFY_SIGNAL,67 SystemTable->BootServices->CreateEvent ( 68 EVT_SIGNAL_EXIT_BOOT_SERVICES, 69 69 TPL_NOTIFY, 70 70 ExitBootServicesCallback, 71 71 NULL, 72 &gEfiEventExitBootServicesGuid,73 72 &mExitBootServicesEvent 74 73 ); -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
r80721 r85718 45 45 DebugPrintErrorLevelLib 46 46 47 [Guids]48 gEfiEventExitBootServicesGuid ## CONSUMES49 50 47 [Pcd] 51 48 gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
r80721 r85718 69 69 // 70 70 FileInfo = AllocateZeroPool(FileInfoSize); 71 // 72 // now get the information 73 // 74 Status = FileHandle->GetInfo(FileHandle, 75 &gEfiFileInfoGuid, 76 &FileInfoSize, 77 FileInfo); 78 // 79 // if we got an error free the memory and return NULL 80 // 81 if (EFI_ERROR(Status) && (FileInfo != NULL)) { 82 FreePool(FileInfo); 83 FileInfo = NULL; 71 if (FileInfo != NULL) { 72 // 73 // now get the information 74 // 75 Status = FileHandle->GetInfo(FileHandle, 76 &gEfiFileInfoGuid, 77 &FileInfoSize, 78 FileInfo); 79 // 80 // if we got an error free the memory and return NULL 81 // 82 if (EFI_ERROR(Status)) { 83 FreePool(FileInfo); 84 FileInfo = NULL; 85 } 84 86 } 85 87 } … … 816 818 } else { 817 819 // 820 // Prepare to move to the parent directory. 821 // Also determine whether CurrentHandle refers to the Root directory. 822 // 823 Status = CurrentHandle->Open (CurrentHandle, &NextHigherHandle, L"..", EFI_FILE_MODE_READ, 0); 824 // 818 825 // We got info... do we have a name? if yes precede the current path with it... 819 826 // 820 if (StrLen (FileInfo->FileName) == 0) { 827 if ((StrLen (FileInfo->FileName) == 0) || EFI_ERROR (Status)) { 828 // 829 // Both FileInfo->FileName being '\0' and EFI_ERROR() suggest that 830 // CurrentHandle refers to the Root directory. As this loop ensures 831 // FullFileName is starting with '\\' at all times, signal success 832 // and exit the loop. 833 // While FileInfo->FileName could theoretically be a value other than 834 // '\0' or '\\', '\\' is guaranteed to be supported by the 835 // specification and hence its value can safely be ignored. 836 // 837 Status = EFI_SUCCESS; 821 838 if (*FullFileName == NULL) { 822 839 ASSERT((*FullFileName == NULL && Size == 0) || (*FullFileName != NULL)); … … 836 853 } 837 854 } 855 856 FileHandleClose(CurrentHandle); 838 857 // 839 858 // Move to the parent directory 840 859 // 841 Status = CurrentHandle->Open (CurrentHandle, &NextHigherHandle, L"..", EFI_FILE_MODE_READ, 0);842 if (EFI_ERROR (Status)) {843 break;844 }845 846 FileHandleClose(CurrentHandle);847 860 CurrentHandle = NextHigherHandle; 848 861 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiLib/UefiLib.c
r80721 r85718 639 639 FreePool (OpenInfoBuffer); 640 640 return Status; 641 } 642 643 /** 644 This function checks the supported languages list for a target language, 645 This only supports RFC 4646 Languages. 646 647 @param SupportedLanguages The supported languages 648 @param TargetLanguage The target language 649 650 @retval Returns EFI_SUCCESS if the language is supported, 651 EFI_UNSUPPORTED otherwise 652 **/ 653 EFI_STATUS 654 EFIAPI 655 IsLanguageSupported ( 656 IN CONST CHAR8 *SupportedLanguages, 657 IN CONST CHAR8 *TargetLanguage 658 ) 659 { 660 UINTN Index; 661 while (*SupportedLanguages != 0) { 662 for (Index = 0; SupportedLanguages[Index] != 0 && SupportedLanguages[Index] != ';'; Index++); 663 if ((AsciiStrnCmp(SupportedLanguages, TargetLanguage, Index) == 0) && (TargetLanguage[Index] == 0)) { 664 return EFI_SUCCESS; 665 } 666 SupportedLanguages += Index; 667 for (; *SupportedLanguages != 0 && *SupportedLanguages == ';'; SupportedLanguages++); 668 } 669 670 return EFI_UNSUPPORTED; 641 671 } 642 672 … … 801 831 // 802 832 Found = FALSE; 803 while (*SupportedLanguages != 0) {804 if (Iso639Language) {833 if (Iso639Language) { 834 while (*SupportedLanguages != 0) { 805 835 if (CompareIso639LanguageCode (Language, SupportedLanguages)) { 806 836 Found = TRUE; … … 808 838 } 809 839 SupportedLanguages += 3; 810 } else {811 for (Index = 0; SupportedLanguages[Index] != 0 && SupportedLanguages[Index] != ';'; Index++);812 if ((AsciiStrnCmp(SupportedLanguages, Language, Index) == 0) && (Language[Index] == 0)) {813 Found = TRUE;814 break;815 }816 SupportedLanguages += Index;817 for (; *SupportedLanguages != 0 && *SupportedLanguages == ';'; SupportedLanguages++);818 840 } 819 } 841 } else { 842 Found = !IsLanguageSupported(Language, SupportedLanguages); 843 } 844 820 845 821 846 // … … 1100 1125 // 1101 1126 Found = FALSE; 1102 while (*SupportedLanguages != 0) {1103 if (Iso639Language) {1127 if (Iso639Language) { 1128 while (*SupportedLanguages != 0) { 1104 1129 if (CompareIso639LanguageCode (Language, SupportedLanguages)) { 1105 1130 Found = TRUE; … … 1107 1132 } 1108 1133 SupportedLanguages += 3; 1109 } else {1110 for (Index = 0; SupportedLanguages[Index] != 0 && SupportedLanguages[Index] != ';'; Index++);1111 if (AsciiStrnCmp(SupportedLanguages, Language, Index) == 0) {1112 Found = TRUE;1113 break;1114 }1115 SupportedLanguages += Index;1116 for (; *SupportedLanguages != 0 && *SupportedLanguages == ';'; SupportedLanguages++);1117 1134 } 1118 } 1119 1135 } else { 1136 Found = !IsLanguageSupported(Language, SupportedLanguages); 1137 } 1120 1138 // 1121 1139 // If Language is not a member of SupportedLanguages, then return EFI_UNSUPPORTED -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
r80721 r85718 94 94 // Register SetVirtualAddressMap () notify function 95 95 // 96 Status = gBS->CreateEvent Ex(97 EVT_ NOTIFY_SIGNAL,96 Status = gBS->CreateEvent ( 97 EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, 98 98 TPL_NOTIFY, 99 99 RuntimeLibVirtualNotifyEvent, 100 100 NULL, 101 &gEfiEventVirtualAddressChangeGuid,102 101 &mEfiVirtualNotifyEvent 103 102 ); … … 105 104 ASSERT_EFI_ERROR (Status); 106 105 107 Status = gBS->CreateEvent Ex(108 EVT_ NOTIFY_SIGNAL,106 Status = gBS->CreateEvent ( 107 EVT_SIGNAL_EXIT_BOOT_SERVICES, 109 108 TPL_NOTIFY, 110 109 RuntimeLibExitBootServicesEvent, 111 110 NULL, 112 &gEfiEventExitBootServicesGuid,113 111 &mEfiExitBootServicesEvent 114 112 ); -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
r80721 r85718 40 40 UefiRuntimeServicesTableLib 41 41 DebugLib 42 43 [Guids]44 gEfiEventExitBootServicesGuid ## CONSUMES ## Event45 gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event46 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiScsiLib/UefiScsiLib.c
r80721 r85718 2 2 UEFI SCSI Library implementation 3 3 4 Copyright (c) 2006 - 20 18, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR> 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 … … 24 24 #define EFI_SCSI_OP_LENGTH_SIX 0x6 25 25 #define EFI_SCSI_OP_LENGTH_TEN 0xa 26 #define EFI_SCSI_OP_LENGTH_TWELVE 0xc 26 27 #define EFI_SCSI_OP_LENGTH_SIXTEEN 0x10 27 28 … … 1055 1056 ZeroMem (Cdb, EFI_SCSI_OP_LENGTH_TEN); 1056 1057 1057 CommandPacket.Timeout = Timeout;1058 CommandPacket.OutDataBuffer = DataBuffer;1059 CommandPacket.SenseData = SenseData;1060 CommandPacket.OutTransferLength = *DataLength;1061 CommandPacket.Cdb = Cdb;1058 CommandPacket.Timeout = Timeout; 1059 CommandPacket.OutDataBuffer = DataBuffer; 1060 CommandPacket.SenseData = SenseData; 1061 CommandPacket.OutTransferLength = *DataLength; 1062 CommandPacket.Cdb = Cdb; 1062 1063 // 1063 1064 // Fill Cdb for Write (10) Command 1064 1065 // 1065 1066 Cdb[0] = EFI_SCSI_OP_WRITE10; 1067 Cdb[1] = EFI_SCSI_BLOCK_FUA; 1066 1068 WriteUnaligned32 ((UINT32 *)&Cdb[2], SwapBytes32 (StartLba)); 1067 1069 WriteUnaligned16 ((UINT16 *)&Cdb[7], SwapBytes16 ((UINT16) SectorSize)); … … 1263 1265 // 1264 1266 Cdb[0] = EFI_SCSI_OP_WRITE16; 1267 Cdb[1] = EFI_SCSI_BLOCK_FUA; 1265 1268 WriteUnaligned64 ((UINT64 *)&Cdb[2], SwapBytes64 (StartLba)); 1266 1269 WriteUnaligned32 ((UINT32 *)&Cdb[10], SwapBytes32 (SectorSize)); … … 1276 1279 *SenseDataLength = CommandPacket.SenseDataLength; 1277 1280 *DataLength = CommandPacket.OutTransferLength; 1281 1282 return Status; 1283 } 1284 1285 1286 /** 1287 Execute Security Protocol In SCSI command on a specific SCSI target. 1288 1289 Executes the SCSI Security Protocol In command on the SCSI target specified by ScsiIo. 1290 If Timeout is zero, then this function waits indefinitely for the command to complete. 1291 If Timeout is greater than zero, then the command is executed and will timeout after 1292 Timeout 100 ns units. 1293 If ScsiIo is NULL, then ASSERT(). 1294 If SenseDataLength is NULL, then ASSERT(). 1295 If HostAdapterStatus is NULL, then ASSERT(). 1296 If TargetStatus is NULL, then ASSERT(). 1297 If TransferLength is NULL, then ASSERT(). 1298 1299 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer 1300 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER 1301 gets returned. 1302 1303 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer 1304 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER 1305 gets returned. 1306 1307 @param[in] ScsiIo SCSI IO Protocol to use. 1308 @param[in] Timeout The length of timeout period. 1309 @param[in, out] SenseData A pointer to output sense data. 1310 @param[in, out] SenseDataLength The length of output sense data. 1311 @param[out] HostAdapterStatus The status of Host Adapter. 1312 @param[out] TargetStatus The status of the target. 1313 @param[in] SecurityProtocol The Security Protocol to use. 1314 @param[in] SecurityProtocolSpecific The Security Protocol Specific data. 1315 @param[in] Inc512 If TRUE, 512 increment (INC_512) bit will be set for the 1316 SECURITY PROTOCOL IN command. 1317 @param[in] DataLength The size in bytes of the data buffer. 1318 @param[in, out] DataBuffer A pointer to a data buffer. 1319 @param[out] TransferLength A pointer to a buffer to store the size in 1320 bytes of the data written to the data buffer. 1321 1322 @retval EFI_SUCCESS Command is executed successfully. 1323 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could 1324 not be transferred. The actual number of bytes transferred is returned in TransferLength. 1325 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 1326 SCSI Command Packets already queued. 1327 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet. 1328 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 1329 the SCSI initiator(i.e., SCSI Host Controller) 1330 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute. 1331 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid. 1332 1333 **/ 1334 EFI_STATUS 1335 EFIAPI 1336 ScsiSecurityProtocolInCommand ( 1337 IN EFI_SCSI_IO_PROTOCOL *ScsiIo, 1338 IN UINT64 Timeout, 1339 IN OUT VOID *SenseData, OPTIONAL 1340 IN OUT UINT8 *SenseDataLength, 1341 OUT UINT8 *HostAdapterStatus, 1342 OUT UINT8 *TargetStatus, 1343 IN UINT8 SecurityProtocol, 1344 IN UINT16 SecurityProtocolSpecific, 1345 IN BOOLEAN Inc512, 1346 IN UINTN DataLength, 1347 IN OUT VOID *DataBuffer, OPTIONAL 1348 OUT UINTN *TransferLength 1349 ) 1350 { 1351 EFI_SCSI_IO_SCSI_REQUEST_PACKET CommandPacket; 1352 EFI_STATUS Status; 1353 UINT8 Cdb[EFI_SCSI_OP_LENGTH_TWELVE]; 1354 1355 ASSERT (SenseDataLength != NULL); 1356 ASSERT (HostAdapterStatus != NULL); 1357 ASSERT (TargetStatus != NULL); 1358 ASSERT (ScsiIo != NULL); 1359 ASSERT (TransferLength != NULL); 1360 ASSERT (DataLength <= MAX_UINT32); 1361 1362 ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET)); 1363 ZeroMem (Cdb, EFI_SCSI_OP_LENGTH_TWELVE); 1364 1365 CommandPacket.Timeout = Timeout; 1366 CommandPacket.InDataBuffer = DataBuffer; 1367 CommandPacket.SenseData = SenseData; 1368 CommandPacket.InTransferLength = (UINT32) DataLength; 1369 CommandPacket.Cdb = Cdb; 1370 // 1371 // Fill Cdb for Security Protocol In Command 1372 // 1373 Cdb[0] = EFI_SCSI_OP_SECURITY_PROTOCOL_IN; 1374 Cdb[1] = SecurityProtocol; 1375 WriteUnaligned16 ((UINT16 *)&Cdb[2], SwapBytes16 (SecurityProtocolSpecific)); 1376 1377 if (Inc512) { 1378 if (DataLength % 512 != 0) { 1379 return EFI_INVALID_PARAMETER; 1380 } 1381 Cdb[4] = BIT7; 1382 WriteUnaligned32 ((UINT32 *)&Cdb[6], SwapBytes32 ((UINT32) DataLength / 512)); 1383 } else { 1384 WriteUnaligned32 ((UINT32 *)&Cdb[6], SwapBytes32 ((UINT32) DataLength)); 1385 } 1386 1387 CommandPacket.CdbLength = EFI_SCSI_OP_LENGTH_TWELVE; 1388 CommandPacket.DataDirection = EFI_SCSI_DATA_IN; 1389 CommandPacket.SenseDataLength = *SenseDataLength; 1390 1391 Status = ScsiIo->ExecuteScsiCommand (ScsiIo, &CommandPacket, NULL); 1392 1393 *HostAdapterStatus = CommandPacket.HostAdapterStatus; 1394 *TargetStatus = CommandPacket.TargetStatus; 1395 *SenseDataLength = CommandPacket.SenseDataLength; 1396 *TransferLength = (UINTN) CommandPacket.InTransferLength; 1397 1398 return Status; 1399 } 1400 1401 1402 /** 1403 Execute Security Protocol Out SCSI command on a specific SCSI target. 1404 1405 Executes the SCSI Security Protocol Out command on the SCSI target specified by ScsiIo. 1406 If Timeout is zero, then this function waits indefinitely for the command to complete. 1407 If Timeout is greater than zero, then the command is executed and will timeout after 1408 Timeout 100 ns units. 1409 If ScsiIo is NULL, then ASSERT(). 1410 If SenseDataLength is NULL, then ASSERT(). 1411 If HostAdapterStatus is NULL, then ASSERT(). 1412 If TargetStatus is NULL, then ASSERT(). 1413 1414 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer 1415 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER 1416 gets returned. 1417 1418 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer 1419 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER 1420 gets returned. 1421 1422 @param[in] ScsiIo SCSI IO Protocol to use. 1423 @param[in] Timeout The length of timeout period. 1424 @param[in, out] SenseData A pointer to output sense data. 1425 @param[in, out] SenseDataLength The length of output sense data. 1426 @param[out] HostAdapterStatus The status of Host Adapter. 1427 @param[out] TargetStatus The status of the target. 1428 @param[in] SecurityProtocol The Security Protocol to use. 1429 @param[in] SecurityProtocolSpecific The Security Protocol Specific data. 1430 @param[in] Inc512 If TRUE, 512 increment (INC_512) bit will be set for the 1431 SECURITY PROTOCOL OUT command. 1432 @param[in] DataLength The size in bytes of the transfer data. 1433 @param[in, out] DataBuffer A pointer to a data buffer. 1434 1435 @retval EFI_SUCCESS Command is executed successfully. 1436 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could 1437 not be transferred. The actual number of bytes transferred is returned in DataLength. 1438 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 1439 SCSI Command Packets already queued. 1440 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet. 1441 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 1442 the SCSI initiator(i.e., SCSI Host Controller) 1443 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute. 1444 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid. 1445 1446 **/ 1447 EFI_STATUS 1448 EFIAPI 1449 ScsiSecurityProtocolOutCommand ( 1450 IN EFI_SCSI_IO_PROTOCOL *ScsiIo, 1451 IN UINT64 Timeout, 1452 IN OUT VOID *SenseData, OPTIONAL 1453 IN OUT UINT8 *SenseDataLength, 1454 OUT UINT8 *HostAdapterStatus, 1455 OUT UINT8 *TargetStatus, 1456 IN UINT8 SecurityProtocol, 1457 IN UINT16 SecurityProtocolSpecific, 1458 IN BOOLEAN Inc512, 1459 IN UINTN DataLength, 1460 IN OUT VOID *DataBuffer OPTIONAL 1461 ) 1462 { 1463 EFI_SCSI_IO_SCSI_REQUEST_PACKET CommandPacket; 1464 EFI_STATUS Status; 1465 UINT8 Cdb[EFI_SCSI_OP_LENGTH_TWELVE]; 1466 1467 ASSERT (SenseDataLength != NULL); 1468 ASSERT (HostAdapterStatus != NULL); 1469 ASSERT (TargetStatus != NULL); 1470 ASSERT (ScsiIo != NULL); 1471 ASSERT (DataLength <= MAX_UINT32); 1472 1473 ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET)); 1474 ZeroMem (Cdb, EFI_SCSI_OP_LENGTH_TWELVE); 1475 1476 CommandPacket.Timeout = Timeout; 1477 CommandPacket.OutDataBuffer = DataBuffer; 1478 CommandPacket.SenseData = SenseData; 1479 CommandPacket.OutTransferLength = (UINT32) DataLength; 1480 CommandPacket.Cdb = Cdb; 1481 // 1482 // Fill Cdb for Security Protocol Out Command 1483 // 1484 Cdb[0] = EFI_SCSI_OP_SECURITY_PROTOCOL_OUT; 1485 Cdb[1] = SecurityProtocol; 1486 WriteUnaligned16 ((UINT16 *)&Cdb[2], SwapBytes16 (SecurityProtocolSpecific)); 1487 1488 if (Inc512) { 1489 if (DataLength % 512 != 0) { 1490 return EFI_INVALID_PARAMETER; 1491 } 1492 Cdb[4] = BIT7; 1493 WriteUnaligned32 ((UINT32 *)&Cdb[6], SwapBytes32 ((UINT32) DataLength / 512)); 1494 } else { 1495 WriteUnaligned32 ((UINT32 *)&Cdb[6], SwapBytes32 ((UINT32) DataLength)); 1496 } 1497 1498 CommandPacket.CdbLength = EFI_SCSI_OP_LENGTH_TWELVE; 1499 CommandPacket.DataDirection = EFI_SCSI_DATA_OUT; 1500 CommandPacket.SenseDataLength = *SenseDataLength; 1501 1502 Status = ScsiIo->ExecuteScsiCommand (ScsiIo, &CommandPacket, NULL); 1503 1504 *HostAdapterStatus = CommandPacket.HostAdapterStatus; 1505 *TargetStatus = CommandPacket.TargetStatus; 1506 *SenseDataLength = CommandPacket.SenseDataLength; 1278 1507 1279 1508 return Status;
Note:
See TracChangeset
for help on using the changeset viewer.