Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103777
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 347 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCacheMaintenanceLib/ArmCache.c
r48674 r58466 1 1 /** @file 2 Cache Maintenance Functions. These functions vary by ARM architecture so the MdePkg 3 versions are null functions used to make sure things will compile. 2 Cache Maintenance Functions. These functions vary by ARM architecture so the MdePkg 3 versions are null functions used to make sure things will compile. 4 4 5 5 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
r58459 r58466 25 25 MODULE_TYPE = BASE 26 26 VERSION_STRING = 1.0 27 LIBRARY_CLASS = CacheMaintenanceLib 27 LIBRARY_CLASS = CacheMaintenanceLib 28 28 29 29 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c
r48674 r58466 195 195 { 196 196 // 197 // Invalidation of the entire data cache without writing back is not supported 197 // Invalidation of the entire data cache without writing back is not supported 198 198 // on IPF architecture, so a write back and invalidate operation is performed. 199 199 // -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c
r58459 r58466 141 141 // 142 142 // Calculate the cache line alignment 143 // 143 // 144 144 End = (Start + Length + (CACHE_LINE_SIZE - 1)) & ~(CACHE_LINE_SIZE - 1); 145 145 Start &= ~((UINTN) CACHE_LINE_SIZE - 1); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCpuLib/Arm/CpuFlushTlb.S
r48674 r58466 1 #------------------------------------------------------------------------------ 1 #------------------------------------------------------------------------------ 2 2 # 3 3 # CpuFlushTlb() for ARM -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCpuLib/Arm/CpuFlushTlb.asm
r48674 r58466 1 ;------------------------------------------------------------------------------ 1 ;------------------------------------------------------------------------------ 2 2 ; 3 3 ; CpuFlushTlb() for ARM … … 30 30 ; ); 31 31 ; 32 CpuFlushTlb 32 CpuFlushTlb 33 33 MOV r0,#0 34 34 MCR p15,0,r0,c8,c5,0 ;Invalidate all the unlocked entried in TLB -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S
r48674 r58466 1 #------------------------------------------------------------------------------ 1 #------------------------------------------------------------------------------ 2 2 # 3 3 # CpuSleep() for ARMv7 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm
r48674 r58466 1 ;------------------------------------------------------------------------------ 1 ;------------------------------------------------------------------------------ 2 2 ; 3 3 ; CpuSleep() for ARMv7 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
r58459 r58466 26 26 MODULE_TYPE = BASE 27 27 VERSION_STRING = 1.0 28 LIBRARY_CLASS = CpuLib 28 LIBRARY_CLASS = CpuLib 29 29 30 30 … … 34 34 35 35 [Sources.IA32] 36 Ia32/CpuSleep.c | MSFT 37 Ia32/CpuFlushTlb.c | MSFT 36 Ia32/CpuSleep.c | MSFT 37 Ia32/CpuFlushTlb.c | MSFT 38 38 39 Ia32/CpuSleep.asm | INTEL 40 Ia32/CpuFlushTlb.asm | INTEL 39 Ia32/CpuSleep.asm | INTEL 40 Ia32/CpuFlushTlb.asm | INTEL 41 41 42 Ia32/CpuSleepGcc.c | GCC 43 Ia32/CpuFlushTlbGcc.c | GCC 42 Ia32/CpuSleepGcc.c | GCC 43 Ia32/CpuFlushTlbGcc.c | GCC 44 44 45 45 [Sources.X64] 46 X64/CpuFlushTlb.asm 46 X64/CpuFlushTlb.asm 47 47 X64/CpuSleep.asm 48 48 49 X64/CpuSleep.S | GCC 50 X64/CpuFlushTlb.S | GCC 49 X64/CpuSleep.S | GCC 50 X64/CpuFlushTlb.S | GCC 51 51 52 52 [Sources.IPF] … … 59 59 [Sources.ARM] 60 60 Arm/CpuFlushTlb.asm | RVCT 61 Arm/CpuSleep.asm | RVCT 61 Arm/CpuSleep.asm | RVCT 62 62 Arm/CpuFlushTlb.S | GCC 63 Arm/CpuSleep.S | GCC 63 Arm/CpuSleep.S | GCC 64 64 65 65 [Sources.AARCH64] -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.S
r48674 r58466 1 #------------------------------------------------------------------------------ 1 #------------------------------------------------------------------------------ 2 2 # Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> 3 3 # This program and the accompanying materials -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
r58459 r58466 21 21 MODULE_TYPE = BASE 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = DebugLib 23 LIBRARY_CLASS = DebugLib 24 24 25 25 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseDebugLibNull/DebugLib.c
r58459 r58466 19 19 Prints a debug message to the debug output device if the specified error level is enabled. 20 20 21 If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function 22 GetDebugPrintErrorLevel (), then print the message specified by Format and the 21 If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function 22 GetDebugPrintErrorLevel (), then print the message specified by Format and the 23 23 associated variable argument list to the debug output device. 24 24 … … 27 27 @param ErrorLevel The error level of the debug message. 28 28 @param Format Format string for the debug message to print. 29 @param ... Variable argument list whose contents are accessed 29 @param ... Variable argument list whose contents are accessed 30 30 based on the format string specified by Format. 31 31 … … 43 43 44 44 /** 45 Prints an assert message containing a filename, line number, and description. 45 Prints an assert message containing a filename, line number, and description. 46 46 This may be followed by a breakpoint or a dead loop. 47 47 48 48 Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" 49 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 50 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 51 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 52 CpuDeadLoop() is called. If neither of these bits are set, then this function 49 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 50 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 51 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 52 CpuDeadLoop() is called. If neither of these bits are set, then this function 53 53 returns immediately after the message is printed to the debug output device. 54 54 DebugAssert() must actively prevent recursion. If DebugAssert() is called while … … 77 77 Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer. 78 78 79 This function fills Length bytes of Buffer with the value specified by 79 This function fills Length bytes of Buffer with the value specified by 80 80 PcdDebugClearMemoryValue, and returns Buffer. 81 81 82 82 If Buffer is NULL, then ASSERT(). 83 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 83 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 84 84 85 85 @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue. 86 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 86 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 87 87 88 88 @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue. … … 103 103 Returns TRUE if ASSERT() macros are enabled. 104 104 105 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 105 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 106 106 PcdDebugProperyMask is set. Otherwise FALSE is returned. 107 107 … … 120 120 121 121 122 /** 122 /** 123 123 Returns TRUE if DEBUG() macros are enabled. 124 124 125 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 125 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 126 126 PcdDebugProperyMask is set. Otherwise FALSE is returned. 127 127 … … 140 140 141 141 142 /** 142 /** 143 143 Returns TRUE if DEBUG_CODE() macros are enabled. 144 144 145 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 145 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 146 146 PcdDebugProperyMask is set. Otherwise FALSE is returned. 147 147 … … 160 160 161 161 162 /** 162 /** 163 163 Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled. 164 164 165 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 165 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 166 166 PcdDebugProperyMask is set. Otherwise FALSE is returned. 167 167 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
r58459 r58466 22 22 MODULE_TYPE = BASE 23 23 VERSION_STRING = 1.0 24 LIBRARY_CLASS = DebugLib 24 LIBRARY_CLASS = DebugLib 25 25 CONSTRUCTOR = BaseDebugLibSerialPortConstructor 26 26 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
r58459 r58466 2 2 Base Debug library instance base on Serial Port library. 3 3 It uses PrintLib to send debug messages to serial port device. 4 5 NOTE: If the Serial Port library enables hardware flow control, then a call 6 to DebugPrint() or DebugAssert() may hang if writes to the serial port are 4 5 NOTE: If the Serial Port library enables hardware flow control, then a call 6 to DebugPrint() or DebugAssert() may hang if writes to the serial port are 7 7 being blocked. This may occur if a key(s) are pressed in a terminal emulator 8 used to monitor the DEBUG() and ASSERT() messages. 8 used to monitor the DEBUG() and ASSERT() messages. 9 9 10 10 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> 11 This program and the accompanying materials 12 are licensed and made available under the terms and conditions of the BSD License 13 which accompanies this distribution. The full text of the license may be found at 14 http://opensource.org/licenses/bsd-license.php. 15 16 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 17 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 This program and the accompanying materials 12 are licensed and made available under the terms and conditions of the BSD License 13 which accompanies this distribution. The full text of the license may be found at 14 http://opensource.org/licenses/bsd-license.php. 15 16 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 17 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 18 18 19 19 **/ … … 29 29 30 30 // 31 // Define the maximum debug and assert message length that this library supports 31 // Define the maximum debug and assert message length that this library supports 32 32 // 33 33 #define MAX_DEBUG_MESSAGE_LENGTH 0x100 … … 51 51 Prints a debug message to the debug output device if the specified error level is enabled. 52 52 53 If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function 54 GetDebugPrintErrorLevel (), then print the message specified by Format and the 53 If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function 54 GetDebugPrintErrorLevel (), then print the message specified by Format and the 55 55 associated variable argument list to the debug output device. 56 56 … … 59 59 @param ErrorLevel The error level of the debug message. 60 60 @param Format Format string for the debug message to print. 61 @param ... Variable argument list whose contents are accessed 61 @param ... Variable argument list whose contents are accessed 62 62 based on the format string specified by Format. 63 63 … … 94 94 95 95 // 96 // Send the print string to a Serial Port 96 // Send the print string to a Serial Port 97 97 // 98 98 SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer)); … … 101 101 102 102 /** 103 Prints an assert message containing a filename, line number, and description. 103 Prints an assert message containing a filename, line number, and description. 104 104 This may be followed by a breakpoint or a dead loop. 105 105 106 106 Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" 107 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 108 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 109 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 110 CpuDeadLoop() is called. If neither of these bits are set, then this function 107 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 108 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 109 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 110 CpuDeadLoop() is called. If neither of these bits are set, then this function 111 111 returns immediately after the message is printed to the debug output device. 112 112 DebugAssert() must actively prevent recursion. If DebugAssert() is called while … … 155 155 Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer. 156 156 157 This function fills Length bytes of Buffer with the value specified by 157 This function fills Length bytes of Buffer with the value specified by 158 158 PcdDebugClearMemoryValue, and returns Buffer. 159 159 160 160 If Buffer is NULL, then ASSERT(). 161 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 161 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 162 162 163 163 @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue. 164 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 164 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 165 165 166 166 @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue. … … 189 189 Returns TRUE if ASSERT() macros are enabled. 190 190 191 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 191 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 192 192 PcdDebugProperyMask is set. Otherwise FALSE is returned. 193 193 … … 206 206 207 207 208 /** 208 /** 209 209 Returns TRUE if DEBUG() macros are enabled. 210 210 211 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 211 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 212 212 PcdDebugProperyMask is set. Otherwise FALSE is returned. 213 213 … … 226 226 227 227 228 /** 228 /** 229 229 Returns TRUE if DEBUG_CODE() macros are enabled. 230 230 231 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 231 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 232 232 PcdDebugProperyMask is set. Otherwise FALSE is returned. 233 233 … … 246 246 247 247 248 /** 248 /** 249 249 Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled. 250 250 251 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 251 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 252 252 PcdDebugProperyMask is set. Otherwise FALSE is returned. 253 253 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.c
r48674 r58466 1 1 /** @file 2 Debug Print Error Level library instance that retrieves the current error 3 level from PcdDebugPrintErrorLevel. This generic library instance does not 2 Debug Print Error Level library instance that retrieves the current error 3 level from PcdDebugPrintErrorLevel. This generic library instance does not 4 4 support the setting of the global debug print error level mask for the platform. 5 5 … … 39 39 /** 40 40 Sets the global debug print error level mask fpr the entire platform. 41 41 42 42 @param ErrorLevel Global debug print error level. 43 43 44 44 @retval TRUE The debug print error level mask was sucessfully set. 45 45 @retval FALSE The debug print error level mask could not be set. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
r58459 r58466 1 1 ## @file 2 2 # Debug Print Error Level library instance based on PcdDebugPrintErrorLevel. 3 # It retrieves the current error level from PcdDebugPrintErrorLevel. 3 # It retrieves the current error level from PcdDebugPrintErrorLevel. 4 4 # 5 5 # Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR> … … 35 35 [LibraryClasses] 36 36 PcdLib 37 37 38 38 [Pcd] 39 39 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel ## CONSUMES -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.c
r48674 r58466 31 31 32 32 /** 33 HandlerInfo table address is set by PcdGuidedExtractHandlerTableAddress, which is used to store 34 the registered guid and Handler list. When it is initialized, it will be directly returned. 33 HandlerInfo table address is set by PcdGuidedExtractHandlerTableAddress, which is used to store 34 the registered guid and Handler list. When it is initialized, it will be directly returned. 35 35 Or, HandlerInfo table will be initialized in this function. 36 36 … … 46 46 { 47 47 EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo; 48 48 49 49 // 50 50 // Set the available memory address to handler info. … … 85 85 HandlerInfo->ExtractHandlerGuidTable = (GUID *) (HandlerInfo + 1); 86 86 HandlerInfo->ExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *) ( 87 (UINT8 *)HandlerInfo->ExtractHandlerGuidTable + 87 (UINT8 *)HandlerInfo->ExtractHandlerGuidTable + 88 88 PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (GUID) 89 89 ); 90 90 HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) ( 91 (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + 92 PcdGet32 (PcdMaximumGuidedExtractHandler) * 91 (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + 92 PcdGet32 (PcdMaximumGuidedExtractHandler) * 93 93 sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER) 94 94 ); … … 102 102 Sets ExtractHandlerGuidTable so it points at a callee allocated array of registered GUIDs. 103 103 The total number of GUIDs in the array are returned. Since the array of GUIDs is callee allocated 104 and caller must treat this array of GUIDs as read-only data. 104 and caller must treat this array of GUIDs as read-only data. 105 105 If ExtractHandlerGuidTable is NULL, then ASSERT(). 106 106 … … 146 146 If the GUID value specified by SectionGuid has already been registered, then return RETURN_ALREADY_STARTED. 147 147 If there are not enough resources available to register the handlers then RETURN_OUT_OF_RESOURCES is returned. 148 148 149 149 If SectionGuid is NULL, then ASSERT(). 150 150 If GetInfoHandler is NULL, then ASSERT(). … … 157 157 required to actually decode the data in a GUIDed section. 158 158 @param[in] DecodeHandler The pointer to a function that decodes a GUIDed section into a caller 159 allocated output buffer. 159 allocated output buffer. 160 160 161 161 @retval RETURN_SUCCESS The handlers were registered. … … 211 211 return RETURN_OUT_OF_RESOURCES; 212 212 } 213 213 214 214 // 215 215 // Register new Handler and guid value. … … 228 228 optional scratch buffer required to actually decode the data in a GUIDed section. 229 229 230 Examines a GUIDed section specified by InputSection. 230 Examines a GUIDed section specified by InputSection. 231 231 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(), 232 then RETURN_UNSUPPORTED is returned. 233 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler 232 then RETURN_UNSUPPORTED is returned. 233 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler 234 234 of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers() 235 235 is used to retrieve the OututBufferSize, ScratchSize, and Attributes values. The return status from the handler of 236 236 type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER is returned. 237 237 238 238 If InputSection is NULL, then ASSERT(). 239 239 If OutputBufferSize is NULL, then ASSERT(). … … 262 262 OUT UINT32 *OutputBufferSize, 263 263 OUT UINT32 *ScratchBufferSize, 264 OUT UINT16 *SectionAttribute 264 OUT UINT16 *SectionAttribute 265 265 ) 266 266 { … … 269 269 EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo; 270 270 EFI_GUID *SectionDefinitionGuid; 271 271 272 272 // 273 273 // Check input paramter … … 311 311 312 312 // 313 // Not found, the input guided section is not supported. 313 // Not found, the input guided section is not supported. 314 314 // 315 315 return RETURN_UNSUPPORTED; … … 322 322 allocated output buffer. 323 323 324 Decodes the GUIDed section specified by InputSection. 324 Decodes the GUIDed section specified by InputSection. 325 325 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(), 326 then RETURN_UNSUPPORTED is returned. 326 then RETURN_UNSUPPORTED is returned. 327 327 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler 328 328 of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers() … … 331 331 then OutputBuffer is set to point at the data in InputSection. Otherwise, the decoded data will be placed in a caller 332 332 allocated buffer specified by OutputBuffer. This function is responsible for computing the EFI_AUTH_STATUS_PLATFORM_OVERRIDE 333 bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned. 334 333 bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned. 334 335 335 If InputSection is NULL, then ASSERT(). 336 336 If OutputBuffer is NULL, then ASSERT(). 337 337 If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT(). 338 If AuthenticationStatus is NULL, then ASSERT(). 338 If AuthenticationStatus is NULL, then ASSERT(). 339 339 340 340 @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file. 341 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 342 @param[in] ScratchBuffer A caller allocated buffer that may be required by this function as a scratch buffer to perform the decode operation. 343 @param[out] AuthenticationStatus 341 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 342 @param[in] ScratchBuffer A caller allocated buffer that may be required by this function as a scratch buffer to perform the decode operation. 343 @param[out] AuthenticationStatus 344 344 A pointer to the authentication status of the decoded output buffer. See the definition 345 345 of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI section of the PI … … 357 357 OUT VOID **OutputBuffer, 358 358 IN VOID *ScratchBuffer, OPTIONAL 359 OUT UINT32 *AuthenticationStatus 359 OUT UINT32 *AuthenticationStatus 360 360 ) 361 361 { … … 364 364 EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo; 365 365 EFI_GUID *SectionDefinitionGuid; 366 366 367 367 // 368 368 // Check input parameter … … 374 374 // 375 375 // Get all registered handler information. 376 // 376 // 377 377 Status = GetExtractGuidedSectionHandlerInfo (&HandlerInfo); 378 378 if (RETURN_ERROR (Status)) { … … 405 405 406 406 // 407 // Not found, the input guided section is not supported. 407 // Not found, the input guided section is not supported. 408 408 // 409 409 return RETURN_UNSUPPORTED; … … 411 411 412 412 /** 413 Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and 413 Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and 414 414 EXTRACT_GUIDED_SECTION_DECODE_HANDLER for a specific GUID section type. 415 416 Retrieves the handlers associated with SectionGuid and returns them in 415 416 Retrieves the handlers associated with SectionGuid and returns them in 417 417 GetInfoHandler and DecodeHandler. 418 418 419 If the GUID value specified by SectionGuid has not been registered, then 419 If the GUID value specified by SectionGuid has not been registered, then 420 420 return RETURN_NOT_FOUND. 421 421 422 422 If SectionGuid is NULL, then ASSERT(). 423 423 424 @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed 424 @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed 425 425 section type being retrieved. 426 @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns 427 the size of the decoded buffer and the size of an optional scratch 428 buffer required to actually decode the data in a GUIDed section. 429 This is an optional parameter that may be NULL. If it is NULL, then 426 @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns 427 the size of the decoded buffer and the size of an optional scratch 428 buffer required to actually decode the data in a GUIDed section. 429 This is an optional parameter that may be NULL. If it is NULL, then 430 430 the previously registered handler is not returned. 431 431 @param[out] DecodeHandler Pointer to a function that decodes a GUIDed section into a caller -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf
r58459 r58466 2 2 # Base ExtractGuidedSection Library. 3 3 # This instance can also be used in SEC phase only when the memory is ready in SEC phase. 4 # PCD PcdGuidedExtractHandlerTableAddress points to the available pysical memory space 4 # PCD PcdGuidedExtractHandlerTableAddress points to the available pysical memory space 5 5 # that is used to store Guided Extract Handlers. 6 # Note: A driver of type DXE_RUNTIME_DRIVER can use this ExtractGuidedSectionLib 7 # in their initialization without any issues. They only have to be careful in 8 # the implementation of runtime services, because this BASE library instance doesn't 6 # Note: A driver of type DXE_RUNTIME_DRIVER can use this ExtractGuidedSectionLib 7 # in their initialization without any issues. They only have to be careful in 8 # the implementation of runtime services, because this BASE library instance doesn't 9 9 # convert the address pointed by PcdGuidedExtractHandlerTableAddress to the virtual address. 10 # 10 # 11 11 # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> 12 12 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
r58459 r58466 26 26 MODULE_TYPE = BASE 27 27 VERSION_STRING = 1.0 28 LIBRARY_CLASS = IoLib 28 LIBRARY_CLASS = IoLib 29 29 30 30 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoHighLevel.c
r58459 r58466 81 81 82 82 /** 83 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise 83 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise 84 84 OR, and writes the result back to the 8-bit I/O port. 85 85 … … 147 147 Writes Value to the bit field of the I/O register. The bit field is specified 148 148 by the StartBit and the EndBit. All other bits in the destination I/O 149 register are preserved. The value written to the I/O port is returned. 149 register are preserved. The value written to the I/O port is returned. 150 150 151 151 If 8-bit I/O port operations are not supported, then ASSERT(). … … 349 349 If 16-bit I/O port operations are not supported, then ASSERT(). 350 350 If Port is not aligned on a 16-bit boundary, then ASSERT(). 351 351 352 352 @param Port The I/O port to write. 353 353 @param AndData The value to AND with the read value from the I/O port. … … 367 367 368 368 /** 369 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise 369 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise 370 370 OR, and writes the result back to the 16-bit I/O port. 371 371 … … 379 379 If 16-bit I/O port operations are not supported, then ASSERT(). 380 380 If Port is not aligned on a 16-bit boundary, then ASSERT(). 381 381 382 382 @param Port The I/O port to write. 383 383 @param AndData The value to AND with the read value from the I/O port. … … 660 660 661 661 /** 662 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise 662 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise 663 663 OR, and writes the result back to the 32-bit I/O port. 664 664 … … 953 953 954 954 /** 955 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise 955 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise 956 956 OR, and writes the result back to the 64-bit I/O port. 957 957 … … 1191 1191 result back to the 8-bit MMIO register. 1192 1192 1193 Reads the 8-bit MMIO register specified by Address, performs a bitwise 1193 Reads the 8-bit MMIO register specified by Address, performs a bitwise 1194 1194 OR between the read result and the value specified by OrData, and 1195 1195 writes the result to the 8-bit MMIO register specified by Address. The value … … 1244 1244 1245 1245 /** 1246 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise 1246 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise 1247 1247 OR, and writes the result back to the 8-bit MMIO register. 1248 1248 … … 1348 1348 writes the result back to the bit field in the 8-bit MMIO register. 1349 1349 1350 Reads the 8-bit MMIO register specified by Address, performs a bitwise 1350 Reads the 8-bit MMIO register specified by Address, performs a bitwise 1351 1351 OR between the read result and the value specified by OrData, and 1352 1352 writes the result to the 8-bit MMIO register specified by Address. The value … … 1478 1478 result back to the 16-bit MMIO register. 1479 1479 1480 Reads the 16-bit MMIO register specified by Address, performs a bitwise 1480 Reads the 16-bit MMIO register specified by Address, performs a bitwise 1481 1481 OR between the read result and the value specified by OrData, and 1482 1482 writes the result to the 16-bit MMIO register specified by Address. The value … … 1533 1533 1534 1534 /** 1535 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise 1535 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise 1536 1536 OR, and writes the result back to the 16-bit MMIO register. 1537 1537 … … 1639 1639 writes the result back to the bit field in the 16-bit MMIO register. 1640 1640 1641 Reads the 16-bit MMIO register specified by Address, performs a bitwise 1641 Reads the 16-bit MMIO register specified by Address, performs a bitwise 1642 1642 OR between the read result and the value specified by OrData, and 1643 1643 writes the result to the 16-bit MMIO register specified by Address. The value … … 1772 1772 result back to the 32-bit MMIO register. 1773 1773 1774 Reads the 32-bit MMIO register specified by Address, performs a bitwise 1774 Reads the 32-bit MMIO register specified by Address, performs a bitwise 1775 1775 OR between the read result and the value specified by OrData, and 1776 1776 writes the result to the 32-bit MMIO register specified by Address. The value … … 1827 1827 1828 1828 /** 1829 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise 1829 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise 1830 1830 OR, and writes the result back to the 32-bit MMIO register. 1831 1831 … … 1933 1933 writes the result back to the bit field in the 32-bit MMIO register. 1934 1934 1935 Reads the 32-bit MMIO register specified by Address, performs a bitwise 1935 Reads the 32-bit MMIO register specified by Address, performs a bitwise 1936 1936 OR between the read result and the value specified by OrData, and 1937 1937 writes the result to the 32-bit MMIO register specified by Address. The value … … 2066 2066 result back to the 64-bit MMIO register. 2067 2067 2068 Reads the 64-bit MMIO register specified by Address, performs a bitwise 2068 Reads the 64-bit MMIO register specified by Address, performs a bitwise 2069 2069 OR between the read result and the value specified by OrData, and 2070 2070 writes the result to the 64-bit MMIO register specified by Address. The value … … 2121 2121 2122 2122 /** 2123 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise 2123 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise 2124 2124 OR, and writes the result back to the 64-bit MMIO register. 2125 2125 … … 2227 2227 writes the result back to the bit field in the 64-bit MMIO register. 2228 2228 2229 Reads the 64-bit MMIO register specified by Address, performs a bitwise 2229 Reads the 64-bit MMIO register specified by Address, performs a bitwise 2230 2230 OR between the read result and the value specified by OrData, and 2231 2231 writes the result to the 64-bit MMIO register specified by Address. The value -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoLib.c
r48674 r58466 108 108 @param Address The MMIO register to write. 109 109 @param Value The value to write to the MMIO register. 110 110 111 111 @return Value. 112 112 … … 170 170 @param Address The MMIO register to write. 171 171 @param Value The value to write to the MMIO register. 172 172 173 173 @return Value. 174 174 … … 186 186 *(volatile UINT16*)Address = Value; 187 187 MemoryFence (); 188 188 189 189 return Value; 190 190 } … … 214 214 215 215 ASSERT ((Address & 3) == 0); 216 216 217 217 MemoryFence (); 218 218 Value = *(volatile UINT32*)Address; 219 219 MemoryFence (); 220 220 221 221 return Value; 222 222 } … … 234 234 @param Address The MMIO register to write. 235 235 @param Value The value to write to the MMIO register. 236 236 237 237 @return Value. 238 238 … … 246 246 { 247 247 ASSERT ((Address & 3) == 0); 248 248 249 249 MemoryFence (); 250 250 *(volatile UINT32*)Address = Value; 251 251 MemoryFence (); 252 252 253 253 return Value; 254 254 } … … 278 278 279 279 ASSERT ((Address & 7) == 0); 280 280 281 281 MemoryFence (); 282 282 Value = *(volatile UINT64*)Address; … … 308 308 { 309 309 ASSERT ((Address & 7) == 0); 310 310 311 311 MemoryFence (); 312 312 *(volatile UINT64*)Address = Value; 313 313 MemoryFence (); 314 315 return Value; 316 } 317 314 315 return Value; 316 } 317 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoLibArm.c
r48674 r58466 1 1 /** @file 2 I/O Library for ARM. 2 I/O Library for ARM. 3 3 4 4 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoLibIcc.c
r48674 r58466 74 74 out dx, al 75 75 } 76 return Value; 76 return Value; 77 77 } 78 78 … … 120 120 If 16-bit I/O port operations are not supported, then ASSERT(). 121 121 If Port is not aligned on a 16-bit boundary, then ASSERT(). 122 122 123 123 @param Port The I/O port to write. 124 124 @param Value The value to write to the I/O port. … … 154 154 If 32-bit I/O port operations are not supported, then ASSERT(). 155 155 If Port is not aligned on a 32-bit boundary, then ASSERT(). 156 156 157 157 @param Port The I/O port to read. 158 158 … … 175 175 mov dword ptr [Data], eax 176 176 } 177 177 178 178 return Data; 179 179 } … … 188 188 If 32-bit I/O port operations are not supported, then ASSERT(). 189 189 If Port is not aligned on a 32-bit boundary, then ASSERT(). 190 190 191 191 @param Port The I/O port to write. 192 192 @param Value The value to write to the I/O port. … … 203 203 { 204 204 ASSERT ((Port & 3) == 0); 205 205 206 206 __asm { 207 207 mov eax, dword ptr [Value] -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoLibIpf.c
r48674 r58466 25 25 This function translates I/O port address to memory address by adding the 64MB 26 26 aligned I/O Port space to the I/O address. 27 If I/O Port space base is not 64MB aligned, then ASSERT (). 27 If I/O Port space base is not 64MB aligned, then ASSERT (). 28 28 29 29 @param Port The I/O port to read. … … 45 45 // 46 46 // Make sure that the I/O Port space base is 64MB aligned. 47 // 47 // 48 48 ASSERT ((IoBlockBaseAddress & 0x3ffffff) == 0); 49 49 Address += IoBlockBaseAddress; … … 108 108 If 32-bit I/O port operations are not supported, then ASSERT(). 109 109 If Port is not aligned on a 32-bit boundary, then ASSERT(). 110 110 111 111 @param Port The I/O port to read. 112 112 … … 182 182 If 16-bit I/O port operations are not supported, then ASSERT(). 183 183 If Port is not aligned on a 16-bit boundary, then ASSERT(). 184 184 185 185 @param Port The I/O port to write. 186 186 @param Value The value to write to the I/O port. … … 208 208 If 32-bit I/O port operations are not supported, then ASSERT(). 209 209 If Port is not aligned on a 32-bit boundary, then ASSERT(). 210 210 211 211 @param Port The I/O port to write. 212 212 @param Value The value to write to the I/O port. … … 308 308 // 309 309 // Make sure that Address is 16-bit aligned. 310 // 310 // 311 311 ASSERT ((Address & 1) == 0); 312 312 … … 345 345 // 346 346 // Make sure that Address is 32-bit aligned. 347 // 347 // 348 348 ASSERT ((Address & 3) == 0); 349 349 … … 382 382 // 383 383 // Make sure that Address is 64-bit aligned. 384 // 384 // 385 385 ASSERT ((Address & 7) == 0); 386 386 … … 406 406 @param Address The MMIO register to write. 407 407 @param Value The value to write to the MMIO register. 408 408 409 409 @return Value. 410 410 … … 438 438 @param Address The MMIO register to write. 439 439 @param Value The value to write to the MMIO register. 440 440 441 441 @return Value. 442 442 … … 451 451 // 452 452 // Make sure that Address is 16-bit aligned. 453 // 453 // 454 454 ASSERT ((Address & 1) == 0); 455 455 … … 475 475 @param Address The MMIO register to write. 476 476 @param Value The value to write to the MMIO register. 477 477 478 478 @return Value. 479 479 … … 488 488 // 489 489 // Make sure that Address is 32-bit aligned. 490 // 490 // 491 491 ASSERT ((Address & 3) == 0); 492 492 … … 523 523 // 524 524 // Make sure that Address is 64-bit aligned. 525 // 525 // 526 526 ASSERT ((Address & 7) == 0); 527 527 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoLibMmioBuffer.c
r48674 r58466 18 18 Copy data from the MMIO region to system memory by using 8-bit access. 19 19 20 Copy data from the MMIO region specified by starting address StartAddress 21 to system memory specified by Buffer by using 8-bit access. The total 20 Copy data from the MMIO region specified by starting address StartAddress 21 to system memory specified by Buffer by using 8-bit access. The total 22 22 number of byte to be copied is specified by Length. Buffer is returned. 23 24 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 23 24 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 25 25 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 26 26 … … 45 45 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 46 46 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); 47 47 48 48 ReturnBuffer = Buffer; 49 49 50 50 while (Length-- != 0) { 51 51 *(Buffer++) = MmioRead8 (StartAddress++); … … 58 58 Copy data from the MMIO region to system memory by using 16-bit access. 59 59 60 Copy data from the MMIO region specified by starting address StartAddress 61 to system memory specified by Buffer by using 16-bit access. The total 60 Copy data from the MMIO region specified by starting address StartAddress 61 to system memory specified by Buffer by using 16-bit access. The total 62 62 number of byte to be copied is specified by Length. Buffer is returned. 63 63 64 64 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 65 65 66 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 66 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 67 67 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 68 68 … … 88 88 89 89 ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0); 90 90 91 91 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 92 92 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 94 94 ASSERT ((Length & (sizeof (UINT16) - 1)) == 0); 95 95 ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0); 96 96 97 97 ReturnBuffer = Buffer; 98 98 99 99 while (Length != 0) { 100 100 *(Buffer++) = MmioRead16 (StartAddress); … … 109 109 Copy data from the MMIO region to system memory by using 32-bit access. 110 110 111 Copy data from the MMIO region specified by starting address StartAddress 112 to system memory specified by Buffer by using 32-bit access. The total 111 Copy data from the MMIO region specified by starting address StartAddress 112 to system memory specified by Buffer by using 32-bit access. The total 113 113 number of byte to be copied is specified by Length. Buffer is returned. 114 114 115 115 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 116 116 117 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 117 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 118 118 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 119 119 … … 139 139 140 140 ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0); 141 141 142 142 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 143 143 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 145 145 ASSERT ((Length & (sizeof (UINT32) - 1)) == 0); 146 146 ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0); 147 147 148 148 ReturnBuffer = Buffer; 149 149 150 150 while (Length != 0) { 151 151 *(Buffer++) = MmioRead32 (StartAddress); … … 160 160 Copy data from the MMIO region to system memory by using 64-bit access. 161 161 162 Copy data from the MMIO region specified by starting address StartAddress 163 to system memory specified by Buffer by using 64-bit access. The total 162 Copy data from the MMIO region specified by starting address StartAddress 163 to system memory specified by Buffer by using 64-bit access. The total 164 164 number of byte to be copied is specified by Length. Buffer is returned. 165 165 166 166 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 167 167 168 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 168 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 169 169 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 170 170 … … 190 190 191 191 ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0); 192 192 193 193 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 194 194 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 196 196 ASSERT ((Length & (sizeof (UINT64) - 1)) == 0); 197 197 ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0); 198 198 199 199 ReturnBuffer = Buffer; 200 200 201 201 while (Length != 0) { 202 202 *(Buffer++) = MmioRead64 (StartAddress); … … 212 212 Copy data from system memory to the MMIO region by using 8-bit access. 213 213 214 Copy data from system memory specified by Buffer to the MMIO region specified 215 by starting address StartAddress by using 8-bit access. The total number 214 Copy data from system memory specified by Buffer to the MMIO region specified 215 by starting address StartAddress by using 8-bit access. The total number 216 216 of byte to be copied is specified by Length. Buffer is returned. 217 218 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 217 218 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 219 219 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 220 220 … … 239 239 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 240 240 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); 241 241 242 242 ReturnBuffer = (UINT8 *) Buffer; 243 243 244 244 while (Length-- != 0) { 245 245 MmioWrite8 (StartAddress++, *(Buffer++)); … … 247 247 248 248 return ReturnBuffer; 249 249 250 250 } 251 251 … … 253 253 Copy data from system memory to the MMIO region by using 16-bit access. 254 254 255 Copy data from system memory specified by Buffer to the MMIO region specified 256 by starting address StartAddress by using 16-bit access. The total number 255 Copy data from system memory specified by Buffer to the MMIO region specified 256 by starting address StartAddress by using 16-bit access. The total number 257 257 of byte to be copied is specified by Length. Buffer is returned. 258 258 259 259 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 260 260 261 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 261 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 262 262 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 263 263 … … 284 284 285 285 ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0); 286 286 287 287 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 288 288 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 292 292 293 293 ReturnBuffer = (UINT16 *) Buffer; 294 294 295 295 while (Length != 0) { 296 296 MmioWrite16 (StartAddress, *(Buffer++)); 297 297 298 298 StartAddress += sizeof (UINT16); 299 299 Length -= sizeof (UINT16); … … 307 307 Copy data from system memory to the MMIO region by using 32-bit access. 308 308 309 Copy data from system memory specified by Buffer to the MMIO region specified 310 by starting address StartAddress by using 32-bit access. The total number 309 Copy data from system memory specified by Buffer to the MMIO region specified 310 by starting address StartAddress by using 32-bit access. The total number 311 311 of byte to be copied is specified by Length. Buffer is returned. 312 312 313 313 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 314 314 315 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 315 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 316 316 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 317 317 … … 338 338 339 339 ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0); 340 340 341 341 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 342 342 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 346 346 347 347 ReturnBuffer = (UINT32 *) Buffer; 348 348 349 349 while (Length != 0) { 350 350 MmioWrite32 (StartAddress, *(Buffer++)); 351 351 352 352 StartAddress += sizeof (UINT32); 353 353 Length -= sizeof (UINT32); … … 360 360 Copy data from system memory to the MMIO region by using 64-bit access. 361 361 362 Copy data from system memory specified by Buffer to the MMIO region specified 363 by starting address StartAddress by using 64-bit access. The total number 362 Copy data from system memory specified by Buffer to the MMIO region specified 363 by starting address StartAddress by using 64-bit access. The total number 364 364 of byte to be copied is specified by Length. Buffer is returned. 365 365 366 366 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 367 367 368 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 368 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 369 369 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 370 370 … … 391 391 392 392 ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0); 393 393 394 394 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 395 395 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 399 399 400 400 ReturnBuffer = (UINT64 *) Buffer; 401 401 402 402 while (Length != 0) { 403 403 MmioWrite64 (StartAddress, *(Buffer++)); 404 404 405 405 StartAddress += sizeof (UINT64); 406 406 Length -= sizeof (UINT64); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c
r48674 r58466 147 147 If 16-bit I/O port operations are not supported, then ASSERT(). 148 148 If Port is not aligned on a 16-bit boundary, then ASSERT(). 149 149 150 150 @param Port The I/O port to write. 151 151 @param Value The value to write to the I/O port. … … 177 177 If 32-bit I/O port operations are not supported, then ASSERT(). 178 178 If Port is not aligned on a 32-bit boundary, then ASSERT(). 179 179 180 180 @param Port The I/O port to read. 181 181 … … 207 207 If 32-bit I/O port operations are not supported, then ASSERT(). 208 208 If Port is not aligned on a 32-bit boundary, then ASSERT(). 209 209 210 210 @param Port The I/O port to write. 211 211 @param Value The value to write to the I/O port. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.S
r48674 r58466 1 #------------------------------------------------------------------------------ 1 #------------------------------------------------------------------------------ 2 2 # 3 3 # CpuBreakpoint() for ARM … … 33 33 # 34 34 ASM_PFX(CpuBreakpoint): 35 swi 0xdbdbdb 35 swi 0xdbdbdb 36 36 bx lr -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm
r48674 r58466 1 ;------------------------------------------------------------------------------ 1 ;------------------------------------------------------------------------------ 2 2 ; 3 3 ; CpuBreakpoint() for ARM … … 35 35 swi 0xdbdbdb 36 36 bx lr 37 37 38 38 END -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/CpuPause.asm
r48674 r58466 1 ;------------------------------------------------------------------------------ 1 ;------------------------------------------------------------------------------ 2 2 ; 3 3 ; CpuPause() for ARM -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/DisableInterrupts.S
r48674 r58466 1 #------------------------------------------------------------------------------ 1 #------------------------------------------------------------------------------ 2 2 # 3 3 # DisableInterrupts() for ARM -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/DisableInterrupts.asm
r48674 r58466 1 ;------------------------------------------------------------------------------ 1 ;------------------------------------------------------------------------------ 2 2 ; 3 3 ; DisableInterrupts() for ARM … … 34 34 MSR CPSR_c,R0 35 35 BX LR 36 36 37 37 END -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/EnableInterrupts.S
r48674 r58466 1 #------------------------------------------------------------------------------ 1 #------------------------------------------------------------------------------ 2 2 # 3 3 # EnableInterrupts() for ARM -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/EnableInterrupts.asm
r48674 r58466 1 ;------------------------------------------------------------------------------ 1 ;------------------------------------------------------------------------------ 2 2 ; 3 3 ; EnableInterrupts() for ARM … … 34 34 MSR CPSR_c,R0 35 35 BX LR 36 36 37 37 END -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/GetInterruptsState.S
r48674 r58466 1 #------------------------------------------------------------------------------ 1 #------------------------------------------------------------------------------ 2 2 # 3 3 # GetInterruptState() function for ARM -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/GetInterruptsState.asm
r48674 r58466 1 ;------------------------------------------------------------------------------ 1 ;------------------------------------------------------------------------------ 2 2 ; 3 3 ; GetInterruptState() function for ARM … … 42 42 MOVNE R0, #0 43 43 BX LR 44 44 45 45 END -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/InternalSwitchStack.c
r48674 r58466 40 40 ); 41 41 42 42 43 43 /** 44 44 Transfers control to a function starting with a new stack. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/Math64.S
r48674 r58466 1 #------------------------------------------------------------------------------ 2 # 3 # Replacement for Math64.c that is coded to use older GCC intrinsics. 1 #------------------------------------------------------------------------------ 2 # 3 # Replacement for Math64.c that is coded to use older GCC intrinsics. 4 4 # Doing this reduces the number of intrinsics that are required when 5 # you port to a new version of gcc. 5 # you port to a new version of gcc. 6 6 # 7 7 # Need to split this into multple files to size optimize the image. … … 160 160 bl ASM_PFX(__udivdi3) 161 161 ldmfd sp!, {r7, pc} 162 163 162 163 164 164 .align 2 165 165 GCC_ASM_EXPORT(InternalMathModU64x32) … … 171 171 bl ASM_PFX(__umoddi3) 172 172 ldmfd sp!, {r7, pc} 173 174 173 174 175 175 .align 2 176 176 GCC_ASM_EXPORT(InternalMathDivRemU64x32) … … 199 199 ldmfd sp!, {r10, r11} 200 200 ldmfd sp!, {r4, r5, r6, r7, pc} 201 202 201 202 203 203 .align 2 204 204 GCC_ASM_EXPORT(InternalMathDivRemU64x64) … … 225 225 ldmfd sp!, {r10, r11} 226 226 ldmfd sp!, {r4, r5, r6, r7, pc} 227 228 227 228 229 229 .align 2 230 230 GCC_ASM_EXPORT(InternalMathDivRemS64x64) … … 251 251 ldmfd sp!, {r10, r11} 252 252 ldmfd sp!, {r4, r5, r6, r7, pc} 253 254 253 254 255 255 .align 2 256 256 GCC_ASM_EXPORT(InternalMathSwapBytes64) -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S
r48674 r58466 1 #------------------------------------------------------------------------------ 1 #------------------------------------------------------------------------------ 2 2 # 3 3 # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
r48674 r58466 1 ;------------------------------------------------------------------------------ 1 ;------------------------------------------------------------------------------ 2 2 ; 3 3 ; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/SwitchStack.S
r48674 r58466 1 //------------------------------------------------------------------------------ 1 //------------------------------------------------------------------------------ 2 2 // 3 3 // Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> … … 13 13 // 14 14 //------------------------------------------------------------------------------ 15 15 16 16 .text 17 17 .align 5 18 18 19 19 GCC_ASM_EXPORT(InternalSwitchStackAsm) 20 GCC_ASM_EXPORT(CpuPause) 21 20 GCC_ASM_EXPORT(CpuPause) 21 22 22 /** 23 23 // -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/SwitchStack.asm
r48674 r58466 1 ;------------------------------------------------------------------------------ 1 ;------------------------------------------------------------------------------ 2 2 ; 3 3 ; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> … … 12 12 ; 13 13 ;------------------------------------------------------------------------------ 14 14 15 15 EXPORT InternalSwitchStackAsm 16 16 17 17 AREA Switch_Stack, CODE, READONLY 18 18 19 19 ;/** 20 20 ; This allows the caller to switch the stack and goes to the new entry point -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Arm/Unaligned.c
r48674 r58466 1 1 /** @file 2 2 Unaligned access functions of BaseLib for ARM. 3 3 4 4 volatile was added to work around optimization issues. 5 5 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/BaseLib.inf
r58459 r58466 23 23 MODULE_TYPE = BASE 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = BaseLib 25 LIBRARY_CLASS = BaseLib 26 26 27 27 # … … 67 67 68 68 [Sources.Ia32] 69 Ia32/Wbinvd.c | MSFT 70 Ia32/WriteMm7.c | MSFT 71 Ia32/WriteMm6.c | MSFT 72 Ia32/WriteMm5.c | MSFT 73 Ia32/WriteMm4.c | MSFT 74 Ia32/WriteMm3.c | MSFT 75 Ia32/WriteMm2.c | MSFT 76 Ia32/WriteMm1.c | MSFT 77 Ia32/WriteMm0.c | MSFT 78 Ia32/WriteLdtr.c | MSFT 79 Ia32/WriteIdtr.c | MSFT 80 Ia32/WriteGdtr.c | MSFT 81 Ia32/WriteDr7.c | MSFT 82 Ia32/WriteDr6.c | MSFT 83 Ia32/WriteDr5.c | MSFT 84 Ia32/WriteDr4.c | MSFT 85 Ia32/WriteDr3.c | MSFT 86 Ia32/WriteDr2.c | MSFT 87 Ia32/WriteDr1.c | MSFT 88 Ia32/WriteDr0.c | MSFT 89 Ia32/WriteCr4.c | MSFT 90 Ia32/WriteCr3.c | MSFT 91 Ia32/WriteCr2.c | MSFT 92 Ia32/WriteCr0.c | MSFT 93 Ia32/WriteMsr64.c | MSFT 94 Ia32/SwapBytes64.c | MSFT 95 Ia32/SetJump.c | MSFT 96 Ia32/RRotU64.c | MSFT 97 Ia32/RShiftU64.c | MSFT 98 Ia32/ReadPmc.c | MSFT 99 Ia32/ReadTsc.c | MSFT 100 Ia32/ReadLdtr.c | MSFT 101 Ia32/ReadIdtr.c | MSFT 102 Ia32/ReadGdtr.c | MSFT 103 Ia32/ReadTr.c | MSFT 104 Ia32/ReadSs.c | MSFT 105 Ia32/ReadGs.c | MSFT 106 Ia32/ReadFs.c | MSFT 107 Ia32/ReadEs.c | MSFT 108 Ia32/ReadDs.c | MSFT 109 Ia32/ReadCs.c | MSFT 110 Ia32/ReadMsr64.c | MSFT 111 Ia32/ReadMm7.c | MSFT 112 Ia32/ReadMm6.c | MSFT 113 Ia32/ReadMm5.c | MSFT 114 Ia32/ReadMm4.c | MSFT 115 Ia32/ReadMm3.c | MSFT 116 Ia32/ReadMm2.c | MSFT 117 Ia32/ReadMm1.c | MSFT 118 Ia32/ReadMm0.c | MSFT 119 Ia32/ReadEflags.c | MSFT 120 Ia32/ReadDr7.c | MSFT 121 Ia32/ReadDr6.c | MSFT 122 Ia32/ReadDr5.c | MSFT 123 Ia32/ReadDr4.c | MSFT 124 Ia32/ReadDr3.c | MSFT 125 Ia32/ReadDr2.c | MSFT 126 Ia32/ReadDr1.c | MSFT 127 Ia32/ReadDr0.c | MSFT 128 Ia32/ReadCr4.c | MSFT 129 Ia32/ReadCr3.c | MSFT 130 Ia32/ReadCr2.c | MSFT 131 Ia32/ReadCr0.c | MSFT 132 Ia32/Mwait.c | MSFT 133 Ia32/Monitor.c | MSFT 134 Ia32/ModU64x32.c | MSFT 135 Ia32/MultU64x64.c | MSFT 136 Ia32/MultU64x32.c | MSFT 137 Ia32/LShiftU64.c | MSFT 138 Ia32/LRotU64.c | MSFT 139 Ia32/LongJump.c | MSFT 140 Ia32/Invd.c | MSFT 141 Ia32/FxRestore.c | MSFT 142 Ia32/FxSave.c | MSFT 143 Ia32/FlushCacheLine.c | MSFT 144 Ia32/EnablePaging32.c | MSFT 145 Ia32/EnableInterrupts.c | MSFT 146 Ia32/EnableDisableInterrupts.c | MSFT 147 Ia32/DivU64x64Remainder.asm | MSFT 148 Ia32/DivU64x32Remainder.c | MSFT 149 Ia32/DivU64x32.c | MSFT 150 Ia32/DisablePaging32.c | MSFT 151 Ia32/DisableInterrupts.c | MSFT 152 Ia32/CpuPause.c | MSFT 153 Ia32/CpuIdEx.c | MSFT 154 Ia32/CpuId.c | MSFT 155 Ia32/CpuBreakpoint.c | MSFT 156 Ia32/ARShiftU64.c | MSFT 69 Ia32/Wbinvd.c | MSFT 70 Ia32/WriteMm7.c | MSFT 71 Ia32/WriteMm6.c | MSFT 72 Ia32/WriteMm5.c | MSFT 73 Ia32/WriteMm4.c | MSFT 74 Ia32/WriteMm3.c | MSFT 75 Ia32/WriteMm2.c | MSFT 76 Ia32/WriteMm1.c | MSFT 77 Ia32/WriteMm0.c | MSFT 78 Ia32/WriteLdtr.c | MSFT 79 Ia32/WriteIdtr.c | MSFT 80 Ia32/WriteGdtr.c | MSFT 81 Ia32/WriteDr7.c | MSFT 82 Ia32/WriteDr6.c | MSFT 83 Ia32/WriteDr5.c | MSFT 84 Ia32/WriteDr4.c | MSFT 85 Ia32/WriteDr3.c | MSFT 86 Ia32/WriteDr2.c | MSFT 87 Ia32/WriteDr1.c | MSFT 88 Ia32/WriteDr0.c | MSFT 89 Ia32/WriteCr4.c | MSFT 90 Ia32/WriteCr3.c | MSFT 91 Ia32/WriteCr2.c | MSFT 92 Ia32/WriteCr0.c | MSFT 93 Ia32/WriteMsr64.c | MSFT 94 Ia32/SwapBytes64.c | MSFT 95 Ia32/SetJump.c | MSFT 96 Ia32/RRotU64.c | MSFT 97 Ia32/RShiftU64.c | MSFT 98 Ia32/ReadPmc.c | MSFT 99 Ia32/ReadTsc.c | MSFT 100 Ia32/ReadLdtr.c | MSFT 101 Ia32/ReadIdtr.c | MSFT 102 Ia32/ReadGdtr.c | MSFT 103 Ia32/ReadTr.c | MSFT 104 Ia32/ReadSs.c | MSFT 105 Ia32/ReadGs.c | MSFT 106 Ia32/ReadFs.c | MSFT 107 Ia32/ReadEs.c | MSFT 108 Ia32/ReadDs.c | MSFT 109 Ia32/ReadCs.c | MSFT 110 Ia32/ReadMsr64.c | MSFT 111 Ia32/ReadMm7.c | MSFT 112 Ia32/ReadMm6.c | MSFT 113 Ia32/ReadMm5.c | MSFT 114 Ia32/ReadMm4.c | MSFT 115 Ia32/ReadMm3.c | MSFT 116 Ia32/ReadMm2.c | MSFT 117 Ia32/ReadMm1.c | MSFT 118 Ia32/ReadMm0.c | MSFT 119 Ia32/ReadEflags.c | MSFT 120 Ia32/ReadDr7.c | MSFT 121 Ia32/ReadDr6.c | MSFT 122 Ia32/ReadDr5.c | MSFT 123 Ia32/ReadDr4.c | MSFT 124 Ia32/ReadDr3.c | MSFT 125 Ia32/ReadDr2.c | MSFT 126 Ia32/ReadDr1.c | MSFT 127 Ia32/ReadDr0.c | MSFT 128 Ia32/ReadCr4.c | MSFT 129 Ia32/ReadCr3.c | MSFT 130 Ia32/ReadCr2.c | MSFT 131 Ia32/ReadCr0.c | MSFT 132 Ia32/Mwait.c | MSFT 133 Ia32/Monitor.c | MSFT 134 Ia32/ModU64x32.c | MSFT 135 Ia32/MultU64x64.c | MSFT 136 Ia32/MultU64x32.c | MSFT 137 Ia32/LShiftU64.c | MSFT 138 Ia32/LRotU64.c | MSFT 139 Ia32/LongJump.c | MSFT 140 Ia32/Invd.c | MSFT 141 Ia32/FxRestore.c | MSFT 142 Ia32/FxSave.c | MSFT 143 Ia32/FlushCacheLine.c | MSFT 144 Ia32/EnablePaging32.c | MSFT 145 Ia32/EnableInterrupts.c | MSFT 146 Ia32/EnableDisableInterrupts.c | MSFT 147 Ia32/DivU64x64Remainder.asm | MSFT 148 Ia32/DivU64x32Remainder.c | MSFT 149 Ia32/DivU64x32.c | MSFT 150 Ia32/DisablePaging32.c | MSFT 151 Ia32/DisableInterrupts.c | MSFT 152 Ia32/CpuPause.c | MSFT 153 Ia32/CpuIdEx.c | MSFT 154 Ia32/CpuId.c | MSFT 155 Ia32/CpuBreakpoint.c | MSFT 156 Ia32/ARShiftU64.c | MSFT 157 157 Ia32/Thunk16.asm | MSFT 158 158 Ia32/EnablePaging64.asm | MSFT … … 160 160 Ia32/DisableCache.c | MSFT 161 161 162 Ia32/Wbinvd.asm | INTEL 163 Ia32/WriteMm7.asm | INTEL 164 Ia32/WriteMm6.asm | INTEL 165 Ia32/WriteMm5.asm | INTEL 166 Ia32/WriteMm4.asm | INTEL 167 Ia32/WriteMm3.asm | INTEL 168 Ia32/WriteMm2.asm | INTEL 169 Ia32/WriteMm1.asm | INTEL 170 Ia32/WriteMm0.asm | INTEL 171 Ia32/WriteLdtr.asm | INTEL 172 Ia32/WriteIdtr.asm | INTEL 173 Ia32/WriteGdtr.asm | INTEL 174 Ia32/WriteDr7.asm | INTEL 175 Ia32/WriteDr6.asm | INTEL 176 Ia32/WriteDr5.asm | INTEL 177 Ia32/WriteDr4.asm | INTEL 178 Ia32/WriteDr3.asm | INTEL 179 Ia32/WriteDr2.asm | INTEL 180 Ia32/WriteDr1.asm | INTEL 181 Ia32/WriteDr0.asm | INTEL 182 Ia32/WriteCr4.asm | INTEL 183 Ia32/WriteCr3.asm | INTEL 184 Ia32/WriteCr2.asm | INTEL 185 Ia32/WriteCr0.asm | INTEL 186 Ia32/WriteMsr64.asm | INTEL 187 Ia32/SwapBytes64.asm | INTEL 188 Ia32/SetJump.asm | INTEL 189 Ia32/RRotU64.asm | INTEL 190 Ia32/RShiftU64.asm | INTEL 191 Ia32/ReadPmc.asm | INTEL 192 Ia32/ReadTsc.asm | INTEL 193 Ia32/ReadLdtr.asm | INTEL 194 Ia32/ReadIdtr.asm | INTEL 195 Ia32/ReadGdtr.asm | INTEL 196 Ia32/ReadTr.asm | INTEL 197 Ia32/ReadSs.asm | INTEL 198 Ia32/ReadGs.asm | INTEL 199 Ia32/ReadFs.asm | INTEL 200 Ia32/ReadEs.asm | INTEL 201 Ia32/ReadDs.asm | INTEL 202 Ia32/ReadCs.asm | INTEL 203 Ia32/ReadMsr64.asm | INTEL 204 Ia32/ReadMm7.asm | INTEL 205 Ia32/ReadMm6.asm | INTEL 206 Ia32/ReadMm5.asm | INTEL 207 Ia32/ReadMm4.asm | INTEL 208 Ia32/ReadMm3.asm | INTEL 209 Ia32/ReadMm2.asm | INTEL 210 Ia32/ReadMm1.asm | INTEL 211 Ia32/ReadMm0.asm | INTEL 212 Ia32/ReadEflags.asm | INTEL 213 Ia32/ReadDr7.asm | INTEL 214 Ia32/ReadDr6.asm | INTEL 215 Ia32/ReadDr5.asm | INTEL 216 Ia32/ReadDr4.asm | INTEL 217 Ia32/ReadDr3.asm | INTEL 218 Ia32/ReadDr2.asm | INTEL 219 Ia32/ReadDr1.asm | INTEL 220 Ia32/ReadDr0.asm | INTEL 221 Ia32/ReadCr4.asm | INTEL 222 Ia32/ReadCr3.asm | INTEL 223 Ia32/ReadCr2.asm | INTEL 224 Ia32/ReadCr0.asm | INTEL 225 Ia32/Mwait.asm | INTEL 226 Ia32/Monitor.asm | INTEL 227 Ia32/ModU64x32.asm | INTEL 228 Ia32/MultU64x64.asm | INTEL 229 Ia32/MultU64x32.asm | INTEL 230 Ia32/LShiftU64.asm | INTEL 231 Ia32/LRotU64.asm | INTEL 232 Ia32/LongJump.asm | INTEL 233 Ia32/Invd.asm | INTEL 234 Ia32/FxRestore.asm | INTEL 235 Ia32/FxSave.asm | INTEL 236 Ia32/FlushCacheLine.asm | INTEL 237 Ia32/EnablePaging32.asm | INTEL 238 Ia32/EnableInterrupts.asm | INTEL 239 Ia32/EnableDisableInterrupts.asm | INTEL 240 Ia32/DivU64x64Remainder.asm | INTEL 241 Ia32/DivU64x32Remainder.asm | INTEL 242 Ia32/DivU64x32.asm | INTEL 243 Ia32/DisablePaging32.asm | INTEL 244 Ia32/DisableInterrupts.asm | INTEL 245 Ia32/CpuPause.asm | INTEL 246 Ia32/CpuIdEx.asm | INTEL 247 Ia32/CpuId.asm | INTEL 248 Ia32/CpuBreakpoint.asm | INTEL 249 Ia32/ARShiftU64.asm | INTEL 162 Ia32/Wbinvd.asm | INTEL 163 Ia32/WriteMm7.asm | INTEL 164 Ia32/WriteMm6.asm | INTEL 165 Ia32/WriteMm5.asm | INTEL 166 Ia32/WriteMm4.asm | INTEL 167 Ia32/WriteMm3.asm | INTEL 168 Ia32/WriteMm2.asm | INTEL 169 Ia32/WriteMm1.asm | INTEL 170 Ia32/WriteMm0.asm | INTEL 171 Ia32/WriteLdtr.asm | INTEL 172 Ia32/WriteIdtr.asm | INTEL 173 Ia32/WriteGdtr.asm | INTEL 174 Ia32/WriteDr7.asm | INTEL 175 Ia32/WriteDr6.asm | INTEL 176 Ia32/WriteDr5.asm | INTEL 177 Ia32/WriteDr4.asm | INTEL 178 Ia32/WriteDr3.asm | INTEL 179 Ia32/WriteDr2.asm | INTEL 180 Ia32/WriteDr1.asm | INTEL 181 Ia32/WriteDr0.asm | INTEL 182 Ia32/WriteCr4.asm | INTEL 183 Ia32/WriteCr3.asm | INTEL 184 Ia32/WriteCr2.asm | INTEL 185 Ia32/WriteCr0.asm | INTEL 186 Ia32/WriteMsr64.asm | INTEL 187 Ia32/SwapBytes64.asm | INTEL 188 Ia32/SetJump.asm | INTEL 189 Ia32/RRotU64.asm | INTEL 190 Ia32/RShiftU64.asm | INTEL 191 Ia32/ReadPmc.asm | INTEL 192 Ia32/ReadTsc.asm | INTEL 193 Ia32/ReadLdtr.asm | INTEL 194 Ia32/ReadIdtr.asm | INTEL 195 Ia32/ReadGdtr.asm | INTEL 196 Ia32/ReadTr.asm | INTEL 197 Ia32/ReadSs.asm | INTEL 198 Ia32/ReadGs.asm | INTEL 199 Ia32/ReadFs.asm | INTEL 200 Ia32/ReadEs.asm | INTEL 201 Ia32/ReadDs.asm | INTEL 202 Ia32/ReadCs.asm | INTEL 203 Ia32/ReadMsr64.asm | INTEL 204 Ia32/ReadMm7.asm | INTEL 205 Ia32/ReadMm6.asm | INTEL 206 Ia32/ReadMm5.asm | INTEL 207 Ia32/ReadMm4.asm | INTEL 208 Ia32/ReadMm3.asm | INTEL 209 Ia32/ReadMm2.asm | INTEL 210 Ia32/ReadMm1.asm | INTEL 211 Ia32/ReadMm0.asm | INTEL 212 Ia32/ReadEflags.asm | INTEL 213 Ia32/ReadDr7.asm | INTEL 214 Ia32/ReadDr6.asm | INTEL 215 Ia32/ReadDr5.asm | INTEL 216 Ia32/ReadDr4.asm | INTEL 217 Ia32/ReadDr3.asm | INTEL 218 Ia32/ReadDr2.asm | INTEL 219 Ia32/ReadDr1.asm | INTEL 220 Ia32/ReadDr0.asm | INTEL 221 Ia32/ReadCr4.asm | INTEL 222 Ia32/ReadCr3.asm | INTEL 223 Ia32/ReadCr2.asm | INTEL 224 Ia32/ReadCr0.asm | INTEL 225 Ia32/Mwait.asm | INTEL 226 Ia32/Monitor.asm | INTEL 227 Ia32/ModU64x32.asm | INTEL 228 Ia32/MultU64x64.asm | INTEL 229 Ia32/MultU64x32.asm | INTEL 230 Ia32/LShiftU64.asm | INTEL 231 Ia32/LRotU64.asm | INTEL 232 Ia32/LongJump.asm | INTEL 233 Ia32/Invd.asm | INTEL 234 Ia32/FxRestore.asm | INTEL 235 Ia32/FxSave.asm | INTEL 236 Ia32/FlushCacheLine.asm | INTEL 237 Ia32/EnablePaging32.asm | INTEL 238 Ia32/EnableInterrupts.asm | INTEL 239 Ia32/EnableDisableInterrupts.asm | INTEL 240 Ia32/DivU64x64Remainder.asm | INTEL 241 Ia32/DivU64x32Remainder.asm | INTEL 242 Ia32/DivU64x32.asm | INTEL 243 Ia32/DisablePaging32.asm | INTEL 244 Ia32/DisableInterrupts.asm | INTEL 245 Ia32/CpuPause.asm | INTEL 246 Ia32/CpuIdEx.asm | INTEL 247 Ia32/CpuId.asm | INTEL 248 Ia32/CpuBreakpoint.asm | INTEL 249 Ia32/ARShiftU64.asm | INTEL 250 250 Ia32/Thunk16.asm | INTEL 251 251 Ia32/EnablePaging64.asm | INTEL … … 254 254 255 255 Ia32/GccInline.c | GCC 256 <<<<<<< .working 256 257 # VBox begin (yasm doesn't like the nasm variant) - original: 257 258 # Ia32/Thunk16.nasm | GCC … … 280 281 Ia32/RShiftU64.S | GCC 281 282 Ia32/LShiftU64.S | GCC 283 ||||||| .merge-left.r103776 284 Ia32/Thunk16.nasm | GCC 285 Ia32/EnableDisableInterrupts.S | GCC 286 Ia32/EnablePaging64.S | GCC 287 Ia32/DisablePaging32.S | GCC 288 Ia32/EnablePaging32.S | GCC 289 Ia32/Mwait.S | GCC 290 Ia32/Monitor.S | GCC 291 Ia32/CpuIdEx.S | GCC 292 Ia32/CpuId.S | GCC 293 Ia32/LongJump.S | GCC 294 Ia32/SetJump.S | GCC 295 Ia32/SwapBytes64.S | GCC 296 Ia32/DivU64x64Remainder.S | GCC 297 Ia32/DivU64x32Remainder.S | GCC 298 Ia32/ModU64x32.S | GCC 299 Ia32/DivU64x32.S | GCC 300 Ia32/MultU64x64.S | GCC 301 Ia32/MultU64x32.S | GCC 302 Ia32/RRotU64.S | GCC 303 Ia32/LRotU64.S | GCC 304 Ia32/ARShiftU64.S | GCC 305 Ia32/RShiftU64.S | GCC 306 Ia32/LShiftU64.S | GCC 307 ======= 308 Ia32/Thunk16.nasm | GCC 309 Ia32/EnableDisableInterrupts.S | GCC 310 Ia32/EnablePaging64.S | GCC 311 Ia32/DisablePaging32.S | GCC 312 Ia32/EnablePaging32.S | GCC 313 Ia32/Mwait.S | GCC 314 Ia32/Monitor.S | GCC 315 Ia32/CpuIdEx.S | GCC 316 Ia32/CpuId.S | GCC 317 Ia32/LongJump.S | GCC 318 Ia32/SetJump.S | GCC 319 Ia32/SwapBytes64.S | GCC 320 Ia32/DivU64x64Remainder.S | GCC 321 Ia32/DivU64x32Remainder.S | GCC 322 Ia32/ModU64x32.S | GCC 323 Ia32/DivU64x32.S | GCC 324 Ia32/MultU64x64.S | GCC 325 Ia32/MultU64x32.S | GCC 326 Ia32/RRotU64.S | GCC 327 Ia32/LRotU64.S | GCC 328 Ia32/ARShiftU64.S | GCC 329 Ia32/RShiftU64.S | GCC 330 Ia32/LShiftU64.S | GCC 331 >>>>>>> .merge-right.r103776 282 332 Ia32/EnableCache.S | GCC 283 333 Ia32/DisableCache.S | GCC … … 396 446 X64/DisableCache.asm 397 447 398 X64/CpuBreakpoint.c | MSFT 399 X64/WriteMsr64.c | MSFT 400 X64/ReadMsr64.c | MSFT 401 402 X64/CpuBreakpoint.asm | INTEL 403 X64/WriteMsr64.asm | INTEL 404 X64/ReadMsr64.asm | INTEL 448 X64/CpuBreakpoint.c | MSFT 449 X64/WriteMsr64.c | MSFT 450 X64/ReadMsr64.c | MSFT 451 452 X64/CpuBreakpoint.asm | INTEL 453 X64/WriteMsr64.asm | INTEL 454 X64/ReadMsr64.asm | INTEL 405 455 406 456 X64/Non-existing.c … … 424 474 X64/GccInline.c | GCC 425 475 # VBox begin (yasm doesn't like the nasm variant) - original: 426 # Ia32/Thunk16.nasm | GCC 476 # Ia32/Thunk16.nasm | GCC 427 477 Ia32/Thunk16.asm | GCC 428 478 # VBox end 429 X64/SwitchStack.S | GCC 430 X64/SetJump.S | GCC 431 X64/LongJump.S | GCC 432 X64/EnableDisableInterrupts.S | GCC 433 X64/DisablePaging64.S | GCC 434 X64/CpuId.S | GCC 435 X64/CpuIdEx.S | GCC 479 X64/SwitchStack.S | GCC 480 X64/SetJump.S | GCC 481 X64/LongJump.S | GCC 482 X64/EnableDisableInterrupts.S | GCC 483 X64/DisablePaging64.S | GCC 484 X64/CpuId.S | GCC 485 X64/CpuIdEx.S | GCC 436 486 X64/EnableCache.S | GCC 437 487 X64/DisableCache.S | GCC 438 ChkStkGcc.c | GCC 488 ChkStkGcc.c | GCC 439 489 440 490 [Sources.IPF] … … 481 531 Arm/InternalSwitchStack.c 482 532 Arm/Unaligned.c 483 Math64.c | RVCT 484 533 Math64.c | RVCT 534 485 535 Arm/SwitchStack.asm | RVCT 486 536 Arm/SetJumpLongJump.asm | RVCT … … 491 541 Arm/CpuBreakpoint.asm | RVCT 492 542 Arm/MemoryFence.asm | RVCT 493 543 494 544 Arm/Math64.S | GCC 495 545 Arm/SwitchStack.S | GCC -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/BitField.c
r58459 r58466 70 70 { 71 71 // 72 // Higher bits in OrData those are not used must be zero. 72 // Higher bits in OrData those are not used must be zero. 73 73 // 74 74 // EndBit - StartBit + 1 might be 32 while the result right shifting 32 on a 32bit integer is undefined, … … 76 76 // 77 77 ASSERT ((OrData >> (EndBit - StartBit)) == ((OrData >> (EndBit - StartBit)) & 1)); 78 78 79 79 // 80 80 // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit] … … 112 112 { 113 113 // 114 // Higher bits in AndData those are not used must be zero. 114 // Higher bits in AndData those are not used must be zero. 115 115 // 116 116 // EndBit - StartBit + 1 might be 32 while the result right shifting 32 on a 32bit integer is undefined, … … 276 276 277 277 Performs a bitwise AND between the bit field specified by StartBit and EndBit 278 in Operand and the value specified by AndData, followed by a bitwise 278 in Operand and the value specified by AndData, followed by a bitwise 279 279 OR with value specified by OrData. All other bits in Operand are 280 280 preserved. The new 8-bit value is returned. … … 468 468 469 469 Performs a bitwise AND between the bit field specified by StartBit and EndBit 470 in Operand and the value specified by AndData, followed by a bitwise 470 in Operand and the value specified by AndData, followed by a bitwise 471 471 OR with value specified by OrData. All other bits in Operand are 472 472 preserved. The new 16-bit value is returned. … … 660 660 661 661 Performs a bitwise AND between the bit field specified by StartBit and EndBit 662 in Operand and the value specified by AndData, followed by a bitwise 662 in Operand and the value specified by AndData, followed by a bitwise 663 663 OR with value specified by OrData. All other bits in Operand are 664 664 preserved. The new 32-bit value is returned. … … 810 810 ASSERT (StartBit <= EndBit); 811 811 // 812 // Higher bits in OrData those are not used must be zero. 812 // Higher bits in OrData those are not used must be zero. 813 813 // 814 814 // EndBit - StartBit + 1 might be 64 while the result right shifting 64 on RShiftU64() API is invalid, … … 858 858 UINT64 Value1; 859 859 UINT64 Value2; 860 860 861 861 ASSERT (EndBit < 64); 862 862 ASSERT (StartBit <= EndBit); 863 863 // 864 // Higher bits in AndData those are not used must be zero. 864 // Higher bits in AndData those are not used must be zero. 865 865 // 866 866 // EndBit - StartBit + 1 might be 64 while the right shifting 64 on RShiftU64() API is invalid, … … 880 880 881 881 Performs a bitwise AND between the bit field specified by StartBit and EndBit 882 in Operand and the value specified by AndData, followed by a bitwise 882 in Operand and the value specified by AndData, followed by a bitwise 883 883 OR with value specified by OrData. All other bits in Operand are 884 884 preserved. The new 64-bit value is returned. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/CheckSum.c
r48674 r58466 50 50 Sum = (UINT8) (Sum + *(Buffer + Count)); 51 51 } 52 52 53 53 return Sum; 54 54 } … … 129 129 Sum = (UINT16) (Sum + *(Buffer + Count)); 130 130 } 131 131 132 132 return Sum; 133 133 } … … 211 211 Sum = Sum + *(Buffer + Count); 212 212 } 213 213 214 214 return Sum; 215 215 } … … 293 293 Sum = Sum + *(Buffer + Count); 294 294 } 295 295 296 296 return Sum; 297 297 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/ChkStkGcc.c
r48674 r58466 18 18 Hack function for passing GCC build. 19 19 **/ 20 VOID 21 __chkstk() 20 VOID 21 __chkstk() 22 22 { 23 23 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/DivS64x64Remainder.c
r48674 r58466 28 28 29 29 It is the caller's responsibility to not call this function with a Divisor of 0. 30 If Divisor is 0, then the quotient and remainder should be assumed to be 30 If Divisor is 0, then the quotient and remainder should be assumed to be 31 31 the largest negative integer. 32 32 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S
r58459 r58466 58 58 jnz L2 59 59 divl %ebx 60 movl %eax, %ebx # ebx <- quotient 61 movl 28(%esp), %ecx # ecx <- high dword of divisor 60 movl %eax, %ebx # ebx <- quotient 61 movl 28(%esp), %ecx # ecx <- high dword of divisor 62 62 mull 24(%esp) # edx:eax <- quotient * divisor[0..31] 63 imull %ebx, %ecx # ecx <- quotient * divisor[32..63] 64 addl %ecx, %edx # edx <- (quotient * divisor)[32..63] 65 mov 32(%esp), %ecx # ecx <- addr for Remainder 66 jc TooLarge # product > 2^64 67 cmpl %edx, %edi # compare high 32 bits 68 ja Correct 69 jb TooLarge # product > dividend 70 cmpl %eax, %esi 71 jae Correct # product <= dividend 63 imull %ebx, %ecx # ecx <- quotient * divisor[32..63] 64 addl %ecx, %edx # edx <- (quotient * divisor)[32..63] 65 mov 32(%esp), %ecx # ecx <- addr for Remainder 66 jc TooLarge # product > 2^64 67 cmpl %edx, %edi # compare high 32 bits 68 ja Correct 69 jb TooLarge # product > dividend 70 cmpl %eax, %esi 71 jae Correct # product <= dividend 72 72 TooLarge: 73 decl %ebx # adjust quotient by -1 74 jecxz Return # return if Remainder == NULL 75 sub 24(%esp), %eax 73 decl %ebx # adjust quotient by -1 74 jecxz Return # return if Remainder == NULL 75 sub 24(%esp), %eax 76 76 sbb 28(%esp), %edx # edx:eax <- (quotient - 1) * divisor 77 77 Correct: … … 82 82 movl %edi, 4(%ecx) 83 83 Return: 84 movl %ebx, %eax # eax <- quotient 84 movl %ebx, %eax # eax <- quotient 85 85 xorl %edx, %edx # quotient is 32 bits long 86 86 pop %edi -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ia32/EnableCache.S
r48674 r58466 16 16 # Abstract: 17 17 # 18 # Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear 18 # Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear 19 19 # the NW bit of CR0 to 0 20 20 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ia32/EnableCache.asm
r48674 r58466 16 16 ; Abstract: 17 17 ; 18 ; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear 18 ; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear 19 19 ; the NW bit of CR0 to 0 20 20 ; -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ia32/GccInline.c
r48674 r58466 1 1 /** @file 2 2 GCC inline implementation of BaseLib processor specific functions. 3 3 4 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 5 5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> … … 33 33 { 34 34 // This is a little bit of overkill and it is more about the compiler that it is 35 // actually processor synchronization. This is like the _ReadWriteBarrier 35 // actually processor synchronization. This is like the _ReadWriteBarrier 36 36 // Microsoft specific intrinsic 37 37 __asm__ __volatile__ ("":::"memory"); … … 66 66 VOID 67 67 ) 68 { 68 { 69 69 __asm__ __volatile__ ("cli"::: "memory"); 70 70 } … … 129 129 { 130 130 UINT64 Data; 131 131 132 132 __asm__ __volatile__ ( 133 133 "rdmsr" … … 135 135 : "c" (Index) // %1 136 136 ); 137 137 138 138 return Data; 139 139 } … … 169 169 "A" (Value) 170 170 ); 171 171 172 172 return Value; 173 173 } … … 192 192 { 193 193 UINTN Eflags; 194 194 195 195 __asm__ __volatile__ ( 196 196 "pushfl \n\t" … … 198 198 : "=r" (Eflags) 199 199 ); 200 200 201 201 return Eflags; 202 202 } … … 221 221 { 222 222 UINTN Data; 223 224 __asm__ __volatile__ ( 225 "movl %%cr0,%0" 223 224 __asm__ __volatile__ ( 225 "movl %%cr0,%0" 226 226 : "=a" (Data) 227 227 ); 228 228 229 229 return Data; 230 230 } … … 248 248 { 249 249 UINTN Data; 250 251 __asm__ __volatile__ ( 252 "movl %%cr2, %0" 250 251 __asm__ __volatile__ ( 252 "movl %%cr2, %0" 253 253 : "=r" (Data) 254 254 ); 255 255 256 256 return Data; 257 257 } … … 274 274 { 275 275 UINTN Data; 276 276 277 277 __asm__ __volatile__ ( 278 278 "movl %%cr3, %0" 279 279 : "=r" (Data) 280 280 ); 281 281 282 282 return Data; 283 283 } … … 301 301 { 302 302 UINTN Data; 303 303 304 304 __asm__ __volatile__ ( 305 305 "movl %%cr4, %0" 306 306 : "=a" (Data) 307 307 ); 308 308 309 309 return Data; 310 310 } … … 432 432 { 433 433 UINTN Data; 434 434 435 435 __asm__ __volatile__ ( 436 436 "movl %%dr0, %0" 437 437 : "=r" (Data) 438 438 ); 439 439 440 440 return Data; 441 441 } … … 459 459 { 460 460 UINTN Data; 461 461 462 462 __asm__ __volatile__ ( 463 463 "movl %%dr1, %0" 464 464 : "=r" (Data) 465 465 ); 466 466 467 467 return Data; 468 468 } … … 486 486 { 487 487 UINTN Data; 488 488 489 489 __asm__ __volatile__ ( 490 490 "movl %%dr2, %0" 491 491 : "=r" (Data) 492 492 ); 493 493 494 494 return Data; 495 495 } … … 513 513 { 514 514 UINTN Data; 515 515 516 516 __asm__ __volatile__ ( 517 517 "movl %%dr3, %0" 518 518 : "=r" (Data) 519 519 ); 520 520 521 521 return Data; 522 522 } … … 540 540 { 541 541 UINTN Data; 542 542 543 543 __asm__ __volatile__ ( 544 544 "movl %%dr4, %0" 545 545 : "=r" (Data) 546 546 ); 547 547 548 548 return Data; 549 549 } … … 567 567 { 568 568 UINTN Data; 569 569 570 570 __asm__ __volatile__ ( 571 571 "movl %%dr5, %0" 572 572 : "=r" (Data) 573 573 ); 574 574 575 575 return Data; 576 576 } … … 594 594 { 595 595 UINTN Data; 596 596 597 597 __asm__ __volatile__ ( 598 598 "movl %%dr6, %0" 599 599 : "=r" (Data) 600 600 ); 601 601 602 602 return Data; 603 603 } … … 621 621 { 622 622 UINTN Data; 623 623 624 624 __asm__ __volatile__ ( 625 625 "movl %%dr7, %0" 626 626 : "=r" (Data) 627 627 ); 628 628 629 629 return Data; 630 630 } … … 855 855 { 856 856 UINT16 Data; 857 857 858 858 __asm__ __volatile__ ( 859 859 "mov %%cs, %0" 860 860 :"=a" (Data) 861 861 ); 862 862 863 863 return Data; 864 864 } … … 881 881 { 882 882 UINT16 Data; 883 883 884 884 __asm__ __volatile__ ( 885 885 "mov %%ds, %0" 886 886 :"=a" (Data) 887 887 ); 888 888 889 889 return Data; 890 890 } … … 907 907 { 908 908 UINT16 Data; 909 909 910 910 __asm__ __volatile__ ( 911 911 "mov %%es, %0" 912 912 :"=a" (Data) 913 913 ); 914 914 915 915 return Data; 916 916 } … … 933 933 { 934 934 UINT16 Data; 935 935 936 936 __asm__ __volatile__ ( 937 937 "mov %%fs, %0" 938 938 :"=a" (Data) 939 939 ); 940 940 941 941 return Data; 942 942 } … … 959 959 { 960 960 UINT16 Data; 961 961 962 962 __asm__ __volatile__ ( 963 963 "mov %%gs, %0" 964 964 :"=a" (Data) 965 965 ); 966 966 967 967 return Data; 968 968 } … … 985 985 { 986 986 UINT16 Data; 987 987 988 988 __asm__ __volatile__ ( 989 989 "mov %%ds, %0" 990 990 :"=a" (Data) 991 991 ); 992 992 993 993 return Data; 994 994 } … … 1011 1011 { 1012 1012 UINT16 Data; 1013 1013 1014 1014 __asm__ __volatile__ ( 1015 1015 "str %0" 1016 1016 : "=a" (Data) 1017 1017 ); 1018 1018 1019 1019 return Data; 1020 1020 } … … 1063 1063 : "m" (*Gdtr) 1064 1064 ); 1065 1065 1066 1066 } 1067 1067 … … 1128 1128 { 1129 1129 UINT16 Data; 1130 1130 1131 1131 __asm__ __volatile__ ( 1132 1132 "sldt %0" 1133 1133 : "=g" (Data) // %0 1134 1134 ); 1135 1135 1136 1136 return Data; 1137 1137 } … … 1181 1181 : 1182 1182 : "m" (*Buffer) // %0 1183 ); 1183 ); 1184 1184 } 1185 1185 … … 1234 1234 : "=A" (Data) // %0 1235 1235 ); 1236 1236 1237 1237 return Data; 1238 1238 } … … 1264 1264 : "=A" (Data) // %0 1265 1265 ); 1266 1266 1267 1267 return Data; 1268 1268 } … … 1294 1294 : "=A" (Data) // %0 1295 1295 ); 1296 1296 1297 1297 return Data; 1298 1298 } … … 1324 1324 : "=A" (Data) // %0 1325 1325 ); 1326 1326 1327 1327 return Data; 1328 1328 } … … 1354 1354 : "=A" (Data) // %0 1355 1355 ); 1356 1356 1357 1357 return Data; 1358 1358 } … … 1384 1384 : "=A" (Data) // %0 1385 1385 ); 1386 1386 1387 1387 return Data; 1388 1388 } … … 1414 1414 : "=A" (Data) // %0 1415 1415 ); 1416 1416 1417 1417 return Data; 1418 1418 } … … 1444 1444 : "=A" (Data) // %0 1445 1445 ); 1446 1446 1447 1447 return Data; 1448 1448 } … … 1466 1466 __asm__ __volatile__ ( 1467 1467 "movq %0, %%mm0" // %0 1468 : 1468 : 1469 1469 : "m" (Value) 1470 1470 ); … … 1489 1489 __asm__ __volatile__ ( 1490 1490 "movq %0, %%mm1" // %0 1491 : 1491 : 1492 1492 : "m" (Value) 1493 1493 ); … … 1512 1512 __asm__ __volatile__ ( 1513 1513 "movq %0, %%mm2" // %0 1514 : 1514 : 1515 1515 : "m" (Value) 1516 1516 ); … … 1535 1535 __asm__ __volatile__ ( 1536 1536 "movq %0, %%mm3" // %0 1537 : 1537 : 1538 1538 : "m" (Value) 1539 1539 ); … … 1558 1558 __asm__ __volatile__ ( 1559 1559 "movq %0, %%mm4" // %0 1560 : 1560 : 1561 1561 : "m" (Value) 1562 1562 ); … … 1581 1581 __asm__ __volatile__ ( 1582 1582 "movq %0, %%mm5" // %0 1583 : 1583 : 1584 1584 : "m" (Value) 1585 1585 ); … … 1604 1604 __asm__ __volatile__ ( 1605 1605 "movq %0, %%mm6" // %0 1606 : 1606 : 1607 1607 : "m" (Value) 1608 1608 ); … … 1627 1627 __asm__ __volatile__ ( 1628 1628 "movq %0, %%mm7" // %0 1629 : 1629 : 1630 1630 : "m" (Value) 1631 1631 ); … … 1649 1649 { 1650 1650 UINT64 Data; 1651 1651 1652 1652 __asm__ __volatile__ ( 1653 1653 "rdtsc" 1654 1654 : "=A" (Data) 1655 1655 ); 1656 1657 return Data; 1656 1657 return Data; 1658 1658 } 1659 1659 … … 1677 1677 { 1678 1678 UINT64 Data; 1679 1679 1680 1680 __asm__ __volatile__ ( 1681 1681 "rdpmc" … … 1683 1683 : "c" (Index) 1684 1684 ); 1685 1686 return Data; 1685 1686 return Data; 1687 1687 } 1688 1688 … … 1721 1721 { 1722 1722 __asm__ __volatile__ ("invd":::"memory"); 1723 1723 1724 1724 } 1725 1725 … … 1748 1748 __asm__ __volatile__ ( 1749 1749 "clflush (%0)" 1750 : "+a" (LinearAddress) 1751 : 1750 : "+a" (LinearAddress) 1751 : 1752 1752 : "memory" 1753 1753 ); 1754 1754 1755 1755 return LinearAddress; 1756 1756 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.S
r48674 r58466 45 45 movl %eax, (%esp) 46 46 pushl $0 # keeps gdb from unwinding stack 47 jmp *8(%ebp) # call and never return 47 jmp *8(%ebp) # call and never return 48 48 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ia32/MultU64x64.S
r48674 r58466 31 31 #------------------------------------------------------------------------------ 32 32 ASM_PFX(InternalMathMultU64x64): 33 push %ebx 34 movl 8(%esp), %ebx # ebx <- M1[0..31] 35 movl 16(%esp), %edx # edx <- M2[0..31] 36 movl %ebx, %ecx 37 movl %edx, %eax 38 imull 20(%esp), %ebx # ebx <- M1[0..31] * M2[32..63] 39 imull 12(%esp), %edx # edx <- M1[32..63] * M2[0..31] 40 addl %edx, %ebx # carries are abandoned 33 push %ebx 34 movl 8(%esp), %ebx # ebx <- M1[0..31] 35 movl 16(%esp), %edx # edx <- M2[0..31] 36 movl %ebx, %ecx 37 movl %edx, %eax 38 imull 20(%esp), %ebx # ebx <- M1[0..31] * M2[32..63] 39 imull 12(%esp), %edx # edx <- M1[32..63] * M2[0..31] 40 addl %edx, %ebx # carries are abandoned 41 41 mull %ecx # edx:eax <- M1[0..31] * M2[0..31] 42 addl %ebx, %edx # carries are abandoned 42 addl %ebx, %edx # carries are abandoned 43 43 pop %ebx 44 44 ret -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ipf/AccessMsrDb.s
r48674 r58466 1 1 /// @file 2 /// IPF specific Machine Specific Registers accessing functions. 3 /// This implementation uses raw data to prepresent the assembly instruction of 2 /// IPF specific Machine Specific Registers accessing functions. 3 /// This implementation uses raw data to prepresent the assembly instruction of 4 4 /// mov msr[]= and mov =msr[]. 5 5 /// … … 44 44 AsmReadMsr:: 45 45 // 46 // The follow 16 bytes stand for the bundle of 46 // The follow 16 bytes stand for the bundle of 47 47 // mov r8=msr[in0];; 48 48 // since MSFT tool chain does not support mov =msr[] instruction … … 95 95 AsmWriteMsr:: 96 96 // 97 // The follow 16 bytes stand for the bundle of 97 // The follow 16 bytes stand for the bundle of 98 98 // mov msr[in0] = in1 99 99 // mov r8 = in1;; -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ipf/Asm.h
r48674 r58466 1 /** @file 1 /** @file 2 2 3 3 This module contains generic macros for an assembly writer. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ipf/AsmCpuMisc.s
r48674 r58466 35 35 // do we need the mf.a also here? 36 36 mf.a // wait for any IO to complete? 37 37 38 38 // not sure if we need serialization here, just put it, in case... 39 39 40 40 srlz.d;; 41 41 srlz.i;; 42 42 43 43 br.ret.dpnt b0;; 44 44 .endp MemoryFence -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ipf/FlushCacheRange.c
r48674 r58466 20 20 CPU. 21 21 22 Flushes the cache lines specified by Address and Length. If Address is not aligned 23 on a cache line boundary, then entire cache line containing Address is flushed. 24 If Address + Length is not aligned on a cache line boundary, then the entire cache 25 line containing Address + Length - 1 is flushed. This function may choose to flush 26 the entire cache if that is more efficient than flushing the specified range. If 27 Length is 0, the no cache lines are flushed. Address is returned. 22 Flushes the cache lines specified by Address and Length. If Address is not aligned 23 on a cache line boundary, then entire cache line containing Address is flushed. 24 If Address + Length is not aligned on a cache line boundary, then the entire cache 25 line containing Address + Length - 1 is flushed. This function may choose to flush 26 the entire cache if that is more efficient than flushing the specified range. If 27 Length is 0, the no cache lines are flushed. Address is returned. 28 28 This function is only available on IPF. 29 29 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ipf/Ia64gen.h
r48674 r58466 1 /** @file 1 /** @file 2 2 3 3 Register Definition for IPF. 4 4 5 5 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> 6 6 This program and the accompanying materials … … 10 10 11 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 14 14 **/ 15 15 #ifndef _IA64GEN_H_ -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ipf/InternalFlushCacheRange.s
r48674 r58466 1 1 //++ 2 2 // Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> 3 // This program and the accompanying materials 4 // are licensed and made available under the terms and conditions of the BSD License 5 // which accompanies this distribution. The full text of the license may be found at 6 // http://opensource.org/licenses/bsd-license.php. 7 // 8 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 9 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 10 // 3 // This program and the accompanying materials 4 // are licensed and made available under the terms and conditions of the BSD License 5 // which accompanies this distribution. The full text of the license may be found at 6 // http://opensource.org/licenses/bsd-license.php. 7 // 8 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 9 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 10 // 11 11 // Module Name: 12 // InternalFlushCacheRange.s 12 // InternalFlushCacheRange.s 13 13 // 14 14 // Abstract: 15 // Assemble routine to flush cache lines 15 // Assemble routine to flush cache lines 16 16 // 17 17 // Revision History: … … 44 44 // 45 45 // @return Address 46 // 46 // 47 47 // VOID * 48 48 // EFIAPI … … 55 55 56 56 NESTED_SETUP (5,8,0,0) 57 57 58 58 mov loc2 = ar.lc 59 59 60 60 mov loc3 = in0 // Start address. 61 61 mov loc4 = in1;; // Length in bytes. 62 62 63 63 cmp.eq p6,p7 = loc4, r0;; // If Length is zero then don't flush any cache 64 (p6) br.spnt.many DoneFlushingC;; 65 66 add loc4 = loc4,loc3 64 (p6) br.spnt.many DoneFlushingC;; 65 66 add loc4 = loc4,loc3 67 67 mov loc5 = 1;; 68 68 sub loc4 = loc4, loc5 ;; // the End address to flush 69 70 dep loc3 = r0,loc3,0,5 71 dep loc4 = r0,loc4,0,5;; 72 shr loc3 = loc3,5 69 70 dep loc3 = r0,loc3,0,5 71 dep loc4 = r0,loc4,0,5;; 72 shr loc3 = loc3,5 73 73 shr loc4 = loc4,5;; // 32 byte cache line 74 75 sub loc4 = loc4,loc3;; // total flush count, It should be add 1 but 76 // the br.cloop will first execute one time 77 mov loc3 = in0 78 mov loc5 = 32 74 75 sub loc4 = loc4,loc3;; // total flush count, It should be add 1 but 76 // the br.cloop will first execute one time 77 mov loc3 = in0 78 mov loc5 = 32 79 79 mov ar.lc = loc4;; 80 80 81 81 StillFlushingC: 82 fc loc3;; 82 fc loc3;; 83 83 sync.i;; 84 84 srlz.i;; … … 86 86 br.cloop.sptk.few StillFlushingC;; 87 87 88 DoneFlushingC: 89 mov ar.lc = loc2 88 DoneFlushingC: 89 mov ar.lc = loc2 90 90 mov r8 = in0 // return *Address 91 91 NESTED_RETURN -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ipf/ReadCr.s
r48674 r58466 94 94 (p49) mov ret0=cr.lrr0 // cr80 95 95 (p50) mov ret0=cr.lrr1 // cr81 96 96 97 97 // 98 98 // Restore predicates and return. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/Ipf/SwitchStack.s
r48674 r58466 28 28 mov r18 = in2 29 29 and r2 = r14, r2 30 30 31 31 flushrs 32 32 33 33 mov ar.rsc = r2 34 34 mov sp = in3 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/LinkedList.c
r58459 r58466 25 25 If List->backLink is NULL, then ASSERT(). 26 26 If Node is NULL, then ASSERT(). 27 If PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE and Node 27 If PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE and Node 28 28 is in not a member of List, then return FALSE 29 29 If PcdMaximumLinkedListLength is not zero, and List contains more than … … 32 32 @param List A pointer to a node in a linked list. 33 33 @param Node A pointer to a node in a linked list. 34 @param VerifyNodeInList TRUE if a check should be made to see if Node is a 35 member of List. FALSE if no membership test should 34 @param VerifyNodeInList TRUE if a check should be made to see if Node is a 35 member of List. FALSE if no membership test should 36 36 be performed. 37 37 38 38 @retval TRUE if PcdVerifyNodeInList is FALSE 39 39 @retval TRUE if DoMembershipCheck is FALSE 40 @retval TRUE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE 40 @retval TRUE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE 41 41 and Node is a member of List. 42 @retval FALSE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE 42 @retval FALSE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE 43 43 and Node is in not a member of List. 44 44 … … 68 68 if (FeaturePcdGet (PcdVerifyNodeInList) && VerifyNodeInList) { 69 69 // 70 // Check to see if Node is a member of List. 70 // Check to see if Node is a member of List. 71 71 // Exit early if the number of nodes in List >= PcdMaximumLinkedListLength 72 72 // … … 87 87 } 88 88 } 89 } while ((Ptr != List) && (Ptr != Node)); 89 } while ((Ptr != List) && (Ptr != Node)); 90 90 91 91 if (Ptr != Node) { … … 176 176 // 177 177 ASSERT (InternalBaseLibIsNodeInList (ListHead, Entry, FALSE)); 178 178 179 179 Entry->ForwardLink = ListHead->ForwardLink; 180 180 Entry->BackLink = ListHead; … … 193 193 If ListHead is NULL, then ASSERT(). 194 194 If Entry is NULL, then ASSERT(). 195 If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 195 If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 196 196 InitializeListHead(), then ASSERT(). 197 197 If PcdMaximumLinkedListLength is not zero, and prior to insertion the number … … 217 217 // 218 218 ASSERT (InternalBaseLibIsNodeInList (ListHead, Entry, FALSE)); 219 219 220 220 Entry->ForwardLink = ListHead; 221 221 Entry->BackLink = ListHead->BackLink; … … 228 228 Retrieves the first node of a doubly-linked list. 229 229 230 Returns the first node of a doubly-linked list. List must have been 230 Returns the first node of a doubly-linked list. List must have been 231 231 initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(). 232 232 If List is empty, then List is returned. 233 233 234 234 If List is NULL, then ASSERT(). 235 If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 235 If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 236 236 InitializeListHead(), then ASSERT(). 237 237 If PcdMaximumLinkedListLength is not zero, and the number of nodes … … 262 262 Retrieves the next node of a doubly-linked list. 263 263 264 Returns the node of a doubly-linked list that follows Node. 264 Returns the node of a doubly-linked list that follows Node. 265 265 List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE() 266 266 or InitializeListHead(). If List is empty, then List is returned. … … 268 268 If List is NULL, then ASSERT(). 269 269 If Node is NULL, then ASSERT(). 270 If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 270 If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 271 271 InitializeListHead(), then ASSERT(). 272 272 If PcdMaximumLinkedListLength is not zero, and List contains more than … … 297 297 /** 298 298 Retrieves the previous node of a doubly-linked list. 299 300 Returns the node of a doubly-linked list that precedes Node. 299 300 Returns the node of a doubly-linked list that precedes Node. 301 301 List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE() 302 302 or InitializeListHead(). If List is empty, then List is returned. 303 303 304 304 If List is NULL, then ASSERT(). 305 305 If Node is NULL, then ASSERT(). 306 If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 306 If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 307 307 InitializeListHead(), then ASSERT(). 308 308 If PcdMaximumLinkedListLength is not zero, and List contains more than 309 309 PcdMaximumLinkedListLength nodes, then ASSERT(). 310 310 If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT(). 311 311 312 312 @param List A pointer to the head node of a doubly-linked list. 313 313 @param Node A pointer to a node in the doubly-linked list. 314 314 315 315 @return A pointer to the previous node if one exists. Otherwise List is returned. 316 316 317 317 **/ 318 318 LIST_ENTRY * … … 327 327 // 328 328 ASSERT (InternalBaseLibIsNodeInList (List, Node, TRUE)); 329 329 330 330 return Node->BackLink; 331 331 } … … 338 338 339 339 If ListHead is NULL, then ASSERT(). 340 If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 340 If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or 341 341 InitializeListHead(), then ASSERT(). 342 342 If PcdMaximumLinkedListLength is not zero, and the number of nodes … … 360 360 // 361 361 ASSERT (InternalBaseLibIsNodeInList (ListHead, ListHead, FALSE)); 362 362 363 363 return (BOOLEAN)(ListHead->ForwardLink == ListHead); 364 364 } … … 375 375 If List is NULL, then ASSERT(). 376 376 If Node is NULL, then ASSERT(). 377 If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(), 377 If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(), 378 378 then ASSERT(). 379 379 If PcdMaximumLinkedListLength is not zero, and the number of nodes 380 380 in List, including the List node, is greater than or equal to 381 381 PcdMaximumLinkedListLength, then ASSERT(). 382 If PcdVerifyNodeInList is TRUE and Node is not a node in List and Node is not 382 If PcdVerifyNodeInList is TRUE and Node is not a node in List and Node is not 383 383 equal to List, then ASSERT(). 384 384 … … 401 401 // 402 402 ASSERT (InternalBaseLibIsNodeInList (List, Node, TRUE)); 403 403 404 404 return (BOOLEAN)(Node == List); 405 405 } … … 439 439 // 440 440 ASSERT (InternalBaseLibIsNodeInList (List, Node, TRUE)); 441 441 442 442 return (BOOLEAN)(!IsNull (List, Node) && List->BackLink == Node); 443 443 } … … 451 451 of the SecondEntry node in a doubly-linked list. SecondEntry must be in the 452 452 same double linked list as FirstEntry and that double linked list must have 453 been initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(). 453 been initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(). 454 454 SecondEntry is returned after the nodes are swapped. 455 455 456 456 If FirstEntry is NULL, then ASSERT(). 457 457 If SecondEntry is NULL, then ASSERT(). 458 If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the 458 If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the 459 459 same linked list, then ASSERT(). 460 460 If PcdMaximumLinkedListLength is not zero, and the number of nodes in the … … 465 465 @param FirstEntry A pointer to a node in a linked list. 466 466 @param SecondEntry A pointer to another node in the same linked list. 467 467 468 468 @return SecondEntry. 469 469 … … 486 486 // 487 487 ASSERT (InternalBaseLibIsNodeInList (FirstEntry, SecondEntry, TRUE)); 488 488 489 489 // 490 490 // Ptr is the node pointed to by FirstEntry->ForwardLink … … 544 544 { 545 545 ASSERT (!IsListEmpty (Entry)); 546 546 547 547 Entry->ForwardLink->BackLink = Entry->BackLink; 548 548 Entry->BackLink->ForwardLink = Entry->ForwardLink; -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/SafeString.c
r58464 r58466 165 165 If Source is NULL. 166 166 If PcdMaximumUnicodeStringLength is not zero, 167 and DestMax is greater than 167 and DestMax is greater than 168 168 PcdMaximumUnicodeStringLength. 169 169 If DestMax is 0. … … 179 179 { 180 180 UINTN SourceLen; 181 181 182 182 ASSERT (((UINTN) Destination & BIT0) == 0); 183 183 ASSERT (((UINTN) Source & BIT0) == 0); … … 239 239 240 240 @retval RETURN_SUCCESS String is copied. 241 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than 241 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than 242 242 MIN(StrLen(Source), Length). 243 243 @retval RETURN_INVALID_PARAMETER If Destination is NULL. 244 244 If Source is NULL. 245 245 If PcdMaximumUnicodeStringLength is not zero, 246 and DestMax is greater than 246 and DestMax is greater than 247 247 PcdMaximumUnicodeStringLength. 248 248 If DestMax is 0. … … 326 326 327 327 @retval RETURN_SUCCESS String is appended. 328 @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than 328 @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than 329 329 StrLen(Destination). 330 330 @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT … … 333 333 If Source is NULL. 334 334 If PcdMaximumUnicodeStringLength is not zero, 335 and DestMax is greater than 335 and DestMax is greater than 336 336 PcdMaximumUnicodeStringLength. 337 337 If DestMax is 0. … … 349 349 UINTN CopyLen; 350 350 UINTN SourceLen; 351 351 352 352 ASSERT (((UINTN) Destination & BIT0) == 0); 353 353 ASSERT (((UINTN) Source & BIT0) == 0); … … 430 430 If Source is NULL. 431 431 If PcdMaximumUnicodeStringLength is not zero, 432 and DestMax is greater than 432 and DestMax is greater than 433 433 PcdMaximumUnicodeStringLength. 434 434 If DestMax is 0. … … 447 447 UINTN CopyLen; 448 448 UINTN SourceLen; 449 449 450 450 ASSERT (((UINTN) Destination & BIT0) == 0); 451 451 ASSERT (((UINTN) Source & BIT0) == 0); … … 568 568 If Source is NULL. 569 569 If PcdMaximumAsciiStringLength is not zero, 570 and DestMax is greater than 570 and DestMax is greater than 571 571 PcdMaximumAsciiStringLength. 572 572 If DestMax is 0. … … 582 582 { 583 583 UINTN SourceLen; 584 584 585 585 // 586 586 // 1. Neither Destination nor Source shall be a null pointer. … … 636 636 637 637 @retval RETURN_SUCCESS String is copied. 638 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than 638 @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than 639 639 MIN(StrLen(Source), Length). 640 640 @retval RETURN_INVALID_PARAMETER If Destination is NULL. 641 641 If Source is NULL. 642 642 If PcdMaximumAsciiStringLength is not zero, 643 and DestMax is greater than 643 and DestMax is greater than 644 644 PcdMaximumAsciiStringLength. 645 645 If DestMax is 0. … … 717 717 718 718 @retval RETURN_SUCCESS String is appended. 719 @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than 719 @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than 720 720 StrLen(Destination). 721 721 @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT … … 724 724 If Source is NULL. 725 725 If PcdMaximumAsciiStringLength is not zero, 726 and DestMax is greater than 726 and DestMax is greater than 727 727 PcdMaximumAsciiStringLength. 728 728 If DestMax is 0. … … 740 740 UINTN CopyLen; 741 741 UINTN SourceLen; 742 742 743 743 // 744 744 // Let CopyLen denote the value DestMax - AsciiStrnLenS(Destination, DestMax) upon entry to AsciiStrCatS. … … 815 815 If Source is NULL. 816 816 If PcdMaximumAsciiStringLength is not zero, 817 and DestMax is greater than 817 and DestMax is greater than 818 818 PcdMaximumAsciiStringLength. 819 819 If DestMax is 0. … … 832 832 UINTN CopyLen; 833 833 UINTN SourceLen; 834 834 835 835 // 836 836 // Let CopyLen denote the value DestMax - AsciiStrnLenS(Destination, DestMax) upon entry to AsciiStrnCatS. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/String.c
r58459 r58466 74 74 [ATTENTION] This function will be deprecated for security reason. 75 75 76 Copies up to a specified length from one Null-terminated Unicode string to 76 Copies up to a specified length from one Null-terminated Unicode string to 77 77 another Null-terminated Unicode string and returns the new Unicode string. 78 78 … … 90 90 If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT(). 91 91 If Source and Destination overlap, then ASSERT(). 92 If PcdMaximumUnicodeStringLength is not zero, and Length is greater than 92 If PcdMaximumUnicodeStringLength is not zero, and Length is greater than 93 93 PcdMaximumUnicodeStringLength, then ASSERT(). 94 94 If PcdMaximumUnicodeStringLength is not zero, and Source contains more than … … 189 189 Null terminator. 190 190 191 This function returns the size, in bytes, of the Null-terminated Unicode string 191 This function returns the size, in bytes, of the Null-terminated Unicode string 192 192 specified by String. 193 193 … … 263 263 Compares up to a specified length the contents of two Null-terminated Unicode strings, 264 264 and returns the difference between the first mismatched Unicode characters. 265 265 266 266 This function compares the Null-terminated Unicode string FirstString to the 267 267 Null-terminated Unicode string SecondString. At most, Length Unicode … … 382 382 [ATTENTION] This function will be deprecated for security reason. 383 383 384 Concatenates up to a specified length one Null-terminated Unicode to the end 385 of another Null-terminated Unicode string, and returns the concatenated 384 Concatenates up to a specified length one Null-terminated Unicode to the end 385 of another Null-terminated Unicode string, and returns the concatenated 386 386 Unicode string. 387 387 … … 399 399 If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT(). 400 400 If Source and Destination overlap, then ASSERT(). 401 If PcdMaximumUnicodeStringLength is not zero, and Length is greater than 401 If PcdMaximumUnicodeStringLength is not zero, and Length is greater than 402 402 PcdMaximumUnicodeStringLength, then ASSERT(). 403 403 If PcdMaximumUnicodeStringLength is not zero, and Destination contains more … … 492 492 SearchStringTmp = SearchString; 493 493 FirstMatch = String; 494 495 while ((*String == *SearchStringTmp) 494 495 while ((*String == *SearchStringTmp) 496 496 && (*String != L'\0')) { 497 497 String++; 498 498 SearchStringTmp++; 499 } 500 499 } 500 501 501 if (*SearchStringTmp == L'\0') { 502 502 return (CHAR16 *) FirstMatch; … … 516 516 Check if a Unicode character is a decimal character. 517 517 518 This internal function checks if a Unicode character is a 518 This internal function checks if a Unicode character is a 519 519 decimal character. The valid decimal character is from 520 520 L'0' to L'9'. … … 536 536 537 537 /** 538 Convert a Unicode character to upper case only if 538 Convert a Unicode character to upper case only if 539 539 it maps to a valid small-case ASCII character. 540 540 … … 568 568 This internal function only deal with Unicode character 569 569 which maps to a valid hexadecimal ASII character, i.e. 570 L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other 570 L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other 571 571 Unicode character, the value returned does not make sense. 572 572 … … 592 592 Check if a Unicode character is a hexadecimal character. 593 593 594 This internal function checks if a Unicode character is a 595 decimal character. The valid hexadecimal character is 594 This internal function checks if a Unicode character is a 595 decimal character. The valid hexadecimal character is 596 596 L'0' to L'9', L'a' to L'f', or L'A' to L'F'. 597 597 … … 656 656 { 657 657 UINTN Result; 658 658 659 659 // 660 660 // ASSERT String is less long than PcdMaximumUnicodeStringLength. … … 681 681 while (InternalIsDecimalDigitCharacter (*String)) { 682 682 // 683 // If the number represented by String overflows according 683 // If the number represented by String overflows according 684 684 // to the range defined by UINTN, then ASSERT(). 685 685 // … … 689 689 String++; 690 690 } 691 691 692 692 return Result; 693 693 } … … 735 735 { 736 736 UINT64 Result; 737 737 738 738 // 739 739 // ASSERT String is less long than PcdMaximumUnicodeStringLength. … … 760 760 while (InternalIsDecimalDigitCharacter (*String)) { 761 761 // 762 // If the number represented by String overflows according 762 // If the number represented by String overflows according 763 763 // to the range defined by UINTN, then ASSERT(). 764 764 // … … 768 768 String++; 769 769 } 770 770 771 771 return Result; 772 772 } … … 820 820 // 821 821 ASSERT (StrSize (String) != 0); 822 823 // 824 // Ignore the pad spaces (space or tab) 822 823 // 824 // Ignore the pad spaces (space or tab) 825 825 // 826 826 while ((*String == L' ') || (*String == L'\t')) { … … 846 846 847 847 Result = 0; 848 848 849 849 while (InternalIsHexaDecimalDigitCharacter (*String)) { 850 850 // 851 // If the Hex Number represented by String overflows according 851 // If the Hex Number represented by String overflows according 852 852 // to the range defined by UINTN, then ASSERT(). 853 853 // … … 910 910 // 911 911 ASSERT (StrSize (String) != 0); 912 913 // 914 // Ignore the pad spaces (space or tab) 912 913 // 914 // Ignore the pad spaces (space or tab) 915 915 // 916 916 while ((*String == L' ') || (*String == L'\t')) { … … 937 937 938 938 Result = 0; 939 939 940 940 while (InternalIsHexaDecimalDigitCharacter (*String)) { 941 941 // 942 // If the Hex Number represented by String overflows according 942 // If the Hex Number represented by String overflows according 943 943 // to the range defined by UINTN, then ASSERT(). 944 944 // … … 956 956 Check if a ASCII character is a decimal character. 957 957 958 This internal function checks if a Unicode character is a 958 This internal function checks if a Unicode character is a 959 959 decimal character. The valid decimal character is from 960 960 '0' to '9'. … … 978 978 Check if a ASCII character is a hexadecimal character. 979 979 980 This internal function checks if a ASCII character is a 981 decimal character. The valid hexadecimal character is 980 This internal function checks if a ASCII character is a 981 decimal character. The valid hexadecimal character is 982 982 L'0' to L'9', L'a' to L'f', or L'A' to L'F'. 983 983 … … 1061 1061 while (*Source != '\0') { 1062 1062 // 1063 // If any Unicode characters in Source contain 1063 // If any Unicode characters in Source contain 1064 1064 // non-zero value in the upper 8 bits, then ASSERT(). 1065 1065 // … … 1135 1135 [ATTENTION] This function will be deprecated for security reason. 1136 1136 1137 Copies up to a specified length one Null-terminated ASCII string to another 1137 Copies up to a specified length one Null-terminated ASCII string to another 1138 1138 Null-terminated ASCII string and returns the new ASCII string. 1139 1139 … … 1148 1148 If Source is NULL, then ASSERT(). 1149 1149 If Source and Destination overlap, then ASSERT(). 1150 If PcdMaximumAsciiStringLength is not zero, and Length is greater than 1150 If PcdMaximumAsciiStringLength is not zero, and Length is greater than 1151 1151 PcdMaximumAsciiStringLength, then ASSERT(). 1152 1152 If PcdMaximumAsciiStringLength is not zero, and Source contains more than … … 1324 1324 @param Chr one Ascii character 1325 1325 1326 @return The uppercase value of Ascii character 1326 @return The uppercase value of Ascii character 1327 1327 1328 1328 **/ … … 1341 1341 This internal function only deal with Unicode character 1342 1342 which maps to a valid hexadecimal ASII character, i.e. 1343 '0' to '9', 'a' to 'f' or 'A' to 'F'. For other 1343 '0' to '9', 'a' to 'f' or 'A' to 'F'. For other 1344 1344 ASCII character, the value returned does not make sense. 1345 1345 … … 1433 1433 If Length > 0 and FirstString is NULL, then ASSERT(). 1434 1434 If Length > 0 and SecondString is NULL, then ASSERT(). 1435 If PcdMaximumAsciiStringLength is not zero, and Length is greater than 1435 If PcdMaximumAsciiStringLength is not zero, and Length is greater than 1436 1436 PcdMaximumAsciiStringLength, then ASSERT(). 1437 1437 If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than … … 1445 1445 @param SecondString A pointer to a Null-terminated ASCII string. 1446 1446 @param Length The maximum number of ASCII characters for compare. 1447 1447 1448 1448 @retval ==0 FirstString is identical to SecondString. 1449 1449 @retval !=0 FirstString is not identical to SecondString. … … 1533 1533 [ATTENTION] This function will be deprecated for security reason. 1534 1534 1535 Concatenates up to a specified length one Null-terminated ASCII string to 1536 the end of another Null-terminated ASCII string, and returns the 1535 Concatenates up to a specified length one Null-terminated ASCII string to 1536 the end of another Null-terminated ASCII string, and returns the 1537 1537 concatenated ASCII string. 1538 1538 … … 1638 1638 SearchStringTmp = SearchString; 1639 1639 FirstMatch = String; 1640 1641 while ((*String == *SearchStringTmp) 1640 1641 while ((*String == *SearchStringTmp) 1642 1642 && (*String != '\0')) { 1643 1643 String++; 1644 1644 SearchStringTmp++; 1645 } 1646 1645 } 1646 1647 1647 if (*SearchStringTmp == '\0') { 1648 1648 return (CHAR8 *) FirstMatch; … … 1696 1696 { 1697 1697 UINTN Result; 1698 1698 1699 1699 // 1700 1700 // ASSERT Strings is less long than PcdMaximumAsciiStringLength … … 1720 1720 while (InternalAsciiIsDecimalDigitCharacter (*String)) { 1721 1721 // 1722 // If the number represented by String overflows according 1722 // If the number represented by String overflows according 1723 1723 // to the range defined by UINTN, then ASSERT(). 1724 1724 // … … 1728 1728 String++; 1729 1729 } 1730 1730 1731 1731 return Result; 1732 1732 } … … 1770 1770 { 1771 1771 UINT64 Result; 1772 1772 1773 1773 // 1774 1774 // ASSERT Strings is less long than PcdMaximumAsciiStringLength … … 1794 1794 while (InternalAsciiIsDecimalDigitCharacter (*String)) { 1795 1795 // 1796 // If the number represented by String overflows according 1796 // If the number represented by String overflows according 1797 1797 // to the range defined by UINTN, then ASSERT(). 1798 1798 // … … 1802 1802 String++; 1803 1803 } 1804 1804 1805 1805 return Result; 1806 1806 } … … 1852 1852 // 1853 1853 ASSERT (AsciiStrSize (String) != 0); 1854 1855 // 1856 // Ignore the pad spaces (space or tab) 1854 1855 // 1856 // Ignore the pad spaces (space or tab) 1857 1857 // 1858 1858 while ((*String == ' ') || (*String == '\t' )) { … … 1879 1879 1880 1880 Result = 0; 1881 1881 1882 1882 while (InternalAsciiIsHexaDecimalDigitCharacter (*String)) { 1883 1883 // 1884 // If the Hex Number represented by String overflows according 1884 // If the Hex Number represented by String overflows according 1885 1885 // to the range defined by UINTN, then ASSERT(). 1886 1886 // … … 1941 1941 // 1942 1942 ASSERT (AsciiStrSize (String) != 0); 1943 1943 1944 1944 // 1945 1945 // Ignore the pad spaces (space or tab) and leading Zeros 1946 1946 // 1947 1947 // 1948 // Ignore the pad spaces (space or tab) 1948 // Ignore the pad spaces (space or tab) 1949 1949 // 1950 1950 while ((*String == ' ') || (*String == '\t' )) { … … 1971 1971 1972 1972 Result = 0; 1973 1973 1974 1974 while (InternalAsciiIsHexaDecimalDigitCharacter (*String)) { 1975 1975 // 1976 // If the Hex Number represented by String overflows according 1976 // If the Hex Number represented by String overflows according 1977 1977 // to the range defined by UINTN, then ASSERT(). 1978 1978 // -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/SwitchStack.c
r48674 r58466 37 37 @param NewStack A pointer to the new stack to use for the EntryPoint 38 38 function. 39 @param ... This variable argument list is ignored for IA32, x64, and EBC. 40 For IPF, this variable argument list is expected to contain 41 a single parameter of type VOID * that specifies the new backing 39 @param ... This variable argument list is ignored for IA32, x64, and EBC. 40 For IPF, this variable argument list is expected to contain 41 a single parameter of type VOID * that specifies the new backing 42 42 store pointer. 43 43 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/CpuIdEx.S
r48674 r58466 45 45 jz L1 46 46 mov %ecx,(%r10) 47 L1: 47 L1: 48 48 mov %r8, %rcx 49 49 jrcxz L2 50 50 movl %eax,(%rcx) 51 L2: 51 L2: 52 52 mov %r9, %rcx 53 53 jrcxz L3 54 54 mov %ebx, (%rcx) 55 L3: 55 L3: 56 56 mov 0x40(%rsp), %rcx 57 57 jrcxz L4 58 58 mov %edx, (%rcx) 59 L4: 59 L4: 60 60 pop %rax # restore Index to rax as return value 61 61 pop %rbx -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/DisablePaging64.S
r48674 r58466 22 22 #------------------------------------------------------------------------------ 23 23 24 24 25 25 26 26 #------------------------------------------------------------------------------ … … 38 38 ASM_GLOBAL ASM_PFX(InternalX86DisablePaging64) 39 39 ASM_PFX(InternalX86DisablePaging64): 40 cli 40 cli 41 41 lea L1(%rip), %rsi # rsi <- The start address of transition code 42 42 mov 0x28(%rsp), %edi # rdi <- New stack … … 45 45 add $4, %rax # round rax up to the next 4 byte boundary 46 46 and $0xfc, %al 47 sub %rax, %rdi # rdi <- use stack to hold transition code 47 sub %rax, %rdi # rdi <- use stack to hold transition code 48 48 mov %edi, %r10d # r10 <- The start address of transicition code below 4G 49 49 push %rcx # save rcx to stack … … 52 52 movsb # copy transition code to (new stack - 64byte) below 4G 53 53 pop %rcx # restore rcx 54 55 mov %r8d, %esi 56 mov %r9d, %edi 54 55 mov %r8d, %esi 56 mov %r9d, %edi 57 57 mov %r10d, %eax 58 58 sub $4, %eax 59 59 push %rcx # push Cs to stack 60 push %r10 # push address of transition code on stack 60 push %r10 # push address of transition code on stack 61 61 .byte 0x48, 0xcb # retq: Use far return to load CS register from stack 62 # (Use raw byte code since some GNU assemblers generates incorrect code for "retq") 62 # (Use raw byte code since some GNU assemblers generates incorrect code for "retq") 63 63 L1: 64 64 mov %eax,%esp # set up new stack … … 69 69 mov %edx,%ebx # save EntryPoint to ebx, for rdmsr will overwrite edx 70 70 mov $0xc0000080,%ecx 71 rdmsr 71 rdmsr 72 72 and $0xfe,%ah # clear LME 73 wrmsr 73 wrmsr 74 74 mov %cr4,%rax 75 75 and $0xdf,%al # clear PAE -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/DisablePaging64.asm
r48674 r58466 40 40 mov edi, [rsp + 28h] ; rdi <- New stack 41 41 lea rax, mTransitionEnd ; rax <- end of transition code 42 sub rax, rsi ; rax <- The size of transition piece code 42 sub rax, rsi ; rax <- The size of transition piece code 43 43 add rax, 4 ; Round RAX up to the next 4 byte boundary 44 44 and al, 0fch … … 49 49 rep movsb ; copy transition code to top of new stack which must be below 4GB 50 50 pop rcx ; restore rcx 51 51 52 52 mov esi, r8d 53 53 mov edi, r9d … … 65 65 btr eax, 31 ; Clear CR0.PG 66 66 mov cr0, rax ; disable paging and caches 67 67 68 68 mov ebx, edx ; save EntryPoint to rbx, for rdmsr will overwrite rdx 69 69 mov ecx, 0c0000080h -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/EnableCache.S
r48674 r58466 16 16 # Abstract: 17 17 # 18 # Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear 18 # Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear 19 19 # the NW bit of CR0 to 0 20 20 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/EnableCache.asm
r48674 r58466 16 16 ; Abstract: 17 17 ; 18 ; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear 18 ; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear 19 19 ; the NW bit of CR0 to 0 20 20 ; -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/FlushCacheLine.asm
r48674 r58466 26 26 ;------------------------------------------------------------------------------ 27 27 ; VOID * 28 ; EFIAPI 28 ; EFIAPI 29 29 ; AsmFlushCacheLine ( 30 30 ; IN VOID *LinearAddress -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/GccInline.c
r48674 r58466 1 1 /** @file 2 2 GCC inline implementation of BaseLib processor specific functions. 3 3 4 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 6 6 This program and the accompanying materials 7 7 are licensed and made available under the terms and conditions of the BSD License … … 34 34 { 35 35 // This is a little bit of overkill and it is more about the compiler that it is 36 // actually processor synchronization. This is like the _ReadWriteBarrier 36 // actually processor synchronization. This is like the _ReadWriteBarrier 37 37 // Microsoft specific intrinsic 38 38 __asm__ __volatile__ ("":::"memory"); … … 67 67 VOID 68 68 ) 69 { 69 { 70 70 __asm__ __volatile__ ("cli"::: "memory"); 71 71 } … … 131 131 UINT32 LowData; 132 132 UINT32 HighData; 133 133 134 134 __asm__ __volatile__ ( 135 135 "rdmsr" … … 138 138 : "c" (Index) // %2 139 139 ); 140 140 141 141 return (((UINT64)HighData) << 32) | LowData; 142 142 } … … 171 171 LowData = (UINT32)(Value); 172 172 HighData = (UINT32)(Value >> 32); 173 173 174 174 __asm__ __volatile__ ( 175 175 "wrmsr" … … 179 179 "d" (HighData) 180 180 ); 181 181 182 182 return Value; 183 183 } … … 202 202 { 203 203 UINTN Eflags; 204 204 205 205 __asm__ __volatile__ ( 206 206 "pushfq \n\t" … … 208 208 : "=r" (Eflags) // %0 209 209 ); 210 210 211 211 return Eflags; 212 212 } … … 231 231 { 232 232 UINTN Data; 233 234 __asm__ __volatile__ ( 235 "mov %%cr0,%0" 233 234 __asm__ __volatile__ ( 235 "mov %%cr0,%0" 236 236 : "=r" (Data) // %0 237 237 ); 238 238 239 239 return Data; 240 240 } … … 258 258 { 259 259 UINTN Data; 260 261 __asm__ __volatile__ ( 262 "mov %%cr2, %0" 260 261 __asm__ __volatile__ ( 262 "mov %%cr2, %0" 263 263 : "=r" (Data) // %0 264 264 ); 265 265 266 266 return Data; 267 267 } … … 284 284 { 285 285 UINTN Data; 286 287 __asm__ __volatile__ ( 288 "mov %%cr3, %0" 286 287 __asm__ __volatile__ ( 288 "mov %%cr3, %0" 289 289 : "=r" (Data) // %0 290 290 ); 291 291 292 292 return Data; 293 293 } … … 311 311 { 312 312 UINTN Data; 313 314 __asm__ __volatile__ ( 315 "mov %%cr4, %0" 313 314 __asm__ __volatile__ ( 315 "mov %%cr4, %0" 316 316 : "=r" (Data) // %0 317 317 ); 318 318 319 319 return Data; 320 320 } … … 442 442 { 443 443 UINTN Data; 444 444 445 445 __asm__ __volatile__ ( 446 446 "mov %%dr0, %0" 447 447 : "=r" (Data) 448 448 ); 449 449 450 450 return Data; 451 451 } … … 469 469 { 470 470 UINTN Data; 471 471 472 472 __asm__ __volatile__ ( 473 473 "mov %%dr1, %0" 474 474 : "=r" (Data) 475 475 ); 476 476 477 477 return Data; 478 478 } … … 496 496 { 497 497 UINTN Data; 498 498 499 499 __asm__ __volatile__ ( 500 500 "mov %%dr2, %0" 501 501 : "=r" (Data) 502 502 ); 503 503 504 504 return Data; 505 505 } … … 523 523 { 524 524 UINTN Data; 525 525 526 526 __asm__ __volatile__ ( 527 527 "mov %%dr3, %0" 528 528 : "=r" (Data) 529 529 ); 530 530 531 531 return Data; 532 532 } … … 550 550 { 551 551 UINTN Data; 552 552 553 553 __asm__ __volatile__ ( 554 554 "mov %%dr4, %0" 555 555 : "=r" (Data) 556 556 ); 557 557 558 558 return Data; 559 559 } … … 577 577 { 578 578 UINTN Data; 579 579 580 580 __asm__ __volatile__ ( 581 581 "mov %%dr5, %0" 582 582 : "=r" (Data) 583 583 ); 584 584 585 585 return Data; 586 586 } … … 604 604 { 605 605 UINTN Data; 606 606 607 607 __asm__ __volatile__ ( 608 608 "mov %%dr6, %0" 609 609 : "=r" (Data) 610 610 ); 611 611 612 612 return Data; 613 613 } … … 631 631 { 632 632 UINTN Data; 633 633 634 634 __asm__ __volatile__ ( 635 635 "mov %%dr7, %0" 636 636 : "=r" (Data) 637 637 ); 638 638 639 639 return Data; 640 640 } … … 865 865 { 866 866 UINT16 Data; 867 867 868 868 __asm__ __volatile__ ( 869 869 "mov %%cs, %0" 870 870 :"=a" (Data) 871 871 ); 872 872 873 873 return Data; 874 874 } … … 891 891 { 892 892 UINT16 Data; 893 893 894 894 __asm__ __volatile__ ( 895 895 "mov %%ds, %0" 896 896 :"=a" (Data) 897 897 ); 898 898 899 899 return Data; 900 900 } … … 917 917 { 918 918 UINT16 Data; 919 919 920 920 __asm__ __volatile__ ( 921 921 "mov %%es, %0" 922 922 :"=a" (Data) 923 923 ); 924 924 925 925 return Data; 926 926 } … … 943 943 { 944 944 UINT16 Data; 945 945 946 946 __asm__ __volatile__ ( 947 947 "mov %%fs, %0" 948 948 :"=a" (Data) 949 949 ); 950 950 951 951 return Data; 952 952 } … … 969 969 { 970 970 UINT16 Data; 971 971 972 972 __asm__ __volatile__ ( 973 973 "mov %%gs, %0" 974 974 :"=a" (Data) 975 975 ); 976 976 977 977 return Data; 978 978 } … … 995 995 { 996 996 UINT16 Data; 997 997 998 998 __asm__ __volatile__ ( 999 999 "mov %%ds, %0" 1000 1000 :"=a" (Data) 1001 1001 ); 1002 1002 1003 1003 return Data; 1004 1004 } … … 1021 1021 { 1022 1022 UINT16 Data; 1023 1023 1024 1024 __asm__ __volatile__ ( 1025 1025 "str %0" 1026 1026 : "=r" (Data) 1027 1027 ); 1028 1028 1029 1029 return Data; 1030 1030 } … … 1073 1073 : "m" (*Gdtr) 1074 1074 ); 1075 1075 1076 1076 } 1077 1077 … … 1138 1138 { 1139 1139 UINT16 Data; 1140 1140 1141 1141 __asm__ __volatile__ ( 1142 1142 "sldt %0" 1143 1143 : "=g" (Data) // %0 1144 1144 ); 1145 1145 1146 1146 return Data; 1147 1147 } … … 1191 1191 : 1192 1192 : "m" (*Buffer) // %0 1193 ); 1193 ); 1194 1194 } 1195 1195 … … 1240 1240 : "=r" (Data) // %0 1241 1241 ); 1242 1242 1243 1243 return Data; 1244 1244 } … … 1266 1266 : "=r" (Data) // %0 1267 1267 ); 1268 1268 1269 1269 return Data; 1270 1270 } … … 1292 1292 : "=r" (Data) // %0 1293 1293 ); 1294 1294 1295 1295 return Data; 1296 1296 } … … 1318 1318 : "=r" (Data) // %0 1319 1319 ); 1320 1320 1321 1321 return Data; 1322 1322 } … … 1344 1344 : "=r" (Data) // %0 1345 1345 ); 1346 1346 1347 1347 return Data; 1348 1348 } … … 1370 1370 : "=r" (Data) // %0 1371 1371 ); 1372 1372 1373 1373 return Data; 1374 1374 } … … 1396 1396 : "=r" (Data) // %0 1397 1397 ); 1398 1398 1399 1399 return Data; 1400 1400 } … … 1422 1422 : "=r" (Data) // %0 1423 1423 ); 1424 1424 1425 1425 return Data; 1426 1426 } … … 1444 1444 __asm__ __volatile__ ( 1445 1445 "movd %0, %%mm0" // %0 1446 : 1446 : 1447 1447 : "m" (Value) 1448 1448 ); … … 1467 1467 __asm__ __volatile__ ( 1468 1468 "movd %0, %%mm1" // %0 1469 : 1469 : 1470 1470 : "m" (Value) 1471 1471 ); … … 1490 1490 __asm__ __volatile__ ( 1491 1491 "movd %0, %%mm2" // %0 1492 : 1492 : 1493 1493 : "m" (Value) 1494 1494 ); … … 1513 1513 __asm__ __volatile__ ( 1514 1514 "movd %0, %%mm3" // %0 1515 : 1515 : 1516 1516 : "m" (Value) 1517 1517 ); … … 1536 1536 __asm__ __volatile__ ( 1537 1537 "movd %0, %%mm4" // %0 1538 : 1538 : 1539 1539 : "m" (Value) 1540 1540 ); … … 1559 1559 __asm__ __volatile__ ( 1560 1560 "movd %0, %%mm5" // %0 1561 : 1561 : 1562 1562 : "m" (Value) 1563 1563 ); … … 1582 1582 __asm__ __volatile__ ( 1583 1583 "movd %0, %%mm6" // %0 1584 : 1584 : 1585 1585 : "m" (Value) 1586 1586 ); … … 1605 1605 __asm__ __volatile__ ( 1606 1606 "movd %0, %%mm7" // %0 1607 : 1607 : 1608 1608 : "m" (Value) 1609 1609 ); … … 1628 1628 UINT32 LowData; 1629 1629 UINT32 HiData; 1630 1630 1631 1631 __asm__ __volatile__ ( 1632 1632 "rdtsc" … … 1634 1634 "=d" (HiData) 1635 1635 ); 1636 1637 return (((UINT64)HiData) << 32) | LowData; 1636 1637 return (((UINT64)HiData) << 32) | LowData; 1638 1638 } 1639 1639 … … 1658 1658 UINT32 LowData; 1659 1659 UINT32 HiData; 1660 1660 1661 1661 __asm__ __volatile__ ( 1662 1662 "rdpmc" … … 1665 1665 : "c" (Index) 1666 1666 ); 1667 1668 return (((UINT64)HiData) << 32) | LowData; 1667 1668 return (((UINT64)HiData) << 32) | LowData; 1669 1669 } 1670 1670 … … 1701 1701 "d" (Edx) 1702 1702 ); 1703 1703 1704 1704 return Eax; 1705 1705 } … … 1729 1729 __asm__ __volatile__ ( 1730 1730 "mwait" 1731 : 1731 : 1732 1732 : "a" (Eax), 1733 1733 "c" (Ecx) 1734 1734 ); 1735 1736 return Eax; 1735 1736 return Eax; 1737 1737 } 1738 1738 … … 1769 1769 { 1770 1770 __asm__ __volatile__ ("invd":::"memory"); 1771 1771 1772 1772 } 1773 1773 … … 1797 1797 "clflush (%0)" 1798 1798 : 1799 : "r" (LinearAddress) 1799 : "r" (LinearAddress) 1800 1800 : "memory" 1801 1801 ); 1802 1802 1803 1803 return LinearAddress; 1804 1804 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/LongJump.S
r48674 r58466 50 50 movdqu 0xC8(%rcx), %xmm13 51 51 movdqu 0xD8(%rcx), %xmm14 52 movdqu 0xE8(%rcx), %xmm15 52 movdqu 0xE8(%rcx), %xmm15 53 53 mov %rdx, %rax # set return value 54 54 jmp *0x48(%rcx) -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/SetJump.S
r48674 r58466 40 40 # save non-volatile fp registers 41 41 stmxcsr 0x50(%rcx) 42 movdqu %xmm6, 0x58(%rcx) 42 movdqu %xmm6, 0x58(%rcx) 43 43 movdqu %xmm7, 0x68(%rcx) 44 44 movdqu %xmm8, 0x78(%rcx) … … 49 49 movdqu %xmm13, 0xC8(%rcx) 50 50 movdqu %xmm14, 0xD8(%rcx) 51 movdqu %xmm15, 0xE8(%rcx) 51 movdqu %xmm15, 0xE8(%rcx) 52 52 xor %rax,%rax 53 53 jmpq *%rdx -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/SwitchStack.S
r48674 r58466 38 38 ASM_GLOBAL ASM_PFX(InternalSwitchStack) 39 39 ASM_PFX(InternalSwitchStack): 40 pushq %rbp 40 pushq %rbp 41 41 movq %rsp, %rbp 42 42 43 43 mov %rcx, %rax // Shift registers for new call 44 44 mov %rdx, %rcx -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/Thunk16.S
r58459 r58466 50 50 51 51 .data 52 52 53 53 .set Lm16Size, ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start) 54 54 ASM_PFX(m16Size): .word Lm16Size … … 86 86 .byte 0x66 87 87 call L_Base # push eip 88 L_Base: 88 L_Base: 89 89 .byte 0x66 90 90 pushq $0 # reserved high order 32 bits of EFlags … … 103 103 cli # disable interrupts 104 104 jnc L_2 105 L_1: 105 L_1: 106 106 testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl 107 107 jz L_2 … … 109 109 orb $2,%al 110 110 outb %al, $0x92 # deactivate A20M# 111 L_2: 111 L_2: 112 112 xorw %ax, %ax # xor eax, eax 113 113 movl %ss, %eax # mov ax, ss … … 181 181 .byte 0x66 # make the following call 32-bit 182 182 call L_Base1 # push eip 183 L_Base1: 183 L_Base1: 184 184 popw %bp # ebp <- address of L_Base1 185 185 pushq (IA32_REGS_SIZE + 2)(%esp) … … 187 187 pushq %rax 188 188 lret # execution begins at next instruction 189 L_RealMode: 189 L_RealMode: 190 190 .byte 0x66,0x2e # CS and operand size override 191 191 lidt (_16Idtr - L_Base1)(%rsi) … … 244 244 pushq %rsi 245 245 pushq %rdi 246 246 247 247 movl %ds, %ebx 248 248 pushq %rbx # Save ds segment register on the stack … … 258 258 movl _ESP(%rsi), %edi 259 259 lea -(IA32_REGS_SIZE + 4)(%edi), %rdi 260 imul $16, %r8d, %eax 260 imul $16, %r8d, %eax 261 261 movl %edi,%ebx # ebx <- stack for 16-bit code 262 262 pushq $(IA32_REGS_SIZE / 4) … … 269 269 andl $0xf,%edx 270 270 shll $12,%eax # segment address in high order 16 bits 271 .set LBackFromUserCodeDelta, ASM_PFX(BackFromUserCode) - ASM_PFX(m16Start) 271 .set LBackFromUserCodeDelta, ASM_PFX(BackFromUserCode) - ASM_PFX(m16Start) 272 272 lea (LBackFromUserCodeDelta)(%rdx), %ax 273 273 stosl # [edi] <- return address of user code 274 274 sgdt 0x60(%rsp) # save GDT stack in argument space 275 movzwq 0x60(%rsp), %r10 # r10 <- GDT limit 276 lea ((ASM_PFX(InternalAsmThunk16) - L_SavedCr4) + 0xf)(%rcx), %r11 277 andq $0xfffffffffffffff0, %r11 # r11 <- 16-byte aligned shadowed GDT table in real mode buffer 278 275 movzwq 0x60(%rsp), %r10 # r10 <- GDT limit 276 lea ((ASM_PFX(InternalAsmThunk16) - L_SavedCr4) + 0xf)(%rcx), %r11 277 andq $0xfffffffffffffff0, %r11 # r11 <- 16-byte aligned shadowed GDT table in real mode buffer 278 279 279 movw %r10w, (SavedGdt - L_SavedCr4)(%rcx) # save the limit of shadowed GDT table 280 280 movq %r11, (SavedGdt - L_SavedCr4 + 0x2)(%rcx) # save the base address of shadowed GDT table 281 281 282 282 movq 0x62(%rsp) ,%rsi # rsi <- the original GDT base address 283 xchg %r10, %rcx # save rcx to r10 and initialize rcx to be the limit of GDT table 283 xchg %r10, %rcx # save rcx to r10 and initialize rcx to be the limit of GDT table 284 284 incq %rcx # rcx <- the size of memory to copy 285 285 xchg %r11, %rdi # save rdi to r11 and initialize rdi to the base address of shadowed GDT table … … 288 288 movq %r10, %rcx # restore the orignal rcx before memory copy 289 289 movq %r11, %rdi # restore the original rdi before memory copy 290 290 291 291 sidt 0x50(%rsp) 292 292 movq %cr0, %rax … … 312 312 .set Ltemp1, _EntryPoint - L_SavedCr4 313 313 .byte Ltemp1 314 L_RetFromRealMode: 314 L_RetFromRealMode: 315 315 popfq 316 316 lgdt 0x60(%rsp) # restore protected mode GDTR … … 319 319 .byte 0x0f, 0xa9 # pop gs 320 320 .byte 0x0f, 0xa1 # pop fs 321 321 322 322 popq %rbx 323 323 movl %ebx, %ss … … 326 326 popq %rbx 327 327 movl %ebx, %ds 328 328 329 329 popq %rdi 330 330 popq %rsi -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/Thunk16.asm
r58459 r58466 142 142 SavedCs DW ? 143 143 @64BitCode: 144 db 090h 144 db 090h 145 145 db 048h, 0bch ; mov rsp, imm64 146 146 SavedSp DQ ? ; restore stack … … 241 241 mov rbx, ss 242 242 push rbx ; Save ss segment register on the stack 243 243 244 244 push fs 245 245 push gs … … 260 260 lea ax, [rdx + (_BackFromUserCode - m16Start)] ; offset address 261 261 stosd ; [edi] <- return address of user code 262 262 263 263 sgdt fword ptr [rsp + 60h] ; save GDT stack in argument space 264 movzx r10, word ptr [rsp + 60h] ; r10 <- GDT limit 264 movzx r10, word ptr [rsp + 60h] ; r10 <- GDT limit 265 265 lea r11, [rcx + (InternalAsmThunk16 - SavedCr4) + 0xf] 266 266 and r11, 0xfffffff0 ; r11 <- 16-byte aligned shadowed GDT table in real mode buffer 267 267 268 268 mov word ptr [rcx + (SavedGdt - SavedCr4)], r10w ; save the limit of shadowed GDT table 269 269 mov qword ptr [rcx + (SavedGdt - SavedCr4) + 2], r11 ; save the base address of shadowed GDT table 270 270 271 271 mov rsi, qword ptr [rsp + 62h] ; rsi <- the original GDT base address 272 272 xchg rcx, r10 ; save rcx to r10 and initialize rcx to be the limit of GDT table … … 276 276 mov rcx, r10 ; restore the orignal rcx before memory copy 277 277 mov rdi, r11 ; restore the original rdi before memory copy 278 278 279 279 sidt fword ptr [rsp + 50h] ; save IDT stack in argument space 280 280 mov rax, cr0 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X64/Thunk16.nasm
r58464 r58466 241 241 push rsi 242 242 push rdi 243 243 244 244 mov ebx, ds 245 245 push rbx ; Save ds segment register on the stack … … 248 248 mov ebx, ss 249 249 push rbx ; Save ss segment register on the stack 250 250 251 251 push fs 252 252 push gs … … 267 267 lea ax, [rdx + (_BackFromUserCode - ASM_PFX(m16Start))] ; offset address 268 268 stosd ; [edi] <- return address of user code 269 269 270 270 sgdt [rsp + 60h] ; save GDT stack in argument space 271 movzx r10, word [rsp + 60h] ; r10 <- GDT limit 271 movzx r10, word [rsp + 60h] ; r10 <- GDT limit 272 272 lea r11, [rcx + (ASM_PFX(InternalAsmThunk16) - _BackFromUserCode.SavedCr4End) + 0xf] 273 273 and r11, ~0xf ; r11 <- 16-byte aligned shadowed GDT table in real mode buffer 274 274 275 275 mov [rcx + (SavedGdt - _BackFromUserCode.SavedCr4End)], r10w ; save the limit of shadowed GDT table 276 276 mov [rcx + (SavedGdt - _BackFromUserCode.SavedCr4End) + 2], r11 ; save the base address of shadowed GDT table 277 277 278 278 mov rsi, [rsp + 62h] ; rsi <- the original GDT base address 279 279 xchg rcx, r10 ; save rcx to r10 and initialize rcx to be the limit of GDT table … … 283 283 mov rcx, r10 ; restore the orignal rcx before memory copy 284 284 mov rdi, r11 ; restore the original rdi before memory copy 285 285 286 286 sidt [rsp + 50h] ; save IDT stack in argument space 287 287 mov rax, cr0 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X86Msr.c
r58459 r58466 197 197 field is specified by the StartBit and the EndBit. All other bits in the 198 198 destination MSR are preserved. The lower 32-bits of the MSR written is 199 returned. The caller must either guarantee that Index and the data written 200 is valid, or the caller must set up exception handlers to catch the exceptions. 199 returned. The caller must either guarantee that Index and the data written 200 is valid, or the caller must set up exception handlers to catch the exceptions. 201 201 This function is only available on IA-32 and x64. 202 202 … … 421 421 422 422 /** 423 Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise 423 Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise 424 424 OR, and writes the result back to the 64-bit MSR. 425 425 … … 490 490 Writes Value to a bit field in a 64-bit MSR. The bit field is specified by 491 491 the StartBit and the EndBit. All other bits in the destination MSR are 492 preserved. The MSR written is returned. The caller must either guarantee 493 that Index and the data written is valid, or the caller must set up exception 492 preserved. The MSR written is returned. The caller must either guarantee 493 that Index and the data written is valid, or the caller must set up exception 494 494 handlers to catch the exceptions. This function is only available on IA-32 and x64. 495 495 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X86Thunk.c
r58459 r58466 87 87 88 88 Prepares all structures and code required to use AsmThunk16(). 89 89 90 90 This interface is limited to be used in either physical mode or virtual modes with paging enabled where the 91 91 virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1. … … 169 169 This function must be called with interrupts disabled. 170 170 171 The register state from the RealModeState field of ThunkContext is restored just prior 172 to calling the 16-bit real mode entry point. This includes the EFLAGS field of RealModeState, 171 The register state from the RealModeState field of ThunkContext is restored just prior 172 to calling the 16-bit real mode entry point. This includes the EFLAGS field of RealModeState, 173 173 which is used to set the interrupt state when a 16-bit real mode entry point is called. 174 174 Control is transferred to the 16-bit real mode entry point specified by the CS and Eip fields of RealModeState. 175 The stack is initialized to the SS and ESP fields of RealModeState. Any parameters passed to 176 the 16-bit real mode code must be populated by the caller at SS:ESP prior to calling this function. 175 The stack is initialized to the SS and ESP fields of RealModeState. Any parameters passed to 176 the 16-bit real mode code must be populated by the caller at SS:ESP prior to calling this function. 177 177 The 16-bit real mode entry point is invoked with a 16-bit CALL FAR instruction, 178 so when accessing stack contents, the 16-bit real mode code must account for the 16-bit segment 179 and 16-bit offset of the return address that were pushed onto the stack. The 16-bit real mode entry 180 point must exit with a RETF instruction. The register state is captured into RealModeState immediately 178 so when accessing stack contents, the 16-bit real mode code must account for the 16-bit segment 179 and 16-bit offset of the return address that were pushed onto the stack. The 16-bit real mode entry 180 point must exit with a RETF instruction. The register state is captured into RealModeState immediately 181 181 after the RETF instruction is executed. 182 183 If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, 184 or any of the 16-bit real mode code makes a SW interrupt, then the caller is responsible for making sure 185 the IDT at address 0 is initialized to handle any HW or SW interrupts that may occur while in 16-bit real mode. 186 187 If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, 188 then the caller is responsible for making sure the 8259 PIC is in a state compatible with 16-bit real mode. 182 183 If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, 184 or any of the 16-bit real mode code makes a SW interrupt, then the caller is responsible for making sure 185 the IDT at address 0 is initialized to handle any HW or SW interrupts that may occur while in 16-bit real mode. 186 187 If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, 188 then the caller is responsible for making sure the 8259 PIC is in a state compatible with 16-bit real mode. 189 189 This includes the base vectors, the interrupt masks, and the edge/level trigger mode. 190 191 If THUNK_ATTRIBUTE_BIG_REAL_MODE is set in the ThunkAttributes field of ThunkContext, then the user code 190 191 If THUNK_ATTRIBUTE_BIG_REAL_MODE is set in the ThunkAttributes field of ThunkContext, then the user code 192 192 is invoked in big real mode. Otherwise, the user code is invoked in 16-bit real mode with 64KB segment limits. 193 194 If neither THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 nor THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in 195 ThunkAttributes, then it is assumed that the user code did not enable the A20 mask, and no attempt is made to 193 194 If neither THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 nor THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in 195 ThunkAttributes, then it is assumed that the user code did not enable the A20 mask, and no attempt is made to 196 196 disable the A20 mask. 197 198 If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is set and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is clear in 199 ThunkAttributes, then attempt to use the INT 15 service to disable the A20 mask. If this INT 15 call fails, 197 198 If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is set and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is clear in 199 ThunkAttributes, then attempt to use the INT 15 service to disable the A20 mask. If this INT 15 call fails, 200 200 then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports. 201 202 If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is clear and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is set in 201 202 If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is clear and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is set in 203 203 ThunkAttributes, then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports. 204 204 205 205 If ThunkContext is NULL, then ASSERT(). 206 206 If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT(). 207 If both THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in 207 If both THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in 208 208 ThunkAttributes, then ASSERT(). 209 209 210 210 This interface is limited to be used in either physical mode or virtual modes with paging enabled where the 211 211 virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1. 212 212 213 213 @param ThunkContext A pointer to the context structure that describes the 214 214 16-bit real mode code to call. … … 229 229 ASSERT (((ThunkContext->ThunkAttributes & (THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 | THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL)) != \ 230 230 (THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 | THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL))); 231 231 232 232 UpdatedRegs = InternalAsmThunk16 ( 233 233 ThunkContext->RealModeState, … … 251 251 This interface is limited to be used in either physical mode or virtual modes with paging enabled where the 252 252 virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1. 253 253 254 254 See AsmPrepareThunk16() and AsmThunk16() for the detailed description and ASSERT() conditions. 255 255 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
r58459 r58466 23 23 MODULE_TYPE = BASE 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = BaseMemoryLib 25 LIBRARY_CLASS = BaseMemoryLib 26 26 27 27 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/CompareMemWrapper.c
r48674 r58466 32 32 value returned is the first mismatched byte in SourceBuffer subtracted from the first 33 33 mismatched byte in DestinationBuffer. 34 34 35 35 If Length > 0 and DestinationBuffer is NULL, then ASSERT(). 36 36 If Length > 0 and SourceBuffer is NULL, then ASSERT(). … … 45 45 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first 46 46 mismatched byte in DestinationBuffer. 47 47 48 48 **/ 49 49 INTN -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 32 32 DestinationBuffer. The implementation must be reentrant, and it must handle the case 33 33 where SourceBuffer overlaps DestinationBuffer. 34 34 35 35 If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). 36 36 If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 31 31 This function copies the contents of the 128-bit GUID specified by SourceGuid to 32 32 DestinationGuid, and returns DestinationGuid. 33 33 34 34 If DestinationGuid is NULL, then ASSERT(). 35 35 If SourceGuid is NULL, then ASSERT(). … … 64 64 This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. 65 65 If there are any bit differences in the two GUIDs, then FALSE is returned. 66 66 67 67 If Guid1 is NULL, then ASSERT(). 68 68 If Guid2 is NULL, then ASSERT(). … … 104 104 GUID in the target buffer is returned. If no match is found, then NULL is returned. 105 105 If Length is 0, then NULL is returned. 106 106 107 107 If Length > 0 and Buffer is NULL, then ASSERT(). 108 108 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c
r48674 r58466 33 33 then a pointer to the matching byte in the target buffer is returned. If no match is found, 34 34 then NULL is returned. If Length is 0, then NULL is returned. 35 35 36 36 If Length > 0 and Buffer is NULL, then ASSERT(). 37 37 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). … … 58 58 ASSERT (Buffer != NULL); 59 59 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); 60 60 61 61 return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); 62 62 } 63 63 64 64 /** 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 66 66 UINTN sized value in the target buffer. 67 67 … … 70 70 then a pointer to the matching byte in the target buffer is returned. If no match is found, 71 71 then NULL is returned. If Length is 0, then NULL is returned. 72 72 73 73 If Length > 0 and Buffer is NULL, then ASSERT(). 74 74 If Buffer is not aligned on a UINTN boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c
r48674 r58466 30 30 31 31 This function fills Length bytes of Buffer with Value, and returns Buffer. 32 32 33 33 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 34 34 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c
r48674 r58466 12 12 PeiMemoryLib 13 13 UefiMemoryLib 14 14 15 15 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 16 16 This program and the accompanying materials … … 30 30 31 31 This function fills Length bytes of Buffer with zeros, and returns Buffer. 32 32 33 33 If Length > 0 and Buffer is NULL, then ASSERT(). 34 34 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf
r58459 r58466 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = BaseMemoryLib 26 LIBRARY_CLASS = BaseMemoryLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c
r48674 r58466 32 32 value returned is the first mismatched byte in SourceBuffer subtracted from the first 33 33 mismatched byte in DestinationBuffer. 34 34 35 35 If Length > 0 and DestinationBuffer is NULL, then ASSERT(). 36 36 If Length > 0 and SourceBuffer is NULL, then ASSERT(). … … 45 45 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first 46 46 mismatched byte in DestinationBuffer. 47 47 48 48 **/ 49 49 INTN -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 32 32 DestinationBuffer. The implementation must be reentrant, and it must handle the case 33 33 where SourceBuffer overlaps DestinationBuffer. 34 34 35 35 If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). 36 36 If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 31 31 This function copies the contents of the 128-bit GUID specified by SourceGuid to 32 32 DestinationGuid, and returns DestinationGuid. 33 33 34 34 If DestinationGuid is NULL, then ASSERT(). 35 35 If SourceGuid is NULL, then ASSERT(). … … 64 64 This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. 65 65 If there are any bit differences in the two GUIDs, then FALSE is returned. 66 66 67 67 If Guid1 is NULL, then ASSERT(). 68 68 If Guid2 is NULL, then ASSERT(). … … 104 104 GUID in the target buffer is returned. If no match is found, then NULL is returned. 105 105 If Length is 0, then NULL is returned. 106 106 107 107 If Length > 0 and Buffer is NULL, then ASSERT(). 108 108 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c
r48674 r58466 33 33 then a pointer to the matching byte in the target buffer is returned. If no match is found, 34 34 then NULL is returned. If Length is 0, then NULL is returned. 35 35 36 36 If Length > 0 and Buffer is NULL, then ASSERT(). 37 37 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). … … 58 58 ASSERT (Buffer != NULL); 59 59 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); 60 60 61 61 return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); 62 62 } 63 63 64 64 /** 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 66 66 UINTN sized value in the target buffer. 67 67 … … 70 70 then a pointer to the matching byte in the target buffer is returned. If no match is found, 71 71 then NULL is returned. If Length is 0, then NULL is returned. 72 72 73 73 If Length > 0 and Buffer is NULL, then ASSERT(). 74 74 If Buffer is not aligned on a UINTN boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c
r48674 r58466 30 30 31 31 This function fills Length bytes of Buffer with Value, and returns Buffer. 32 32 33 33 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 34 34 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.S
r48674 r58466 47 47 pushq %rsi 48 48 pushq %rdi 49 movq %rcx, %rsi 50 movq %rdx, %rdi 51 movq %r8, %rcx 49 movq %rcx, %rsi 50 movq %rdx, %rdi 51 movq %r8, %rcx 52 52 repe cmpsb 53 53 movzbq -1(%rsi), %rax 54 54 movzbq -1(%rdi), %rdx 55 subq %rdx, %rax 55 subq %rdx, %rax 56 56 popq %rdi 57 57 popq %rsi -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.S
r48674 r58466 41 41 movq %rdx, %rsi # rsi <- Source 42 42 movq %rcx, %rdi # rdi <- Destination 43 leaq -1(%rsi, %r8,), %r9 # r9 <- End of Source 44 cmpq %rdi, %rsi 43 leaq -1(%rsi, %r8,), %r9 # r9 <- End of Source 44 cmpq %rdi, %rsi 45 45 movq %rdi, %rax # rax <- Destination as return value 46 46 jae L0 … … 48 48 jae L_CopyBackward # Copy backward if overlapped 49 49 L0: 50 movq %r8, %rcx 50 movq %r8, %rcx 51 51 andq $7, %r8 52 52 shrq $3, %rcx # rcx <- # of Qwords to copy … … 56 56 movq (%rsi), %mm0 57 57 movntq %mm0, (%rdi) 58 addq $8, %rsi 58 addq $8, %rsi 59 59 addq $8, %rdi 60 60 loop L1 … … 67 67 std # set direction flag 68 68 L_CopyBytes: 69 movq %r8, %rcx 69 movq %r8, %rcx 70 70 rep movsb # Copy bytes backward 71 71 cld -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.S
r48674 r58466 46 46 ASM_PFX(InternalMemScanMem16): 47 47 pushq %rdi 48 movq %rcx, %rdi 49 movq %r8, %rax 50 movq %rdx, %rcx 48 movq %rcx, %rdi 49 movq %r8, %rax 50 movq %rdx, %rcx 51 51 repne scasw 52 52 leaq -2(%rdi), %rax 53 cmovnz %rcx, %rax 53 cmovnz %rcx, %rax 54 54 popq %rdi 55 55 ret -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.S
r48674 r58466 46 46 ASM_PFX(InternalMemScanMem32): 47 47 pushq %rdi 48 movq %rcx, %rdi 49 movq %r8, %rax 50 movq %rdx, %rcx 48 movq %rcx, %rdi 49 movq %r8, %rax 50 movq %rdx, %rcx 51 51 repne scasl 52 52 leaq -4(%rdi), %rax 53 cmovnz %rcx, %rax 53 cmovnz %rcx, %rax 54 54 popq %rdi 55 55 ret -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.S
r48674 r58466 46 46 ASM_PFX(InternalMemScanMem64): 47 47 pushq %rdi 48 movq %rcx, %rdi 49 movq %r8, %rax 50 movq %rdx, %rcx 48 movq %rcx, %rdi 49 movq %r8, %rax 50 movq %rdx, %rcx 51 51 repne scasq 52 52 leaq -8(%rdi), %rax 53 cmovnz %rcx, %rax 53 cmovnz %rcx, %rax 54 54 popq %rdi 55 55 ret -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.S
r48674 r58466 46 46 ASM_PFX(InternalMemScanMem8): 47 47 pushq %rdi 48 movq %rcx, %rdi 49 movq %rdx, %rcx 50 movq %r8, %rax 48 movq %rcx, %rdi 49 movq %rdx, %rcx 50 movq %r8, %rax 51 51 repne scasb 52 52 leaq -1(%rdi), %rax -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.S
r48674 r58466 44 44 movq %r8, %rdi # rdi <- Buffer 45 45 movq %rdx, %rcx 46 andq $7, %rdx 46 andq $7, %rdx 47 47 shrq $3, %rcx 48 48 jz L_SetBytes 49 49 .byte 0x0f, 0x70, 0x0C0, 0x00 50 50 L0: 51 movntq %mm0, (%rdi) 51 movntq %mm0, (%rdi) 52 52 addq $8, %rdi 53 53 loop L0 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.S
r48674 r58466 38 38 ASM_PFX(InternalMemSetMem16): 39 39 pushq %rdi 40 movq %r8, %rax 41 movd %rax, %mm0 42 movq %rcx, %r8 43 movq %r8, %rdi 44 movq %rdx, %rcx 45 andl $3, %edx 40 movq %r8, %rax 41 movd %rax, %mm0 42 movq %rcx, %r8 43 movq %r8, %rdi 44 movq %rdx, %rcx 45 andl $3, %edx 46 46 shrq $2, %rcx 47 47 jz L_SetWords 48 48 .byte 0x0f, 0x70, 0x0C0, 0x00 49 49 L0: 50 movntq %mm0, (%rdi) 51 addq $8, %rdi 50 movntq %mm0, (%rdi) 51 addq $8, %rdi 52 52 loop L0 53 53 mfence 54 54 L_SetWords: 55 movl %edx, %ecx 55 movl %edx, %ecx 56 56 rep stosw 57 57 movq %r8, %rax -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.S
r48674 r58466 44 44 .byte 0x0f, 0x70, 0x0C0, 0x44 45 45 L0: 46 movntq %mm0, (%rdx) 46 movntq %mm0, (%rdx) 47 47 leaq 8(%rdx), %rdx # use "lea" to avoid flag changes 48 48 loop L0 … … 50 50 L_SetDwords: 51 51 jnc L1 52 movd %mm0, (%rdx) 52 movd %mm0, (%rdx) 53 53 L1: 54 54 ret -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.S
r58459 r58466 40 40 xchg %rdx, %rcx #rcx <- Count 41 41 L0: 42 movntq %mm0, (%rdx) 42 movntq %mm0, (%rdx) 43 43 addq $8, %rdx 44 44 loop L0 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c
r48674 r58466 12 12 PeiMemoryLib 13 13 UefiMemoryLib 14 14 15 15 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 16 16 This program and the accompanying materials … … 30 30 31 31 This function fills Length bytes of Buffer with zeros, and returns Buffer. 32 32 33 33 If Length > 0 and Buffer is NULL, then ASSERT(). 34 34 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
r58459 r58466 2 2 # Instance of Base Memory Library optimized for use in DXE phase. 3 3 # 4 # Base Memory Library that is optimized for use in DXE phase. 4 # Base Memory Library that is optimized for use in DXE phase. 5 5 # Uses REP, MMX, XMM registers as required for best performance. 6 6 # … … 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = BaseMemoryLib 26 LIBRARY_CLASS = BaseMemoryLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/CompareMemWrapper.c
r48674 r58466 32 32 value returned is the first mismatched byte in SourceBuffer subtracted from the first 33 33 mismatched byte in DestinationBuffer. 34 34 35 35 If Length > 0 and DestinationBuffer is NULL, then ASSERT(). 36 36 If Length > 0 and SourceBuffer is NULL, then ASSERT(). … … 45 45 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first 46 46 mismatched byte in DestinationBuffer. 47 47 48 48 **/ 49 49 INTN -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/CopyMemWrapper.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 32 32 DestinationBuffer. The implementation must be reentrant, and it must handle the case 33 33 where SourceBuffer overlaps DestinationBuffer. 34 34 35 35 If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). 36 36 If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 31 31 This function copies the contents of the 128-bit GUID specified by SourceGuid to 32 32 DestinationGuid, and returns DestinationGuid. 33 33 34 34 If DestinationGuid is NULL, then ASSERT(). 35 35 If SourceGuid is NULL, then ASSERT(). … … 64 64 This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. 65 65 If there are any bit differences in the two GUIDs, then FALSE is returned. 66 66 67 67 If Guid1 is NULL, then ASSERT(). 68 68 If Guid2 is NULL, then ASSERT(). … … 104 104 GUID in the target buffer is returned. If no match is found, then NULL is returned. 105 105 If Length is 0, then NULL is returned. 106 106 107 107 If Length > 0 and Buffer is NULL, then ASSERT(). 108 108 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem16Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem32Wrapper.c
r48674 r58466 33 33 then a pointer to the matching byte in the target buffer is returned. If no match is found, 34 34 then NULL is returned. If Length is 0, then NULL is returned. 35 35 36 36 If Length > 0 and Buffer is NULL, then ASSERT(). 37 37 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem64Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). … … 58 58 ASSERT (Buffer != NULL); 59 59 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); 60 60 61 61 return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); 62 62 } 63 63 64 64 /** 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 66 66 UINTN sized value in the target buffer. 67 67 … … 70 70 then a pointer to the matching byte in the target buffer is returned. If no match is found, 71 71 then NULL is returned. If Length is 0, then NULL is returned. 72 72 73 73 If Length > 0 and Buffer is NULL, then ASSERT(). 74 74 If Buffer is not aligned on a UINTN boundary, then ASSERT(). … … 78 78 @param Buffer The pointer to the target buffer to scan. 79 79 @param Length The number of bytes in Buffer to scan. 80 @param Value 80 @param Value 81 81 The value to search for in the target buffer. 82 82 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c
r48674 r58466 30 30 31 31 This function fills Length bytes of Buffer with Value, and returns Buffer. 32 32 33 33 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 34 34 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.S
r48674 r58466 42 42 # IN UINTN Length 43 43 # ); 44 #------------------------------------------------------------------------------ 44 #------------------------------------------------------------------------------ 45 45 ASM_GLOBAL ASM_PFX(InternalMemCompareMem) 46 46 ASM_PFX(InternalMemCompareMem): -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.S
r48674 r58466 40 40 movq %rdx, %rsi # rsi <- Source 41 41 movq %rcx, %rdi # rdi <- Destination 42 leaq -1(%rsi,%r8,), %r9 # r9 <- Last byte of Source 42 leaq -1(%rsi,%r8,), %r9 # r9 <- Last byte of Source 43 43 cmpq %rdi, %rsi 44 44 movq %rdi, %rax # rax <- Destination as return value -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.S
r48674 r58466 48 48 shrq $3, %rcx # rcx = rcx / 8 49 49 cld 50 rep stosq 50 rep stosq 51 51 movq %rdx, %rcx # rcx = rdx 52 52 andq $7, %rcx # rcx = rcx & 7 53 rep stosb 53 rep stosb 54 54 popq %rax # rax = Buffer 55 55 popq %rbx -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.asm
r48674 r58466 48 48 shr rcx, 3 ; rcx = rcx / 8 49 49 cld 50 rep stosq 50 rep stosq 51 51 mov rcx, rdx ; rcx = rdx 52 52 and rcx, 7 ; rcx = rcx & 7 53 rep stosb 53 rep stosb 54 54 pop rax ; rax = Buffer 55 55 ret -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptDxe/ZeroMemWrapper.c
r48674 r58466 12 12 PeiMemoryLib 13 13 UefiMemoryLib 14 14 15 15 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 16 16 This program and the accompanying materials … … 30 30 31 31 This function fills Length bytes of Buffer with zeros, and returns Buffer. 32 32 33 33 If Length > 0 and Buffer is NULL, then ASSERT(). 34 34 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf
r58459 r58466 2 2 # Instance of Base Memory Library optimized for use in PEI phase. 3 3 # 4 # Base Memory Library that is optimized for use in PEI phase. 4 # Base Memory Library that is optimized for use in PEI phase. 5 5 # Uses REP, MMX, XMM registers as required for best performance. 6 6 # … … 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = BaseMemoryLib 26 LIBRARY_CLASS = BaseMemoryLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c
r48674 r58466 32 32 value returned is the first mismatched byte in SourceBuffer subtracted from the first 33 33 mismatched byte in DestinationBuffer. 34 34 35 35 If Length > 0 and DestinationBuffer is NULL, then ASSERT(). 36 36 If Length > 0 and SourceBuffer is NULL, then ASSERT(). … … 45 45 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first 46 46 mismatched byte in DestinationBuffer. 47 47 48 48 **/ 49 49 INTN -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/CopyMemWrapper.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 32 32 DestinationBuffer. The implementation must be reentrant, and it must handle the case 33 33 where SourceBuffer overlaps DestinationBuffer. 34 34 35 35 If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). 36 36 If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 31 31 This function copies the contents of the 128-bit GUID specified by SourceGuid to 32 32 DestinationGuid, and returns DestinationGuid. 33 33 34 34 If DestinationGuid is NULL, then ASSERT(). 35 35 If SourceGuid is NULL, then ASSERT(). … … 64 64 This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. 65 65 If there are any bit differences in the two GUIDs, then FALSE is returned. 66 66 67 67 If Guid1 is NULL, then ASSERT(). 68 68 If Guid2 is NULL, then ASSERT(). … … 104 104 GUID in the target buffer is returned. If no match is found, then NULL is returned. 105 105 If Length is 0, then NULL is returned. 106 106 107 107 If Length > 0 and Buffer is NULL, then ASSERT(). 108 108 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c
r48674 r58466 33 33 then a pointer to the matching byte in the target buffer is returned. If no match is found, 34 34 then NULL is returned. If Length is 0, then NULL is returned. 35 35 36 36 If Length > 0 and Buffer is NULL, then ASSERT(). 37 37 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). … … 58 58 ASSERT (Buffer != NULL); 59 59 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); 60 60 61 61 return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); 62 62 } 63 63 64 64 /** 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 66 66 UINTN sized value in the target buffer. 67 67 … … 70 70 then a pointer to the matching byte in the target buffer is returned. If no match is found, 71 71 then NULL is returned. If Length is 0, then NULL is returned. 72 72 73 73 If Length > 0 and Buffer is NULL, then ASSERT(). 74 74 If Buffer is not aligned on a UINTN boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c
r48674 r58466 30 30 31 31 This function fills Length bytes of Buffer with Value, and returns Buffer. 32 32 33 33 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 34 34 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c
r48674 r58466 12 12 PeiMemoryLib 13 13 UefiMemoryLib 14 14 15 15 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 16 16 This program and the accompanying materials … … 30 30 31 31 This function fills Length bytes of Buffer with zeros, and returns Buffer. 32 32 33 33 If Length > 0 and Buffer is NULL, then ASSERT(). 34 34 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
r58459 r58466 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = BaseMemoryLib 26 LIBRARY_CLASS = BaseMemoryLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/CompareMemWrapper.c
r48674 r58466 32 32 value returned is the first mismatched byte in SourceBuffer subtracted from the first 33 33 mismatched byte in DestinationBuffer. 34 34 35 35 If Length > 0 and DestinationBuffer is NULL, then ASSERT(). 36 36 If Length > 0 and SourceBuffer is NULL, then ASSERT(). … … 45 45 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first 46 46 mismatched byte in DestinationBuffer. 47 47 48 48 **/ 49 49 INTN -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/CopyMemWrapper.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 32 32 DestinationBuffer. The implementation must be reentrant, and it must handle the case 33 33 where SourceBuffer overlaps DestinationBuffer. 34 34 35 35 If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). 36 36 If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 31 31 This function copies the contents of the 128-bit GUID specified by SourceGuid to 32 32 DestinationGuid, and returns DestinationGuid. 33 33 34 34 If DestinationGuid is NULL, then ASSERT(). 35 35 If SourceGuid is NULL, then ASSERT(). … … 64 64 This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. 65 65 If there are any bit differences in the two GUIDs, then FALSE is returned. 66 66 67 67 If Guid1 is NULL, then ASSERT(). 68 68 If Guid2 is NULL, then ASSERT(). … … 104 104 GUID in the target buffer is returned. If no match is found, then NULL is returned. 105 105 If Length is 0, then NULL is returned. 106 106 107 107 If Length > 0 and Buffer is NULL, then ASSERT(). 108 108 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c
r48674 r58466 33 33 then a pointer to the matching byte in the target buffer is returned. If no match is found, 34 34 then NULL is returned. If Length is 0, then NULL is returned. 35 35 36 36 If Length > 0 and Buffer is NULL, then ASSERT(). 37 37 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). … … 58 58 ASSERT (Buffer != NULL); 59 59 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); 60 60 61 61 return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); 62 62 } 63 63 64 64 /** 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 66 66 UINTN sized value in the target buffer. 67 67 … … 70 70 then a pointer to the matching byte in the target buffer is returned. If no match is found, 71 71 then NULL is returned. If Length is 0, then NULL is returned. 72 72 73 73 If Length > 0 and Buffer is NULL, then ASSERT(). 74 74 If Buffer is not aligned on a UINTN boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c
r48674 r58466 30 30 31 31 This function fills Length bytes of Buffer with Value, and returns Buffer. 32 32 33 33 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 34 34 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c
r48674 r58466 12 12 PeiMemoryLib 13 13 UefiMemoryLib 14 14 15 15 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 16 16 This program and the accompanying materials … … 30 30 31 31 This function fills Length bytes of Buffer with zeros, and returns Buffer. 32 32 33 33 If Length > 0 and Buffer is NULL, then ASSERT(). 34 34 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf
r58459 r58466 23 23 MODULE_TYPE = BASE 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = BaseMemoryLib 25 LIBRARY_CLASS = BaseMemoryLib 26 26 27 27 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c
r48674 r58466 32 32 value returned is the first mismatched byte in SourceBuffer subtracted from the first 33 33 mismatched byte in DestinationBuffer. 34 34 35 35 If Length > 0 and DestinationBuffer is NULL, then ASSERT(). 36 36 If Length > 0 and SourceBuffer is NULL, then ASSERT(). … … 45 45 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first 46 46 mismatched byte in DestinationBuffer. 47 47 48 48 **/ 49 49 INTN -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 32 32 DestinationBuffer. The implementation must be reentrant, and it must handle the case 33 33 where SourceBuffer overlaps DestinationBuffer. 34 34 35 35 If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). 36 36 If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 31 31 This function copies the contents of the 128-bit GUID specified by SourceGuid to 32 32 DestinationGuid, and returns DestinationGuid. 33 33 34 34 If DestinationGuid is NULL, then ASSERT(). 35 35 If SourceGuid is NULL, then ASSERT(). … … 64 64 This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. 65 65 If there are any bit differences in the two GUIDs, then FALSE is returned. 66 66 67 67 If Guid1 is NULL, then ASSERT(). 68 68 If Guid2 is NULL, then ASSERT(). … … 104 104 GUID in the target buffer is returned. If no match is found, then NULL is returned. 105 105 If Length is 0, then NULL is returned. 106 106 107 107 If Length > 0 and Buffer is NULL, then ASSERT(). 108 108 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c
r48674 r58466 33 33 then a pointer to the matching byte in the target buffer is returned. If no match is found, 34 34 then NULL is returned. If Length is 0, then NULL is returned. 35 35 36 36 If Length > 0 and Buffer is NULL, then ASSERT(). 37 37 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). … … 58 58 ASSERT (Buffer != NULL); 59 59 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); 60 60 61 61 return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); 62 62 } 63 63 64 64 /** 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 66 66 UINTN sized value in the target buffer. 67 67 … … 70 70 then a pointer to the matching byte in the target buffer is returned. If no match is found, 71 71 then NULL is returned. If Length is 0, then NULL is returned. 72 72 73 73 If Length > 0 and Buffer is NULL, then ASSERT(). 74 74 If Buffer is not aligned on a UINTN boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c
r48674 r58466 30 30 31 31 This function fills Length bytes of Buffer with Value, and returns Buffer. 32 32 33 33 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 34 34 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/X64/CopyMem.S
r48674 r58466 47 47 cmpq %rdi, %r9 # Overlapped? 48 48 jae L_CopyBackward # Copy backward if overlapped 49 L0: 50 xorq %rcx, %rcx 49 L0: 50 xorq %rcx, %rcx 51 51 subq %rdi, %rcx # rcx <- -rdi 52 52 andq $15, %rcx # rcx + rsi should be 16 bytes aligned -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c
r48674 r58466 12 12 PeiMemoryLib 13 13 UefiMemoryLib 14 14 15 15 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 16 16 This program and the accompanying materials … … 30 30 31 31 This function fills Length bytes of Buffer with zeros, and returns Buffer. 32 32 33 33 If Length > 0 and Buffer is NULL, then ASSERT(). 34 34 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePalLibNull/BasePalLibNull.inf
r58459 r58466 21 21 MODULE_TYPE = BASE 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = PalLib 23 LIBRARY_CLASS = PalLib 24 24 25 25 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePalLibNull/PalCall.c
r48674 r58466 1 1 /** @file 2 2 3 3 Template and Sample instance of PalCallLib. 4 4 5 5 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php. 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php. 10 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 13 14 14 **/ 15 15 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
r58459 r58466 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = PcdLib 26 LIBRARY_CLASS = PcdLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePcdLibNull/PcdLib.c
r58459 r58466 25 25 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned. 26 26 27 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and 27 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and 28 28 set values associated with a PCD token. 29 30 If SkuId >= 0x100, then ASSERT(). 29 30 If SkuId >= 0x100, then ASSERT(). 31 31 32 32 @return Return the SKU ID that just be set. … … 46 46 /** 47 47 This function provides a means by which to retrieve a value for a given PCD token. 48 49 Returns the 8-bit value for the token specified by TokenNumber. 48 49 Returns the 8-bit value for the token specified by TokenNumber. 50 50 51 51 @param[in] TokenNumber The PCD token number to retrieve a current value for. 52 52 53 @return Returns the 8-bit value for the token specified by TokenNumber. 53 @return Returns the 8-bit value for the token specified by TokenNumber. 54 54 55 55 **/ … … 69 69 /** 70 70 This function provides a means by which to retrieve a value for a given PCD token. 71 72 Returns the 16-bit value for the token specified by TokenNumber. 71 72 Returns the 16-bit value for the token specified by TokenNumber. 73 73 74 74 @param[in] TokenNumber The PCD token number to retrieve a current value for. 75 75 76 @return Returns the 16-bit value for the token specified by TokenNumber. 76 @return Returns the 16-bit value for the token specified by TokenNumber. 77 77 78 78 **/ … … 92 92 /** 93 93 This function provides a means by which to retrieve a value for a given PCD token. 94 95 Returns the 32-bit value for the token specified by TokenNumber. 94 95 Returns the 32-bit value for the token specified by TokenNumber. 96 96 97 97 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 115 115 /** 116 116 This function provides a means by which to retrieve a value for a given PCD token. 117 117 118 118 Returns the 64-bit value for the token specified by TokenNumber. 119 119 … … 138 138 /** 139 139 This function provides a means by which to retrieve a value for a given PCD token. 140 140 141 141 Returns the pointer to the buffer of the token specified by TokenNumber. 142 142 … … 161 161 /** 162 162 This function provides a means by which to retrieve a value for a given PCD token. 163 164 Returns the Boolean value of the token specified by TokenNumber. 163 164 Returns the Boolean value of the token specified by TokenNumber. 165 165 166 166 @param[in] TokenNumber The PCD token number to retrieve a current value for. 167 167 168 @return Returns the Boolean value of the token specified by TokenNumber. 169 170 **/ 171 BOOLEAN 168 @return Returns the Boolean value of the token specified by TokenNumber. 169 170 **/ 171 BOOLEAN 172 172 EFIAPI 173 173 LibPcdGetBool ( … … 187 187 @param[in] TokenNumber The PCD token number to retrieve a current value for. 188 188 189 @return Returns the size of the token specified by TokenNumber. 189 @return Returns the size of the token specified by TokenNumber. 190 190 191 191 **/ … … 205 205 /** 206 206 This function provides a means by which to retrieve a value for a given PCD token. 207 207 208 208 Returns the 8-bit value for the token specified by TokenNumber and Guid. 209 210 If Guid is NULL, then ASSERT(). 211 212 @param[in] Guid The pointer to a 128-bit unique value that designates 209 210 If Guid is NULL, then ASSERT(). 211 212 @param[in] Guid The pointer to a 128-bit unique value that designates 213 213 which namespace to retrieve a value from. 214 214 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 235 235 236 236 Returns the 16-bit value for the token specified by TokenNumber and Guid. 237 238 If Guid is NULL, then ASSERT(). 239 240 @param[in] Guid The pointer to a 128-bit unique value that designates 237 238 If Guid is NULL, then ASSERT(). 239 240 @param[in] Guid The pointer to a 128-bit unique value that designates 241 241 which namespace to retrieve a value from. 242 242 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 261 261 /** 262 262 Returns the 32-bit value for the token specified by TokenNumber and Guid. 263 If Guid is NULL, then ASSERT(). 264 265 @param[in] Guid The pointer to a 128-bit unique value that designates 263 If Guid is NULL, then ASSERT(). 264 265 @param[in] Guid The pointer to a 128-bit unique value that designates 266 266 which namespace to retrieve a value from. 267 267 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 286 286 /** 287 287 This function provides a means by which to retrieve a value for a given PCD token. 288 288 289 289 Returns the 64-bit value for the token specified by TokenNumber and Guid. 290 291 If Guid is NULL, then ASSERT(). 292 293 @param[in] Guid The pointer to a 128-bit unique value that designates 290 291 If Guid is NULL, then ASSERT(). 292 293 @param[in] Guid The pointer to a 128-bit unique value that designates 294 294 which namespace to retrieve a value from. 295 295 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 314 314 /** 315 315 This function provides a means by which to retrieve a value for a given PCD token. 316 316 317 317 Returns the pointer to the buffer of token specified by TokenNumber and Guid. 318 319 If Guid is NULL, then ASSERT(). 320 321 @param[in] Guid The pointer to a 128-bit unique value that designates 318 319 If Guid is NULL, then ASSERT(). 320 321 @param[in] Guid The pointer to a 128-bit unique value that designates 322 322 which namespace to retrieve a value from. 323 323 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 342 342 /** 343 343 This function provides a means by which to retrieve a value for a given PCD token. 344 345 Returns the Boolean value of the token specified by TokenNumber and Guid. 346 347 If Guid is NULL, then ASSERT(). 348 349 @param[in] Guid The pointer to a 128-bit unique value that designates 344 345 Returns the Boolean value of the token specified by TokenNumber and Guid. 346 347 If Guid is NULL, then ASSERT(). 348 349 @param[in] Guid The pointer to a 128-bit unique value that designates 350 350 which namespace to retrieve a value from. 351 351 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 370 370 /** 371 371 This function provides a means by which to retrieve the size of a given PCD token. 372 373 Returns the size of the token specified by TokenNumber and Guid. 374 375 If Guid is NULL, then ASSERT(). 376 377 @param[in] Guid The pointer to a 128-bit unique value that designates 372 373 Returns the size of the token specified by TokenNumber and Guid. 374 375 If Guid is NULL, then ASSERT(). 376 377 @param[in] Guid The pointer to a 128-bit unique value that designates 378 378 which namespace to retrieve a value from. 379 379 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 398 398 /** 399 399 This function provides a means by which to set a value for a given PCD token. 400 401 Sets the 8-bit value for the token specified by TokenNumber 400 401 Sets the 8-bit value for the token specified by TokenNumber 402 402 to the value specified by Value. Value is returned. 403 403 … … 426 426 /** 427 427 This function provides a means by which to set a value for a given PCD token. 428 429 Sets the 16-bit value for the token specified by TokenNumber 428 429 Sets the 16-bit value for the token specified by TokenNumber 430 430 to the value specified by Value. Value is returned. 431 431 … … 454 454 /** 455 455 This function provides a means by which to set a value for a given PCD token. 456 457 Sets the 32-bit value for the token specified by TokenNumber 456 457 Sets the 32-bit value for the token specified by TokenNumber 458 458 to the value specified by Value. Value is returned. 459 459 … … 482 482 /** 483 483 This function provides a means by which to set a value for a given PCD token. 484 485 Sets the 64-bit value for the token specified by TokenNumber 484 485 Sets the 64-bit value for the token specified by TokenNumber 486 486 to the value specified by Value. Value is returned. 487 487 … … 510 510 /** 511 511 This function provides a means by which to set a value for a given PCD token. 512 513 Sets a buffer for the token specified by TokenNumber to the value 514 specified by Buffer and SizeOfBuffer. Buffer is returned. 515 If SizeOfBuffer is greater than the maximum size support by TokenNumber, 516 then set SizeOfBuffer to the maximum size supported by TokenNumber and 512 513 Sets a buffer for the token specified by TokenNumber to the value 514 specified by Buffer and SizeOfBuffer. Buffer is returned. 515 If SizeOfBuffer is greater than the maximum size support by TokenNumber, 516 then set SizeOfBuffer to the maximum size supported by TokenNumber and 517 517 return NULL to indicate that the set operation was not actually performed, 518 518 or ASSERT() if the set operation was not corretly performed. 519 519 520 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the 520 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the 521 521 maximum size supported by TokenName and NULL must be returned. 522 522 523 523 If SizeOfBuffer is NULL, then ASSERT(). 524 524 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 525 525 526 526 @param[in] TokenNumber The PCD token number to set a current value for. 527 527 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. … … 548 548 /** 549 549 This function provides a means by which to set a value for a given PCD token. 550 551 Sets the Boolean value for the token specified by TokenNumber 550 551 Sets the Boolean value for the token specified by TokenNumber 552 552 to the value specified by Value. Value is returned. 553 553 … … 576 576 /** 577 577 This function provides a means by which to set a value for a given PCD token. 578 579 Sets the 8-bit value for the token specified by TokenNumber and 578 579 Sets the 8-bit value for the token specified by TokenNumber and 580 580 Guid to the value specified by Value. Value is returned. 581 581 … … 583 583 If the set operation was not correctly performed, then ASSERT(). 584 584 585 @param[in] Guid The pointer to a 128-bit unique value that 585 @param[in] Guid The pointer to a 128-bit unique value that 586 586 designates which namespace to set a value from. 587 587 @param[in] TokenNumber The PCD token number to set a current value for. … … 608 608 /** 609 609 This function provides a means by which to set a value for a given PCD token. 610 611 Sets the 16-bit value for the token specified by TokenNumber and 610 611 Sets the 16-bit value for the token specified by TokenNumber and 612 612 Guid to the value specified by Value. Value is returned. 613 613 … … 615 615 If the set operation was not correctly performed, then ASSERT(). 616 616 617 @param[in] Guid The pointer to a 128-bit unique value that 617 @param[in] Guid The pointer to a 128-bit unique value that 618 618 designates which namespace to set a value from. 619 619 @param[in] TokenNumber The PCD token number to set a current value for. … … 640 640 /** 641 641 This function provides a means by which to set a value for a given PCD token. 642 643 Sets the 32-bit value for the token specified by TokenNumber and 642 643 Sets the 32-bit value for the token specified by TokenNumber and 644 644 Guid to the value specified by Value. Value is returned. 645 645 … … 647 647 If the set operation was not correctly performed, then ASSERT(). 648 648 649 @param[in] Guid The pointer to a 128-bit unique value that 649 @param[in] Guid The pointer to a 128-bit unique value that 650 650 designates which namespace to set a value from. 651 651 @param[in] TokenNumber The PCD token number to set a current value for. … … 672 672 /** 673 673 This function provides a means by which to set a value for a given PCD token. 674 675 Sets the 64-bit value for the token specified by TokenNumber and 674 675 Sets the 64-bit value for the token specified by TokenNumber and 676 676 Guid to the value specified by Value. Value is returned. 677 677 … … 679 679 If the set operation was not correctly performed, then ASSERT(). 680 680 681 @param[in] Guid The pointer to a 128-bit unique value that 681 @param[in] Guid The pointer to a 128-bit unique value that 682 682 designates which namespace to set a value from. 683 683 @param[in] TokenNumber The PCD token number to set a current value for. … … 704 704 /** 705 705 This function provides a means by which to set a value for a given PCD token. 706 707 Sets a buffer for the token specified by TokenNumber to the value specified by 708 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 709 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size 710 supported by TokenNumber and return NULL to indicate that the set operation 706 707 Sets a buffer for the token specified by TokenNumber to the value specified by 708 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 709 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size 710 supported by TokenNumber and return NULL to indicate that the set operation 711 711 was not actually performed, or ASSERT() if the set operation was not corretly performed. 712 712 713 713 If Guid is NULL, then ASSERT(). 714 714 If SizeOfBuffer is NULL, then ASSERT(). 715 715 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 716 717 @param[in] Guid The pointer to a 128-bit unique value that 716 717 @param[in] Guid The pointer to a 128-bit unique value that 718 718 designates which namespace to set a value from. 719 719 @param[in] TokenNumber The PCD token number to set a current value for. … … 742 742 /** 743 743 This function provides a means by which to set a value for a given PCD token. 744 745 Sets the Boolean value for the token specified by TokenNumber and 744 745 Sets the Boolean value for the token specified by TokenNumber and 746 746 Guid to the value specified by Value. Value is returned. 747 747 … … 749 749 If the set operation was not correctly performed, then ASSERT(). 750 750 751 @param[in] Guid The pointer to a 128-bit unique value that 751 @param[in] Guid The pointer to a 128-bit unique value that 752 752 designates which namespace to set a value from. 753 753 @param[in] TokenNumber The PCD token number to set a current value for. … … 774 774 /** 775 775 Set up a notification function that is called when a specified token is set. 776 777 When the token specified by TokenNumber and Guid is set, 778 then notification function specified by NotificationFunction is called. 779 If Guid is NULL, then the default token space is used. 780 776 777 When the token specified by TokenNumber and Guid is set, 778 then notification function specified by NotificationFunction is called. 779 If Guid is NULL, then the default token space is used. 780 781 781 If NotificationFunction is NULL, then ASSERT(). 782 782 783 @param[in] Guid The pointer to a 128-bit unique value that designates which 784 namespace to set a value from. If NULL, then the default 783 @param[in] Guid The pointer to a 128-bit unique value that designates which 784 namespace to set a value from. If NULL, then the default 785 785 token space is used. 786 786 @param[in] TokenNumber The PCD token number to monitor. 787 @param[in] NotificationFunction The function to call when the token 787 @param[in] NotificationFunction The function to call when the token 788 788 specified by Guid and TokenNumber is set. 789 789 … … 804 804 /** 805 805 Disable a notification function that was established with LibPcdCallbackonSet(). 806 807 Disable a notification function that was previously established with LibPcdCallbackOnSet(). 808 806 807 Disable a notification function that was previously established with LibPcdCallbackOnSet(). 808 809 809 If NotificationFunction is NULL, then ASSERT(). 810 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, 810 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, 811 811 and NotificationFunction, then ASSERT(). 812 812 813 813 @param[in] Guid Specify the GUID token space. 814 814 @param[in] TokenNumber Specify the token number. … … 831 831 /** 832 832 Retrieves the next token in a token space. 833 834 Retrieves the next PCD token number from the token space specified by Guid. 835 If Guid is NULL, then the default token space is used. If TokenNumber is 0, 836 then the first token number is returned. Otherwise, the token number that 837 follows TokenNumber in the token space is returned. If TokenNumber is the last 838 token number in the token space, then 0 is returned. 839 833 834 Retrieves the next PCD token number from the token space specified by Guid. 835 If Guid is NULL, then the default token space is used. If TokenNumber is 0, 836 then the first token number is returned. Otherwise, the token number that 837 follows TokenNumber in the token space is returned. If TokenNumber is the last 838 token number in the token space, then 0 is returned. 839 840 840 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT(). 841 841 842 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace 842 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace 843 843 to set a value from. If NULL, then the default token space is used. 844 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD 844 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD 845 845 token number. 846 846 … … 848 848 849 849 **/ 850 UINTN 850 UINTN 851 851 EFIAPI 852 852 LibPcdGetNextToken ( … … 864 864 /** 865 865 Used to retrieve the list of available PCD token space GUIDs. 866 866 867 867 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces 868 868 in the platform. 869 869 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned. 870 870 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned. 871 871 872 872 @param TokenSpaceGuid The pointer to a PCD token space GUID. 873 873 … … 875 875 876 876 **/ 877 GUID * 877 GUID * 878 878 EFIAPI 879 879 LibPcdGetNextTokenSpace ( … … 889 889 /** 890 890 Sets a value of a patchable PCD entry that is type pointer. 891 892 Sets the PCD entry specified by PatchVariable to the value specified by Buffer 893 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 894 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 895 NULL to indicate that the set operation was not actually performed. 896 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 891 892 Sets the PCD entry specified by PatchVariable to the value specified by Buffer 893 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 894 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 895 NULL to indicate that the set operation was not actually performed. 896 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 897 897 MaximumDatumSize and NULL must be returned. 898 898 899 899 If PatchVariable is NULL, then ASSERT(). 900 900 If SizeOfBuffer is NULL, then ASSERT(). 901 901 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 902 902 903 @param[in] PatchVariable A pointer to the global variable in a module that is 903 @param[in] PatchVariable A pointer to the global variable in a module that is 904 904 the target of the set operation. 905 905 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 906 906 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 907 907 @param[in] Buffer A pointer to the buffer to used to set the target variable. 908 908 909 909 @return Return the pointer to the buffer that was set. 910 910 … … 921 921 ASSERT (PatchVariable != NULL); 922 922 ASSERT (SizeOfBuffer != NULL); 923 923 924 924 if (*SizeOfBuffer > 0) { 925 925 ASSERT (Buffer != NULL); … … 931 931 return NULL; 932 932 } 933 933 934 934 CopyMem (PatchVariable, Buffer, *SizeOfBuffer); 935 935 936 936 return (VOID *) Buffer; 937 937 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
r58459 r58466 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = PciCf8Lib 26 LIBRARY_CLASS = PciCf8Lib 27 27 28 28 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePciCf8Lib/PciCf8Lib.c
r58459 r58466 62 62 63 63 /** 64 Registers a PCI device so PCI configuration registers may be accessed after 64 Registers a PCI device so PCI configuration registers may be accessed after 65 65 SetVirtualAddressMap(). 66 67 Registers the PCI device specified by Address so all the PCI configuration registers 66 67 Registers the PCI device specified by Address so all the PCI configuration registers 68 68 associated with that PCI device may be accessed after SetVirtualAddressMap() is called. 69 69 70 70 If Address > 0x0FFFFFFF, then ASSERT(). 71 71 If the register specified by Address >= 0x100, then ASSERT(). … … 73 73 @param Address The address that encodes the PCI Bus, Device, Function and 74 74 Register. 75 75 76 76 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 77 @retval RETURN_UNSUPPORTED An attempt was made to call this function 77 @retval RETURN_UNSUPPORTED An attempt was made to call this function 78 78 after ExitBootServices(). 79 79 @retval RETURN_UNSUPPORTED The resources required to access the PCI device … … 118 118 UINT32 AddressPort; 119 119 UINT8 Result; 120 120 121 121 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 122 122 InterruptState = SaveAndDisableInterrupts (); … … 156 156 UINT32 AddressPort; 157 157 UINT8 Result; 158 158 159 159 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 160 160 InterruptState = SaveAndDisableInterrupts (); … … 201 201 UINT32 AddressPort; 202 202 UINT8 Result; 203 203 204 204 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 205 205 InterruptState = SaveAndDisableInterrupts (); … … 246 246 UINT32 AddressPort; 247 247 UINT8 Result; 248 248 249 249 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 250 250 InterruptState = SaveAndDisableInterrupts (); … … 294 294 UINT32 AddressPort; 295 295 UINT8 Result; 296 296 297 297 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 298 298 InterruptState = SaveAndDisableInterrupts (); … … 342 342 UINT32 AddressPort; 343 343 UINT8 Result; 344 344 345 345 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 346 346 InterruptState = SaveAndDisableInterrupts (); … … 394 394 UINT32 AddressPort; 395 395 UINT8 Result; 396 396 397 397 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 398 398 InterruptState = SaveAndDisableInterrupts (); … … 450 450 UINT32 AddressPort; 451 451 UINT8 Result; 452 452 453 453 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 454 454 InterruptState = SaveAndDisableInterrupts (); … … 506 506 UINT32 AddressPort; 507 507 UINT8 Result; 508 508 509 509 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 510 510 InterruptState = SaveAndDisableInterrupts (); … … 567 567 UINT32 AddressPort; 568 568 UINT8 Result; 569 569 570 570 ASSERT_INVALID_PCI_ADDRESS (Address, 0); 571 571 InterruptState = SaveAndDisableInterrupts (); … … 610 610 UINT32 AddressPort; 611 611 UINT16 Result; 612 612 613 613 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 614 614 InterruptState = SaveAndDisableInterrupts (); … … 649 649 UINT32 AddressPort; 650 650 UINT16 Result; 651 651 652 652 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 653 653 InterruptState = SaveAndDisableInterrupts (); … … 695 695 UINT32 AddressPort; 696 696 UINT16 Result; 697 697 698 698 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 699 699 InterruptState = SaveAndDisableInterrupts (); … … 741 741 UINT32 AddressPort; 742 742 UINT16 Result; 743 743 744 744 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 745 745 InterruptState = SaveAndDisableInterrupts (); … … 790 790 UINT32 AddressPort; 791 791 UINT16 Result; 792 792 793 793 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 794 794 InterruptState = SaveAndDisableInterrupts (); … … 839 839 UINT32 AddressPort; 840 840 UINT16 Result; 841 841 842 842 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 843 843 InterruptState = SaveAndDisableInterrupts (); … … 892 892 UINT32 AddressPort; 893 893 UINT16 Result; 894 894 895 895 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 896 896 InterruptState = SaveAndDisableInterrupts (); … … 949 949 UINT32 AddressPort; 950 950 UINT16 Result; 951 951 952 952 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 953 953 InterruptState = SaveAndDisableInterrupts (); … … 1006 1006 UINT32 AddressPort; 1007 1007 UINT16 Result; 1008 1008 1009 1009 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 1010 1010 InterruptState = SaveAndDisableInterrupts (); … … 1068 1068 UINT32 AddressPort; 1069 1069 UINT16 Result; 1070 1070 1071 1071 ASSERT_INVALID_PCI_ADDRESS (Address, 1); 1072 1072 InterruptState = SaveAndDisableInterrupts (); … … 1111 1111 UINT32 AddressPort; 1112 1112 UINT32 Result; 1113 1113 1114 1114 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1115 1115 InterruptState = SaveAndDisableInterrupts (); … … 1150 1150 UINT32 AddressPort; 1151 1151 UINT32 Result; 1152 1152 1153 1153 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1154 1154 InterruptState = SaveAndDisableInterrupts (); … … 1196 1196 UINT32 AddressPort; 1197 1197 UINT32 Result; 1198 1198 1199 1199 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1200 1200 InterruptState = SaveAndDisableInterrupts (); … … 1242 1242 UINT32 AddressPort; 1243 1243 UINT32 Result; 1244 1244 1245 1245 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1246 1246 InterruptState = SaveAndDisableInterrupts (); … … 1291 1291 UINT32 AddressPort; 1292 1292 UINT32 Result; 1293 1293 1294 1294 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1295 1295 InterruptState = SaveAndDisableInterrupts (); … … 1340 1340 UINT32 AddressPort; 1341 1341 UINT32 Result; 1342 1342 1343 1343 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1344 1344 InterruptState = SaveAndDisableInterrupts (); … … 1393 1393 UINT32 AddressPort; 1394 1394 UINT32 Result; 1395 1395 1396 1396 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1397 1397 InterruptState = SaveAndDisableInterrupts (); … … 1450 1450 UINT32 AddressPort; 1451 1451 UINT32 Result; 1452 1452 1453 1453 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1454 1454 InterruptState = SaveAndDisableInterrupts (); … … 1507 1507 UINT32 AddressPort; 1508 1508 UINT32 Result; 1509 1509 1510 1510 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1511 1511 InterruptState = SaveAndDisableInterrupts (); … … 1569 1569 UINT32 AddressPort; 1570 1570 UINT32 Result; 1571 1571 1572 1572 ASSERT_INVALID_PCI_ADDRESS (Address, 3); 1573 1573 InterruptState = SaveAndDisableInterrupts (); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
r58459 r58466 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = PciExpressLib 26 LIBRARY_CLASS = PciExpressLib 27 27 28 28 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePciExpressLib/PciExpressLib.c
r58459 r58466 38 38 39 39 /** 40 Registers a PCI device so PCI configuration registers may be accessed after 40 Registers a PCI device so PCI configuration registers may be accessed after 41 41 SetVirtualAddressMap(). 42 43 Registers the PCI device specified by Address so all the PCI configuration 44 registers associated with that PCI device may be accessed after SetVirtualAddressMap() 42 43 Registers the PCI device specified by Address so all the PCI configuration 44 registers associated with that PCI device may be accessed after SetVirtualAddressMap() 45 45 is called. 46 47 If Address > 0x0FFFFFFF, then ASSERT(). 48 49 @param Address The address that encodes the PCI Bus, Device, Function and 50 Register. 51 46 47 If Address > 0x0FFFFFFF, then ASSERT(). 48 49 @param Address The address that encodes the PCI Bus, Device, Function and 50 Register. 51 52 52 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 53 @retval RETURN_UNSUPPORTED An attempt was made to call this function 53 @retval RETURN_UNSUPPORTED An attempt was made to call this function 54 54 after ExitBootServices(). 55 55 @retval RETURN_UNSUPPORTED The resources required to access the PCI device … … 71 71 /** 72 72 Gets the base address of PCI Express. 73 73 74 74 This internal functions retrieves PCI Express Base Address via a PCD entry 75 75 PcdPciExpressBaseAddress. 76 76 77 77 @return The base address of PCI Express. 78 78 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
r58459 r58466 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = PciLib 26 LIBRARY_CLASS = PciLib 27 27 28 28 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePciLibCf8/PciLib.c
r58459 r58466 21 21 22 22 /** 23 Registers a PCI device so PCI configuration registers may be accessed after 23 Registers a PCI device so PCI configuration registers may be accessed after 24 24 SetVirtualAddressMap(). 25 26 Registers the PCI device specified by Address so all the PCI configuration registers 25 26 Registers the PCI device specified by Address so all the PCI configuration registers 27 27 associated with that PCI device may be accessed after SetVirtualAddressMap() is called. 28 29 If Address > 0x0FFFFFFF, then ASSERT(). 30 31 @param Address The address that encodes the PCI Bus, Device, Function and 32 Register. 33 28 29 If Address > 0x0FFFFFFF, then ASSERT(). 30 31 @param Address The address that encodes the PCI Bus, Device, Function and 32 Register. 33 34 34 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 35 @retval RETURN_UNSUPPORTED An attempt was made to call this function 35 @retval RETURN_UNSUPPORTED An attempt was made to call this function 36 36 after ExitBootServices(). 37 37 @retval RETURN_UNSUPPORTED The resources required to access the PCI device -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
r58459 r58466 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = PciLib 26 LIBRARY_CLASS = PciLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePciLibPciExpress/PciLib.c
r58459 r58466 21 21 22 22 /** 23 Registers a PCI device so PCI configuration registers may be accessed after 23 Registers a PCI device so PCI configuration registers may be accessed after 24 24 SetVirtualAddressMap(). 25 26 Registers the PCI device specified by Address so all the PCI configuration registers 25 26 Registers the PCI device specified by Address so all the PCI configuration registers 27 27 associated with that PCI device may be accessed after SetVirtualAddressMap() is called. 28 29 If Address > 0x0FFFFFFF, then ASSERT(). 30 31 @param Address The address that encodes the PCI Bus, Device, Function and 32 Register. 33 28 29 If Address > 0x0FFFFFFF, then ASSERT(). 30 31 @param Address The address that encodes the PCI Bus, Device, Function and 32 Register. 33 34 34 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 35 @retval RETURN_UNSUPPORTED An attempt was made to call this function 35 @retval RETURN_UNSUPPORTED An attempt was made to call this function 36 36 after ExitBootServices(). 37 37 @retval RETURN_UNSUPPORTED The resources required to access the PCI device -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
r58459 r58466 21 21 MODULE_TYPE = BASE 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = PeCoffExtraActionLib 23 LIBRARY_CLASS = PeCoffExtraActionLib 24 24 25 25 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePeCoffExtraActionLibNull/PeCoffExtraActionLib.c
r48674 r58466 33 33 { 34 34 ASSERT (ImageContext != NULL); 35 } 35 } 36 36 37 37 /** 38 38 Performs additional actions just before a PE/COFF image is unloaded. Any resources 39 39 that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed. 40 40 41 41 If ImageContext is NULL, then ASSERT(). 42 42 43 43 @param ImageContext The pointer to the image context structure that describes the 44 44 PE/COFF image that is being unloaded. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
r58459 r58466 21 21 MODULE_TYPE = BASE 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = PeCoffGetEntryPointLib 23 LIBRARY_CLASS = PeCoffGetEntryPointLib 24 24 25 25 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
r48674 r58466 1 1 /** @file 2 Provides the services to get the entry point to a PE/COFF image that has either been 2 Provides the services to get the entry point to a PE/COFF image that has either been 3 3 loaded into memory or is executing at it's linked address. 4 4 … … 129 129 /** 130 130 Returns a pointer to the PDB file name for a PE/COFF image that has been 131 loaded into system memory with the PE/COFF Loader Library functions. 131 loaded into system memory with the PE/COFF Loader Library functions. 132 132 133 133 Returns the PDB file name for the PE/COFF image specified by Pe32Data. If … … 247 247 // 248 248 // Scan the directory to find the debug entry. 249 // 249 // 250 250 for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), DebugEntry++) { 251 251 if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) { … … 292 292 293 293 ASSERT (Pe32Data != NULL); 294 294 295 295 DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data; 296 296 if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) { -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePeCoffLib/Arm/PeCoffLoaderEx.c
r48674 r58466 19 19 20 20 /** 21 Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and 21 Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and 22 22 return the immediate data encoded in the instruction. 23 23 … … 34 34 UINT32 Movt; 35 35 UINT16 Address; 36 36 37 37 // Thumb2 is two 16-bit instructions working together. Not a single 32-bit instruction 38 38 // Example MOVT R0, #0 is 0x0000f2c0 or 0xf2c0 0x0000 39 Movt = (*Instruction << 16) | (*(Instruction + 1)); 39 Movt = (*Instruction << 16) | (*(Instruction + 1)); 40 40 41 41 // imm16 = imm4:i:imm3:imm8 … … 66 66 67 67 // First 16-bit chunk of instruciton 68 Patch = ((Address >> 12) & 0x000f); // imm4 68 Patch = ((Address >> 12) & 0x000f); // imm4 69 69 Patch |= (((Address & BIT11) != 0) ? BIT10 : 0); // i 70 70 // Mask out instruction bits and or in address … … 82 82 83 83 /** 84 Pass in a pointer to an ARM MOVW/MOVT instruciton pair and 84 Pass in a pointer to an ARM MOVW/MOVT instruciton pair and 85 85 return the immediate data encoded in the two` instruction. 86 86 … … 97 97 UINT16 *Word; 98 98 UINT16 *Top; 99 99 100 100 Word = Instructions; // MOVW 101 101 Top = Word + 2; // MOVT 102 102 103 103 return (ThumbMovtImmediateAddress (Top) << 16) + ThumbMovtImmediateAddress (Word); 104 104 } … … 119 119 UINT16 *Word; 120 120 UINT16 *Top; 121 121 122 122 Word = Instructions; // MOVW 123 123 Top = Word + 2; // MOVT … … 126 126 ThumbMovtImmediatePatch (Top, (UINT16)(Address >> 16)); 127 127 } 128 129 128 129 130 130 131 131 /** … … 155 155 156 156 switch ((*Reloc) >> 12) { 157 157 158 158 case EFI_IMAGE_REL_BASED_ARM_MOV32T: 159 159 FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust; … … 162 162 if (*FixupData != NULL) { 163 163 *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64)); 164 // Fixup16 is not aligned so we must copy it. Thumb instructions are streams of 16 bytes. 164 // Fixup16 is not aligned so we must copy it. Thumb instructions are streams of 16 bytes. 165 165 CopyMem (*FixupData, Fixup16, sizeof (UINT64)); 166 166 *FixupData = *FixupData + sizeof(UINT64); 167 167 } 168 168 break; 169 169 170 170 case EFI_IMAGE_REL_BASED_ARM_MOV32A: 171 171 ASSERT (FALSE); … … 183 183 loading and relocating of the image type. It's up to the caller to support 184 184 the entry point. 185 185 186 186 @param Machine Machine type from the PE Header. 187 187 … … 195 195 { 196 196 if ((Machine == IMAGE_FILE_MACHINE_ARMTHUMB_MIXED) || (Machine == IMAGE_FILE_MACHINE_EBC)) { 197 return TRUE; 197 return TRUE; 198 198 } 199 199 … … 236 236 } 237 237 break; 238 238 239 239 case EFI_IMAGE_REL_BASED_ARM_MOV32A: 240 240 ASSERT (FALSE); … … 244 244 return RETURN_UNSUPPORTED; 245 245 } 246 246 247 247 return RETURN_SUCCESS; 248 248 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
r58459 r58466 62 62 { 63 63 // 64 // NOTE: Some versions of Linux ELILO for Itanium have an incorrect magic value 65 // in the PE/COFF Header. If the MachineType is Itanium(IA64) and the 64 // NOTE: Some versions of Linux ELILO for Itanium have an incorrect magic value 65 // in the PE/COFF Header. If the MachineType is Itanium(IA64) and the 66 66 // Magic value in the OptionalHeader is EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC 67 67 // then override the returned value to EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC … … 78 78 79 79 /** 80 Retrieves the PE or TE Header from a PE/COFF or TE image. 80 Retrieves the PE or TE Header from a PE/COFF or TE image. 81 81 82 82 Caution: This function may receive untrusted input. 83 PE/COFF image is external input, so this routine will 84 also done many checks in PE image to make sure PE image DosHeader, PeOptionHeader, 85 SizeOfHeader, Section Data Region and Security Data Region be in PE image range. 83 PE/COFF image is external input, so this routine will 84 also done many checks in PE image to make sure PE image DosHeader, PeOptionHeader, 85 SizeOfHeader, Section Data Region and Security Data Region be in PE image range. 86 86 87 87 @param ImageContext The context of the image being loaded. … … 212 212 // 213 213 // TE Image Data Directory Entry size is non-zero, but the Data Directory Virtual Address is zero. 214 // This case is not a valid TE image. 214 // This case is not a valid TE image. 215 215 // 216 216 if ((Hdr.Te->DataDirectory[0].Size != 0 && Hdr.Te->DataDirectory[0].VirtualAddress == 0) || … … 236 236 // 237 237 // 2. Check the FileHeader.SizeOfOptionalHeader field. 238 // OptionalHeader.NumberOfRvaAndSizes is not bigger than 16, so 238 // OptionalHeader.NumberOfRvaAndSizes is not bigger than 16, so 239 239 // OptionalHeader.NumberOfRvaAndSizes * sizeof (EFI_IMAGE_DATA_DIRECTORY) will not overflow. 240 240 // … … 350 350 // 351 351 // 2. Check the FileHeader.SizeOfOptionalHeader field. 352 // OptionalHeader.NumberOfRvaAndSizes is not bigger than 16, so 352 // OptionalHeader.NumberOfRvaAndSizes is not bigger than 16, so 353 353 // OptionalHeader.NumberOfRvaAndSizes * sizeof (EFI_IMAGE_DATA_DIRECTORY) will not overflow. 354 354 // … … 514 514 // Section data should bigger than the Pe header. 515 515 // 516 if (SectionHeader.VirtualAddress < ImageContext->SizeOfHeaders || 516 if (SectionHeader.VirtualAddress < ImageContext->SizeOfHeaders || 517 517 SectionHeader.PointerToRawData < ImageContext->SizeOfHeaders) { 518 518 ImageContext->ImageError = IMAGE_ERROR_UNSUPPORTED; … … 562 562 Retrieves information about a PE/COFF image. 563 563 564 Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize, 565 DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and 566 DebugDirectoryEntryRva fields of the ImageContext structure. 567 If ImageContext is NULL, then return RETURN_INVALID_PARAMETER. 568 If the PE/COFF image accessed through the ImageRead service in the ImageContext 569 structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED. 570 If any errors occur while computing the fields of ImageContext, 571 then the error status is returned in the ImageError field of ImageContext. 564 Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize, 565 DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and 566 DebugDirectoryEntryRva fields of the ImageContext structure. 567 If ImageContext is NULL, then return RETURN_INVALID_PARAMETER. 568 If the PE/COFF image accessed through the ImageRead service in the ImageContext 569 structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED. 570 If any errors occur while computing the fields of ImageContext, 571 then the error status is returned in the ImageError field of ImageContext. 572 572 If the image is a TE image, then SectionAlignment is set to 0. 573 The ImageRead and Handle fields of ImageContext structure must be valid prior 573 The ImageRead and Handle fields of ImageContext structure must be valid prior 574 574 to invoking this service. 575 575 576 576 Caution: This function may receive untrusted input. 577 PE/COFF image is external input, so this routine will 578 also done many checks in PE image to make sure PE image DosHeader, PeOptionHeader, 579 SizeOfHeader, Section Data Region and Security Data Region be in PE image range. 577 PE/COFF image is external input, so this routine will 578 also done many checks in PE image to make sure PE image DosHeader, PeOptionHeader, 579 SizeOfHeader, Section Data Region and Security Data Region be in PE image range. 580 580 581 581 @param ImageContext The pointer to the image context structure that describes the PE/COFF … … 832 832 // values for the corresponding sections. So the ImageSize can be determined 833 833 // by the RVA and the VirtualSize of the last section header in the 834 // Section Table. 834 // Section Table. 835 835 // 836 836 if ((++Index) == (UINTN)Hdr.Te->NumberOfSections) { … … 887 887 PeCoffLoaderImageAddress ( 888 888 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, 889 IN UINTN Address, 889 IN UINTN Address, 890 890 IN UINTN TeStrippedOffset 891 891 ) … … 909 909 of ImageContext as the relocation base address. The caller must allocate the relocation 910 910 fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function. 911 912 The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, 913 ImageSize, DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, 914 DebugDirectoryEntryRva, EntryPoint, FixupDataSize, CodeView, PdbPointer, and FixupData of 911 912 The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, 913 ImageSize, DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, 914 DebugDirectoryEntryRva, EntryPoint, FixupDataSize, CodeView, PdbPointer, and FixupData of 915 915 the ImageContext structure must be valid prior to invoking this service. 916 916 917 917 If ImageContext is NULL, then ASSERT(). 918 918 … … 969 969 // 970 970 if (ImageContext->RelocationsStripped) { 971 // Applies additional environment specific actions to relocate fixups 971 // Applies additional environment specific actions to relocate fixups 972 972 // to a PE/COFF image if needed 973 PeCoffLoaderRelocateImageExtraAction (ImageContext); 973 PeCoffLoaderRelocateImageExtraAction (ImageContext); 974 974 return RETURN_SUCCESS; 975 975 } … … 1051 1051 // Set base and end to bypass processing below. 1052 1052 // 1053 RelocBase = RelocBaseEnd = NULL; 1053 RelocBase = RelocBaseEnd = NULL; 1054 1054 } 1055 1055 RelocBaseOrg = RelocBase; … … 1087 1087 ImageContext->ImageError = IMAGE_ERROR_FAILED_RELOCATION; 1088 1088 return RETURN_LOAD_ERROR; 1089 } 1089 } 1090 1090 1091 1091 // … … 1174 1174 } 1175 1175 } 1176 1177 // Applies additional environment specific actions to relocate fixups 1176 1177 // Applies additional environment specific actions to relocate fixups 1178 1178 // to a PE/COFF image if needed 1179 1179 PeCoffLoaderRelocateImageExtraAction (ImageContext); 1180 1180 1181 1181 return RETURN_SUCCESS; 1182 1182 } … … 1189 1189 the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function. 1190 1190 The EntryPoint, FixupDataSize, CodeView, PdbPointer and HiiResourceData fields of ImageContext are computed. 1191 The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, ImageSize, 1192 DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva 1191 The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, ImageSize, 1192 DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva 1193 1193 fields of the ImageContext structure must be valid prior to invoking this service. 1194 1194 1195 1195 If ImageContext is NULL, then ASSERT(). 1196 1196 … … 1504 1504 1505 1505 if (TempDebugEntryRva != 0) { 1506 ImageContext->CodeView = PeCoffLoaderImageAddress (ImageContext, TempDebugEntryRva, TeStrippedOffset); 1506 ImageContext->CodeView = PeCoffLoaderImageAddress (ImageContext, TempDebugEntryRva, TeStrippedOffset); 1507 1507 if (ImageContext->CodeView == NULL) { 1508 1508 ImageContext->ImageError = IMAGE_ERROR_FAILED_RELOCATION; … … 1586 1586 if (Base != NULL) { 1587 1587 ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) Base; 1588 Offset = sizeof (EFI_IMAGE_RESOURCE_DIRECTORY) + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY) * 1588 Offset = sizeof (EFI_IMAGE_RESOURCE_DIRECTORY) + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY) * 1589 1589 (ResourceDirectory->NumberOfNamedEntries + ResourceDirectory->NumberOfIdEntries); 1590 1590 if (Offset > DirectoryEntry->Size) { … … 1622 1622 } 1623 1623 ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (Base + ResourceDirectoryEntry->u2.s.OffsetToDirectory); 1624 Offset = ResourceDirectoryEntry->u2.s.OffsetToDirectory + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY) + 1624 Offset = ResourceDirectoryEntry->u2.s.OffsetToDirectory + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY) + 1625 1625 sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY) * (ResourceDirectory->NumberOfNamedEntries + ResourceDirectory->NumberOfIdEntries); 1626 1626 if (Offset > DirectoryEntry->Size) { … … 1639 1639 } 1640 1640 ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (Base + ResourceDirectoryEntry->u2.s.OffsetToDirectory); 1641 Offset = ResourceDirectoryEntry->u2.s.OffsetToDirectory + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY) + 1641 Offset = ResourceDirectoryEntry->u2.s.OffsetToDirectory + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY) + 1642 1642 sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY) * (ResourceDirectory->NumberOfNamedEntries + ResourceDirectory->NumberOfIdEntries); 1643 1643 if (Offset > DirectoryEntry->Size) { … … 1668 1668 } 1669 1669 } 1670 1670 1671 1671 return Status; 1672 1672 } … … 1675 1675 /** 1676 1676 Reapply fixups on a fixed up PE32/PE32+ image to allow virutal calling at EFI 1677 runtime. 1678 1679 This function reapplies relocation fixups to the PE/COFF image specified by ImageBase 1680 and ImageSize so the image will execute correctly when the PE/COFF image is mapped 1681 to the address specified by VirtualImageBase. RelocationData must be identical 1682 to the FiuxupData buffer from the PE_COFF_LOADER_IMAGE_CONTEXT structure 1677 runtime. 1678 1679 This function reapplies relocation fixups to the PE/COFF image specified by ImageBase 1680 and ImageSize so the image will execute correctly when the PE/COFF image is mapped 1681 to the address specified by VirtualImageBase. RelocationData must be identical 1682 to the FiuxupData buffer from the PE_COFF_LOADER_IMAGE_CONTEXT structure 1683 1683 after this PE/COFF image was relocated with PeCoffLoaderRelocateImage(). 1684 1684 … … 1687 1687 prior to transferring control to a PE/COFF image that is loaded using this library. 1688 1688 1689 @param ImageBase The base address of a PE/COFF image that has been loaded 1689 @param ImageBase The base address of a PE/COFF image that has been loaded 1690 1690 and relocated into system memory. 1691 1691 @param VirtImageBase The request virtual address that the PE/COFF image is to 1692 1692 be fixed up for. 1693 1693 @param ImageSize The size, in bytes, of the PE/COFF image. 1694 @param RelocationData A pointer to the relocation data that was collected when the PE/COFF 1694 @param RelocationData A pointer to the relocation data that was collected when the PE/COFF 1695 1695 image was relocated using PeCoffLoaderRelocateImage(). 1696 1696 1697 1697 **/ 1698 1698 VOID … … 1787 1787 return ; 1788 1788 } 1789 1789 1790 1790 // 1791 1791 // ASSERT for the invalid image when RelocBase and RelocBaseEnd are both NULL. … … 1889 1889 /** 1890 1890 Reads contents of a PE/COFF image from a buffer in system memory. 1891 1892 This is the default implementation of a PE_COFF_LOADER_READ_FILE function 1893 that assumes FileHandle pointer to the beginning of a PE/COFF image. 1894 This function reads contents of the PE/COFF image that starts at the system memory 1895 address specified by FileHandle. The read operation copies ReadSize bytes from the 1896 PE/COFF image starting at byte offset FileOffset into the buffer specified by Buffer. 1891 1892 This is the default implementation of a PE_COFF_LOADER_READ_FILE function 1893 that assumes FileHandle pointer to the beginning of a PE/COFF image. 1894 This function reads contents of the PE/COFF image that starts at the system memory 1895 address specified by FileHandle. The read operation copies ReadSize bytes from the 1896 PE/COFF image starting at byte offset FileOffset into the buffer specified by Buffer. 1897 1897 The size of the buffer actually read is returned in ReadSize. 1898 1898 1899 1899 The caller must make sure the FileOffset and ReadSize within the file scope. 1900 1900 … … 1905 1905 @param FileHandle The pointer to base of the input stream 1906 1906 @param FileOffset Offset into the PE/COFF image to begin the read operation. 1907 @param ReadSize On input, the size in bytes of the requested read operation. 1907 @param ReadSize On input, the size in bytes of the requested read operation. 1908 1908 On output, the number of bytes actually read. 1909 1909 @param Buffer Output buffer that contains the data read from the PE/COFF image. 1910 1910 1911 @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into 1911 @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into 1912 1912 the buffer. 1913 1913 **/ … … 1931 1931 /** 1932 1932 Unloads a loaded PE/COFF image from memory and releases its taken resource. 1933 Releases any environment specific resources that were allocated when the image 1934 specified by ImageContext was loaded using PeCoffLoaderLoadImage(). 1935 1933 Releases any environment specific resources that were allocated when the image 1934 specified by ImageContext was loaded using PeCoffLoaderLoadImage(). 1935 1936 1936 For NT32 emulator, the PE/COFF image loaded by system needs to release. 1937 For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded, 1937 For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded, 1938 1938 this function can simply return RETURN_SUCCESS. 1939 1939 1940 1940 If ImageContext is NULL, then ASSERT(). 1941 1941 1942 1942 @param ImageContext The pointer to the image context structure that describes the PE/COFF 1943 1943 image to be unloaded. … … 1952 1952 { 1953 1953 // 1954 // Applies additional environment specific actions to unload a 1954 // Applies additional environment specific actions to unload a 1955 1955 // PE/COFF image if needed 1956 1956 // -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
r58459 r58466 30 30 MODULE_TYPE = BASE 31 31 VERSION_STRING = 1.0 32 LIBRARY_CLASS = PeCoffLib 32 LIBRARY_CLASS = PeCoffLib 33 33 34 34 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c
r48674 r58466 219 219 does not mean the image can be executed it means the PE/COFF loader supports 220 220 loading and relocating of the image type. It's up to the caller to support 221 the entry point. 222 221 the entry point. 222 223 223 The itanium version PE/COFF loader/relocater supports itanium and EBC image. 224 224 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
r48674 r58466 44 44 loading and relocating of the image type. It's up to the caller to support 45 45 the entry point. 46 46 47 47 The IA32/X64 version PE/COFF loader/relocater both support IA32, X64 and EBC images. 48 48 … … 57 57 ) 58 58 { 59 if ((Machine == IMAGE_FILE_MACHINE_I386) || (Machine == IMAGE_FILE_MACHINE_X64) || 59 if ((Machine == IMAGE_FILE_MACHINE_I386) || (Machine == IMAGE_FILE_MACHINE_X64) || 60 60 (Machine == IMAGE_FILE_MACHINE_EBC)) { 61 return TRUE; 61 return TRUE; 62 62 } 63 63 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
r58459 r58466 21 21 MODULE_TYPE = BASE 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = PerformanceLib 23 LIBRARY_CLASS = PerformanceLib 24 24 25 25 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePerformanceLibNull/PerformanceLib.c
r58459 r58466 22 22 23 23 /** 24 Creates a record for the beginning of a performance measurement. 25 24 Creates a record for the beginning of a performance measurement. 25 26 26 Creates a record that contains the Handle, Token, and Module. 27 27 If TimeStamp is not zero, then TimeStamp is added to the record as the start time. … … 55 55 56 56 /** 57 Fills in the end time of a performance measurement. 58 57 Fills in the end time of a performance measurement. 58 59 59 Looks up the record that matches Handle, Token, and Module. 60 60 If the record can not be found then return RETURN_NOT_FOUND. … … 90 90 91 91 /** 92 Attempts to retrieve a performance measurement log entry from the performance measurement log. 92 Attempts to retrieve a performance measurement log entry from the performance measurement log. 93 93 It can also retrieve the log created by StartPerformanceMeasurementEx and EndPerformanceMeasurementEx, 94 94 and then eliminate the Identifier. … … 115 115 On exit, the key of the next performance lof entry entry. 116 116 @param Handle The pointer to environment specific context used to identify the component 117 being measured. 117 being measured. 118 118 @param Token The pointer to a Null-terminated ASCII string that identifies the component 119 being measured. 119 being measured. 120 120 @param Module The pointer to a Null-terminated ASCII string that identifies the module 121 121 being measured. … … 131 131 EFIAPI 132 132 GetPerformanceMeasurement ( 133 IN UINTN LogEntryKey, 133 IN UINTN LogEntryKey, 134 134 OUT CONST VOID **Handle, 135 135 OUT CONST CHAR8 **Token, … … 266 266 EFIAPI 267 267 GetPerformanceMeasurementEx ( 268 IN UINTN LogEntryKey, 268 IN UINTN LogEntryKey, 269 269 OUT CONST VOID **Handle, 270 270 OUT CONST CHAR8 **Token, … … 286 286 287 287 /** 288 Returns TRUE if the performance measurement macros are enabled. 289 288 Returns TRUE if the performance measurement macros are enabled. 289 290 290 This function returns TRUE if the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of 291 291 PcdPerformanceLibraryPropertyMask is set. Otherwise FALSE is returned. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDebug.inf
r58459 r58466 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = PostCodeLib 26 LIBRARY_CLASS = PostCodeLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePostCodeLibDebug/PostCode.c
r48674 r58466 3 3 4 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 22 22 Sends an 32-bit value to a POST card. 23 23 24 Sends the 32-bit value specified by Value to a POST card, and returns Value. 25 Some implementations of this library function may perform I/O operations 26 directly to a POST card device. Other implementations may send Value to 27 ReportStatusCode(), and the status code reporting mechanism will eventually 24 Sends the 32-bit value specified by Value to a POST card, and returns Value. 25 Some implementations of this library function may perform I/O operations 26 directly to a POST card device. Other implementations may send Value to 27 ReportStatusCode(), and the status code reporting mechanism will eventually 28 28 display the 32-bit value on the status reporting device. 29 30 PostCode() must actively prevent recursion. If PostCode() is called while 31 processing another any other Post Code Library function, then 29 30 PostCode() must actively prevent recursion. If PostCode() is called while 31 processing another any other Post Code Library function, then 32 32 PostCode() must return Value immediately. 33 33 … … 52 52 53 53 Sends the 32-bit value specified by Value to a POST card, and returns Value. 54 If Description is not NULL, then the ASCII string specified by Description is 55 also passed to the handler that displays the POST card value. Some 56 implementations of this library function may perform I/O operations directly 57 to a POST card device. Other implementations may send Value to ReportStatusCode(), 58 and the status code reporting mechanism will eventually display the 32-bit 59 value on the status reporting device. 54 If Description is not NULL, then the ASCII string specified by Description is 55 also passed to the handler that displays the POST card value. Some 56 implementations of this library function may perform I/O operations directly 57 to a POST card device. Other implementations may send Value to ReportStatusCode(), 58 and the status code reporting mechanism will eventually display the 32-bit 59 value on the status reporting device. 60 60 61 PostCodeWithDescription()must actively prevent recursion. If 62 PostCodeWithDescription() is called while processing another any other Post 63 Code Library function, then PostCodeWithDescription() must return Value 61 PostCodeWithDescription()must actively prevent recursion. If 62 PostCodeWithDescription() is called while processing another any other Post 63 Code Library function, then PostCodeWithDescription() must return Value 64 64 immediately. 65 65 66 66 @param Value The 32-bit value to write to the POST card. 67 @param Description The pointer to an ASCII string that is a description of the 68 POST code value. This is an optional parameter that may 67 @param Description The pointer to an ASCII string that is a description of the 68 POST code value. This is an optional parameter that may 69 69 be NULL. 70 70 … … 87 87 Returns TRUE if POST Codes are enabled. 88 88 89 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED 89 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED 90 90 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned. 91 91 92 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 92 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 93 93 PcdPostCodeProperyMask is set. 94 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 94 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 95 95 PcdPostCodeProperyMask is clear. 96 96 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
r58459 r58466 23 23 MODULE_TYPE = BASE 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = PostCodeLib 25 LIBRARY_CLASS = PostCodeLib 26 26 27 27 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePostCodeLibPort80/PostCode.c
r48674 r58466 3 3 4 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 22 22 Sends an 32-bit value to a POST card. 23 23 24 Sends the 32-bit value specified by Value to a POST card, and returns Value. 25 Some implementations of this library function may perform I/O operations 26 directly to a POST card device. Other implementations may send Value to 27 ReportStatusCode(), and the status code reporting mechanism will eventually 24 Sends the 32-bit value specified by Value to a POST card, and returns Value. 25 Some implementations of this library function may perform I/O operations 26 directly to a POST card device. Other implementations may send Value to 27 ReportStatusCode(), and the status code reporting mechanism will eventually 28 28 display the 32-bit value on the status reporting device. 29 30 PostCode() must actively prevent recursion. If PostCode() is called while 31 processing another any other Post Code Library function, then 29 30 PostCode() must actively prevent recursion. If PostCode() is called while 31 processing another any other Post Code Library function, then 32 32 PostCode() must return Value immediately. 33 33 … … 52 52 53 53 Sends the 32-bit value specified by Value to a POST card, and returns Value. 54 If Description is not NULL, then the ASCII string specified by Description is 55 also passed to the handler that displays the POST card value. Some 56 implementations of this library function may perform I/O operations directly 57 to a POST card device. Other implementations may send Value to ReportStatusCode(), 58 and the status code reporting mechanism will eventually display the 32-bit 59 value on the status reporting device. 54 If Description is not NULL, then the ASCII string specified by Description is 55 also passed to the handler that displays the POST card value. Some 56 implementations of this library function may perform I/O operations directly 57 to a POST card device. Other implementations may send Value to ReportStatusCode(), 58 and the status code reporting mechanism will eventually display the 32-bit 59 value on the status reporting device. 60 60 61 PostCodeWithDescription()must actively prevent recursion. If 62 PostCodeWithDescription() is called while processing another any other Post 63 Code Library function, then PostCodeWithDescription() must return Value 61 PostCodeWithDescription()must actively prevent recursion. If 62 PostCodeWithDescription() is called while processing another any other Post 63 Code Library function, then PostCodeWithDescription() must return Value 64 64 immediately. 65 65 66 66 @param Value The 32-bit value to write to the POST card. 67 @param Description The pointer to an ASCII string that is a description of the 68 POST code value. This is an optional parameter that may 67 @param Description The pointer to an ASCII string that is a description of the 68 POST code value. This is an optional parameter that may 69 69 be NULL. 70 70 … … 87 87 Returns TRUE if POST Codes are enabled. 88 88 89 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED 89 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED 90 90 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned. 91 91 92 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 92 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 93 93 PcdPostCodeProperyMask is set. 94 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 94 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 95 95 PcdPostCodeProperyMask is clear. 96 96 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePrintLib/BasePrintLib.inf
r58459 r58466 21 21 MODULE_TYPE = BASE 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = PrintLib 23 LIBRARY_CLASS = PrintLib 24 24 25 25 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePrintLib/PrintLib.c
r48674 r58466 18 18 // 19 19 // Declare a VA_LIST global variable that is used in calls to BasePrintLibSPrintMarker() 20 // when the BASE_LIST parameter is valid and the VA_LIST parameter is ignored. 21 // A NULL VA_LIST can not be passed into BasePrintLibSPrintMarker() because some 20 // when the BASE_LIST parameter is valid and the VA_LIST parameter is ignored. 21 // A NULL VA_LIST can not be passed into BasePrintLibSPrintMarker() because some 22 22 // compilers define VA_LIST to be a structure. 23 23 // … … 27 27 28 28 /** 29 Produces a Null-terminated Unicode string in an output buffer based on 29 Produces a Null-terminated Unicode string in an output buffer based on 30 30 a Null-terminated Unicode format string and a VA_LIST argument list 31 31 32 32 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 33 and BufferSize. 34 The Unicode string is produced by parsing the format string specified by FormatString. 35 Arguments are pulled from the variable argument list specified by Marker based on the 36 contents of the format string. 33 and BufferSize. 34 The Unicode string is produced by parsing the format string specified by FormatString. 35 Arguments are pulled from the variable argument list specified by Marker based on the 36 contents of the format string. 37 37 The number of Unicode characters in the produced output buffer is returned not including 38 38 the Null-terminator. … … 43 43 If BufferSize > 1 and FormatString is NULL, then ASSERT(). 44 44 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT(). 45 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 45 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 46 46 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then 47 47 ASSERT(). … … 50 50 Null-terminator, then ASSERT(). 51 51 52 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 52 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 53 53 Unicode string. 54 54 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 55 55 @param FormatString A Null-terminated Unicode format string. 56 56 @param Marker VA_LIST marker for the variable argument list. 57 57 58 58 @return The number of Unicode characters in the produced output buffer not including the 59 59 Null-terminator. … … 75 75 76 76 /** 77 Produces a Null-terminated Unicode string in an output buffer based on 77 Produces a Null-terminated Unicode string in an output buffer based on 78 78 a Null-terminated Unicode format string and a BASE_LIST argument list 79 79 80 80 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 81 and BufferSize. 82 The Unicode string is produced by parsing the format string specified by FormatString. 83 Arguments are pulled from the variable argument list specified by Marker based on the 84 contents of the format string. 81 and BufferSize. 82 The Unicode string is produced by parsing the format string specified by FormatString. 83 Arguments are pulled from the variable argument list specified by Marker based on the 84 contents of the format string. 85 85 The number of Unicode characters in the produced output buffer is returned not including 86 86 the Null-terminator. … … 91 91 If BufferSize > 1 and FormatString is NULL, then ASSERT(). 92 92 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT(). 93 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 93 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 94 94 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then 95 95 ASSERT(). … … 98 98 Null-terminator, then ASSERT(). 99 99 100 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 100 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 101 101 Unicode string. 102 102 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 103 103 @param FormatString A Null-terminated Unicode format string. 104 104 @param Marker BASE_LIST marker for the variable argument list. 105 105 106 106 @return The number of Unicode characters in the produced output buffer not including the 107 107 Null-terminator. … … 123 123 124 124 /** 125 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 125 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 126 126 Unicode format string and variable argument list. 127 127 128 128 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 129 129 and BufferSize. … … 138 138 If BufferSize > 1 and FormatString is NULL, then ASSERT(). 139 139 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT(). 140 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 140 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 141 141 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then 142 142 ASSERT(). … … 145 145 Null-terminator, then ASSERT(). 146 146 147 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 147 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 148 148 Unicode string. 149 149 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 150 150 @param FormatString A Null-terminated Unicode format string. 151 @param ... Variable argument list whose contents are accessed based on the 151 @param ... Variable argument list whose contents are accessed based on the 152 152 format string specified by FormatString. 153 153 154 154 @return The number of Unicode characters in the produced output buffer not including the 155 155 Null-terminator. … … 177 177 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 178 178 ASCII format string and a VA_LIST argument list 179 179 180 180 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 181 181 and BufferSize. 182 182 The Unicode string is produced by parsing the format string specified by FormatString. 183 Arguments are pulled from the variable argument list specified by Marker based on the 183 Arguments are pulled from the variable argument list specified by Marker based on the 184 184 contents of the format string. 185 185 The number of Unicode characters in the produced output buffer is returned not including … … 197 197 Null-terminator, then ASSERT(). 198 198 199 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 199 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 200 200 Unicode string. 201 201 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 202 202 @param FormatString A Null-terminated ASCII format string. 203 203 @param Marker VA_LIST marker for the variable argument list. 204 204 205 205 @return The number of Unicode characters in the produced output buffer not including the 206 206 Null-terminator. … … 223 223 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 224 224 ASCII format string and a BASE_LIST argument list 225 225 226 226 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 227 227 and BufferSize. 228 228 The Unicode string is produced by parsing the format string specified by FormatString. 229 Arguments are pulled from the variable argument list specified by Marker based on the 229 Arguments are pulled from the variable argument list specified by Marker based on the 230 230 contents of the format string. 231 231 The number of Unicode characters in the produced output buffer is returned not including … … 243 243 Null-terminator, then ASSERT(). 244 244 245 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 245 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 246 246 Unicode string. 247 247 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 248 248 @param FormatString A Null-terminated ASCII format string. 249 249 @param Marker BASE_LIST marker for the variable argument list. 250 250 251 251 @return The number of Unicode characters in the produced output buffer not including the 252 252 Null-terminator. … … 267 267 268 268 /** 269 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 269 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 270 270 ASCII format string and variable argument list. 271 271 272 272 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 273 273 and BufferSize. 274 274 The Unicode string is produced by parsing the format string specified by FormatString. 275 Arguments are pulled from the variable argument list based on the contents of the 275 Arguments are pulled from the variable argument list based on the contents of the 276 276 format string. 277 277 The number of Unicode characters in the produced output buffer is returned not including … … 289 289 Null-terminator, then ASSERT(). 290 290 291 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 291 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 292 292 Unicode string. 293 293 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 294 294 @param FormatString A Null-terminated ASCII format string. 295 @param ... Variable argument list whose contents are accessed based on the 295 @param ... Variable argument list whose contents are accessed based on the 296 296 format string specified by FormatString. 297 297 298 298 @return The number of Unicode characters in the produced output buffer not including the 299 299 Null-terminator. … … 320 320 /** 321 321 Converts a decimal value to a Null-terminated Unicode string. 322 323 Converts the decimal number specified by Value to a Null-terminated Unicode 324 string specified by Buffer containing at most Width characters. No padding of spaces 322 323 Converts the decimal number specified by Value to a Null-terminated Unicode 324 string specified by Buffer containing at most Width characters. No padding of spaces 325 325 is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed. 326 326 The number of Unicode characters in Buffer is returned not including the Null-terminator. 327 327 If the conversion contains more than Width characters, then only the first 328 Width characters are returned, and the total number of characters 328 Width characters are returned, and the total number of characters 329 329 required to perform the conversion is returned. 330 Additional conversion parameters are specified in Flags. 331 330 Additional conversion parameters are specified in Flags. 331 332 332 The Flags bit LEFT_JUSTIFY is always ignored. 333 333 All conversions are left justified in Buffer. … … 335 335 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas 336 336 are inserted every 3rd digit starting from the right. 337 If RADIX_HEX is set in Flags, then the output buffer will be 337 If RADIX_HEX is set in Flags, then the output buffer will be 338 338 formatted in hexadecimal format. 339 339 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'. 340 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 341 then Buffer is padded with '0' characters so the combination of the optional '-' 340 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 341 then Buffer is padded with '0' characters so the combination of the optional '-' 342 342 sign character, '0' characters, digit characters for Value, and the Null-terminator 343 343 add up to Width characters. … … 355 355 @param Width The maximum number of Unicode characters to place in Buffer, not including 356 356 the Null-terminator. 357 357 358 358 @return The number of Unicode characters in Buffer not including the Null-terminator. 359 359 … … 375 375 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 376 376 ASCII format string and a VA_LIST argument list. 377 377 378 378 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 379 379 and BufferSize. 380 380 The ASCII string is produced by parsing the format string specified by FormatString. 381 Arguments are pulled from the variable argument list specified by Marker based on 381 Arguments are pulled from the variable argument list specified by Marker based on 382 382 the contents of the format string. 383 383 The number of ASCII characters in the produced output buffer is returned not including … … 394 394 Null-terminator, then ASSERT(). 395 395 396 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 396 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 397 397 ASCII string. 398 398 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 399 399 @param FormatString A Null-terminated ASCII format string. 400 400 @param Marker VA_LIST marker for the variable argument list. 401 401 402 402 @return The number of ASCII characters in the produced output buffer not including the 403 403 Null-terminator. … … 419 419 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 420 420 ASCII format string and a BASE_LIST argument list. 421 421 422 422 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 423 423 and BufferSize. 424 424 The ASCII string is produced by parsing the format string specified by FormatString. 425 Arguments are pulled from the variable argument list specified by Marker based on 425 Arguments are pulled from the variable argument list specified by Marker based on 426 426 the contents of the format string. 427 427 The number of ASCII characters in the produced output buffer is returned not including … … 438 438 Null-terminator, then ASSERT(). 439 439 440 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 440 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 441 441 ASCII string. 442 442 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 443 443 @param FormatString A Null-terminated ASCII format string. 444 444 @param Marker BASE_LIST marker for the variable argument list. 445 445 446 446 @return The number of ASCII characters in the produced output buffer not including the 447 447 Null-terminator. … … 463 463 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 464 464 ASCII format string and variable argument list. 465 465 466 466 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 467 467 and BufferSize. 468 468 The ASCII string is produced by parsing the format string specified by FormatString. 469 Arguments are pulled from the variable argument list based on the contents of the 469 Arguments are pulled from the variable argument list based on the contents of the 470 470 format string. 471 471 The number of ASCII characters in the produced output buffer is returned not including … … 482 482 Null-terminator, then ASSERT(). 483 483 484 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 484 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 485 485 ASCII string. 486 486 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 487 487 @param FormatString A Null-terminated ASCII format string. 488 @param ... Variable argument list whose contents are accessed based on the 488 @param ... Variable argument list whose contents are accessed based on the 489 489 format string specified by FormatString. 490 490 491 491 @return The number of ASCII characters in the produced output buffer not including the 492 492 Null-terminator. … … 514 514 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 515 515 Unicode format string and a VA_LIST argument list. 516 516 517 517 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 518 518 and BufferSize. 519 519 The ASCII string is produced by parsing the format string specified by FormatString. 520 Arguments are pulled from the variable argument list specified by Marker based on 520 Arguments are pulled from the variable argument list specified by Marker based on 521 521 the contents of the format string. 522 522 The number of ASCII characters in the produced output buffer is returned not including … … 534 534 Null-terminator, then ASSERT(). 535 535 536 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 536 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 537 537 ASCII string. 538 538 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 539 539 @param FormatString A Null-terminated Unicode format string. 540 540 @param Marker VA_LIST marker for the variable argument list. 541 541 542 542 @return The number of ASCII characters in the produced output buffer not including the 543 543 Null-terminator. … … 560 560 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 561 561 Unicode format string and a BASE_LIST argument list. 562 562 563 563 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 564 564 and BufferSize. 565 565 The ASCII string is produced by parsing the format string specified by FormatString. 566 Arguments are pulled from the variable argument list specified by Marker based on 566 Arguments are pulled from the variable argument list specified by Marker based on 567 567 the contents of the format string. 568 568 The number of ASCII characters in the produced output buffer is returned not including … … 580 580 Null-terminator, then ASSERT(). 581 581 582 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 582 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 583 583 ASCII string. 584 584 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 585 585 @param FormatString A Null-terminated Unicode format string. 586 586 @param Marker BASE_LIST marker for the variable argument list. 587 587 588 588 @return The number of ASCII characters in the produced output buffer not including the 589 589 Null-terminator. … … 606 606 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 607 607 Unicode format string and variable argument list. 608 608 609 609 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 610 610 and BufferSize. 611 611 The ASCII string is produced by parsing the format string specified by FormatString. 612 Arguments are pulled from the variable argument list based on the contents of the 612 Arguments are pulled from the variable argument list based on the contents of the 613 613 format string. 614 614 The number of ASCII characters in the produced output buffer is returned not including … … 626 626 Null-terminator, then ASSERT(). 627 627 628 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 628 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 629 629 ASCII string. 630 630 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 631 631 @param FormatString A Null-terminated Unicode format string. 632 @param ... Variable argument list whose contents are accessed based on the 632 @param ... Variable argument list whose contents are accessed based on the 633 633 format string specified by FormatString. 634 634 635 635 @return The number of ASCII characters in the produced output buffer not including the 636 636 Null-terminator. … … 658 658 /** 659 659 Converts a decimal value to a Null-terminated ASCII string. 660 661 Converts the decimal number specified by Value to a Null-terminated ASCII string 662 specified by Buffer containing at most Width characters. No padding of spaces 660 661 Converts the decimal number specified by Value to a Null-terminated ASCII string 662 specified by Buffer containing at most Width characters. No padding of spaces 663 663 is ever performed. 664 664 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed. … … 667 667 characters are returned, and the total number of characters required to perform 668 668 the conversion is returned. 669 Additional conversion parameters are specified in Flags. 669 Additional conversion parameters are specified in Flags. 670 670 The Flags bit LEFT_JUSTIFY is always ignored. 671 671 All conversions are left justified in Buffer. … … 673 673 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas 674 674 are inserted every 3rd digit starting from the right. 675 If RADIX_HEX is set in Flags, then the output buffer will be 675 If RADIX_HEX is set in Flags, then the output buffer will be 676 676 formatted in hexadecimal format. 677 677 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'. 678 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 679 then Buffer is padded with '0' characters so the combination of the optional '-' 678 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 679 then Buffer is padded with '0' characters so the combination of the optional '-' 680 680 sign character, '0' characters, digit characters for Value, and the Null-terminator 681 681 add up to Width characters. 682 682 683 683 If Buffer is NULL, then ASSERT(). 684 684 If unsupported bits are set in Flags, then ASSERT(). … … 692 692 @param Width The maximum number of ASCII characters to place in Buffer, not including 693 693 the Null-terminator. 694 694 695 695 @return The number of ASCII characters in Buffer not including the Null-terminator. 696 696 … … 709 709 710 710 /** 711 Returns the number of characters that would be produced by if the formatted 711 Returns the number of characters that would be produced by if the formatted 712 712 output were produced not including the Null-terminator. 713 713 … … 718 718 @param[in] Marker VA_LIST marker for the variable argument list. 719 719 720 @return The number of characters that would be produced, not including the 720 @return The number of characters that would be produced, not including the 721 721 Null-terminator. 722 722 **/ … … 734 734 735 735 /** 736 Returns the number of characters that would be produced by if the formatted 736 Returns the number of characters that would be produced by if the formatted 737 737 output were produced not including the Null-terminator. 738 738 … … 742 742 @param[in] Marker VA_LIST marker for the variable argument list. 743 743 744 @return The number of characters that would be produced, not including the 744 @return The number of characters that would be produced, not including the 745 745 Null-terminator. 746 746 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePrintLib/PrintLibInternal.c
r58459 r58466 70 70 @param Buffer The buffer to place the Unicode or ASCII string. 71 71 @param EndBuffer The end of the input Buffer. No characters will be 72 placed after that. 72 placed after that. 73 73 @param Length The count of character to be placed into Buffer. 74 74 (Negative value indicates no buffer fill.) … … 89 89 { 90 90 INTN Index; 91 91 92 92 for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) { 93 93 *Buffer = (CHAR8) Character; … … 115 115 CHAR8 * 116 116 BasePrintLibValueToString ( 117 IN OUT CHAR8 *Buffer, 118 IN INT64 Value, 117 IN OUT CHAR8 *Buffer, 118 IN INT64 Value, 119 119 IN UINTN Radix 120 120 ) … … 139 139 /** 140 140 Internal function that converts a decimal value to a Null-terminated string. 141 142 Converts the decimal number specified by Value to a Null-terminated 141 142 Converts the decimal number specified by Value to a Null-terminated 143 143 string specified by Buffer containing at most Width characters. 144 144 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed. 145 145 The total number of characters placed in Buffer is returned. 146 146 If the conversion contains more than Width characters, then only the first 147 Width characters are returned, and the total number of characters 147 Width characters are returned, and the total number of characters 148 148 required to perform the conversion is returned. 149 Additional conversion parameters are specified in Flags. 149 Additional conversion parameters are specified in Flags. 150 150 The Flags bit LEFT_JUSTIFY is always ignored. 151 151 All conversions are left justified in Buffer. … … 154 154 are inserted every 3rd digit starting from the right. 155 155 If Value is < 0, then the fist character in Buffer is a '-'. 156 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 157 then Buffer is padded with '0' characters so the combination of the optional '-' 156 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 157 then Buffer is padded with '0' characters so the combination of the optional '-' 158 158 sign character, '0' characters, digit characters for Value, and the Null-terminator 159 159 add up to Width characters. … … 171 171 the Null-terminator. 172 172 @param Increment The character increment in Buffer. 173 173 174 174 @return Total number of characters required to perform the conversion. 175 175 … … 209 209 210 210 OriginalBuffer = Buffer; 211 211 212 212 // 213 213 // Width is 0 or COMMA_TYPE is set, PREFIX_ZERO is ignored. … … 226 226 // 227 227 EndBuffer = Buffer + Width * Increment; 228 228 229 229 // 230 230 // Convert decimal negative … … 235 235 Width--; 236 236 } 237 237 238 238 // 239 239 // Count the length of the value string. … … 242 242 ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix); 243 243 Count = ValueBufferPtr - ValueBuffer; 244 244 245 245 // 246 246 // Append Zero … … 249 249 Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Count, '0', Increment); 250 250 } 251 251 252 252 // 253 253 // Print Comma type for every 3 characters … … 269 269 } 270 270 } 271 271 272 272 // 273 273 // Print Null-terminator … … 279 279 280 280 /** 281 Worker function that produces a Null-terminated string in an output buffer 281 Worker function that produces a Null-terminated string in an output buffer 282 282 based on a Null-terminated format string and a VA_LIST argument list. 283 283 284 VSPrint function to process format and place the results in Buffer. Since a 285 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 284 VSPrint function to process format and place the results in Buffer. Since a 285 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 286 286 this is the main print working routine. 287 287 288 288 If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all. 289 289 290 @param[out] Buffer The character buffer to print the results of the 290 @param[out] Buffer The character buffer to print the results of the 291 291 parsing of Format into. 292 @param[in] BufferSize The maximum number of characters to put into 292 @param[in] BufferSize The maximum number of characters to put into 293 293 buffer. 294 294 @param[in] Flags Initial flags value. 295 Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 295 Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 296 296 and COUNT_ONLY_NO_PRINT set. 297 297 @param[in] Format A Null-terminated format string. … … 349 349 // 350 350 // If you change this code be sure to match the 2 versions of this function. 351 // Nearly identical logic is found in the BasePrintLib and 351 // Nearly identical logic is found in the BasePrintLib and 352 352 // DxePrintLibPrint2Protocol (both PrintLib instances). 353 353 // … … 393 393 // 394 394 // Make sure format string cannot contain more than PcdMaximumUnicodeStringLength 395 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 395 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 396 396 // 397 397 ASSERT (StrSize ((CHAR16 *) Format) != 0); … … 401 401 // 402 402 // Make sure format string cannot contain more than PcdMaximumAsciiStringLength 403 // Ascii characters if PcdMaximumAsciiStringLength is not zero. 403 // Ascii characters if PcdMaximumAsciiStringLength is not zero. 404 404 // 405 405 ASSERT (AsciiStrSize (Format) != 0); … … 445 445 FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask; 446 446 switch (FormatCharacter) { 447 case '.': 448 Flags |= PRECISION; 447 case '.': 448 Flags |= PRECISION; 449 449 break; 450 case '-': 451 Flags |= LEFT_JUSTIFY; 450 case '-': 451 Flags |= LEFT_JUSTIFY; 452 452 break; 453 case '+': 454 Flags |= PREFIX_SIGN; 453 case '+': 454 Flags |= PREFIX_SIGN; 455 455 break; 456 case ' ': 457 Flags |= PREFIX_BLANK; 456 case ' ': 457 Flags |= PREFIX_BLANK; 458 458 break; 459 case ',': 460 Flags |= COMMA_TYPE; 459 case ',': 460 Flags |= COMMA_TYPE; 461 461 break; 462 462 case 'L': 463 case 'l': 464 Flags |= LONG_TYPE; 463 case 'l': 464 Flags |= LONG_TYPE; 465 465 break; 466 466 case '*': … … 506 506 } 507 507 break; 508 508 509 509 case '\0': 510 510 // 511 511 // Make no output if Format string terminates unexpectedly when 512 // looking up for flag, width, precision and type. 512 // looking up for flag, width, precision and type. 513 513 // 514 514 Format -= BytesPerFormatCharacter; … … 521 521 break; 522 522 } 523 } 523 } 524 524 525 525 // … … 553 553 // 'd','x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int". 554 554 // This assumption is made so the format string definition is compatible with the ANSI C 555 // Specification for formatted strings. It is recommended that the Base Types be used 556 // everywhere, but in this one case, compliance with ANSI C is more important, and 557 // provides an implementation that is compatible with that largest possible set of CPU 555 // Specification for formatted strings. It is recommended that the Base Types be used 556 // everywhere, but in this one case, compliance with ANSI C is more important, and 557 // provides an implementation that is compatible with that largest possible set of CPU 558 558 // architectures. This is why the type "int" is used in this one case. 559 559 // … … 597 597 // 'd','x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int". 598 598 // This assumption is made so the format string definition is compatible with the ANSI C 599 // Specification for formatted strings. It is recommended that the Base Types be used 600 // everywhere, but in this one case, compliance with ANSI C is more important, and 601 // provides an implementation that is compatible with that largest possible set of CPU 599 // Specification for formatted strings. It is recommended that the Base Types be used 600 // everywhere, but in this one case, compliance with ANSI C is more important, and 601 // provides an implementation that is compatible with that largest possible set of CPU 602 602 // architectures. This is why the type "unsigned int" is used in this one case. 603 603 // … … 613 613 } 614 614 ArgumentString = (CHAR8 *)ValueBuffer + Count; 615 615 616 616 Digits = Count % 3; 617 617 if (Digits != 0) { … … 686 686 BasePrintLibSPrint ( 687 687 ValueBuffer, 688 MAXIMUM_VALUE_CHARACTERS, 688 MAXIMUM_VALUE_CHARACTERS, 689 689 0, 690 690 "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", … … 707 707 case 't': 708 708 if (BaseListMarker == NULL) { 709 TmpTime = VA_ARG (VaListMarker, TIME *); 709 TmpTime = VA_ARG (VaListMarker, TIME *); 710 710 } else { 711 TmpTime = BASE_ARG (BaseListMarker, TIME *); 711 TmpTime = BASE_ARG (BaseListMarker, TIME *); 712 712 } 713 713 if (TmpTime == NULL) { … … 794 794 } 795 795 break; 796 796 797 797 case '\r': 798 798 Format += BytesPerFormatCharacter; … … 960 960 // 961 961 // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength 962 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 962 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 963 963 // 964 964 ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0)); 965 965 // 966 966 // Make sure output buffer cannot contain more than PcdMaximumAsciiStringLength 967 // ASCII characters if PcdMaximumAsciiStringLength is not zero. 967 // ASCII characters if PcdMaximumAsciiStringLength is not zero. 968 968 // 969 969 ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0)); … … 973 973 974 974 /** 975 Worker function that produces a Null-terminated string in an output buffer 975 Worker function that produces a Null-terminated string in an output buffer 976 976 based on a Null-terminated format string and variable argument list. 977 977 978 VSPrint function to process format and place the results in Buffer. Since a 979 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 978 VSPrint function to process format and place the results in Buffer. Since a 979 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 980 980 this is the main print working routine 981 981 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePrintLib/PrintLibInternal.h
r48674 r58466 54 54 55 55 /** 56 Worker function that produces a Null-terminated string in an output buffer 56 Worker function that produces a Null-terminated string in an output buffer 57 57 based on a Null-terminated format string and a VA_LIST argument list. 58 58 59 VSPrint function to process format and place the results in Buffer. Since a 60 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 59 VSPrint function to process format and place the results in Buffer. Since a 60 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 61 61 this is the main print working routine. 62 62 63 63 If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all. 64 64 65 @param[out] Buffer The character buffer to print the results of the 65 @param[out] Buffer The character buffer to print the results of the 66 66 parsing of Format into. 67 @param[in] BufferSize The maximum number of characters to put into 67 @param[in] BufferSize The maximum number of characters to put into 68 68 buffer. 69 69 @param[in] Flags Initial flags value. 70 Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 70 Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 71 71 and COUNT_ONLY_NO_PRINT set. 72 72 @param[in] Format A Null-terminated format string. … … 92 92 93 93 /** 94 Worker function that produces a Null-terminated string in an output buffer 94 Worker function that produces a Null-terminated string in an output buffer 95 95 based on a Null-terminated format string and variable argument list. 96 96 97 VSPrint function to process format and place the results in Buffer. Since a 98 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 97 VSPrint function to process format and place the results in Buffer. Since a 98 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 99 99 this is the main print working routine 100 100 … … 128 128 @param Buffer Buffer to place the Unicode or ASCII string. 129 129 @param EndBuffer The end of the input Buffer. No characters will be 130 placed after that. 130 placed after that. 131 131 @param Length The count of character to be placed into Buffer. 132 132 (Negative value indicates no buffer fill.) … … 160 160 CHAR8 * 161 161 BasePrintLibValueToString ( 162 IN OUT CHAR8 *Buffer, 163 IN INT64 Value, 162 IN OUT CHAR8 *Buffer, 163 IN INT64 Value, 164 164 IN UINTN Radix 165 165 ); … … 167 167 /** 168 168 Internal function that converts a decimal value to a Null-terminated string. 169 170 Converts the decimal number specified by Value to a Null-terminated 169 170 Converts the decimal number specified by Value to a Null-terminated 171 171 string specified by Buffer containing at most Width characters. 172 172 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed. 173 173 The total number of characters placed in Buffer is returned. 174 174 If the conversion contains more than Width characters, then only the first 175 Width characters are returned, and the total number of characters 175 Width characters are returned, and the total number of characters 176 176 required to perform the conversion is returned. 177 Additional conversion parameters are specified in Flags. 177 Additional conversion parameters are specified in Flags. 178 178 The Flags bit LEFT_JUSTIFY is always ignored. 179 179 All conversions are left justified in Buffer. … … 182 182 are inserted every 3rd digit starting from the right. 183 183 If Value is < 0, then the fist character in Buffer is a '-'. 184 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 185 then Buffer is padded with '0' characters so the combination of the optional '-' 184 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 185 then Buffer is padded with '0' characters so the combination of the optional '-' 186 186 sign character, '0' characters, digit characters for Value, and the Null-terminator 187 187 add up to Width characters. … … 199 199 the Null-terminator. 200 200 @param Increment Character increment in Buffer. 201 201 202 202 @return Total number of characters required to perform the conversion. 203 203 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLib.c
r48674 r58466 216 216 { 217 217 ASSERT (DevicePath != NULL); 218 218 219 219 return EFI_SUCCESS; 220 220 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseS3BootScriptLibNull/BootScriptLib.c
r58459 r58466 1 1 /** @file 2 Null function implementation for EFI S3 boot script. 2 Null function implementation for EFI S3 boot script. 3 3 4 4 Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> … … 20 20 21 21 /** 22 Save I/O write to boot script 22 Save I/O write to boot script 23 23 24 24 @param Width the width of the I/O operations.Enumerated in S3_BOOT_SCRIPT_LIB_WIDTH. … … 199 199 IN VOID *DataMask 200 200 ) 201 { 201 { 202 202 return RETURN_SUCCESS; 203 203 } … … 210 210 @param Length A pointer to signify the number of bytes that this operation will do. 211 211 @param Buffer Contains the value of data to execute to the SMBUS slave device. 212 212 213 213 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 214 214 @retval RETURN_SUCCESS Opcode is added. … … 217 217 EFIAPI 218 218 S3BootScriptSaveSmbusExecute ( 219 IN UINTN SmBusAddress, 219 IN UINTN SmBusAddress, 220 220 IN EFI_SMBUS_OPERATION Operation, 221 221 IN UINTN *Length, … … 229 229 230 230 @param Duration Duration in microseconds of the stall 231 231 232 232 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 233 233 @retval RETURN_SUCCESS Opcode is added. … … 245 245 246 246 @param EntryPoint Entry point of the code to be dispatched. 247 247 248 248 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 249 249 @retval RETURN_SUCCESS Opcode is added. … … 262 262 @param EntryPoint Entry point of the code to be dispatched. 263 263 @param Context Argument to be passed into the EntryPoint of the code to be dispatched. 264 264 265 265 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 266 266 @retval RETURN_SUCCESS Opcode is added. … … 279 279 Adds a record for memory reads of the memory location and continues when the exit criteria is 280 280 satisfied or after a defined duration. 281 281 282 282 Please aware, below interface is different with PI specification, Vol 5: 283 283 EFI_S3_SAVE_STATE_PROTOCOL.Write() for EFI_BOOT_SCRIPT_MEM_POLL_OPCODE. … … 313 313 Store arbitrary information in the boot script table. This opcode is a no-op on dispatch and is only 314 314 used for debugging script issues. 315 315 316 316 @param InformationLength Length of the data in bytes 317 317 @param Information Information to be logged in the boot scrpit 318 318 319 319 @retval RETURN_UNSUPPORTED If entering runtime, this method will not support. 320 320 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. … … 325 325 EFIAPI 326 326 S3BootScriptSaveInformation ( 327 IN UINT32 InformationLength, 327 IN UINT32 InformationLength, 328 328 IN VOID *Information 329 329 ) … … 334 334 Adds a record for I/O reads the I/O location and continues when the exit criteria is satisfied or after a 335 335 defined duration. 336 337 @param Width The width of the I/O operations. 336 337 @param Width The width of the I/O operations. 338 338 @param Address The base address of the I/O operations. 339 339 @param Data The comparison value used for the polling exit criteria. … … 353 353 IN UINT64 Address, 354 354 IN VOID *Data, 355 IN VOID *DataMask, 356 IN UINT64 Delay 355 IN VOID *DataMask, 356 IN UINT64 Delay 357 357 ) 358 358 { … … 364 364 after a defined duration. 365 365 366 @param Width The width of the I/O operations. 366 @param Width The width of the I/O operations. 367 367 @param Address The address within the PCI configuration space. 368 368 @param Data The comparison value used for the polling exit criteria. … … 392 392 after a defined duration. 393 393 394 @param Width The width of the I/O operations. 394 @param Width The width of the I/O operations. 395 395 @param Segment The PCI segment number for Address. 396 396 @param Address The address within the PCI configuration space. … … 404 404 @retval RETURN_SUCCESS Opcode is added. 405 405 @note A known Limitations in the implementation: When interpreting the opcode EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE 406 EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as 406 EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as 407 407 Zero, or else, assert. 408 408 … … 440 440 } 441 441 /** 442 This is an function to close the S3 boot script table. The function could only be called in 443 BOOT time phase. To comply with the Framework spec definition on 442 This is an function to close the S3 boot script table. The function could only be called in 443 BOOT time phase. To comply with the Framework spec definition on 444 444 EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable(), this function will fulfill following things: 445 445 1. Closes the specified boot script table 446 2. It allocates a new memory pool to duplicate all the boot scripts in the specified table. 447 Once this function is called, the table maintained by the library will be destroyed 446 2. It allocates a new memory pool to duplicate all the boot scripts in the specified table. 447 Once this function is called, the table maintained by the library will be destroyed 448 448 after it is copied into the allocated pool. 449 3. Any attempts to add a script record after calling this function will cause a new table 449 3. Any attempts to add a script record after calling this function will cause a new table 450 450 to be created by the library. 451 4. The base address of the allocated pool will be returned in Address. Note that after 451 4. The base address of the allocated pool will be returned in Address. Note that after 452 452 using the boot script table, the CALLER is responsible for freeing the pool that is allocated 453 by this function. 453 by this function. 454 454 455 455 In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. By then it is not 456 456 necessary to provide this API in BootScriptLib. To provides this API for now is only to meet 457 457 the requirement from Framework Spec. 458 459 If anyone does call CloseTable() on a real platform, then the caller is responsible for figuring out 460 how to get the script to run on an S3 resume because the boot script maintained by the lib will be 458 459 If anyone does call CloseTable() on a real platform, then the caller is responsible for figuring out 460 how to get the script to run on an S3 resume because the boot script maintained by the lib will be 461 461 destroyed. 462 463 @return the base address of the new copy of the boot script table. 462 463 @return the base address of the new copy of the boot script table. 464 464 465 465 **/ … … 476 476 477 477 @param RETURN_SUCCESS The boot script table was executed successfully. 478 @param RETURN_UNSUPPORTED Invalid script table or opcode. 478 @param RETURN_UNSUPPORTED Invalid script table or opcode. 479 479 **/ 480 480 RETURN_STATUS … … 487 487 } 488 488 /** 489 Move the last boot script entry to the position 489 Move the last boot script entry to the position 490 490 491 491 @param BeforeOrAfter Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position … … 514 514 515 515 @param BeforeOrAfter Specifies whether the opcode is stored before (TRUE) 516 or after (FALSE) the position in the boot script table 516 or after (FALSE) the position in the boot script table 517 517 specified by Position. 518 @param CreateIfNotFound Specifies whether the label will be created if the label 518 @param CreateIfNotFound Specifies whether the label will be created if the label 519 519 does not exists (TRUE) or not (FALSE). 520 520 @param Position On entry, specifies the position in the boot script table … … 527 527 specified script table. 528 528 @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported. 529 If the opcode is unknow or not supported because of the PCD 529 If the opcode is unknow or not supported because of the PCD 530 530 Feature Flags. 531 531 @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script. … … 533 533 **/ 534 534 RETURN_STATUS 535 EFIAPI 535 EFIAPI 536 536 S3BootScriptLabel ( 537 537 IN BOOLEAN BeforeOrAfter, … … 552 552 specified script table. 553 553 @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported. 554 If the opcode is unknow or not supported because of the PCD 554 If the opcode is unknow or not supported because of the PCD 555 555 Feature Flags. 556 556 @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script. … … 558 558 **/ 559 559 RETURN_STATUS 560 EFIAPI 560 EFIAPI 561 561 S3BootScriptCompare ( 562 562 IN UINT8 *Position1, -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseS3IoLib/BaseS3IoLib.inf
r58459 r58466 2 2 # Instance of S3 I/O Library based on I/O and S3 BootScript Library. 3 3 # 4 # S3 I/O and MMIO Library Services that do I/O and also 4 # S3 I/O and MMIO Library Services that do I/O and also 5 5 # enable the I/O operatation to be replayed during an S3 resume. 6 6 # … … 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = S3IoLib 26 LIBRARY_CLASS = S3IoLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseS3IoLib/S3IoLib.c
r58459 r58466 2 2 I/O and MMIO Library Services that do I/O and also enable the I/O operatation 3 3 to be replayed during an S3 resume. 4 4 5 5 Copyright (c) 2006 -2012, Intel Corporation. All rights reserved.<BR> 6 6 … … 28 28 29 29 This internal worker function saves an I/O port value in the S3 script 30 to be replayed on S3 resume. 30 to be replayed on S3 resume. 31 31 32 32 If the saving process fails, then ASSERT(). … … 45 45 { 46 46 RETURN_STATUS Status; 47 47 48 48 Status = S3BootScriptSaveIoWrite ( 49 49 Width, … … 54 54 ASSERT (Status == RETURN_SUCCESS); 55 55 } 56 56 57 57 /** 58 58 Saves an 8-bit I/O port value to the boot script. 59 59 60 60 This internal worker function saves an 8-bit I/O port value in the S3 script 61 to be replayed on S3 resume. 61 to be replayed on S3 resume. 62 62 63 63 If the saving process fails, then ASSERT(). … … 190 190 /** 191 191 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise 192 inclusive OR, and writes the result back to the 8-bit I/O port and saves 192 inclusive OR, and writes the result back to the 8-bit I/O port and saves 193 193 the value in the S3 script to be replayed on S3 resume. 194 194 … … 291 291 /** 292 292 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the 293 result back to the bit field in the 8-bit port and saves the value in the 293 result back to the bit field in the 8-bit port and saves the value in the 294 294 S3 script to be replayed on S3 resume. 295 295 … … 330 330 /** 331 331 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the 332 result back to the bit field in the 8-bit port and saves the value in the 332 result back to the bit field in the 8-bit port and saves the value in the 333 333 S3 script to be replayed on S3 resume. 334 334 … … 414 414 415 415 This internal worker function saves a 16-bit I/O port value in the S3 script 416 to be replayed on S3 resume. 416 to be replayed on S3 resume. 417 417 418 418 If the saving process fails, then ASSERT(). … … 431 431 { 432 432 InternalSaveIoWriteValueToBootScript (S3BootScriptWidthUint16, Port, &Value); 433 433 434 434 return Value; 435 435 } … … 487 487 /** 488 488 Reads a 16-bit I/O port, performs a bitwise OR, and writes the 489 result back to the 16-bit I/O port and saves the value in the S3 script to 489 result back to the 16-bit I/O port and saves the value in the S3 script to 490 490 be replayed on S3 resume. 491 491 … … 608 608 609 609 /** 610 Writes a bit field to an I/O register and saves the value in the S3 script 610 Writes a bit field to an I/O register and saves the value in the S3 script 611 611 to be replayed on S3 resume. 612 612 … … 646 646 /** 647 647 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the 648 result back to the bit field in the 16-bit port and saves the value in the 648 result back to the bit field in the 16-bit port and saves the value in the 649 649 S3 script to be replayed on S3 resume. 650 650 … … 685 685 /** 686 686 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the 687 result back to the bit field in the 16-bit port and saves the value in the 687 result back to the bit field in the 16-bit port and saves the value in the 688 688 S3 script to be replayed on S3 resume. 689 689 … … 725 725 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a 726 726 bitwise OR, and writes the result back to the bit field in the 727 16-bit port and saves the value in the S3 script to be replayed on S3 727 16-bit port and saves the value in the S3 script to be replayed on S3 728 728 resume. 729 729 … … 770 770 771 771 This internal worker function saves a 32-bit I/O port value in the S3 script 772 to be replayed on S3 resume. 772 to be replayed on S3 resume. 773 773 774 774 If the saving process fails, then ASSERT(). … … 787 787 { 788 788 InternalSaveIoWriteValueToBootScript (S3BootScriptWidthUint32, Port, &Value); 789 789 790 790 return Value; 791 791 } … … 843 843 /** 844 844 Reads a 32-bit I/O port, performs a bitwise OR, and writes the 845 result back to the 32-bit I/O port and saves the value in the S3 script to 845 result back to the 32-bit I/O port and saves the value in the S3 script to 846 846 be replayed on S3 resume. 847 847 … … 901 901 /** 902 902 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise 903 inclusive OR, and writes the result back to the 32-bit I/O port and saves 903 inclusive OR, and writes the result back to the 32-bit I/O port and saves 904 904 the value in the S3 script to be replayed on S3 resume. 905 905 … … 1002 1002 /** 1003 1003 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the 1004 result back to the bit field in the 32-bit port and saves the value in the 1004 result back to the bit field in the 32-bit port and saves the value in the 1005 1005 S3 script to be replayed on S3 resume. 1006 1006 … … 1041 1041 /** 1042 1042 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the 1043 result back to the bit field in the 32-bit port and saves the value in the 1043 result back to the bit field in the 32-bit port and saves the value in the 1044 1044 S3 script to be replayed on S3 resume. 1045 1045 … … 1081 1081 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a 1082 1082 bitwise OR, and writes the result back to the bit field in the 1083 32-bit port and saves the value in the S3 script to be replayed on S3 1083 32-bit port and saves the value in the S3 script to be replayed on S3 1084 1084 resume. 1085 1085 … … 1126 1126 1127 1127 This internal worker function saves a 64-bit I/O port value in the S3 script 1128 to be replayed on S3 resume. 1128 to be replayed on S3 resume. 1129 1129 1130 1130 If the saving process fails, then ASSERT(). … … 1143 1143 { 1144 1144 InternalSaveIoWriteValueToBootScript (S3BootScriptWidthUint64, Port, &Value); 1145 1145 1146 1146 return Value; 1147 1147 } … … 1199 1199 /** 1200 1200 Reads a 64-bit I/O port, performs a bitwise OR, and writes the 1201 result back to the 64-bit I/O port and saves the value in the S3 script to 1201 result back to the 64-bit I/O port and saves the value in the S3 script to 1202 1202 be replayed on S3 resume. 1203 1203 … … 1358 1358 /** 1359 1359 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the 1360 result back to the bit field in the 64-bit port and saves the value in the 1360 result back to the bit field in the 64-bit port and saves the value in the 1361 1361 S3 script to be replayed on S3 resume. 1362 1362 … … 1397 1397 /** 1398 1398 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the 1399 result back to the bit field in the 64-bit port and saves the value in the 1399 result back to the bit field in the 64-bit port and saves the value in the 1400 1400 S3 script to be replayed on S3 resume. 1401 1401 … … 1437 1437 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a 1438 1438 bitwise OR, and writes the result back to the bit field in the 1439 64-bit port and saves the value in the S3 script to be replayed on S3 1439 64-bit port and saves the value in the S3 script to be replayed on S3 1440 1440 resume. 1441 1441 … … 1482 1482 1483 1483 This internal worker function saves an MMIO register value in the S3 script 1484 to be replayed on S3 resume. 1484 to be replayed on S3 resume. 1485 1485 1486 1486 If the saving process fails, then ASSERT(). … … 1513 1513 1514 1514 This internal worker function saves an 8-bit MMIO register value in the S3 script 1515 to be replayed on S3 resume. 1515 to be replayed on S3 resume. 1516 1516 1517 1517 If the saving process fails, then ASSERT(). … … 1535 1535 1536 1536 /** 1537 Reads an 8-bit MMIO register and saves the value in the S3 script to be 1537 Reads an 8-bit MMIO register and saves the value in the S3 script to be 1538 1538 replayed on S3 resume. 1539 1539 … … 1559 1559 1560 1560 /** 1561 Writes an 8-bit MMIO register and saves the value in the S3 script to be 1561 Writes an 8-bit MMIO register and saves the value in the S3 script to be 1562 1562 replayed on S3 resume. 1563 1563 … … 1586 1586 /** 1587 1587 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the 1588 result back to the 8-bit MMIO register and saves the value in the S3 script 1588 result back to the 8-bit MMIO register and saves the value in the S3 script 1589 1589 to be replayed on S3 resume. 1590 1590 … … 1615 1615 /** 1616 1616 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result 1617 back to the 8-bit MMIO register and saves the value in the S3 script to be 1617 back to the 8-bit MMIO register and saves the value in the S3 script to be 1618 1618 replayed on S3 resume. 1619 1619 … … 1644 1644 /** 1645 1645 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise 1646 inclusive OR, and writes the result back to the 8-bit MMIO register and saves 1646 inclusive OR, and writes the result back to the 8-bit MMIO register and saves 1647 1647 the value in the S3 script to be replayed on S3 resume. 1648 1648 … … 1870 1870 1871 1871 This internal worker function saves a 16-bit MMIO register value in the S3 script 1872 to be replayed on S3 resume. 1872 to be replayed on S3 resume. 1873 1873 1874 1874 If the saving process fails, then ASSERT(). … … 1887 1887 { 1888 1888 InternalSaveMmioWriteValueToBootScript (S3BootScriptWidthUint16, Address, &Value); 1889 1889 1890 1890 return Value; 1891 1891 } … … 1944 1944 /** 1945 1945 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the 1946 result back to the 16-bit MMIO register and saves the value in the S3 script 1946 result back to the 16-bit MMIO register and saves the value in the S3 script 1947 1947 to be replayed on S3 resume. 1948 1948 … … 1973 1973 /** 1974 1974 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result 1975 back to the 16-bit MMIO register and saves the value in the S3 script to be 1975 back to the 16-bit MMIO register and saves the value in the S3 script to be 1976 1976 replayed on S3 resume. 1977 1977 … … 2002 2002 /** 2003 2003 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise 2004 inclusive OR, and writes the result back to the 16-bit MMIO register and 2004 inclusive OR, and writes the result back to the 16-bit MMIO register and 2005 2005 saves the value in the S3 script to be replayed on S3 resume. 2006 2006 … … 2102 2102 /** 2103 2103 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and 2104 writes the result back to the bit field in the 16-bit MMIO register and 2104 writes the result back to the bit field in the 16-bit MMIO register and 2105 2105 saves the value in the S3 script to be replayed on S3 resume. 2106 2106 … … 2142 2142 /** 2143 2143 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and 2144 writes the result back to the bit field in the 16-bit MMIO register and 2144 writes the result back to the bit field in the 16-bit MMIO register and 2145 2145 saves the value in the S3 script to be replayed on S3 resume. 2146 2146 … … 2228 2228 2229 2229 This internal worker function saves a 32-bit MMIO register value in the S3 script 2230 to be replayed on S3 resume. 2230 to be replayed on S3 resume. 2231 2231 2232 2232 If the saving process fails, then ASSERT(). … … 2250 2250 2251 2251 /** 2252 Reads a 32-bit MMIO register saves the value in the S3 script to be 2252 Reads a 32-bit MMIO register saves the value in the S3 script to be 2253 2253 replayed on S3 resume. 2254 2254 … … 2274 2274 2275 2275 /** 2276 Writes a 32-bit MMIO register and saves the value in the S3 script to be 2276 Writes a 32-bit MMIO register and saves the value in the S3 script to be 2277 2277 replayed on S3 resume. 2278 2278 … … 2301 2301 /** 2302 2302 Reads a 32-bit MMIO register, performs a bitwise OR, and writes the 2303 result back to the 32-bit MMIO register and saves the value in the S3 script 2303 result back to the 32-bit MMIO register and saves the value in the S3 script 2304 2304 to be replayed on S3 resume. 2305 2305 … … 2330 2330 /** 2331 2331 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result 2332 back to the 32-bit MMIO register and saves the value in the S3 script to be 2332 back to the 32-bit MMIO register and saves the value in the S3 script to be 2333 2333 replayed on S3 resume. 2334 2334 … … 2359 2359 /** 2360 2360 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise 2361 inclusive OR, and writes the result back to the 32-bit MMIO register and 2361 inclusive OR, and writes the result back to the 32-bit MMIO register and 2362 2362 saves the value in the S3 script to be replayed on S3 resume. 2363 2363 … … 2390 2390 2391 2391 /** 2392 Reads a bit field of a MMIO register and saves the value in the S3 script 2392 Reads a bit field of a MMIO register and saves the value in the S3 script 2393 2393 to be replayed on S3 resume. 2394 2394 … … 2422 2422 2423 2423 /** 2424 Writes a bit field to a MMIO register and saves the value in the S3 script 2424 Writes a bit field to a MMIO register and saves the value in the S3 script 2425 2425 to be replayed on S3 resume. 2426 2426 … … 2459 2459 /** 2460 2460 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and 2461 writes the result back to the bit field in the 32-bit MMIO register and 2461 writes the result back to the bit field in the 32-bit MMIO register and 2462 2462 saves the value in the S3 script to be replayed on S3 resume. 2463 2463 … … 2499 2499 /** 2500 2500 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and 2501 writes the result back to the bit field in the 32-bit MMIO register and 2501 writes the result back to the bit field in the 32-bit MMIO register and 2502 2502 saves the value in the S3 script to be replayed on S3 resume. 2503 2503 … … 2585 2585 2586 2586 This internal worker function saves a 64-bit MMIO register value in the S3 script 2587 to be replayed on S3 resume. 2587 to be replayed on S3 resume. 2588 2588 2589 2589 If the saving process fails, then ASSERT(). … … 2607 2607 2608 2608 /** 2609 Reads a 64-bit MMIO register and saves the value in the S3 script to be 2609 Reads a 64-bit MMIO register and saves the value in the S3 script to be 2610 2610 replayed on S3 resume. 2611 2611 … … 2631 2631 2632 2632 /** 2633 Writes a 64-bit MMIO register and saves the value in the S3 script to be 2633 Writes a 64-bit MMIO register and saves the value in the S3 script to be 2634 2634 replayed on S3 resume. 2635 2635 … … 2658 2658 /** 2659 2659 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the 2660 result back to the 64-bit MMIO register and saves the value in the S3 script 2660 result back to the 64-bit MMIO register and saves the value in the S3 script 2661 2661 to be replayed on S3 resume. 2662 2662 … … 2687 2687 /** 2688 2688 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result 2689 back to the 64-bit MMIO register and saves the value in the S3 script to be 2689 back to the 64-bit MMIO register and saves the value in the S3 script to be 2690 2690 replayed on S3 resume. 2691 2691 … … 2716 2716 /** 2717 2717 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise 2718 inclusive OR, and writes the result back to the 64-bit MMIO register and 2718 inclusive OR, and writes the result back to the 64-bit MMIO register and 2719 2719 saves the value in the S3 script to be replayed on S3 resume. 2720 2720 … … 2816 2816 /** 2817 2817 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and 2818 writes the result back to the bit field in the 64-bit MMIO register and 2818 writes the result back to the bit field in the 64-bit MMIO register and 2819 2819 saves the value in the S3 script to be replayed on S3 resume. 2820 2820 … … 2942 2942 and saves the value in the S3 script to be replayed on S3 resume. 2943 2943 2944 Copy data from MMIO region specified by starting address StartAddress 2945 to system memory specified by Buffer by using 8-bit access. The total 2944 Copy data from MMIO region specified by starting address StartAddress 2945 to system memory specified by Buffer by using 8-bit access. The total 2946 2946 number of byte to be copied is specified by Length. Buffer is returned. 2947 2948 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 2947 2948 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 2949 2949 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 2950 2950 … … 2985 2985 and saves the value in the S3 script to be replayed on S3 resume. 2986 2986 2987 Copy data from MMIO region specified by starting address StartAddress 2988 to system memory specified by Buffer by using 16-bit access. The total 2987 Copy data from MMIO region specified by starting address StartAddress 2988 to system memory specified by Buffer by using 16-bit access. The total 2989 2989 number of byte to be copied is specified by Length. Buffer is returned. 2990 2990 2991 2991 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 2992 2992 2993 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 2993 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 2994 2994 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 2995 2995 … … 3032 3032 and saves the value in the S3 script to be replayed on S3 resume. 3033 3033 3034 Copy data from MMIO region specified by starting address StartAddress 3035 to system memory specified by Buffer by using 32-bit access. The total 3034 Copy data from MMIO region specified by starting address StartAddress 3035 to system memory specified by Buffer by using 32-bit access. The total 3036 3036 number of byte to be copied is specified by Length. Buffer is returned. 3037 3037 3038 3038 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 3039 3039 3040 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3040 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3041 3041 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 3042 3042 … … 3079 3079 and saves the value in the S3 script to be replayed on S3 resume. 3080 3080 3081 Copy data from MMIO region specified by starting address StartAddress 3082 to system memory specified by Buffer by using 64-bit access. The total 3081 Copy data from MMIO region specified by starting address StartAddress 3082 to system memory specified by Buffer by using 64-bit access. The total 3083 3083 number of byte to be copied is specified by Length. Buffer is returned. 3084 3084 3085 3085 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 3086 3086 3087 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3087 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3088 3088 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 3089 3089 … … 3127 3127 and saves the value in the S3 script to be replayed on S3 resume. 3128 3128 3129 Copy data from system memory specified by Buffer to MMIO region specified 3130 by starting address StartAddress by using 8-bit access. The total number 3129 Copy data from system memory specified by Buffer to MMIO region specified 3130 by starting address StartAddress by using 8-bit access. The total number 3131 3131 of byte to be copied is specified by Length. Buffer is returned. 3132 3133 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3132 3133 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3134 3134 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 3135 3135 … … 3170 3170 and saves the value in the S3 script to be replayed on S3 resume. 3171 3171 3172 Copy data from system memory specified by Buffer to MMIO region specified 3173 by starting address StartAddress by using 16-bit access. The total number 3172 Copy data from system memory specified by Buffer to MMIO region specified 3173 by starting address StartAddress by using 16-bit access. The total number 3174 3174 of byte to be copied is specified by Length. Buffer is returned. 3175 3175 3176 3176 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 3177 3177 3178 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3178 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3179 3179 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 3180 3180 … … 3219 3219 and saves the value in the S3 script to be replayed on S3 resume. 3220 3220 3221 Copy data from system memory specified by Buffer to MMIO region specified 3222 by starting address StartAddress by using 32-bit access. The total number 3221 Copy data from system memory specified by Buffer to MMIO region specified 3222 by starting address StartAddress by using 32-bit access. The total number 3223 3223 of byte to be copied is specified by Length. Buffer is returned. 3224 3224 3225 3225 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 3226 3226 3227 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3227 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3228 3228 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 3229 3229 … … 3267 3267 and saves the value in the S3 script to be replayed on S3 resume. 3268 3268 3269 Copy data from system memory specified by Buffer to MMIO region specified 3270 by starting address StartAddress by using 64-bit access. The total number 3269 Copy data from system memory specified by Buffer to MMIO region specified 3270 by starting address StartAddress by using 64-bit access. The total number 3271 3271 of byte to be copied is specified by Length. Buffer is returned. 3272 3272 3273 3273 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 3274 3274 3275 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3275 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 3276 3276 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 3277 3277 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseS3PciLib/BaseS3PciLib.inf
r58459 r58466 2 2 # Instance of S3 PCI Library based on PCI and S3 BootScript Library. 3 3 # 4 # S3 PCI Services that perform PCI Configuration cycles and 4 # S3 PCI Services that perform PCI Configuration cycles and 5 5 # also enable the PCI operation to be replayed during an S3 resume. 6 6 # … … 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = S3PciLib 26 LIBRARY_CLASS = S3PciLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseS3PciLib/S3PciLib.c
r58459 r58466 2 2 PCI configuration Library Services that do PCI configuration and also enable 3 3 the PCI operations to be replayed during an S3 resume. This library class 4 maps directly on top of the PciLib class. 4 maps directly on top of the PciLib class. 5 5 6 6 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> … … 32 32 33 33 This internal worker function saves a PCI configuration value in 34 the S3 script to be replayed on S3 resume. 34 the S3 script to be replayed on S3 resume. 35 35 36 36 If the saving process fails, then ASSERT(). … … 64 64 65 65 This internal worker function saves an 8-bit PCI configuration value in 66 the S3 script to be replayed on S3 resume. 66 the S3 script to be replayed on S3 resume. 67 67 68 68 If the saving process fails, then ASSERT(). … … 430 430 431 431 This internal worker function saves a 16-bit PCI configuration value in 432 the S3 script to be replayed on S3 resume. 432 the S3 script to be replayed on S3 resume. 433 433 434 434 If the saving process fails, then ASSERT(). … … 806 806 807 807 This internal worker function saves a 32-bit PCI configuration value in the S3 script 808 to be replayed on S3 resume. 808 to be replayed on S3 resume. 809 809 810 810 If the saving process fails, then ASSERT(). … … 1265 1265 ); 1266 1266 ASSERT (Status == RETURN_SUCCESS); 1267 1267 1268 1268 return Size; 1269 1269 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseS3SmbusLib/BaseS3SmbusLib.inf
r58459 r58466 3 3 # 4 4 # S3 Smbus Library Services that do SMBus transactions and also enable the 5 # operatation to be replayed during an S3 resume. 5 # operatation to be replayed during an S3 resume. 6 6 # 7 7 # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> … … 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = S3SmbusLib 26 LIBRARY_CLASS = S3SmbusLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseS3SmbusLib/S3SmbusLib.c
r48674 r58466 2 2 Smbus Library Services that do SMBus transactions and also enable the operatation 3 3 to be replayed during an S3 resume. This library class maps directly on top 4 of the SmbusLib class. 4 of the SmbusLib class. 5 5 6 6 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR> … … 26 26 27 27 /** 28 Saves an SMBus operation to S3 script to be replayed on S3 resume. 28 Saves an SMBus operation to S3 script to be replayed on S3 resume. 29 29 30 30 This function provides a standard way to save SMBus operation to S3 boot Script. … … 87 87 { 88 88 SmBusQuickRead (SmBusAddress, Status); 89 89 90 90 InternalSaveSmBusExecToBootScript (EfiSmbusQuickRead, SmBusAddress, 0, NULL); 91 91 } … … 120 120 InternalSaveSmBusExecToBootScript (EfiSmbusQuickWrite, SmBusAddress, 0, NULL); 121 121 } 122 122 123 123 /** 124 124 Executes an SMBUS receive byte command and saves the value in the S3 script to be replayed … … 278 278 If Length in SmBusAddress is not zero, then ASSERT(). 279 279 If any reserved bits of SmBusAddress are set, then ASSERT(). 280 280 281 281 @param SmBusAddress Address that encodes the SMBUS Slave Address, 282 282 SMBUS Command, SMBUS Data Length, and PEC. … … 295 295 { 296 296 UINT16 Word; 297 297 298 298 Word = SmBusReadDataWord (SmBusAddress, Status); 299 299 … … 376 376 InternalSaveSmBusExecToBootScript (EfiSmbusProcessCall, SmBusAddress, 2, &Value); 377 377 378 return Word; 378 return Word; 379 379 } 380 380 … … 428 428 Bytes are written to the SMBUS from Buffer. 429 429 The number of bytes written is returned, and will never return a value larger than 32-bytes. 430 If Status is not NULL, then the status of the executed command is returned in Status. 430 If Status is not NULL, then the status of the executed command is returned in Status. 431 431 If Length in SmBusAddress is zero or greater than 32, then ASSERT(). 432 432 If Buffer is NULL, then ASSERT(). … … 455 455 456 456 InternalSaveSmBusExecToBootScript (EfiSmbusWriteBlock, SmBusAddress, SMBUS_LIB_LENGTH (SmBusAddress), Buffer); 457 457 458 458 return Length; 459 459 } … … 494 494 { 495 495 UINTN Length; 496 496 497 497 Length = SmBusBlockProcessCall (SmBusAddress, WriteBuffer, ReadBuffer, Status); 498 498 499 499 InternalSaveSmBusExecToBootScript (EfiSmbusBWBRProcessCall, SmBusAddress, SMBUS_LIB_LENGTH (SmBusAddress), ReadBuffer); 500 500 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseS3StallLib/BaseS3StallLib.inf
r58459 r58466 3 3 # 4 4 # Stall Services that do stall and also enable the Stall operatation 5 # to be replayed during an S3 resume. 5 # to be replayed during an S3 resume. 6 6 # 7 7 # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> … … 24 24 MODULE_TYPE = BASE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = S3StallLib 26 LIBRARY_CLASS = S3StallLib 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseS3StallLib/S3StallLib.c
r48674 r58466 2 2 Stall Services that do stall and also enable the Stall operatation 3 3 to be replayed during an S3 resume. This library class maps directly on top 4 of the Timer class. 4 of the Timer class. 5 5 6 6 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR> … … 43 43 { 44 44 RETURN_STATUS Status; 45 45 46 46 Status = S3BootScriptSaveStall (MicroSecondDelay (MicroSeconds)); 47 47 ASSERT (Status == RETURN_SUCCESS); 48 48 49 49 return MicroSeconds; 50 50 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.c
r48674 r58466 19 19 /** 20 20 Initialize the serial device hardware. 21 21 22 22 If no initialization is required, then return RETURN_SUCCESS. 23 23 If the serial device was successfully initialized, then return RETURN_SUCCESS. 24 24 If the serial device could not be initialized, then return RETURN_DEVICE_ERROR. 25 25 26 26 @retval RETURN_SUCCESS The serial device was initialized. 27 27 @retval RETURN_DEVICE_ERROR The serial device could not be initialized. … … 38 38 39 39 /** 40 Write data from buffer to serial device. 41 42 Writes NumberOfBytes data bytes from Buffer to the serial device. 40 Write data from buffer to serial device. 41 42 Writes NumberOfBytes data bytes from Buffer to the serial device. 43 43 The number of bytes actually written to the serial device is returned. 44 44 If the return value is less than NumberOfBytes, then the write operation failed. 45 If Buffer is NULL, then ASSERT(). 45 If Buffer is NULL, then ASSERT(). 46 46 If NumberOfBytes is zero, then return 0. 47 47 … … 50 50 51 51 @retval 0 NumberOfBytes is 0. 52 @retval >0 The number of bytes written to the serial device. 52 @retval >0 The number of bytes written to the serial device. 53 53 If this value is less than NumberOfBytes, then the read operation failed. 54 54 … … 67 67 /** 68 68 Read data from serial device and save the datas in buffer. 69 69 70 70 Reads NumberOfBytes data bytes from a serial device into the buffer 71 specified by Buffer. The number of bytes actually read is returned. 71 specified by Buffer. The number of bytes actually read is returned. 72 72 If the return value is less than NumberOfBytes, then the rest operation failed. 73 If Buffer is NULL, then ASSERT(). 73 If Buffer is NULL, then ASSERT(). 74 74 If NumberOfBytes is zero, then return 0. 75 75 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.c
r58464 r58466 279 279 If Length in SmBusAddress is not zero, then ASSERT(). 280 280 If any reserved bits of SmBusAddress are set, then ASSERT(). 281 281 282 282 @param SmBusAddress Address that encodes the SMBUS Slave Address, 283 283 SMBUS Command, SMBUS Data Length, and PEC. … … 454 454 Bytes are written to the SMBUS from Buffer. 455 455 The number of bytes written is returned, and will never return a value larger than 32-bytes. 456 If Status is not NULL, then the status of the executed command is returned in Status. 456 If Status is not NULL, then the status of the executed command is returned in Status. 457 457 If Length in SmBusAddress is zero or greater than 32, then ASSERT(). 458 458 If Buffer is NULL, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSynchronizationLib/Arm/Synchronization.c
r48674 r58466 46 46 Performs an atomic compare exchange operation on a 64-bit unsigned integer. 47 47 48 Performs an atomic compare exchange operation on the 64-bit unsigned integer specified 49 by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and 50 CompareValue is returned. If Value is not equal to CompareValue, then Value is returned. 48 Performs an atomic compare exchange operation on the 64-bit unsigned integer specified 49 by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and 50 CompareValue is returned. If Value is not equal to CompareValue, then Value is returned. 51 51 The compare exchange operation must be performed using MP safe mechanisms. 52 52 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
r58459 r58466 31 31 32 32 [Sources.IA32] 33 Ia32/InterlockedCompareExchange64.c | MSFT 34 Ia32/InterlockedCompareExchange32.c | MSFT 35 Ia32/InterlockedDecrement.c | MSFT 36 Ia32/InterlockedIncrement.c | MSFT 33 Ia32/InterlockedCompareExchange64.c | MSFT 34 Ia32/InterlockedCompareExchange32.c | MSFT 35 Ia32/InterlockedDecrement.c | MSFT 36 Ia32/InterlockedIncrement.c | MSFT 37 37 SynchronizationMsc.c | MSFT 38 38 39 Ia32/InterlockedCompareExchange64.asm | INTEL 40 Ia32/InterlockedCompareExchange32.asm | INTEL 41 Ia32/InterlockedDecrement.asm | INTEL 42 Ia32/InterlockedIncrement.asm | INTEL 39 Ia32/InterlockedCompareExchange64.asm | INTEL 40 Ia32/InterlockedCompareExchange32.asm | INTEL 41 Ia32/InterlockedDecrement.asm | INTEL 42 Ia32/InterlockedIncrement.asm | INTEL 43 43 Synchronization.c | INTEL 44 44 … … 49 49 X64/InterlockedCompareExchange64.c | MSFT 50 50 X64/InterlockedCompareExchange32.c | MSFT 51 51 52 52 X64/InterlockedCompareExchange64.asm | INTEL 53 53 X64/InterlockedCompareExchange32.asm | INTEL 54 55 X64/InterlockedDecrement.c | MSFT56 X64/InterlockedIncrement.c | MSFT57 SynchronizationMsc.c | MSFT58 54 59 X64/InterlockedDecrement.asm | INTEL 60 X64/InterlockedIncrement.asm | INTEL 61 Synchronization.c | INTEL 55 X64/InterlockedDecrement.c | MSFT 56 X64/InterlockedIncrement.c | MSFT 57 SynchronizationMsc.c | MSFT 58 59 X64/InterlockedDecrement.asm | INTEL 60 X64/InterlockedIncrement.asm | INTEL 61 Synchronization.c | INTEL 62 62 63 63 X64/GccInline.c | GCC 64 SynchronizationGcc.c | GCC 64 SynchronizationGcc.c | GCC 65 65 66 66 [Sources.IPF] … … 69 69 Ipf/InterlockedCompareExchange32.s 70 70 71 Synchronization.c | INTEL 72 SynchronizationMsc.c | MSFT 73 SynchronizationGcc.c | GCC 71 Synchronization.c | INTEL 72 SynchronizationMsc.c | MSFT 73 SynchronizationGcc.c | GCC 74 74 75 75 [Sources.EBC] -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSynchronizationLib/Ebc/Synchronization.c
r48674 r58466 47 47 Performs an atomic compare exchange operation on a 64-bit unsigned integer. 48 48 49 Performs an atomic compare exchange operation on the 64-bit unsigned integer specified 50 by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and 51 CompareValue is returned. If Value is not equal to CompareValue, then Value is returned. 49 Performs an atomic compare exchange operation on the 64-bit unsigned integer specified 50 by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and 51 CompareValue is returned. If Value is not equal to CompareValue, then Value is returned. 52 52 The compare exchange operation must be performed using MP safe mechanisms. 53 53 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
r48674 r58466 1 1 /** @file 2 2 GCC inline implementation of BaseSynchronizationLib processor specific functions. 3 3 4 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 5 5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> … … 43 43 : "=a" (Result), // %0 44 44 "=m" (*Value) // %1 45 : "m" (*Value) // %2 45 : "m" (*Value) // %2 46 46 : "memory", 47 47 "cc" 48 48 ); 49 50 return Result; 49 50 return Result; 51 51 52 52 } … … 73 73 { 74 74 UINT32 Result; 75 75 76 76 __asm__ __volatile__ ( 77 77 "lock \n\t" … … 80 80 : "=a" (Result), // %0 81 81 "=m" (*Value) // %1 82 : "m" (*Value) // %2 82 : "m" (*Value) // %2 83 83 : "memory", 84 84 "cc" 85 85 ); 86 86 87 87 return Result; 88 88 } … … 122 122 : "q" (ExchangeValue), // %1 123 123 "m" (*Value), // %2 124 "0" (CompareValue) // %4 124 "0" (CompareValue) // %4 125 125 : "memory", 126 126 "cc" … … 157 157 __asm__ __volatile__ ( 158 158 " \n\t" 159 "push %%ebx \n\t" 160 "movl %2,%%ebx \n\t" 159 "push %%ebx \n\t" 160 "movl %2,%%ebx \n\t" 161 161 "lock \n\t" 162 162 "cmpxchg8b (%1) \n\t" … … 169 169 "cc" 170 170 ); 171 171 172 172 return CompareValue; 173 173 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSynchronizationLib/Synchronization.c
r58459 r58466 23 23 24 24 This function retrieves the spin lock alignment requirements for optimal 25 performance on a given CPU architecture. The spin lock alignment is byte alignment. 25 performance on a given CPU architecture. The spin lock alignment is byte alignment. 26 26 It must be a power of two and is returned by this function. If there are no alignment 27 27 requirements, then 1 must be returned. The spin lock synchronization -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSynchronizationLib/SynchronizationGcc.c
r58459 r58466 17 17 18 18 // 19 // GCC inline assembly for Read Write Barrier 19 // GCC inline assembly for Read Write Barrier 20 20 // 21 21 #define _ReadWriteBarrier() do { __asm__ __volatile__ ("": : : "memory"); } while(0) … … 29 29 30 30 This function retrieves the spin lock alignment requirements for optimal 31 performance on a given CPU architecture. The spin lock alignment is byte alignment. 31 performance on a given CPU architecture. The spin lock alignment is byte alignment. 32 32 It must be a power of two and is returned by this function. If there are no alignment 33 33 requirements, then 1 must be returned. The spin lock synchronization … … 192 192 SPIN_LOCK LockValue; 193 193 VOID *Result; 194 194 195 195 ASSERT (SpinLock != NULL); 196 196 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSynchronizationLib/SynchronizationMsc.c
r58459 r58466 31 31 32 32 This function retrieves the spin lock alignment requirements for optimal 33 performance on a given CPU architecture. The spin lock alignment is byte alignment. 33 performance on a given CPU architecture. The spin lock alignment is byte alignment. 34 34 It must be a power of two and is returned by this function. If there are no alignment 35 35 requirements, then 1 must be returned. The spin lock synchronization … … 194 194 SPIN_LOCK LockValue; 195 195 VOID *Result; 196 196 197 197 ASSERT (SpinLock != NULL); 198 198 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c
r48674 r58466 1 1 /** @file 2 2 GCC inline implementation of BaseSynchronizationLib processor specific functions. 3 3 4 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 6 6 This program and the accompanying materials 7 7 are licensed and made available under the terms and conditions of the BSD License … … 44 44 : "=a" (Result), // %0 45 45 "=m" (*Value) // %1 46 : "m" (*Value) // %2 46 : "m" (*Value) // %2 47 47 : "memory", 48 48 "cc" 49 49 ); 50 51 return Result; 50 51 return Result; 52 52 } 53 53 … … 73 73 { 74 74 UINT32 Result; 75 75 76 76 __asm__ __volatile__ ( 77 77 "lock \n\t" … … 80 80 : "=a" (Result), // %0 81 81 "=m" (*Value) // %1 82 : "m" (*Value) // %2 82 : "m" (*Value) // %2 83 83 : "memory", 84 84 "cc" 85 85 ); 86 86 87 87 return Result; 88 88 } … … 123 123 "=m" (*Value) // %1 124 124 : "a" (CompareValue), // %2 125 "r" (ExchangeValue), // %3 125 "r" (ExchangeValue), // %3 126 126 "m" (*Value) 127 127 : "memory", 128 128 "cc" 129 129 ); 130 130 131 131 return CompareValue; 132 132 } … … 165 165 "=m" (*Value) // %1 166 166 : "a" (CompareValue), // %2 167 "r" (ExchangeValue), // %3 167 "r" (ExchangeValue), // %3 168 168 "m" (*Value) 169 169 : "memory", 170 170 "cc" 171 171 ); 172 172 173 173 return CompareValue; 174 174 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
r58459 r58466 26 26 MODULE_TYPE = BASE 27 27 VERSION_STRING = 1.0 28 LIBRARY_CLASS = TimerLib 28 LIBRARY_CLASS = TimerLib 29 29 30 30 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
r58459 r58466 72 72 // 73 73 Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits); 74 74 75 75 // 76 76 // Copy NumOfBits of bits from mSubBitBuf into mBitBuf … … 102 102 // 103 103 // Pop NumOfBits of Bits from Left 104 // 104 // 105 105 OutBits = (UINT32) (Sd->mBitBuf >> (BITBUFSIZ - NumOfBits)); 106 106 … … 167 167 Count[BitLen[Index]]++; 168 168 } 169 169 170 170 Start[0] = 0; 171 171 Start[1] = 0; … … 183 183 184 184 JuBits = (UINT16) (16 - TableBits); 185 185 186 186 Weight[0] = 0; 187 187 for (Index = 1; Index <= TableBits; Index++) { … … 192 192 while (Index <= 16) { 193 193 Weight[Index] = (UINT16) (1U << (16 - Index)); 194 Index++; 194 Index++; 195 195 } 196 196 … … 233 233 *Pointer = Avail++; 234 234 } 235 235 236 236 if (*Pointer < (2 * NC - 1)) { 237 237 if ((Index3 & Mask) != 0) { … … 336 336 ASSERT (nn <= NPT); 337 337 // 338 // Read Extra Set Code Length Array size 338 // Read Extra Set Code Length Array size 339 339 // 340 340 Number = (UINT16) GetBits (Sd, nbit); … … 361 361 // 362 362 // If a code length is less than 7, then it is encoded as a 3-bit 363 // value. Or it is encoded as a series of "1"s followed by a 363 // value. Or it is encoded as a series of "1"s followed by a 364 364 // terminating "0". The number of "1"s = Code length - 4. 365 365 // … … 371 371 } 372 372 } 373 373 374 374 FillBuf (Sd, (UINT16) ((CharC < 7) ? 3 : CharC - 3)); 375 375 376 376 Sd->mPTLen[Index++] = (UINT8) CharC; 377 378 // 379 // For Code&Len Set, 377 378 // 379 // For Code&Len Set, 380 380 // After the third length of the code length concatenation, 381 // a 2-bit value is used to indicated the number of consecutive 381 // a 2-bit value is used to indicated the number of consecutive 382 382 // zero lengths after the third length. 383 383 // … … 393 393 Sd->mPTLen[Index++] = 0; 394 394 } 395 395 396 396 return MakeTable (Sd, nn, Sd->mPTLen, 8, Sd->mPTTable); 397 397 } … … 505 505 // Starting a new block 506 506 // Read BlockSize from block header 507 // 507 // 508 508 Sd->mBlockSize = (UINT16) GetBits (Sd, 16); 509 509 … … 524 524 525 525 // 526 // Read in the Position Set Code Length Arrary, 526 // Read in the Position Set Code Length Arrary, 527 527 // Generate the Huffman code mapping table for the Position Set. 528 528 // … … 582 582 // 583 583 // Get one code from mBitBuf 584 // 584 // 585 585 CharC = DecodeC (Sd); 586 586 if (Sd->mBadTableFlag != 0) { … … 606 606 // 607 607 CharC = (UINT16) (CharC - (BIT8 - THRESHOLD)); 608 608 609 609 // 610 610 // Get string length … … 637 637 638 638 /** 639 Given a compressed source buffer, this function retrieves the size of 640 the uncompressed buffer and the size of the scratch buffer required 639 Given a compressed source buffer, this function retrieves the size of 640 the uncompressed buffer and the size of the scratch buffer required 641 641 to decompress the compressed source buffer. 642 642 643 Retrieves the size of the uncompressed buffer and the temporary scratch buffer 643 Retrieves the size of the uncompressed buffer and the temporary scratch buffer 644 644 required to decompress the buffer specified by Source and SourceSize. 645 645 If the size of the uncompressed buffer or the size of the scratch buffer cannot 646 be determined from the compressed data specified by Source and SourceData, 646 be determined from the compressed data specified by Source and SourceData, 647 647 then RETURN_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed 648 648 buffer is returned in DestinationSize, the size of the scratch buffer is returned 649 649 in ScratchSize, and RETURN_SUCCESS is returned. 650 This function does not have scratch buffer available to perform a thorough 650 This function does not have scratch buffer available to perform a thorough 651 651 checking of the validity of the source data. It just retrieves the "Original Size" 652 652 field from the beginning bytes of the source data and output it as DestinationSize. … … 663 663 by Source and SourceSize is decompressed. 664 664 @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that 665 is required to decompress the compressed buffer specified 665 is required to decompress the compressed buffer specified 666 666 by Source and SourceSize. 667 667 668 @retval RETURN_SUCCESS The size of the uncompressed data was returned 669 in DestinationSize, and the size of the scratch 668 @retval RETURN_SUCCESS The size of the uncompressed data was returned 669 in DestinationSize, and the size of the scratch 670 670 buffer was returned in ScratchSize. 671 @retval RETURN_INVALID_PARAMETER 672 The size of the uncompressed data or the size of 673 the scratch buffer cannot be determined from 674 the compressed data specified by Source 671 @retval RETURN_INVALID_PARAMETER 672 The size of the uncompressed data or the size of 673 the scratch buffer cannot be determined from 674 the compressed data specified by Source 675 675 and SourceSize. 676 676 **/ … … 711 711 This function is designed so that the decompression algorithm can be implemented 712 712 without using any memory services. As a result, this function is not allowed to 713 call any memory allocation services in its implementation. It is the caller's 713 call any memory allocation services in its implementation. It is the caller's 714 714 responsibility to allocate and free the Destination and Scratch buffers. 715 If the compressed source data specified by Source is successfully decompressed 716 into Destination, then RETURN_SUCCESS is returned. If the compressed source data 715 If the compressed source data specified by Source is successfully decompressed 716 into Destination, then RETURN_SUCCESS is returned. If the compressed source data 717 717 specified by Source is not in a valid compressed data format, 718 718 then RETURN_INVALID_PARAMETER is returned. … … 725 725 @param Destination The destination buffer to store the decompressed data. 726 726 @param Scratch A temporary scratch buffer that is used to perform the decompression. 727 This is an optional parameter that may be NULL if the 727 This is an optional parameter that may be NULL if the 728 728 required scratch buffer size is 0. 729 730 @retval RETURN_SUCCESS Decompression completed successfully, and 729 730 @retval RETURN_SUCCESS Decompression completed successfully, and 731 731 the uncompressed buffer is returned in Destination. 732 @retval RETURN_INVALID_PARAMETER 733 The source buffer specified by Source is corrupted 732 @retval RETURN_INVALID_PARAMETER 733 The source buffer specified by Source is corrupted 734 734 (not in a valid compressed format). 735 735 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
r58459 r58466 21 21 MODULE_TYPE = BASE 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = UefiDecompressLib 23 LIBRARY_CLASS = UefiDecompressLib 24 24 25 25 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.c
r48674 r58466 22 22 23 23 // 24 // Cache copy of HobList pointer. 25 // 24 // Cache copy of HobList pointer. 25 // 26 26 VOID *gHobList = NULL; 27 27 28 28 /** 29 The entry point of PE/COFF Image for the DXE Core. 29 The entry point of PE/COFF Image for the DXE Core. 30 30 31 31 This function is the entry point for the DXE Core. This function is required to call … … 35 35 If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system. 36 36 37 @param HobStart The pointer to the beginning of the HOB List passed in from the PEI Phase. 37 @param HobStart The pointer to the beginning of the HOB List passed in from the PEI Phase. 38 38 39 39 **/ … … 67 67 This function is required to call _ModuleEntryPoint() passing in HobStart. 68 68 69 @param HobStart The pointer to the beginning of the HOB List passed in from the PEI Phase. 69 @param HobStart The pointer to the beginning of the HOB List passed in from the PEI Phase. 70 70 71 71 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
r58459 r58466 21 21 MODULE_TYPE = DXE_CORE 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = DxeCoreEntryPoint|DXE_CORE 23 LIBRARY_CLASS = DxeCoreEntryPoint|DXE_CORE 24 24 25 25 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
r58459 r58466 24 24 MODULE_TYPE = DXE_CORE 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = HobLib|DXE_CORE 26 LIBRARY_CLASS = HobLib|DXE_CORE 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeCoreHobLib/HobLib.c
r58459 r58466 24 24 25 25 This function returns the pointer to first HOB in the list. 26 For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer 26 For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer 27 27 to the HOB list. For the DXE phase, the HOB list pointer can be retrieved through 28 28 the EFI System Table by looking up theHOB list GUID in the System Configuration Table. 29 Since the System Configuration Table does not exist that the time the DXE Core is 30 launched, the DXE Core uses a global variable from the DXE Core Entry Point Library 29 Since the System Configuration Table does not exist that the time the DXE Core is 30 launched, the DXE Core uses a global variable from the DXE Core Entry Point Library 31 31 to manage the pointer to the HOB list. 32 32 33 33 If the pointer to the HOB list is NULL, then ASSERT(). 34 34 35 35 @return The pointer to the HOB list. 36 36 … … 49 49 Returns the next instance of a HOB type from the starting HOB. 50 50 51 This function searches the first instance of a HOB type from the starting HOB pointer. 51 This function searches the first instance of a HOB type from the starting HOB pointer. 52 52 If there does not exist such HOB type from the starting HOB pointer, it will return NULL. 53 53 In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer 54 54 unconditionally: it returns HobStart back if HobStart itself meets the requirement; 55 55 caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. 56 56 57 57 If HobStart is NULL, then ASSERT(). 58 58 … … 90 90 Returns the first instance of a HOB type among the whole HOB list. 91 91 92 This function searches the first instance of a HOB type among the whole HOB list. 93 If there does not exist such HOB type in the HOB list, it will return NULL. 94 92 This function searches the first instance of a HOB type among the whole HOB list. 93 If there does not exist such HOB type in the HOB list, it will return NULL. 94 95 95 If the pointer to the HOB list is NULL, then ASSERT(). 96 96 … … 114 114 /** 115 115 Returns the next instance of the matched GUID HOB from the starting HOB. 116 117 This function searches the first instance of a HOB from the starting HOB pointer. 118 Such HOB should satisfy two conditions: 119 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION, and its GUID Name equals to the input Guid. 120 If such a HOB from the starting HOB pointer does not exist, it will return NULL. 116 117 This function searches the first instance of a HOB from the starting HOB pointer. 118 Such HOB should satisfy two conditions: 119 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION, and its GUID Name equals to the input Guid. 120 If such a HOB from the starting HOB pointer does not exist, it will return NULL. 121 121 Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () 122 122 to extract the data section and its size information, respectively. … … 124 124 unconditionally: it returns HobStart back if HobStart itself meets the requirement; 125 125 caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. 126 126 127 127 If Guid is NULL, then ASSERT(). 128 128 If HobStart is NULL, then ASSERT(). … … 155 155 /** 156 156 Returns the first instance of the matched GUID HOB among the whole HOB list. 157 158 This function searches the first instance of a HOB among the whole HOB list. 157 158 This function searches the first instance of a HOB among the whole HOB list. 159 159 Such HOB should satisfy two conditions: 160 160 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. … … 162 162 Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () 163 163 to extract the data section and its size information, respectively. 164 164 165 165 If the pointer to the HOB list is NULL, then ASSERT(). 166 166 If Guid is NULL, then ASSERT(). … … 186 186 Get the system boot mode from the HOB list. 187 187 188 This function returns the system boot mode information from the 188 This function returns the system boot mode information from the 189 189 PHIT HOB in HOB list. 190 190 191 191 If the pointer to the HOB list is NULL, then ASSERT(). 192 192 193 193 @param VOID 194 194 … … 215 215 It can only be invoked during PEI phase; 216 216 for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 217 217 218 218 If ModuleName is NULL, then ASSERT(). 219 219 If there is no additional space for HOB creation, then ASSERT(). … … 246 246 It can only be invoked during PEI phase; 247 247 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 248 248 249 249 If there is no additional space for HOB creation, then ASSERT(). 250 250 … … 278 278 It can only be invoked during PEI phase; 279 279 for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 280 280 281 281 If there is no additional space for HOB creation, then ASSERT(). 282 282 … … 303 303 304 304 /** 305 Builds a customized HOB tagged with a GUID for identification and returns 305 Builds a customized HOB tagged with a GUID for identification and returns 306 306 the start address of GUID HOB data. 307 307 308 This function builds a customized HOB tagged with a GUID for identification 309 and returns the start address of GUID HOB data so that caller can fill the customized data. 308 This function builds a customized HOB tagged with a GUID for identification 309 and returns the start address of GUID HOB data so that caller can fill the customized data. 310 310 The HOB Header and Name field is already stripped. 311 311 It can only be invoked during PEI phase. 312 312 For DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 313 313 314 314 If Guid is NULL, then ASSERT(). 315 315 If there is no additional space for HOB creation, then ASSERT(). … … 339 339 340 340 /** 341 Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB 341 Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB 342 342 data field, and returns the start address of the GUID HOB data. 343 343 344 344 This function builds a customized HOB tagged with a GUID for identification and copies the input 345 data to the HOB data field and returns the start address of the GUID HOB data. It can only be 346 invoked during PEI phase; for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 345 data to the HOB data field and returns the start address of the GUID HOB data. It can only be 346 invoked during PEI phase; for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 347 347 The HOB Header and Name field is already stripped. 348 348 It can only be invoked during PEI phase. 349 349 For DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 350 350 351 351 If Guid is NULL, then ASSERT(). 352 352 If Data is NULL and DataLength > 0, then ASSERT(). … … 384 384 It can only be invoked during PEI phase; 385 385 for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 386 386 387 387 If there is no additional space for HOB creation, then ASSERT(). 388 388 … … 410 410 It can only be invoked during PEI phase; 411 411 for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 412 412 413 413 If there is no additional space for HOB creation, then ASSERT(). 414 414 … … 417 417 @param FvName The name of the Firmware Volume. 418 418 @param FileName The name of the file. 419 419 420 420 **/ 421 421 VOID … … 437 437 It can only be invoked during PEI phase; 438 438 for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 439 439 440 440 If the platform does not support Capsule Volume HOBs, then ASSERT(). 441 441 If there is no additional space for HOB creation, then ASSERT(). … … 464 464 It can only be invoked during PEI phase; 465 465 for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 466 466 467 467 If there is no additional space for HOB creation, then ASSERT(). 468 468 … … 490 490 It can only be invoked during PEI phase; 491 491 for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 492 492 493 493 If there is no additional space for HOB creation, then ASSERT(). 494 494 … … 516 516 It can only be invoked during PEI phase; 517 517 for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 518 518 519 519 If there is no additional space for HOB creation, then ASSERT(). 520 520 … … 544 544 It can only be invoked during PEI phase; 545 545 for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase. 546 546 547 547 If there is no additional space for HOB creation, then ASSERT(). 548 548 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeExtendedSalLib/DxeExtendedSalLib.inf
r58459 r58466 20 20 MODULE_TYPE = DXE_DRIVER 21 21 VERSION_STRING = 1.0 22 LIBRARY_CLASS = ExtendedSalLib|DXE_DRIVER UEFI_DRIVER UEFI_APPLICATION 22 LIBRARY_CLASS = ExtendedSalLib|DXE_DRIVER UEFI_DRIVER UEFI_APPLICATION 23 23 CONSTRUCTOR = DxeExtendedSalLibConstruct 24 24 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeExtendedSalLib/ExtendedSalLib.c
r48674 r58466 65 65 Constructor function to get Extended SAL Boot Service Protocol, and initializes 66 66 physical plabel of ESAL entrypoint. 67 67 68 68 This function first locates Extended SAL Boot Service Protocol and caches it in global variable. 69 69 Then it initializes the physical plable of ESAL entrypoint, and stores … … 110 110 /** 111 111 Registers function of ESAL class and it's associated global. 112 112 113 113 This function registers function of ESAL class, together with its associated global. 114 114 It is worker function for RegisterEsalClass(). … … 145 145 /** 146 146 Registers ESAL Class and it's associated global. 147 147 148 148 This function registers one or more Extended SAL services in a given 149 149 class along with the associated global context. … … 154 154 @param ModuleGlobal Module global for the class. 155 155 @param ... List of Function/FunctionId pairs, ended by NULL 156 156 157 157 @retval EFI_SUCCESS The Extended SAL services were registered. 158 158 @retval EFI_UNSUPPORTED This function was called after ExitBootServices(). 159 159 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register one or more of the specified services. 160 @retval Other ClassGuid could not be installed onto a new handle. 160 @retval Other ClassGuid could not be installed onto a new handle. 161 161 162 162 **/ … … 216 216 /** 217 217 Calls an Extended SAL Class service that was previously registered with RegisterEsalClass(). 218 218 219 219 This function gets the entrypoint of Extended SAL, and calls an Extended SAL Class service 220 220 that was previously registered with RegisterEsalClass() through this entrypoint. … … 230 230 @param Arg7 Argument 7 ClassGuid/FunctionId defined 231 231 @param Arg8 Argument 8 ClassGuid/FunctionId defined 232 232 233 233 @retval EFI_SAL_SUCCESS ESAL procedure successfully called. 234 234 @retval EFI_SAL_ERROR The address of ExtendedSalProc() can not be correctly 235 235 initialized. 236 236 @retval Other Status returned from ExtendedSalProc() service of 237 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL. 237 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL. 238 238 239 239 **/ … … 299 299 /** 300 300 Wrapper for the EsalStallFunctionId service of Extended SAL Stall Services Class. 301 301 302 302 This function is a wrapper for the EsalStallFunctionId service of Extended SAL 303 303 Stall Services Class. See EsalStallFunctionId of Extended SAL Specification. … … 317 317 { 318 318 return EsalCall ( 319 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO, 320 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI, 321 StallFunctionId, 322 Microseconds, 323 0, 324 0, 325 0, 326 0, 327 0, 319 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO, 320 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI, 321 StallFunctionId, 322 Microseconds, 323 0, 324 0, 325 0, 326 0, 327 0, 328 328 0 329 329 ); … … 332 332 /** 333 333 Wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class. 334 334 335 335 This function is a wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL 336 336 PAL Services Services Class. See EsalSetNewPalEntryFunctionId of Extended SAL Specification. … … 354 354 { 355 355 return EsalCall ( 356 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO, 356 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO, 357 357 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI, 358 SetNewPalEntryFunctionId, 359 PhysicalAddress, 360 PalEntryPoint, 361 0, 362 0, 363 0, 364 0, 358 SetNewPalEntryFunctionId, 359 PhysicalAddress, 360 PalEntryPoint, 361 0, 362 0, 363 0, 364 0, 365 365 0 366 366 ); … … 369 369 /** 370 370 Wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class. 371 371 372 372 This function is a wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL 373 373 PAL Services Services Class. See EsalGetNewPalEntryFunctionId of Extended SAL Specification. … … 393 393 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO, 394 394 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI, 395 GetNewPalEntryFunctionId, 396 PhysicalAddress, 397 0, 398 0, 399 0, 400 0, 401 0, 395 GetNewPalEntryFunctionId, 396 PhysicalAddress, 397 0, 398 0, 399 0, 400 0, 401 0, 402 402 0 403 403 ); … … 406 406 /** 407 407 Wrapper for the EsalGetStateBufferFunctionId service of Extended SAL MCA Log Services Class. 408 408 409 409 This function is a wrapper for the EsalGetStateBufferFunctionId service of Extended SAL 410 410 MCA Log Services Class. See EsalGetStateBufferFunctionId of Extended SAL Specification. … … 435 435 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO, 436 436 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI, 437 EsalGetStateBufferFunctionId, 438 McaType, 439 0, 440 0, 441 0, 442 0, 443 0, 437 EsalGetStateBufferFunctionId, 438 McaType, 439 0, 440 0, 441 0, 442 0, 443 0, 444 444 0 445 445 ); … … 453 453 /** 454 454 Wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL MCA Log Services Class. 455 455 456 456 This function is a wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL 457 457 MCA Log Services Class. See EsalSaveStateBufferFunctionId of Extended SAL Specification. … … 471 471 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO, 472 472 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI, 473 EsalSaveStateBufferFunctionId, 474 McaType, 475 0, 476 0, 477 0, 478 0, 479 0, 473 EsalSaveStateBufferFunctionId, 474 McaType, 475 0, 476 0, 477 0, 478 0, 479 0, 480 480 0 481 481 ); … … 484 484 /** 485 485 Wrapper for the EsalGetVectorsFunctionId service of Extended SAL Base Services Class. 486 486 487 487 This function is a wrapper for the EsalGetVectorsFunctionId service of Extended SAL 488 488 Base Services Class. See EsalGetVectorsFunctionId of Extended SAL Specification. … … 506 506 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 507 507 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 508 EsalGetVectorsFunctionId, 509 VectorType, 510 0, 511 0, 512 0, 513 0, 514 0, 508 EsalGetVectorsFunctionId, 509 VectorType, 510 0, 511 0, 512 0, 513 0, 514 0, 515 515 0 516 516 ); … … 519 519 /** 520 520 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class. 521 521 522 522 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL 523 523 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification. … … 543 543 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 544 544 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 545 EsalMcGetParamsFunctionId, 546 ParamInfoType, 547 0, 548 0, 549 0, 550 0, 551 0, 545 EsalMcGetParamsFunctionId, 546 ParamInfoType, 547 0, 548 0, 549 0, 550 0, 551 0, 552 552 0 553 553 ); … … 556 556 /** 557 557 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class. 558 558 559 559 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL 560 560 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification. … … 574 574 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 575 575 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 576 EsalMcGetMcParamsFunctionId, 577 0, 578 0, 579 0, 580 0, 581 0, 582 0, 576 EsalMcGetMcParamsFunctionId, 577 0, 578 0, 579 0, 580 0, 581 0, 582 0, 583 583 0 584 584 ); … … 587 587 /** 588 588 Wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL Base Services Class. 589 589 590 590 This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL 591 591 Base Services Class. See EsalGetMcCheckinFlagsFunctionId of Extended SAL Specification. … … 605 605 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 606 606 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 607 EsalGetMcCheckinFlagsFunctionId, 608 CpuIndex, 609 0, 610 0, 611 0, 612 0, 613 0, 607 EsalGetMcCheckinFlagsFunctionId, 608 CpuIndex, 609 0, 610 0, 611 0, 612 0, 613 0, 614 614 0 615 615 ); … … 618 618 /** 619 619 Wrapper for the EsalAddCpuDataFunctionId service of Extended SAL MP Services Class. 620 620 621 621 This function is a wrapper for the EsalAddCpuDataFunctionId service of Extended SAL 622 622 MP Services Class. See EsalAddCpuDataFunctionId of Extended SAL Specification. … … 643 643 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 644 644 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 645 AddCpuDataFunctionId, 646 CpuGlobalId, 647 Enabled, 648 PalCompatibility, 649 0, 650 0, 651 0, 645 AddCpuDataFunctionId, 646 CpuGlobalId, 647 Enabled, 648 PalCompatibility, 649 0, 650 0, 651 0, 652 652 0 653 653 ); … … 656 656 /** 657 657 Wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL MP Services Class. 658 658 659 659 This function is a wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL 660 660 MP Services Class. See EsalRemoveCpuDataFunctionId of Extended SAL Specification. … … 675 675 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 676 676 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 677 RemoveCpuDataFunctionId, 678 CpuGlobalId, 679 0, 680 0, 681 0, 682 0, 683 0, 677 RemoveCpuDataFunctionId, 678 CpuGlobalId, 679 0, 680 0, 681 0, 682 0, 683 0, 684 684 0 685 685 ); … … 688 688 /** 689 689 Wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL MP Services Class. 690 690 691 691 This function is a wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL 692 692 MP Services Class. See EsalModifyCpuDataFunctionId of Extended SAL Specification. … … 713 713 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 714 714 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 715 ModifyCpuDataFunctionId, 716 CpuGlobalId, 717 Enabled, 718 PalCompatibility, 719 0, 720 0, 721 0, 715 ModifyCpuDataFunctionId, 716 CpuGlobalId, 717 Enabled, 718 PalCompatibility, 719 0, 720 0, 721 0, 722 722 0 723 723 ); … … 726 726 /** 727 727 Wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL MP Services Class. 728 728 729 729 This function is a wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL 730 730 MP Services Class. See EsalGetCpuDataByIdFunctionId of Extended SAL Specification. … … 748 748 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 749 749 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 750 GetCpuDataByIDFunctionId, 751 CpuGlobalId, 752 IndexByEnabledCpu, 753 0, 754 0, 755 0, 756 0, 750 GetCpuDataByIDFunctionId, 751 CpuGlobalId, 752 IndexByEnabledCpu, 753 0, 754 0, 755 0, 756 0, 757 757 0 758 758 ); … … 761 761 /** 762 762 Wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL MP Services Class. 763 763 764 764 This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL 765 765 MP Services Class. See EsalGetCpuDataByIndexFunctionId of Extended SAL Specification. … … 783 783 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 784 784 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 785 GetCpuDataByIndexFunctionId, 786 Index, 787 IndexByEnabledCpu, 788 0, 789 0, 790 0, 791 0, 785 GetCpuDataByIndexFunctionId, 786 Index, 787 IndexByEnabledCpu, 788 0, 789 0, 790 0, 791 0, 792 792 0 793 793 ); … … 796 796 /** 797 797 Wrapper for the EsalWhoAmIFunctionId service of Extended SAL MP Services Class. 798 798 799 799 This function is a wrapper for the EsalWhoAmIFunctionId service of Extended SAL 800 800 MP Services Class. See EsalWhoAmIFunctionId of Extended SAL Specification. … … 816 816 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 817 817 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 818 CurrentProcInfoFunctionId, 819 IndexByEnabledCpu, 820 0, 821 0, 822 0, 823 0, 824 0, 818 CurrentProcInfoFunctionId, 819 IndexByEnabledCpu, 820 0, 821 0, 822 0, 823 0, 824 0, 825 825 0 826 826 ); … … 829 829 /** 830 830 Wrapper for the EsalNumProcessors service of Extended SAL MP Services Class. 831 831 832 832 This function is a wrapper for the EsalNumProcessors service of Extended SAL 833 833 MP Services Class. See EsalNumProcessors of Extended SAL Specification. … … 846 846 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 847 847 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 848 NumProcessorsFunctionId, 849 0, 850 0, 851 0, 852 0, 853 0, 854 0, 848 NumProcessorsFunctionId, 849 0, 850 0, 851 0, 852 0, 853 0, 854 0, 855 855 0 856 856 ); … … 859 859 /** 860 860 Wrapper for the EsalSetMinStateFnctionId service of Extended SAL MP Services Class. 861 861 862 862 This function is a wrapper for the EsalSetMinStateFnctionId service of Extended SAL 863 863 MP Services Class. See EsalSetMinStateFnctionId of Extended SAL Specification. … … 881 881 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 882 882 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 883 SetMinStateFunctionId, 884 CpuGlobalId, 885 MinStatePointer, 886 0, 887 0, 888 0, 889 0, 883 SetMinStateFunctionId, 884 CpuGlobalId, 885 MinStatePointer, 886 0, 887 0, 888 0, 889 0, 890 890 0 891 891 ); … … 894 894 /** 895 895 Wrapper for the EsalGetMinStateFunctionId service of Extended SAL MP Services Class. 896 896 897 897 This function is a wrapper for the EsalGetMinStateFunctionId service of Extended SAL 898 898 MP Services Class. See EsalGetMinStateFunctionId of Extended SAL Specification. … … 913 913 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 914 914 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 915 GetMinStateFunctionId, 916 CpuGlobalId, 917 0, 918 0, 919 0, 920 0, 921 0, 915 GetMinStateFunctionId, 916 CpuGlobalId, 917 0, 918 0, 919 0, 920 0, 921 0, 922 922 0 923 923 ); … … 926 926 /** 927 927 Wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL MCA Services Class. 928 928 929 929 This function is a wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL 930 930 MCA Services Class. See EsalMcsGetStateInfoFunctionId of Extended SAL Specification. … … 951 951 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO, 952 952 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI, 953 McaGetStateInfoFunctionId, 954 CpuGlobalId, 955 0, 956 0, 957 0, 958 0, 959 0, 953 McaGetStateInfoFunctionId, 954 CpuGlobalId, 955 0, 956 0, 957 0, 958 0, 959 0, 960 960 0 961 961 ); … … 969 969 /** 970 970 Wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL MCA Services Class. 971 971 972 972 This function is a wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL 973 973 MCA Services Class. See EsalMcaRegisterCpuFunctionId of Extended SAL Specification. … … 990 990 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO, 991 991 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI, 992 McaRegisterCpuFunctionId, 993 CpuGlobalId, 994 StateBufferPointer, 995 0, 996 0, 997 0, 998 0, 999 0 1000 ); 1001 } 992 McaRegisterCpuFunctionId, 993 CpuGlobalId, 994 StateBufferPointer, 995 0, 996 0, 997 0, 998 0, 999 0 1000 ); 1001 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeExtendedSalLib/Ipf/AsmExtendedSalLib.s
r48674 r58466 36 36 // r10 = Virtual Plabel 37 37 // r11 = psr 38 // 39 // As per static calling conventions. 40 // 38 // 39 // As per static calling conventions. 40 // 41 41 //-- 42 42 //--------------------------------------------------------------------------- … … 67 67 // in1 = Physical GP 68 68 // 69 // Return Value: 69 // Return Value: 70 70 // r8 = EFI_SAL_SUCCESS 71 // 72 // As per static calling conventions. 73 // 71 // 72 // As per static calling conventions. 73 // 74 74 //-- 75 75 //--------------------------------------------------------------------------- … … 91 91 92 92 .align 32 93 EsalEntryPoint: 93 EsalEntryPoint: 94 94 data8 0 // Physical Entry 95 95 data8 0 // GP -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
r58459 r58466 40 40 ReallocateExtractHandlerTable ( 41 41 ) 42 { 42 { 43 43 // 44 44 // Reallocate memory for GuidTable 45 45 // 46 46 mExtractHandlerGuidTable = ReallocatePool ( 47 mMaxNumberOfExtractHandler * sizeof (GUID), 48 (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (GUID), 47 mMaxNumberOfExtractHandler * sizeof (GUID), 48 (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (GUID), 49 49 mExtractHandlerGuidTable 50 50 ); … … 58 58 // 59 59 mExtractDecodeHandlerTable = ReallocatePool ( 60 mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER), 61 (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER), 60 mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER), 61 (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER), 62 62 mExtractDecodeHandlerTable 63 63 ); … … 71 71 // 72 72 mExtractGetInfoHandlerTable = ReallocatePool ( 73 mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER), 74 (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER), 73 mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER), 74 (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER), 75 75 mExtractGetInfoHandlerTable 76 76 ); … … 79 79 goto Done; 80 80 } 81 81 82 82 // 83 83 // Increase max handler number … … 96 96 FreePool (mExtractGetInfoHandlerTable); 97 97 } 98 98 99 99 return RETURN_OUT_OF_RESOURCES; 100 100 } … … 123 123 Sets ExtractHandlerGuidTable so it points at a callee allocated array of registered GUIDs. 124 124 The total number of GUIDs in the array are returned. Since the array of GUIDs is callee allocated 125 and caller must treat this array of GUIDs as read-only data. 125 and caller must treat this array of GUIDs as read-only data. 126 126 If ExtractHandlerGuidTable is NULL, then ASSERT(). 127 127 … … 151 151 If the GUID value specified by SectionGuid has already been registered, then return RETURN_ALREADY_STARTED. 152 152 If there are not enough resources available to register the handlers then RETURN_OUT_OF_RESOURCES is returned. 153 153 154 154 If SectionGuid is NULL, then ASSERT(). 155 155 If GetInfoHandler is NULL, then ASSERT(). … … 162 162 required to actually decode the data in a GUIDed section. 163 163 @param[in] DecodeHandler The pointer to a function that decodes a GUIDed section into a caller 164 allocated output buffer. 164 allocated output buffer. 165 165 166 166 @retval RETURN_SUCCESS The handlers were registered. … … 199 199 } 200 200 } 201 201 202 202 // 203 203 // Check the global table is enough to contain new Handler. … … 208 208 } 209 209 } 210 210 211 211 // 212 212 // Register new Handler and guid value. … … 234 234 optional scratch buffer required to actually decode the data in a GUIDed section. 235 235 236 Examines a GUIDed section specified by InputSection. 236 Examines a GUIDed section specified by InputSection. 237 237 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(), 238 then RETURN_UNSUPPORTED is returned. 239 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler 238 then RETURN_UNSUPPORTED is returned. 239 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler 240 240 of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers() 241 241 is used to retrieve the OututBufferSize, ScratchSize, and Attributes values. The return status from the handler of 242 242 type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER is returned. 243 243 244 244 If InputSection is NULL, then ASSERT(). 245 245 If OutputBufferSize is NULL, then ASSERT(). … … 268 268 OUT UINT32 *OutputBufferSize, 269 269 OUT UINT32 *ScratchBufferSize, 270 OUT UINT16 *SectionAttribute 270 OUT UINT16 *SectionAttribute 271 271 ) 272 272 { … … 274 274 EFI_GUID *SectionDefinitionGuid; 275 275 276 ASSERT (InputSection != NULL); 276 ASSERT (InputSection != NULL); 277 277 ASSERT (OutputBufferSize != NULL); 278 278 ASSERT (ScratchBufferSize != NULL); … … 284 284 SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid); 285 285 } 286 286 287 287 // 288 288 // Search the match registered GetInfo handler for the input guided section. … … 303 303 304 304 // 305 // Not found, the input guided section is not supported. 305 // Not found, the input guided section is not supported. 306 306 // 307 307 return RETURN_UNSUPPORTED; … … 314 314 allocated output buffer. 315 315 316 Decodes the GUIDed section specified by InputSection. 316 Decodes the GUIDed section specified by InputSection. 317 317 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(), 318 then RETURN_UNSUPPORTED is returned. 318 then RETURN_UNSUPPORTED is returned. 319 319 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler 320 320 of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers() … … 323 323 then OutputBuffer is set to point at the data in InputSection. Otherwise, the decoded data will be placed in caller 324 324 allocated buffer specified by OutputBuffer. This function is responsible for computing the EFI_AUTH_STATUS_PLATFORM_OVERRIDE 325 bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned. 326 325 bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned. 326 327 327 If InputSection is NULL, then ASSERT(). 328 328 If OutputBuffer is NULL, then ASSERT(). 329 329 If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT(). 330 If AuthenticationStatus is NULL, then ASSERT(). 330 If AuthenticationStatus is NULL, then ASSERT(). 331 331 332 332 @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file. 333 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 334 @param[in] ScratchBuffer A caller allocated buffer that may be required by this function as a scratch buffer to perform the decode operation. 335 @param[out] AuthenticationStatus 333 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 334 @param[in] ScratchBuffer A caller allocated buffer that may be required by this function as a scratch buffer to perform the decode operation. 335 @param[out] AuthenticationStatus 336 336 A pointer to the authentication status of the decoded output buffer. See the definition 337 337 of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI section of the PI … … 349 349 OUT VOID **OutputBuffer, 350 350 IN VOID *ScratchBuffer, OPTIONAL 351 OUT UINT32 *AuthenticationStatus 351 OUT UINT32 *AuthenticationStatus 352 352 ) 353 353 { 354 354 UINT32 Index; 355 355 EFI_GUID *SectionDefinitionGuid; 356 356 357 357 // 358 358 // Check the input parameters … … 386 386 387 387 // 388 // Not found, the input guided section is not supported. 388 // Not found, the input guided section is not supported. 389 389 // 390 390 return RETURN_UNSUPPORTED; … … 392 392 393 393 /** 394 Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and 394 Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and 395 395 EXTRACT_GUIDED_SECTION_DECODE_HANDLER for a specific GUID section type. 396 397 Retrieves the handlers associated with SectionGuid and returns them in 396 397 Retrieves the handlers associated with SectionGuid and returns them in 398 398 GetInfoHandler and DecodeHandler. 399 399 400 If the GUID value specified by SectionGuid has not been registered, then 400 If the GUID value specified by SectionGuid has not been registered, then 401 401 return RETURN_NOT_FOUND. 402 402 403 403 If SectionGuid is NULL, then ASSERT(). 404 404 405 @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed 405 @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed 406 406 section type being retrieved. 407 @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns 408 the size of the decoded buffer and the size of an optional scratch 409 buffer required to actually decode the data in a GUIDed section. 410 This is an optional parameter that may be NULL. If it is NULL, then 407 @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns 408 the size of the decoded buffer and the size of an optional scratch 409 buffer required to actually decode the data in a GUIDed section. 410 This is an optional parameter that may be NULL. If it is NULL, then 411 411 the previously registered handler is not returned. 412 412 @param[out] DecodeHandler Pointer to a function that decodes a GUIDed section into a caller … … 426 426 ) 427 427 { 428 UINT32 Index; 428 UINT32 Index; 429 429 430 430 // … … 438 438 for (Index = 0; Index < mNumberOfExtractHandler; Index ++) { 439 439 if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionGuid)) { 440 440 441 441 // 442 442 // If the guided handler has been registered before, then return the registered handlers. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
r58459 r58466 23 23 MODULE_TYPE = DXE_DRIVER 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = ExtractGuidedSectionLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 25 LIBRARY_CLASS = ExtractGuidedSectionLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 26 26 27 27 CONSTRUCTOR = DxeExtractGuidedSectionLibConstructor -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeHobLib/DxeHobLib.inf
r58459 r58466 24 24 MODULE_TYPE = DXE_DRIVER 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = HobLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER SMM_CORE DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 26 LIBRARY_CLASS = HobLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER SMM_CORE DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 27 27 CONSTRUCTOR = HobLibConstructor 28 28 … … 43 43 DebugLib 44 44 UefiLib 45 45 46 46 [Guids] 47 47 gEfiHobListGuid ## CONSUMES ## SystemTable -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeHobLib/HobLib.c
r58459 r58466 26 26 /** 27 27 The constructor function caches the pointer to HOB list. 28 28 29 29 The constructor function gets the start address of HOB list from system configuration table. 30 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. 30 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. 31 31 32 32 @param ImageHandle The firmware allocated handle for the EFI image. 33 33 @param SystemTable A pointer to the EFI System Table. 34 34 35 35 @retval EFI_SUCCESS The constructor successfully gets HobList. 36 36 @retval Other value The constructor can't get HobList. … … 57 57 58 58 This function returns the pointer to first HOB in the list. 59 For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer 59 For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer 60 60 to the HOB list. For the DXE phase, the HOB list pointer can be retrieved through 61 61 the EFI System Table by looking up theHOB list GUID in the System Configuration Table. 62 Since the System Configuration Table does not exist that the time the DXE Core is 63 launched, the DXE Core uses a global variable from the DXE Core Entry Point Library 62 Since the System Configuration Table does not exist that the time the DXE Core is 63 launched, the DXE Core uses a global variable from the DXE Core Entry Point Library 64 64 to manage the pointer to the HOB list. 65 65 66 66 If the pointer to the HOB list is NULL, then ASSERT(). 67 67 68 68 @return The pointer to the HOB list. 69 69 … … 82 82 Returns the next instance of a HOB type from the starting HOB. 83 83 84 This function searches the first instance of a HOB type from the starting HOB pointer. 84 This function searches the first instance of a HOB type from the starting HOB pointer. 85 85 If there does not exist such HOB type from the starting HOB pointer, it will return NULL. 86 86 In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer 87 87 unconditionally: it returns HobStart back if HobStart itself meets the requirement; 88 88 caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. 89 89 90 90 If HobStart is NULL, then ASSERT(). 91 91 … … 106 106 107 107 ASSERT (HobStart != NULL); 108 108 109 109 Hob.Raw = (UINT8 *) HobStart; 110 110 // … … 123 123 Returns the first instance of a HOB type among the whole HOB list. 124 124 125 This function searches the first instance of a HOB type among the whole HOB list. 126 If there does not exist such HOB type in the HOB list, it will return NULL. 127 125 This function searches the first instance of a HOB type among the whole HOB list. 126 If there does not exist such HOB type in the HOB list, it will return NULL. 127 128 128 If the pointer to the HOB list is NULL, then ASSERT(). 129 129 … … 147 147 /** 148 148 Returns the next instance of the matched GUID HOB from the starting HOB. 149 150 This function searches the first instance of a HOB from the starting HOB pointer. 151 Such HOB should satisfy two conditions: 152 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. 153 If there does not exist such HOB from the starting HOB pointer, it will return NULL. 149 150 This function searches the first instance of a HOB from the starting HOB pointer. 151 Such HOB should satisfy two conditions: 152 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. 153 If there does not exist such HOB from the starting HOB pointer, it will return NULL. 154 154 Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () 155 155 to extract the data section and its size information, respectively. … … 157 157 unconditionally: it returns HobStart back if HobStart itself meets the requirement; 158 158 caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. 159 159 160 160 If Guid is NULL, then ASSERT(). 161 161 If HobStart is NULL, then ASSERT(). … … 188 188 /** 189 189 Returns the first instance of the matched GUID HOB among the whole HOB list. 190 191 This function searches the first instance of a HOB among the whole HOB list. 190 191 This function searches the first instance of a HOB among the whole HOB list. 192 192 Such HOB should satisfy two conditions: 193 193 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. … … 195 195 Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () 196 196 to extract the data section and its size information, respectively. 197 197 198 198 If the pointer to the HOB list is NULL, then ASSERT(). 199 199 If Guid is NULL, then ASSERT(). … … 219 219 Get the system boot mode from the HOB list. 220 220 221 This function returns the system boot mode information from the 221 This function returns the system boot mode information from the 222 222 PHIT HOB in HOB list. 223 223 224 224 If the pointer to the HOB list is NULL, then ASSERT(). 225 225 226 226 @param VOID 227 227 … … 248 248 It can only be invoked during PEI phase; 249 249 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 250 250 251 251 If ModuleName is NULL, then ASSERT(). 252 252 If there is no additional space for HOB creation, then ASSERT(). … … 279 279 It can only be invoked during PEI phase; 280 280 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 281 281 282 282 If there is no additional space for HOB creation, then ASSERT(). 283 283 … … 311 311 It can only be invoked during PEI phase; 312 312 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 313 313 314 314 If there is no additional space for HOB creation, then ASSERT(). 315 315 … … 336 336 337 337 /** 338 Builds a customized HOB tagged with a GUID for identification and returns 338 Builds a customized HOB tagged with a GUID for identification and returns 339 339 the start address of GUID HOB data. 340 340 341 This function builds a customized HOB tagged with a GUID for identification 342 and returns the start address of GUID HOB data so that caller can fill the customized data. 341 This function builds a customized HOB tagged with a GUID for identification 342 and returns the start address of GUID HOB data so that caller can fill the customized data. 343 343 The HOB Header and Name field is already stripped. 344 344 It can only be invoked during PEI phase; 345 345 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 346 346 347 347 If Guid is NULL, then ASSERT(). 348 348 If there is no additional space for HOB creation, then ASSERT(). … … 372 372 373 373 /** 374 Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB 374 Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB 375 375 data field, and returns the start address of the GUID HOB data. 376 376 377 377 This function builds a customized HOB tagged with a GUID for identification and copies the input 378 data to the HOB data field and returns the start address of the GUID HOB data. It can only be 379 invoked during PEI phase; for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 378 data to the HOB data field and returns the start address of the GUID HOB data. It can only be 379 invoked during PEI phase; for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 380 380 The HOB Header and Name field is already stripped. 381 381 It can only be invoked during PEI phase; 382 382 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 383 383 384 384 If Guid is NULL, then ASSERT(). 385 385 If Data is NULL and DataLength > 0, then ASSERT(). … … 417 417 It can only be invoked during PEI phase; 418 418 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 419 419 420 420 If there is no additional space for HOB creation, then ASSERT(). 421 421 … … 443 443 It can only be invoked during PEI phase; 444 444 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 445 445 446 446 If there is no additional space for HOB creation, then ASSERT(). 447 447 … … 450 450 @param FvName The name of the Firmware Volume. 451 451 @param FileName The name of the file. 452 452 453 453 **/ 454 454 VOID … … 471 471 It can only be invoked during PEI phase; 472 472 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 473 473 474 474 If the platform does not support Capsule Volume HOBs, then ASSERT(). 475 475 If there is no additional space for HOB creation, then ASSERT(). … … 498 498 It can only be invoked during PEI phase; 499 499 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 500 500 501 501 If there is no additional space for HOB creation, then ASSERT(). 502 502 … … 524 524 It can only be invoked during PEI phase; 525 525 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 526 526 527 527 If there is no additional space for HOB creation, then ASSERT(). 528 528 … … 550 550 It can only be invoked during PEI phase; 551 551 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 552 552 553 553 If there is no additional space for HOB creation, then ASSERT(). 554 554 … … 578 578 It can only be invoked during PEI phase; 579 579 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 580 580 581 581 If there is no additional space for HOB creation, then ASSERT(). 582 582 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeHstiLib/HstiAip.c
r58464 r58466 19 19 This function returns information of type InformationType from the adapter. 20 20 If an adapter does not support the requested informational type, then 21 EFI_UNSUPPORTED is returned. 21 EFI_UNSUPPORTED is returned. 22 22 23 23 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance. … … 31 31 @retval EFI_DEVICE_ERROR The device reported an error. 32 32 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. 33 @retval EFI_INVALID_PARAMETER This is NULL. 34 @retval EFI_INVALID_PARAMETER InformationBlock is NULL. 33 @retval EFI_INVALID_PARAMETER This is NULL. 34 @retval EFI_INVALID_PARAMETER InformationBlock is NULL. 35 35 @retval EFI_INVALID_PARAMETER InformationBlockSize is NULL. 36 36 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeHstiLib/HstiDxe.c
r58464 r58466 116 116 117 117 Hsti = InformationBlock; 118 if ((Hsti->Role == Role) && 118 if ((Hsti->Role == Role) && 119 119 ((ImplementationID == NULL) || (StrCmp (ImplementationID, Hsti->ImplementationID) == 0))) { 120 120 break; … … 312 312 HstiAip->HstiSize = HstiSize; 313 313 HstiAip->HstiMaxSize = HstiSize; 314 314 315 315 Handle = NULL; 316 316 Status = gBS->InstallMultipleProtocolInterfaces ( -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeIoLibCpuIo2/DxeCpuIo2LibInternal.h
r48674 r58466 1 1 /** @file 2 2 Internal include file of DXE CPU IO2 Library. 3 3 4 4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials are licensed and made available … … 102 102 @param Width The width of the I/O operation. 103 103 @param Data The value to write to the I/O port. 104 104 105 105 @return Data read from registers in the EFI system memory space. 106 106 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeIoLibCpuIo2/DxeIoLibCpuIo2.inf
r58459 r58466 6 6 # Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> 7 7 # This program and the accompanying materials are licensed and made available 8 # under the terms and conditions of the BSD License which accompanies this 8 # under the terms and conditions of the BSD License which accompanies this 9 9 # distribution. The full text of the license may be found at 10 10 # http://opensource.org/licenses/bsd-license.php. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeIoLibCpuIo2/IoLib.c
r48674 r58466 1 1 /** @file 2 2 I/O Library instance based on EFI_CPU_IO2_PROTOCOL. 3 3 4 4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials are licensed and made available … … 149 149 @param Width The width of the I/O operation. 150 150 @param Data The value to write to the I/O port. 151 151 152 152 @return Data read from registers in the EFI system memory space. 153 153 … … 225 225 226 226 If Port is not aligned on a 16-bit boundary, then ASSERT(). 227 227 228 228 If 16-bit I/O port operations are not supported, then ASSERT(). 229 229 … … 283 283 This function must guarantee that all I/O read and write operations are 284 284 serialized. 285 285 286 286 If Port is not aligned on a 32-bit boundary, then ASSERT(). 287 287 … … 374 374 375 375 If Port is not aligned on a 64-bit boundary, then ASSERT(). 376 376 377 377 If 64-bit I/O port operations are not supported, then ASSERT(). 378 378 … … 451 451 452 452 If Address is not aligned on a 16-bit boundary, then ASSERT(). 453 453 454 454 If 16-bit MMIO register operations are not supported, then ASSERT(). 455 455 … … 480 480 481 481 If Address is not aligned on a 16-bit boundary, then ASSERT(). 482 482 483 483 If 16-bit MMIO register operations are not supported, then ASSERT(). 484 484 … … 509 509 510 510 If Address is not aligned on a 32-bit boundary, then ASSERT(). 511 511 512 512 If 32-bit MMIO register operations are not supported, then ASSERT(). 513 513 … … 538 538 539 539 If Address is not aligned on a 32-bit boundary, then ASSERT(). 540 540 541 541 If 32-bit MMIO register operations are not supported, then ASSERT(). 542 542 … … 567 567 568 568 If Address is not aligned on a 64-bit boundary, then ASSERT(). 569 569 570 570 If 64-bit MMIO register operations are not supported, then ASSERT(). 571 571 … … 596 596 597 597 If Address is not aligned on a 64-bit boundary, then ASSERT(). 598 598 599 599 If 64-bit MMIO register operations are not supported, then ASSERT(). 600 600 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeIoLibCpuIo2/IoLibMmioBuffer.c
r48674 r58466 68 68 69 69 If Length is not aligned on a 16-bit boundary, then ASSERT(). 70 70 71 71 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). 72 72 … … 171 171 172 172 If Length is not aligned on a 64-bit boundary, then ASSERT(). 173 173 174 174 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). 175 175 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeIoLibEsal/DxeIoLibEsal.inf
r58459 r58466 7 7 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 8 8 # This program and the accompanying materials are licensed and made available 9 # under the terms and conditions of the BSD License which accompanies this 9 # under the terms and conditions of the BSD License which accompanies this 10 10 # distribution. The full text of the license may be found at 11 11 # http://opensource.org/licenses/bsd-license.php. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeIoLibEsal/DxeIoLibEsalInternal.h
r48674 r58466 1 1 /** @file 2 2 Internal include file for the I/O Library using ESAL services. 3 3 4 4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials are licensed and made available -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeIoLibEsal/IoLib.c
r48674 r58466 44 44 EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO, 45 45 EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI, 46 IoReadFunctionId, 47 (UINT64)Width, 48 Port, 49 1, 50 (UINT64)&Data, 51 0, 52 0, 46 IoReadFunctionId, 47 (UINT64)Width, 48 Port, 49 1, 50 (UINT64)&Data, 51 0, 52 0, 53 53 0 54 54 ); … … 85 85 EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO, 86 86 EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI, 87 IoWriteFunctionId, 88 (UINT64)Width, 89 Port, 90 1, 91 (UINT64)&Data, 92 0, 93 0, 87 IoWriteFunctionId, 88 (UINT64)Width, 89 Port, 90 1, 91 (UINT64)&Data, 92 0, 93 0, 94 94 0 95 95 ); … … 127 127 EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO, 128 128 EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI, 129 MemReadFunctionId, 130 (UINT64)Width, 131 Address, 132 1, 133 (UINT64)&Data, 134 0, 135 0, 129 MemReadFunctionId, 130 (UINT64)Width, 131 Address, 132 1, 133 (UINT64)&Data, 134 0, 135 0, 136 136 0 137 137 ); … … 168 168 EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO, 169 169 EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI, 170 MemWriteFunctionId, 171 (UINT64)Width, 172 Address, 173 1, 174 (UINT64)&Data, 175 0, 176 0, 170 MemWriteFunctionId, 171 (UINT64)Width, 172 Address, 173 1, 174 (UINT64)&Data, 175 0, 176 0, 177 177 0 178 178 ); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeIoLibEsal/IoLibMmioBuffer.c
r48674 r58466 18 18 Copy data from MMIO region to system memory by using 8-bit access. 19 19 20 Copy data from MMIO region specified by starting address StartAddress 21 to system memory specified by Buffer by using 8-bit access. The total 20 Copy data from MMIO region specified by starting address StartAddress 21 to system memory specified by Buffer by using 8-bit access. The total 22 22 number of byte to be copied is specified by Length. Buffer is returned. 23 24 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 23 24 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 25 25 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 26 26 … … 45 45 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 46 46 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); 47 47 48 48 ReturnBuffer = Buffer; 49 49 50 50 while (Length-- > 0) { 51 51 *(Buffer++) = MmioRead8 (StartAddress++); … … 58 58 Copy data from MMIO region to system memory by using 16-bit access. 59 59 60 Copy data from MMIO region specified by starting address StartAddress 61 to system memory specified by Buffer by using 16-bit access. The total 60 Copy data from MMIO region specified by starting address StartAddress 61 to system memory specified by Buffer by using 16-bit access. The total 62 62 number of byte to be copied is specified by Length. Buffer is returned. 63 63 64 64 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 65 65 66 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 66 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 67 67 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 68 68 … … 88 88 89 89 ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0); 90 90 91 91 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 92 92 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 94 94 ASSERT ((Length & (sizeof (UINT16) - 1)) == 0); 95 95 ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0); 96 96 97 97 ReturnBuffer = Buffer; 98 98 99 99 while (Length > 0) { 100 100 *(Buffer++) = MmioRead16 (StartAddress); … … 109 109 Copy data from MMIO region to system memory by using 32-bit access. 110 110 111 Copy data from MMIO region specified by starting address StartAddress 112 to system memory specified by Buffer by using 32-bit access. The total 111 Copy data from MMIO region specified by starting address StartAddress 112 to system memory specified by Buffer by using 32-bit access. The total 113 113 number of byte to be copied is specified by Length. Buffer is returned. 114 114 115 115 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 116 116 117 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 117 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 118 118 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 119 119 … … 139 139 140 140 ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0); 141 141 142 142 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 143 143 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 145 145 ASSERT ((Length & (sizeof (UINT32) - 1)) == 0); 146 146 ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0); 147 147 148 148 ReturnBuffer = Buffer; 149 149 150 150 while (Length > 0) { 151 151 *(Buffer++) = MmioRead32 (StartAddress); … … 160 160 Copy data from MMIO region to system memory by using 64-bit access. 161 161 162 Copy data from MMIO region specified by starting address StartAddress 163 to system memory specified by Buffer by using 64-bit access. The total 162 Copy data from MMIO region specified by starting address StartAddress 163 to system memory specified by Buffer by using 64-bit access. The total 164 164 number of byte to be copied is specified by Length. Buffer is returned. 165 165 166 166 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 167 167 168 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 168 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 169 169 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 170 170 … … 190 190 191 191 ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0); 192 192 193 193 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 194 194 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 196 196 ASSERT ((Length & (sizeof (UINT64) - 1)) == 0); 197 197 ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0); 198 198 199 199 ReturnBuffer = Buffer; 200 200 201 201 while (Length > 0) { 202 202 *(Buffer++) = MmioRead64 (StartAddress); … … 212 212 Copy data from system memory to MMIO region by using 8-bit access. 213 213 214 Copy data from system memory specified by Buffer to MMIO region specified 215 by starting address StartAddress by using 8-bit access. The total number 214 Copy data from system memory specified by Buffer to MMIO region specified 215 by starting address StartAddress by using 8-bit access. The total number 216 216 of byte to be copied is specified by Length. Buffer is returned. 217 218 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 217 218 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 219 219 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 220 220 … … 239 239 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 240 240 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); 241 241 242 242 ReturnBuffer = (UINT8 *) Buffer; 243 243 244 244 while (Length-- > 0) { 245 245 MmioWrite8 (StartAddress++, *(Buffer++)); … … 247 247 248 248 return ReturnBuffer; 249 249 250 250 } 251 251 … … 253 253 Copy data from system memory to MMIO region by using 16-bit access. 254 254 255 Copy data from system memory specified by Buffer to MMIO region specified 256 by starting address StartAddress by using 16-bit access. The total number 255 Copy data from system memory specified by Buffer to MMIO region specified 256 by starting address StartAddress by using 16-bit access. The total number 257 257 of byte to be copied is specified by Length. Buffer is returned. 258 258 259 259 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 260 260 261 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 261 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 262 262 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 263 263 … … 284 284 285 285 ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0); 286 286 287 287 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 288 288 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 292 292 293 293 ReturnBuffer = (UINT16 *) Buffer; 294 294 295 295 while (Length > 0) { 296 296 MmioWrite16 (StartAddress, *(Buffer++)); 297 297 298 298 StartAddress += sizeof (UINT16); 299 299 Length -= sizeof (UINT16); … … 307 307 Copy data from system memory to MMIO region by using 32-bit access. 308 308 309 Copy data from system memory specified by Buffer to MMIO region specified 310 by starting address StartAddress by using 32-bit access. The total number 309 Copy data from system memory specified by Buffer to MMIO region specified 310 by starting address StartAddress by using 32-bit access. The total number 311 311 of byte to be copied is specified by Length. Buffer is returned. 312 312 313 313 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 314 314 315 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 315 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 316 316 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 317 317 … … 338 338 339 339 ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0); 340 340 341 341 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 342 342 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 346 346 347 347 ReturnBuffer = (UINT32 *) Buffer; 348 348 349 349 while (Length > 0) { 350 350 MmioWrite32 (StartAddress, *(Buffer++)); 351 351 352 352 StartAddress += sizeof (UINT32); 353 353 Length -= sizeof (UINT32); … … 360 360 Copy data from system memory to MMIO region by using 64-bit access. 361 361 362 Copy data from system memory specified by Buffer to MMIO region specified 363 by starting address StartAddress by using 64-bit access. The total number 362 Copy data from system memory specified by Buffer to MMIO region specified 363 by starting address StartAddress by using 64-bit access. The total number 364 364 of byte to be copied is specified by Length. Buffer is returned. 365 365 366 366 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 367 367 368 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 368 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 369 369 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 370 370 … … 391 391 392 392 ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0); 393 393 394 394 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 395 395 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 399 399 400 400 ReturnBuffer = (UINT64 *) Buffer; 401 401 402 402 while (Length > 0) { 403 403 MmioWrite64 (StartAddress, *(Buffer++)); 404 404 405 405 StartAddress += sizeof (UINT64); 406 406 Length -= sizeof (UINT64); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxePalLibEsal/DxePalLibEsal.c
r48674 r58466 60 60 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO, 61 61 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI, 62 PalProcFunctionId, 63 Index, 64 Arg2, 65 Arg3, 66 Arg4, 67 0, 68 0, 62 PalProcFunctionId, 63 Index, 64 Arg2, 65 Arg3, 66 Arg4, 67 0, 68 0, 69 69 0 70 70 ); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxePalLibEsal/DxePalLibEsal.inf
r58459 r58466 20 20 MODULE_TYPE = DXE_DRIVER 21 21 VERSION_STRING = 1.0 22 LIBRARY_CLASS = PalLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION 22 LIBRARY_CLASS = PalLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION 23 23 24 24 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxePcdLib/DxePcdLib.c
r58459 r58466 3 3 4 4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 … … 47 47 if (mPiPcd == NULL) { 48 48 // 49 // PI Pcd protocol defined in PI 1.2 vol3 should be installed before the module 49 // PI Pcd protocol defined in PI 1.2 vol3 should be installed before the module 50 50 // access DynamicEx type PCD. 51 51 // … … 74 74 // PCD protocol need to be installed before the module access Dynamic type PCD. 75 75 // But dynamic type PCD is not required in PI 1.2 specification. 76 // 76 // 77 77 Status = gBS->LocateProtocol (&gPcdProtocolGuid, NULL, (VOID **)&mPcd); 78 78 ASSERT_EFI_ERROR (Status); … … 110 110 GetPcdInfoProtocolPointer ( 111 111 VOID 112 ) 112 ) 113 113 { 114 114 EFI_STATUS Status; … … 126 126 127 127 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned. 128 If SkuId >= PCD_MAX_SKU_ID, then ASSERT(). 128 If SkuId >= PCD_MAX_SKU_ID, then ASSERT(). 129 129 130 130 @param SkuId The SKU value that will be used when the PCD service retrieves and sets values … … 151 151 /** 152 152 This function provides a means by which to retrieve a value for a given PCD token. 153 154 Returns the 8-bit value for the token specified by TokenNumber. 153 154 Returns the 8-bit value for the token specified by TokenNumber. 155 155 156 156 @param[in] TokenNumber The PCD token number to retrieve a current value for. 157 157 158 @return Returns the 8-bit value for the token specified by TokenNumber. 158 @return Returns the 8-bit value for the token specified by TokenNumber. 159 159 160 160 **/ … … 172 172 /** 173 173 This function provides a means by which to retrieve a value for a given PCD token. 174 175 Returns the 16-bit value for the token specified by TokenNumber. 174 175 Returns the 16-bit value for the token specified by TokenNumber. 176 176 177 177 @param[in] TokenNumber The PCD token number to retrieve a current value for. 178 178 179 @return Returns the 16-bit value for the token specified by TokenNumber. 179 @return Returns the 16-bit value for the token specified by TokenNumber. 180 180 181 181 **/ … … 193 193 /** 194 194 This function provides a means by which to retrieve a value for a given PCD token. 195 196 Returns the 32-bit value for the token specified by TokenNumber. 195 196 Returns the 32-bit value for the token specified by TokenNumber. 197 197 198 198 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 214 214 /** 215 215 This function provides a means by which to retrieve a value for a given PCD token. 216 216 217 217 Returns the 64-bit value for the token specified by TokenNumber. 218 218 … … 235 235 /** 236 236 This function provides a means by which to retrieve a value for a given PCD token. 237 237 238 238 Returns the pointer to the buffer of the token specified by TokenNumber. 239 239 … … 256 256 /** 257 257 This function provides a means by which to retrieve a value for a given PCD token. 258 259 Returns the Boolean value of the token specified by TokenNumber. 258 259 Returns the Boolean value of the token specified by TokenNumber. 260 260 261 261 @param[in] TokenNumber The PCD token number to retrieve a current value for. 262 262 263 @return Returns the Boolean value of the token specified by TokenNumber. 264 265 **/ 266 BOOLEAN 263 @return Returns the Boolean value of the token specified by TokenNumber. 264 265 **/ 266 BOOLEAN 267 267 EFIAPI 268 268 LibPcdGetBool ( … … 280 280 @param[in] TokenNumber The PCD token number to retrieve a current value for. 281 281 282 @return Returns the size of the token specified by TokenNumber. 282 @return Returns the size of the token specified by TokenNumber. 283 283 284 284 **/ … … 296 296 /** 297 297 This function provides a means by which to retrieve a value for a given PCD token. 298 298 299 299 Returns the 8-bit value for the token specified by TokenNumber and Guid. 300 301 If Guid is NULL, then ASSERT(). 302 303 @param[in] Guid The pointer to a 128-bit unique value that designates 300 301 If Guid is NULL, then ASSERT(). 302 303 @param[in] Guid The pointer to a 128-bit unique value that designates 304 304 which namespace to retrieve a value from. 305 305 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 316 316 { 317 317 ASSERT (Guid != NULL); 318 318 319 319 return GetPiPcdProtocol()->Get8 (Guid, TokenNumber); 320 320 } … … 325 325 326 326 Returns the 16-bit value for the token specified by TokenNumber and Guid. 327 328 If Guid is NULL, then ASSERT(). 329 330 @param[in] Guid The pointer to a 128-bit unique value that designates 327 328 If Guid is NULL, then ASSERT(). 329 330 @param[in] Guid The pointer to a 128-bit unique value that designates 331 331 which namespace to retrieve a value from. 332 332 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 350 350 /** 351 351 Returns the 32-bit value for the token specified by TokenNumber and Guid. 352 If Guid is NULL, then ASSERT(). 353 354 @param[in] Guid The pointer to a 128-bit unique value that designates 352 If Guid is NULL, then ASSERT(). 353 354 @param[in] Guid The pointer to a 128-bit unique value that designates 355 355 which namespace to retrieve a value from. 356 356 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 375 375 /** 376 376 This function provides a means by which to retrieve a value for a given PCD token. 377 377 378 378 Returns the 64-bit value for the token specified by TokenNumber and Guid. 379 380 If Guid is NULL, then ASSERT(). 381 382 @param[in] Guid The pointer to a 128-bit unique value that designates 379 380 If Guid is NULL, then ASSERT(). 381 382 @param[in] Guid The pointer to a 128-bit unique value that designates 383 383 which namespace to retrieve a value from. 384 384 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 395 395 { 396 396 ASSERT (Guid != NULL); 397 397 398 398 return GetPiPcdProtocol()->Get64 (Guid, TokenNumber); 399 399 } … … 403 403 /** 404 404 This function provides a means by which to retrieve a value for a given PCD token. 405 405 406 406 Returns the pointer to the buffer of token specified by TokenNumber and Guid. 407 408 If Guid is NULL, then ASSERT(). 409 410 @param[in] Guid The pointer to a 128-bit unique value that designates 407 408 If Guid is NULL, then ASSERT(). 409 410 @param[in] Guid The pointer to a 128-bit unique value that designates 411 411 which namespace to retrieve a value from. 412 412 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 431 431 /** 432 432 This function provides a means by which to retrieve a value for a given PCD token. 433 434 Returns the Boolean value of the token specified by TokenNumber and Guid. 435 436 If Guid is NULL, then ASSERT(). 437 438 @param[in] Guid The pointer to a 128-bit unique value that designates 433 434 Returns the Boolean value of the token specified by TokenNumber and Guid. 435 436 If Guid is NULL, then ASSERT(). 437 438 @param[in] Guid The pointer to a 128-bit unique value that designates 439 439 which namespace to retrieve a value from. 440 440 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 459 459 /** 460 460 This function provides a means by which to retrieve the size of a given PCD token. 461 462 Returns the size of the token specified by TokenNumber and Guid. 463 464 If Guid is NULL, then ASSERT(). 465 466 @param[in] Guid The pointer to a 128-bit unique value that designates 461 462 Returns the size of the token specified by TokenNumber and Guid. 463 464 If Guid is NULL, then ASSERT(). 465 466 @param[in] Guid The pointer to a 128-bit unique value that designates 467 467 which namespace to retrieve a value from. 468 468 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 487 487 /** 488 488 This function provides a means by which to set a value for a given PCD token. 489 490 Sets the 8-bit value for the token specified by TokenNumber 489 490 Sets the 8-bit value for the token specified by TokenNumber 491 491 to the value specified by Value. Value is returned. 492 492 … … 510 510 Status = GetPcdProtocol()->Set8 (TokenNumber, Value); 511 511 ASSERT_EFI_ERROR (Status); 512 512 513 513 return Value; 514 514 } … … 518 518 /** 519 519 This function provides a means by which to set a value for a given PCD token. 520 521 Sets the 16-bit value for the token specified by TokenNumber 520 521 Sets the 16-bit value for the token specified by TokenNumber 522 522 to the value specified by Value. Value is returned. 523 523 … … 541 541 Status = GetPcdProtocol()->Set16 (TokenNumber, Value); 542 542 ASSERT_EFI_ERROR (Status); 543 543 544 544 return Value; 545 545 } … … 549 549 /** 550 550 This function provides a means by which to set a value for a given PCD token. 551 552 Sets the 32-bit value for the token specified by TokenNumber 551 552 Sets the 32-bit value for the token specified by TokenNumber 553 553 to the value specified by Value. Value is returned. 554 554 … … 569 569 { 570 570 EFI_STATUS Status; 571 571 572 572 Status = GetPcdProtocol()->Set32 (TokenNumber, Value); 573 573 ASSERT_EFI_ERROR (Status); … … 580 580 /** 581 581 This function provides a means by which to set a value for a given PCD token. 582 583 Sets the 64-bit value for the token specified by TokenNumber 582 583 Sets the 64-bit value for the token specified by TokenNumber 584 584 to the value specified by Value. Value is returned. 585 585 586 586 If the set operation was not correctly performed, then ASSERT(). 587 587 588 588 @param[in] TokenNumber The PCD token number to set a current value for. 589 589 @param[in] Value The 64-bit value to set. … … 611 611 /** 612 612 This function provides a means by which to set a value for a given PCD token. 613 614 Sets a buffer for the token specified by TokenNumber to the value 615 specified by Buffer and SizeOfBuffer. Buffer is returned. 616 If SizeOfBuffer is greater than the maximum size support by TokenNumber, 617 then set SizeOfBuffer to the maximum size supported by TokenNumber and 613 614 Sets a buffer for the token specified by TokenNumber to the value 615 specified by Buffer and SizeOfBuffer. Buffer is returned. 616 If SizeOfBuffer is greater than the maximum size support by TokenNumber, 617 then set SizeOfBuffer to the maximum size supported by TokenNumber and 618 618 return NULL to indicate that the set operation was not actually performed, 619 619 or ASSERT() if the set operation was not correctly performed. 620 620 621 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the 621 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the 622 622 maximum size supported by TokenName and NULL must be returned. 623 623 624 624 If SizeOfBuffer is NULL, then ASSERT(). 625 625 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 626 626 627 627 @param[in] TokenNumber The PCD token number to set a current value for. 628 628 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. … … 663 663 /** 664 664 This function provides a means by which to set a value for a given PCD token. 665 666 Sets the Boolean value for the token specified by TokenNumber 665 666 Sets the Boolean value for the token specified by TokenNumber 667 667 to the value specified by Value. Value is returned. 668 668 … … 694 694 /** 695 695 This function provides a means by which to set a value for a given PCD token. 696 697 Sets the 8-bit value for the token specified by TokenNumber and 696 697 Sets the 8-bit value for the token specified by TokenNumber and 698 698 Guid to the value specified by Value. Value is returned. 699 699 … … 701 701 If the set operation was not correctly performed, then ASSERT(). 702 702 703 @param[in] Guid The pointer to a 128-bit unique value that 703 @param[in] Guid The pointer to a 128-bit unique value that 704 704 designates which namespace to set a value from. 705 705 @param[in] TokenNumber The PCD token number to set a current value for. … … 731 731 /** 732 732 This function provides a means by which to set a value for a given PCD token. 733 734 Sets the 16-bit value for the token specified by TokenNumber and 733 734 Sets the 16-bit value for the token specified by TokenNumber and 735 735 Guid to the value specified by Value. Value is returned. 736 736 … … 738 738 If the set operation was not correctly performed, then ASSERT(). 739 739 740 @param[in] Guid The pointer to a 128-bit unique value that 740 @param[in] Guid The pointer to a 128-bit unique value that 741 741 designates which namespace to set a value from. 742 742 @param[in] TokenNumber The PCD token number to set a current value for. … … 768 768 /** 769 769 This function provides a means by which to set a value for a given PCD token. 770 771 Sets the 32-bit value for the token specified by TokenNumber and 770 771 Sets the 32-bit value for the token specified by TokenNumber and 772 772 Guid to the value specified by Value. Value is returned. 773 773 … … 775 775 If the set operation was not correctly performed, then ASSERT(). 776 776 777 @param[in] Guid The pointer to a 128-bit unique value that 777 @param[in] Guid The pointer to a 128-bit unique value that 778 778 designates which namespace to set a value from. 779 779 @param[in] TokenNumber The PCD token number to set a current value for. … … 805 805 /** 806 806 This function provides a means by which to set a value for a given PCD token. 807 808 Sets the 64-bit value for the token specified by TokenNumber and 807 808 Sets the 64-bit value for the token specified by TokenNumber and 809 809 Guid to the value specified by Value. Value is returned. 810 810 … … 812 812 If the set operation was not correctly performed, then ASSERT(). 813 813 814 @param[in] Guid The pointer to a 128-bit unique value that 814 @param[in] Guid The pointer to a 128-bit unique value that 815 815 designates which namespace to set a value from. 816 816 @param[in] TokenNumber The PCD token number to set a current value for. … … 842 842 /** 843 843 This function provides a means by which to set a value for a given PCD token. 844 845 Sets a buffer for the token specified by TokenNumber to the value specified by 846 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 847 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size 848 supported by TokenNumber and return NULL to indicate that the set operation 844 845 Sets a buffer for the token specified by TokenNumber to the value specified by 846 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 847 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size 848 supported by TokenNumber and return NULL to indicate that the set operation 849 849 was not actually performed, or ASSERT() if the set operation was not corretly performed. 850 850 851 851 If Guid is NULL, then ASSERT(). 852 852 If SizeOfBuffer is NULL, then ASSERT(). 853 853 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 854 855 @param[in] Guid The pointer to a 128-bit unique value that 854 855 @param[in] Guid The pointer to a 128-bit unique value that 856 856 designates which namespace to set a value from. 857 857 @param[in] TokenNumber The PCD token number to set a current value for. … … 896 896 /** 897 897 This function provides a means by which to set a value for a given PCD token. 898 899 Sets the Boolean value for the token specified by TokenNumber and 898 899 Sets the Boolean value for the token specified by TokenNumber and 900 900 Guid to the value specified by Value. Value is returned. 901 901 … … 903 903 If the set operation was not correctly performed, then ASSERT(). 904 904 905 @param[in] Guid The pointer to a 128-bit unique value that 905 @param[in] Guid The pointer to a 128-bit unique value that 906 906 designates which namespace to set a value from. 907 907 @param[in] TokenNumber The PCD token number to set a current value for. … … 933 933 /** 934 934 Set up a notification function that is called when a specified token is set. 935 936 When the token specified by TokenNumber and Guid is set, 937 then notification function specified by NotificationFunction is called. 935 936 When the token specified by TokenNumber and Guid is set, 937 then notification function specified by NotificationFunction is called. 938 938 If Guid is NULL, then the default token space is used. 939 939 If NotificationFunction is NULL, then ASSERT(). 940 940 941 @param[in] Guid The pointer to a 128-bit unique value that designates which 942 namespace to set a value from. If NULL, then the default 941 @param[in] Guid The pointer to a 128-bit unique value that designates which 942 namespace to set a value from. If NULL, then the default 943 943 token space is used. 944 944 @param[in] TokenNumber The PCD token number to monitor. 945 @param[in] NotificationFunction The function to call when the token 945 @param[in] NotificationFunction The function to call when the token 946 946 specified by Guid and TokenNumber is set. 947 947 … … 969 969 /** 970 970 Disable a notification function that was established with LibPcdCallbackonSet(). 971 971 972 972 Disable a notification function that was previously established with LibPcdCallbackOnSet(). 973 973 If NotificationFunction is NULL, then ASSERT(). 974 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, 974 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, 975 975 and NotificationFunction, then ASSERT(). 976 976 977 977 @param[in] Guid Specify the GUID token space. 978 978 @param[in] TokenNumber Specify the token number. … … 991 991 992 992 ASSERT (NotificationFunction != NULL); 993 993 994 994 Status = GetPiPcdProtocol()->CancelCallback (Guid, TokenNumber, (EFI_PCD_PROTOCOL_CALLBACK) NotificationFunction); 995 995 ASSERT_EFI_ERROR (Status); … … 1002 1002 /** 1003 1003 Retrieves the next token in a token space. 1004 1005 Retrieves the next PCD token number from the token space specified by Guid. 1006 If Guid is NULL, then the default token space is used. If TokenNumber is 0, 1007 then the first token number is returned. Otherwise, the token number that 1008 follows TokenNumber in the token space is returned. If TokenNumber is the last 1009 token number in the token space, then 0 is returned. 1010 1004 1005 Retrieves the next PCD token number from the token space specified by Guid. 1006 If Guid is NULL, then the default token space is used. If TokenNumber is 0, 1007 then the first token number is returned. Otherwise, the token number that 1008 follows TokenNumber in the token space is returned. If TokenNumber is the last 1009 token number in the token space, then 0 is returned. 1010 1011 1011 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT(). 1012 1012 1013 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace 1013 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace 1014 1014 to set a value from. If NULL, then the default token space is used. 1015 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD 1015 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD 1016 1016 token number. 1017 1017 … … 1019 1019 1020 1020 **/ 1021 UINTN 1021 UINTN 1022 1022 EFIAPI 1023 1023 LibPcdGetNextToken ( … … 1038 1038 /** 1039 1039 Used to retrieve the list of available PCD token space GUIDs. 1040 1040 1041 1041 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces 1042 1042 in the platform. 1043 1043 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned. 1044 1044 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned. 1045 1045 1046 1046 @param TokenSpaceGuid The pointer to the a PCD token space GUID. 1047 1047 … … 1063 1063 /** 1064 1064 Sets a value of a patchable PCD entry that is type pointer. 1065 1066 Sets the PCD entry specified by PatchVariable to the value specified by Buffer 1067 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 1068 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 1069 NULL to indicate that the set operation was not actually performed. 1070 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 1065 1066 Sets the PCD entry specified by PatchVariable to the value specified by Buffer 1067 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 1068 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 1069 NULL to indicate that the set operation was not actually performed. 1070 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 1071 1071 MaximumDatumSize and NULL must be returned. 1072 1072 1073 1073 If PatchVariable is NULL, then ASSERT(). 1074 1074 If SizeOfBuffer is NULL, then ASSERT(). 1075 1075 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1076 1076 1077 @param[in] PatchVariable A pointer to the global variable in a module that is 1077 @param[in] PatchVariable A pointer to the global variable in a module that is 1078 1078 the target of the set operation. 1079 1079 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 1080 1080 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 1081 1081 @param[in] Buffer A pointer to the buffer to used to set the target variable. 1082 1082 1083 1083 @return Return the pointer to the buffer been set. 1084 1084 … … 1095 1095 ASSERT (PatchVariable != NULL); 1096 1096 ASSERT (SizeOfBuffer != NULL); 1097 1097 1098 1098 if (*SizeOfBuffer > 0) { 1099 1099 ASSERT (Buffer != NULL); … … 1105 1105 return NULL; 1106 1106 } 1107 1107 1108 1108 CopyMem (PatchVariable, Buffer, *SizeOfBuffer); 1109 1109 1110 1110 return (VOID *) Buffer; 1111 1111 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxePcdLib/DxePcdLib.inf
r58459 r58466 6 6 # It is EDKII implementation which support Dynamic/DynamicEx Pcds. 7 7 # 2) EFI_PCD_PROTOCOL 8 # It is defined by PI specification 1.2, Vol 3 which only support dynamicEx 8 # It is defined by PI specification 1.2, Vol 3 which only support dynamicEx 9 9 # type Pcd. 10 10 # … … 14 14 # EFI_PCD_PROTOCOL to handle dynamicEx type PCD. 15 15 # 16 # Note: A driver of type DXE_RUNTIME_DRIVER and DXE_SMM_DRIVER can only use this DxePcdLib 17 # in their initialization without any issues to access Dynamic and DynamicEx PCD. They can't 16 # Note: A driver of type DXE_RUNTIME_DRIVER and DXE_SMM_DRIVER can only use this DxePcdLib 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 aviable in OS runtime phase. 19 # Because EFI_PCD_PROTOCOL is DXE protocol that is not aviable in OS runtime phase. 20 20 # 21 21 # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> … … 38 38 MODULE_TYPE = DXE_DRIVER 39 39 VERSION_STRING = 1.0 40 LIBRARY_CLASS = PcdLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER SMM_CORE UEFI_APPLICATION UEFI_DRIVER 40 LIBRARY_CLASS = PcdLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER SMM_CORE UEFI_APPLICATION UEFI_DRIVER 41 41 42 42 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeRuntimeExtendedSalLib/DxeRuntimeExtendedSalLib.inf
r58459 r58466 20 20 MODULE_TYPE = DXE_RUNTIME_DRIVER 21 21 VERSION_STRING = 1.0 22 LIBRARY_CLASS = ExtendedSalLib|DXE_RUNTIME_DRIVER DXE_SAL_DRIVER 22 LIBRARY_CLASS = ExtendedSalLib|DXE_RUNTIME_DRIVER DXE_SAL_DRIVER 23 23 CONSTRUCTOR = DxeRuntimeExtendedSalLibConstruct 24 24 DESTRUCTOR = DxeRuntimeExtendedSalLibDeconstruct -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeRuntimeExtendedSalLib/ExtendedSalLib.c
r48674 r58466 159 159 Constructor function to initializes physical plabel of ESAL entrypoint and register an event 160 160 for initialization of virtual plabel of ESAL entrypoint. 161 161 162 162 This is the library constructor function to call a function to initialize physical plabel of ESAL entrypoint 163 and to register notification function for 163 and to register notification function for 164 164 EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, which sets virtual plabel of ESAL entrypoint. 165 165 … … 201 201 202 202 /** 203 Destructor function to close the event created by the library constructor 204 205 This is the library destructor function to close the event with type of 203 Destructor function to close the event created by the library constructor 204 205 This is the library destructor function to close the event with type of 206 206 EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, which is created by the library constructor. 207 207 … … 233 233 /** 234 234 Registers function of ESAL class and it's associated global. 235 235 236 236 This function registers function of ESAL class, together with its associated global. 237 237 It is worker function for RegisterEsalClass(). … … 268 268 /** 269 269 Registers ESAL Class and it's associated global. 270 270 271 271 This function registers one or more Extended SAL services in a given 272 272 class along with the associated global context. … … 281 281 @retval EFI_UNSUPPORTED This function was called after ExitBootServices(). 282 282 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register one or more of the specified services. 283 @retval Other ClassGuid could not be installed onto a new handle. 283 @retval Other ClassGuid could not be installed onto a new handle. 284 284 285 285 **/ … … 339 339 /** 340 340 Calls an Extended SAL Class service that was previously registered with RegisterEsalClass(). 341 341 342 342 This function gets the entrypoint of Extended SAL, and calls an Extended SAL Class service 343 343 that was previously registered with RegisterEsalClass() through this entrypoint. … … 353 353 @param Arg7 Argument 7 ClassGuid/FunctionId defined 354 354 @param Arg8 Argument 8 ClassGuid/FunctionId defined 355 355 356 356 @retval EFI_SAL_SUCCESS ESAL procedure successfully called. 357 357 @retval EFI_SAL_ERROR The address of ExtendedSalProc() can not be correctly 358 358 initialized. 359 359 @retval Other Status returned from ExtendedSalProc() service of 360 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL. 360 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL. 361 361 362 362 **/ … … 422 422 /** 423 423 Wrapper for the EsalStallFunctionId service of Extended SAL Stall Services Class. 424 424 425 425 This function is a wrapper for the EsalStallFunctionId service of Extended SAL 426 426 Stall Services Class. See EsalStallFunctionId of Extended SAL Specification. … … 440 440 { 441 441 return EsalCall ( 442 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO, 443 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI, 444 StallFunctionId, 445 Microseconds, 446 0, 447 0, 448 0, 449 0, 450 0, 442 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO, 443 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI, 444 StallFunctionId, 445 Microseconds, 446 0, 447 0, 448 0, 449 0, 450 0, 451 451 0 452 452 ); … … 455 455 /** 456 456 Wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class. 457 457 458 458 This function is a wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL 459 459 PAL Services Services Class. See EsalSetNewPalEntryFunctionId of Extended SAL Specification. … … 477 477 { 478 478 return EsalCall ( 479 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO, 479 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO, 480 480 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI, 481 SetNewPalEntryFunctionId, 482 PhysicalAddress, 483 PalEntryPoint, 484 0, 485 0, 486 0, 487 0, 481 SetNewPalEntryFunctionId, 482 PhysicalAddress, 483 PalEntryPoint, 484 0, 485 0, 486 0, 487 0, 488 488 0 489 489 ); … … 492 492 /** 493 493 Wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class. 494 494 495 495 This function is a wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL 496 496 PAL Services Services Class. See EsalGetNewPalEntryFunctionId of Extended SAL Specification. … … 516 516 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO, 517 517 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI, 518 GetNewPalEntryFunctionId, 519 PhysicalAddress, 520 0, 521 0, 522 0, 523 0, 524 0, 518 GetNewPalEntryFunctionId, 519 PhysicalAddress, 520 0, 521 0, 522 0, 523 0, 524 0, 525 525 0 526 526 ); … … 529 529 /** 530 530 Wrapper for the EsalGetStateBufferFunctionId service of Extended SAL MCA Log Services Class. 531 531 532 532 This function is a wrapper for the EsalGetStateBufferFunctionId service of Extended SAL 533 533 MCA Log Services Class. See EsalGetStateBufferFunctionId of Extended SAL Specification. … … 558 558 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO, 559 559 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI, 560 EsalGetStateBufferFunctionId, 561 McaType, 562 0, 563 0, 564 0, 565 0, 566 0, 560 EsalGetStateBufferFunctionId, 561 McaType, 562 0, 563 0, 564 0, 565 0, 566 0, 567 567 0 568 568 ); … … 576 576 /** 577 577 Wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL MCA Log Services Class. 578 578 579 579 This function is a wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL 580 580 MCA Log Services Class. See EsalSaveStateBufferFunctionId of Extended SAL Specification. 581 581 582 582 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO. 583 583 … … 594 594 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO, 595 595 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI, 596 EsalSaveStateBufferFunctionId, 597 McaType, 598 0, 599 0, 600 0, 601 0, 602 0, 596 EsalSaveStateBufferFunctionId, 597 McaType, 598 0, 599 0, 600 0, 601 0, 602 0, 603 603 0 604 604 ); … … 607 607 /** 608 608 Wrapper for the EsalGetVectorsFunctionId service of Extended SAL Base Services Class. 609 609 610 610 This function is a wrapper for the EsalGetVectorsFunctionId service of Extended SAL 611 611 Base Services Class. See EsalGetVectorsFunctionId of Extended SAL Specification. … … 629 629 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 630 630 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 631 EsalGetVectorsFunctionId, 632 VectorType, 633 0, 634 0, 635 0, 636 0, 637 0, 631 EsalGetVectorsFunctionId, 632 VectorType, 633 0, 634 0, 635 0, 636 0, 637 0, 638 638 0 639 639 ); … … 642 642 /** 643 643 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class. 644 644 645 645 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL 646 646 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification. … … 666 666 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 667 667 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 668 EsalMcGetParamsFunctionId, 669 ParamInfoType, 670 0, 671 0, 672 0, 673 0, 674 0, 668 EsalMcGetParamsFunctionId, 669 ParamInfoType, 670 0, 671 0, 672 0, 673 0, 674 0, 675 675 0 676 676 ); … … 679 679 /** 680 680 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class. 681 681 682 682 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL 683 683 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification. 684 684 685 685 @retval EFI_SAL_SUCCESS Call completed without error. 686 686 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered … … 697 697 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 698 698 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 699 EsalMcGetMcParamsFunctionId, 700 0, 701 0, 702 0, 703 0, 704 0, 705 0, 699 EsalMcGetMcParamsFunctionId, 700 0, 701 0, 702 0, 703 0, 704 0, 705 0, 706 706 0 707 707 ); … … 710 710 /** 711 711 Wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL Base Services Class. 712 712 713 713 This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL 714 714 Base Services Class. See EsalGetMcCheckinFlagsFunctionId of Extended SAL Specification. … … 728 728 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 729 729 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 730 EsalGetMcCheckinFlagsFunctionId, 731 CpuIndex, 732 0, 733 0, 734 0, 735 0, 736 0, 730 EsalGetMcCheckinFlagsFunctionId, 731 CpuIndex, 732 0, 733 0, 734 0, 735 0, 736 0, 737 737 0 738 738 ); … … 741 741 /** 742 742 Wrapper for the EsalAddCpuDataFunctionId service of Extended SAL MP Services Class. 743 743 744 744 This function is a wrapper for the EsalAddCpuDataFunctionId service of Extended SAL 745 745 MP Services Class. See EsalAddCpuDataFunctionId of Extended SAL Specification. … … 766 766 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 767 767 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 768 AddCpuDataFunctionId, 769 CpuGlobalId, 770 Enabled, 771 PalCompatibility, 772 0, 773 0, 774 0, 768 AddCpuDataFunctionId, 769 CpuGlobalId, 770 Enabled, 771 PalCompatibility, 772 0, 773 0, 774 0, 775 775 0 776 776 ); … … 779 779 /** 780 780 Wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL MP Services Class. 781 781 782 782 This function is a wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL 783 783 MP Services Class. See EsalRemoveCpuDataFunctionId of Extended SAL Specification. … … 798 798 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 799 799 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 800 RemoveCpuDataFunctionId, 801 CpuGlobalId, 802 0, 803 0, 804 0, 805 0, 806 0, 800 RemoveCpuDataFunctionId, 801 CpuGlobalId, 802 0, 803 0, 804 0, 805 0, 806 0, 807 807 0 808 808 ); … … 811 811 /** 812 812 Wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL MP Services Class. 813 813 814 814 This function is a wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL 815 815 MP Services Class. See EsalModifyCpuDataFunctionId of Extended SAL Specification. … … 836 836 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 837 837 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 838 ModifyCpuDataFunctionId, 839 CpuGlobalId, 840 Enabled, 841 PalCompatibility, 842 0, 843 0, 844 0, 838 ModifyCpuDataFunctionId, 839 CpuGlobalId, 840 Enabled, 841 PalCompatibility, 842 0, 843 0, 844 0, 845 845 0 846 846 ); … … 849 849 /** 850 850 Wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL MP Services Class. 851 851 852 852 This function is a wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL 853 853 MP Services Class. See EsalGetCpuDataByIdFunctionId of Extended SAL Specification. … … 871 871 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 872 872 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 873 GetCpuDataByIDFunctionId, 874 CpuGlobalId, 875 IndexByEnabledCpu, 876 0, 877 0, 878 0, 879 0, 873 GetCpuDataByIDFunctionId, 874 CpuGlobalId, 875 IndexByEnabledCpu, 876 0, 877 0, 878 0, 879 0, 880 880 0 881 881 ); … … 884 884 /** 885 885 Wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL MP Services Class. 886 886 887 887 This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL 888 888 MP Services Class. See EsalGetCpuDataByIndexFunctionId of Extended SAL Specification. … … 906 906 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 907 907 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 908 GetCpuDataByIndexFunctionId, 909 Index, 910 IndexByEnabledCpu, 911 0, 912 0, 913 0, 914 0, 908 GetCpuDataByIndexFunctionId, 909 Index, 910 IndexByEnabledCpu, 911 0, 912 0, 913 0, 914 0, 915 915 0 916 916 ); … … 919 919 /** 920 920 Wrapper for the EsalWhoAmIFunctionId service of Extended SAL MP Services Class. 921 921 922 922 This function is a wrapper for the EsalWhoAmIFunctionId service of Extended SAL 923 923 MP Services Class. See EsalWhoAmIFunctionId of Extended SAL Specification. … … 939 939 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 940 940 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 941 CurrentProcInfoFunctionId, 942 IndexByEnabledCpu, 943 0, 944 0, 945 0, 946 0, 947 0, 941 CurrentProcInfoFunctionId, 942 IndexByEnabledCpu, 943 0, 944 0, 945 0, 946 0, 947 0, 948 948 0 949 949 ); … … 952 952 /** 953 953 Wrapper for the EsalNumProcessors service of Extended SAL MP Services Class. 954 954 955 955 This function is a wrapper for the EsalNumProcessors service of Extended SAL 956 956 MP Services Class. See EsalNumProcessors of Extended SAL Specification. … … 969 969 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 970 970 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 971 NumProcessorsFunctionId, 972 0, 973 0, 974 0, 975 0, 976 0, 977 0, 971 NumProcessorsFunctionId, 972 0, 973 0, 974 0, 975 0, 976 0, 977 0, 978 978 0 979 979 ); … … 982 982 /** 983 983 Wrapper for the EsalSetMinStateFnctionId service of Extended SAL MP Services Class. 984 984 985 985 This function is a wrapper for the EsalSetMinStateFnctionId service of Extended SAL 986 986 MP Services Class. See EsalSetMinStateFnctionId of Extended SAL Specification. … … 1004 1004 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 1005 1005 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 1006 SetMinStateFunctionId, 1007 CpuGlobalId, 1008 MinStatePointer, 1009 0, 1010 0, 1011 0, 1012 0, 1006 SetMinStateFunctionId, 1007 CpuGlobalId, 1008 MinStatePointer, 1009 0, 1010 0, 1011 0, 1012 0, 1013 1013 0 1014 1014 ); … … 1017 1017 /** 1018 1018 Wrapper for the EsalGetMinStateFunctionId service of Extended SAL MP Services Class. 1019 1019 1020 1020 This function is a wrapper for the EsalGetMinStateFunctionId service of Extended SAL 1021 1021 MP Services Class. See EsalGetMinStateFunctionId of Extended SAL Specification. … … 1036 1036 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO, 1037 1037 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI, 1038 GetMinStateFunctionId, 1039 CpuGlobalId, 1040 0, 1041 0, 1042 0, 1043 0, 1044 0, 1038 GetMinStateFunctionId, 1039 CpuGlobalId, 1040 0, 1041 0, 1042 0, 1043 0, 1044 0, 1045 1045 0 1046 1046 ); … … 1049 1049 /** 1050 1050 Wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL MCA Services Class. 1051 1051 1052 1052 This function is a wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL 1053 1053 MCA Services Class. See EsalMcsGetStateInfoFunctionId of Extended SAL Specification. … … 1074 1074 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO, 1075 1075 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI, 1076 McaGetStateInfoFunctionId, 1077 CpuGlobalId, 1078 0, 1079 0, 1080 0, 1081 0, 1082 0, 1076 McaGetStateInfoFunctionId, 1077 CpuGlobalId, 1078 0, 1079 0, 1080 0, 1081 0, 1082 0, 1083 1083 0 1084 1084 ); … … 1092 1092 /** 1093 1093 Wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL MCA Services Class. 1094 1094 1095 1095 This function is a wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL 1096 1096 MCA Services Class. See EsalMcaRegisterCpuFunctionId of Extended SAL Specification. … … 1113 1113 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO, 1114 1114 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI, 1115 McaRegisterCpuFunctionId, 1116 CpuGlobalId, 1117 StateBufferPointer, 1118 0, 1119 0, 1120 0, 1121 0, 1122 0 1123 ); 1124 } 1115 McaRegisterCpuFunctionId, 1116 CpuGlobalId, 1117 StateBufferPointer, 1118 0, 1119 0, 1120 0, 1121 0, 1122 0 1123 ); 1124 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeRuntimeExtendedSalLib/Ipf/AsmExtendedSalLib.s
r48674 r58466 36 36 // r10 = Virtual Plabel 37 37 // r11 = psr 38 // 39 // As per static calling conventions. 40 // 38 // 39 // As per static calling conventions. 40 // 41 41 //-- 42 42 //--------------------------------------------------------------------------- … … 67 67 // in1 = Physical GP 68 68 // 69 // Return Value: 69 // Return Value: 70 70 // r8 = EFI_SAL_SUCCESS 71 // 72 // As per static calling conventions. 73 // 71 // 72 // As per static calling conventions. 73 // 74 74 //-- 75 75 //--------------------------------------------------------------------------- … … 100 100 // in1 = Virtual GP 101 101 // 102 // Return Value: 102 // Return Value: 103 103 // r8 = EFI_SAL_ERROR 104 // 105 // As per static calling conventions. 106 // 104 // 105 // As per static calling conventions. 106 // 107 107 //-- 108 108 //--------------------------------------------------------------------------- … … 125 125 126 126 .align 32 127 EsalEntryPoint: 127 EsalEntryPoint: 128 128 data8 0 // Physical Entry 129 129 data8 0 // GP -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib.inf
r58459 r58466 1 1 ## @file 2 # Instance of PCI Express Library using the 256 MB PCI Express MMIO window that 2 # Instance of PCI Express Library using the 256 MB PCI Express MMIO window that 3 3 # is safe for runtime use. 4 4 # 5 5 # PCI Express Library that uses the 256 MB PCI Express MMIO window to perform 6 # PCI Configuration cycles. Layers on top of an I/O Library instance. A table of 7 # PCI devices that are registered for for runtime access is maintained so the 6 # PCI Configuration cycles. Layers on top of an I/O Library instance. A table of 7 # PCI devices that are registered for for runtime access is maintained so the 8 8 # proper virtual address is used to perform the PCI Express Configuration cycle. 9 9 # … … 27 27 MODULE_TYPE = DXE_RUNTIME_DRIVER 28 28 VERSION_STRING = 1.0 29 LIBRARY_CLASS = PciExpressLib|DXE_RUNTIME_DRIVER 29 LIBRARY_CLASS = PciExpressLib|DXE_RUNTIME_DRIVER 30 30 CONSTRUCTOR = DxeRuntimePciExpressLibConstructor 31 31 DESTRUCTOR = DxeRuntimePciExpressLibDestructor -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c
r58459 r58466 104 104 105 105 /** 106 The constructor function caches the PCI Express Base Address and creates a 106 The constructor function caches the PCI Express Base Address and creates a 107 107 Set Virtual Address Map event to convert physical address to virtual addresses. 108 108 109 109 @param ImageHandle The firmware allocated handle for the EFI image. 110 110 @param SystemTable A pointer to the EFI System Table. 111 111 112 112 @retval EFI_SUCCESS The constructor completed successfully. 113 113 @retval Other value The constructor did not complete successfully. … … 145 145 146 146 /** 147 The destructor function frees any allocated buffers and closes the Set Virtual 147 The destructor function frees any allocated buffers and closes the Set Virtual 148 148 Address Map event. 149 149 150 150 @param ImageHandle The firmware allocated handle for the EFI image. 151 151 @param SystemTable A pointer to the EFI System Table. 152 152 153 153 @retval EFI_SUCCESS The destructor completed successfully. 154 154 @retval Other value The destructor did not complete successfully. … … 165 165 166 166 // 167 // If one or more PCI devices have been registered for runtime access, then 167 // If one or more PCI devices have been registered for runtime access, then 168 168 // free the registration table. 169 169 // … … 183 183 /** 184 184 Gets the base address of PCI Express. 185 185 186 186 This internal functions retrieves PCI Express Base Address via a PCD entry 187 187 PcdPciExpressBaseAddress. 188 188 189 189 @param Address The address that encodes the PCI Bus, Device, Function and Register. 190 190 @return The base address of PCI Express. … … 248 248 249 249 // 250 // Return the physical address 250 // Return the physical address 251 251 // 252 252 return Address; … … 254 254 255 255 /** 256 Registers a PCI device so PCI configuration registers may be accessed after 256 Registers a PCI device so PCI configuration registers may be accessed after 257 257 SetVirtualAddressMap(). 258 259 Registers the PCI device specified by Address so all the PCI configuration 260 registers associated with that PCI device may be accessed after SetVirtualAddressMap() 258 259 Registers the PCI device specified by Address so all the PCI configuration 260 registers associated with that PCI device may be accessed after SetVirtualAddressMap() 261 261 is called. 262 262 263 263 If Address > 0x0FFFFFFF, then ASSERT(). 264 264 265 265 @param Address The address that encodes the PCI Bus, Device, Function and 266 266 Register. 267 267 268 268 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 269 @retval RETURN_UNSUPPORTED An attempt was made to call this function 269 @retval RETURN_UNSUPPORTED An attempt was made to call this function 270 270 after ExitBootServices(). 271 271 @retval RETURN_UNSUPPORTED The resources required to access the PCI device … … 335 335 // 336 336 NewTable = ReallocateRuntimePool ( 337 (mDxeRuntimePciExpressLibNumberOfRuntimeRanges + 0) * sizeof (PCI_EXPRESS_RUNTIME_REGISTRATION_TABLE), 338 (mDxeRuntimePciExpressLibNumberOfRuntimeRanges + 1) * sizeof (PCI_EXPRESS_RUNTIME_REGISTRATION_TABLE), 337 (mDxeRuntimePciExpressLibNumberOfRuntimeRanges + 0) * sizeof (PCI_EXPRESS_RUNTIME_REGISTRATION_TABLE), 338 (mDxeRuntimePciExpressLibNumberOfRuntimeRanges + 1) * sizeof (PCI_EXPRESS_RUNTIME_REGISTRATION_TABLE), 339 339 mDxeRuntimePciExpressLibRegistrationTable 340 340 ); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeSalLibEsal/DxeSalLibEsal.c
r48674 r58466 22 22 /** 23 23 Makes a SAL procedure call. 24 25 This is a wrapper function to make a SAL procedure call. 24 25 This is a wrapper function to make a SAL procedure call. 26 26 No parameter checking is performed on the 8 input parameters, 27 27 but there are some common rules that the caller should follow … … 60 60 { 61 61 SAL_RETURN_REGS Regs; 62 62 63 63 // 64 64 // Initial all members in this structure. … … 74 74 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 75 75 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 76 SalSetVectorsFunctionId, 77 Arg2, 78 Arg3, 79 Arg4, 80 Arg5, 81 Arg6, 82 Arg7, 76 SalSetVectorsFunctionId, 77 Arg2, 78 Arg3, 79 Arg4, 80 Arg5, 81 Arg6, 82 Arg7, 83 83 Arg8 84 84 ); … … 89 89 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO, 90 90 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI, 91 SalGetStateInfoFunctionId, 92 Arg2, 93 Arg3, 94 Arg4, 95 Arg5, 96 Arg6, 97 Arg7, 91 SalGetStateInfoFunctionId, 92 Arg2, 93 Arg3, 94 Arg4, 95 Arg5, 96 Arg6, 97 Arg7, 98 98 Arg8 99 99 ); … … 104 104 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO, 105 105 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI, 106 SalGetStateInfoSizeFunctionId, 107 Arg2, 108 Arg3, 109 Arg4, 110 Arg5, 111 Arg6, 112 Arg7, 106 SalGetStateInfoSizeFunctionId, 107 Arg2, 108 Arg3, 109 Arg4, 110 Arg5, 111 Arg6, 112 Arg7, 113 113 Arg8 114 114 ); … … 119 119 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO, 120 120 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI, 121 SalClearStateInfoFunctionId, 122 Arg2, 123 Arg3, 124 Arg4, 125 Arg5, 126 Arg6, 127 Arg7, 121 SalClearStateInfoFunctionId, 122 Arg2, 123 Arg3, 124 Arg4, 125 Arg5, 126 Arg6, 127 Arg7, 128 128 Arg8 129 129 ); … … 134 134 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 135 135 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 136 SalMcRendezFunctionId, 137 Arg2, 138 Arg3, 139 Arg4, 140 Arg5, 141 Arg6, 142 Arg7, 136 SalMcRendezFunctionId, 137 Arg2, 138 Arg3, 139 Arg4, 140 Arg5, 141 Arg6, 142 Arg7, 143 143 Arg8 144 144 ); … … 149 149 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 150 150 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 151 SalMcSetParamsFunctionId, 152 Arg2, 153 Arg3, 154 Arg4, 155 Arg5, 156 Arg6, 157 Arg7, 151 SalMcSetParamsFunctionId, 152 Arg2, 153 Arg3, 154 Arg4, 155 Arg5, 156 Arg6, 157 Arg7, 158 158 Arg8 159 159 ); … … 164 164 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 165 165 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 166 EsalRegisterPhysicalAddrFunctionId, 167 Arg2, 168 Arg3, 169 Arg4, 170 Arg5, 171 Arg6, 172 Arg7, 166 EsalRegisterPhysicalAddrFunctionId, 167 Arg2, 168 Arg3, 169 Arg4, 170 Arg5, 171 Arg6, 172 Arg7, 173 173 Arg8 174 174 ); … … 179 179 EFI_EXTENDED_SAL_CACHE_SERVICES_PROTOCOL_GUID_LO, 180 180 EFI_EXTENDED_SAL_CACHE_SERVICES_PROTOCOL_GUID_HI, 181 SalCacheFlushFunctionId, 182 Arg2, 183 Arg3, 184 Arg4, 185 Arg5, 186 Arg6, 187 Arg7, 181 SalCacheFlushFunctionId, 182 Arg2, 183 Arg3, 184 Arg4, 185 Arg5, 186 Arg6, 187 Arg7, 188 188 Arg8 189 189 ); … … 194 194 EFI_EXTENDED_SAL_CACHE_SERVICES_PROTOCOL_GUID_LO, 195 195 EFI_EXTENDED_SAL_CACHE_SERVICES_PROTOCOL_GUID_HI, 196 SalCacheInitFunctionId, 197 Arg2, 198 Arg3, 199 Arg4, 200 Arg5, 201 Arg6, 202 Arg7, 196 SalCacheInitFunctionId, 197 Arg2, 198 Arg3, 199 Arg4, 200 Arg5, 201 Arg6, 202 Arg7, 203 203 Arg8 204 204 ); … … 209 209 EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID_LO, 210 210 EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID_HI, 211 SalPciConfigReadFunctionId, 212 Arg2, 213 Arg3, 214 Arg4, 215 Arg5, 216 Arg6, 217 Arg7, 211 SalPciConfigReadFunctionId, 212 Arg2, 213 Arg3, 214 Arg4, 215 Arg5, 216 Arg6, 217 Arg7, 218 218 Arg8 219 219 ); … … 224 224 EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID_LO, 225 225 EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID_HI, 226 SalPciConfigWriteFunctionId, 227 Arg2, 228 Arg3, 229 Arg4, 230 Arg5, 231 Arg6, 232 Arg7, 226 SalPciConfigWriteFunctionId, 227 Arg2, 228 Arg3, 229 Arg4, 230 Arg5, 231 Arg6, 232 Arg7, 233 233 Arg8 234 234 ); … … 239 239 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 240 240 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 241 EsalGetPlatformBaseFreqFunctionId, 242 Arg2, 243 Arg3, 244 Arg4, 245 Arg5, 246 Arg6, 247 Arg7, 241 EsalGetPlatformBaseFreqFunctionId, 242 Arg2, 243 Arg3, 244 Arg4, 245 Arg5, 246 Arg6, 247 Arg7, 248 248 Arg8 249 249 ); … … 254 254 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO, 255 255 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI, 256 EsalPhysicalIdInfoFunctionId, 257 Arg2, 258 Arg3, 259 Arg4, 260 Arg5, 261 Arg6, 262 Arg7, 256 EsalPhysicalIdInfoFunctionId, 257 Arg2, 258 Arg3, 259 Arg4, 260 Arg5, 261 Arg6, 262 Arg7, 263 263 Arg8 264 264 ); … … 269 269 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO, 270 270 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI, 271 EsalUpdatePalFunctionId, 272 Arg2, 273 Arg3, 274 Arg4, 275 Arg5, 276 Arg6, 277 Arg7, 271 EsalUpdatePalFunctionId, 272 Arg2, 273 Arg3, 274 Arg4, 275 Arg5, 276 Arg6, 277 Arg7, 278 278 Arg8 279 279 ); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeSalLibEsal/DxeSalLibEsal.inf
r58459 r58466 20 20 MODULE_TYPE = DXE_DRIVER 21 21 VERSION_STRING = 1.0 22 LIBRARY_CLASS = SalLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION 22 LIBRARY_CLASS = SalLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION 23 23 24 24 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeServicesLib/DxeServicesLib.c
r58459 r58466 1 1 /** @file 2 MDE DXE Services Library provides functions that simplify the development of DXE Drivers. 2 MDE DXE Services Library provides functions that simplify the development of DXE Drivers. 3 3 These functions help access data from sections of FFS files or from file path. 4 4 … … 30 30 /** 31 31 Identify the device handle from which the Image is loaded from. As this device handle is passed to 32 GetSectionFromFv as the identifier for a Firmware Volume, an EFI_FIRMWARE_VOLUME2_PROTOCOL 32 GetSectionFromFv as the identifier for a Firmware Volume, an EFI_FIRMWARE_VOLUME2_PROTOCOL 33 33 protocol instance should be located succesfully by calling gBS->HandleProtocol (). 34 34 35 35 This function locates the EFI_LOADED_IMAGE_PROTOCOL instance installed 36 36 on ImageHandle. It then returns EFI_LOADED_IMAGE_PROTOCOL.DeviceHandle. 37 37 38 38 If ImageHandle is NULL, then ASSERT (); 39 39 If failed to locate a EFI_LOADED_IMAGE_PROTOCOL on ImageHandle, then ASSERT (); 40 40 41 41 @param ImageHandle The firmware allocated handle for UEFI image. 42 42 … … 51 51 EFI_STATUS Status; 52 52 EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; 53 53 54 54 ASSERT (ImageHandle != NULL); 55 55 … … 67 67 68 68 /** 69 Allocate and fill a buffer from a Firmware Section identified by a Firmware File GUID name, a Firmware 69 Allocate and fill a buffer from a Firmware Section identified by a Firmware File GUID name, a Firmware 70 70 Section type and instance number from the specified Firmware Volume. 71 71 72 This functions first locate the EFI_FIRMWARE_VOLUME2_PROTOCOL protocol instance on FvHandle in order to 73 carry out the Firmware Volume read operation. The function then reads the Firmware Section found sepcifed 74 by NameGuid, SectionType and SectionInstance. 75 76 The details of this search order is defined in description of EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection () 72 This functions first locate the EFI_FIRMWARE_VOLUME2_PROTOCOL protocol instance on FvHandle in order to 73 carry out the Firmware Volume read operation. The function then reads the Firmware Section found sepcifed 74 by NameGuid, SectionType and SectionInstance. 75 76 The details of this search order is defined in description of EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection () 77 77 found in PI Specification. 78 79 If SectionType is EFI_SECTION_TE, EFI_SECTION_TE is used as section type to start the search. If EFI_SECTION_TE section 80 is not found, EFI_SECTION_PE32 will be used to try the search again. If no EFI_SECTION_PE32 section is found, EFI_NOT_FOUND 78 79 If SectionType is EFI_SECTION_TE, EFI_SECTION_TE is used as section type to start the search. If EFI_SECTION_TE section 80 is not found, EFI_SECTION_PE32 will be used to try the search again. If no EFI_SECTION_PE32 section is found, EFI_NOT_FOUND 81 81 is returned. 82 83 The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated 82 83 The data and size is returned by Buffer and Size. The caller is responsible to free the Buffer allocated 84 84 by this function. This function can be only called at TPL_NOTIFY and below. 85 85 86 86 If FvHandle is NULL, then ASSERT (); 87 87 If NameGuid is NULL, then ASSERT(); … … 89 89 If Size is NULL, then ASSERT(). 90 90 91 @param FvHandle The device handle that contains a instance of 91 @param FvHandle The device handle that contains a instance of 92 92 EFI_FIRMWARE_VOLUME2_PROTOCOL instance. 93 93 @param NameGuid The GUID name of a Firmware File. 94 94 @param SectionType The Firmware Section type. 95 @param SectionInstance The instance number of Firmware Section to 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 the data read 97 @param Buffer On output, Buffer contains the the data read 98 98 from the section in the Firmware File found. 99 99 @param Size On output, the size of Buffer. 100 100 101 101 @retval EFI_SUCCESS The image is found and data and size is returned. 102 @retval EFI_NOT_FOUND The image specified by NameGuid and SectionType 102 @retval EFI_NOT_FOUND The image specified by NameGuid and SectionType 103 103 can't be found. 104 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the 104 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the 105 105 output data buffer or complete the operations. 106 @retval EFI_DEVICE_ERROR A hardware error occurs during reading from the 106 @retval EFI_DEVICE_ERROR A hardware error occurs during reading from the 107 107 Firmware Volume. 108 @retval EFI_ACCESS_DENIED The firmware volume containing the searched 108 @retval EFI_ACCESS_DENIED The firmware volume containing the searched 109 109 Firmware File is configured to disallow reads. 110 110 111 111 **/ 112 112 EFI_STATUS … … 127 127 ASSERT (Buffer != NULL); 128 128 ASSERT (Size != NULL); 129 129 130 130 ASSERT (FvHandle != NULL); 131 131 … … 156 156 if (EFI_ERROR (Status) && (SectionType == EFI_SECTION_TE)) { 157 157 // 158 // Try reading PE32 section, if the required section is TE type 158 // Try reading PE32 section, if the required section is TE type 159 159 // 160 160 *Buffer = NULL; … … 175 175 176 176 /** 177 Searches all the available firmware volumes and returns the first matching FFS section. 177 Searches all the available firmware volumes and returns the first matching FFS section. 178 178 179 179 This function searches all the firmware volumes for FFS files with FV file type specified by FileType 180 The order that the firmware volumes is searched is not deterministic. For each available FV a search 181 is made for FFS file of type FileType. If the FV contains more than one FFS file with the same FileType, 182 the FileInstance instance will be the matched FFS file. For each FFS file found a search 183 is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance instances 184 of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer. 185 Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size. 186 It is the caller's responsibility to use FreePool() to free the allocated buffer. 187 See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections 180 The order that the firmware volumes is searched is not deterministic. For each available FV a search 181 is made for FFS file of type FileType. If the FV contains more than one FFS file with the same FileType, 182 the FileInstance instance will be the matched FFS file. For each FFS file found a search 183 is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance instances 184 of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer. 185 Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size. 186 It is the caller's responsibility to use FreePool() to free the allocated buffer. 187 See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections 188 188 are retrieved from an FFS file based on SectionType and SectionInstance. 189 189 190 If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, 190 If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, 191 191 the search will be retried with a section type of EFI_SECTION_PE32. 192 192 This function must be called with a TPL <= TPL_NOTIFY. … … 195 195 If Size is NULL, then ASSERT(). 196 196 197 @param FileType Indicates the FV file type to search for within all 197 @param FileType Indicates the FV file type to search for within all 198 198 available FVs. 199 @param FileInstance Indicates which file instance within all available 199 @param FileInstance Indicates which file instance within all available 200 200 FVs specified by FileType. 201 201 FileInstance starts from zero. 202 @param SectionType Indicates the FFS section type to search for 203 within the FFS file 202 @param SectionType Indicates the FFS section type to search for 203 within the FFS file 204 204 specified by FileType with FileInstance. 205 @param SectionInstance Indicates which section instance within the FFS file 206 specified by FileType with FileInstance to retrieve. 205 @param SectionInstance Indicates which section instance within the FFS file 206 specified by FileType with FileInstance to retrieve. 207 207 SectionInstance starts from zero. 208 @param Buffer On output, a pointer to a callee allocated buffer 208 @param Buffer On output, a pointer to a callee allocated buffer 209 209 containing the FFS file section that was found. 210 Is it the caller's responsibility to free this 210 Is it the caller's responsibility to free this 211 211 buffer using FreePool(). 212 212 @param Size On output, a pointer to the size, in bytes, of Buffer. … … 214 214 @retval EFI_SUCCESS The specified FFS section was returned. 215 215 @retval EFI_NOT_FOUND The specified FFS section could not be found. 216 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve 216 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve 217 217 the matching FFS section. 218 @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a 218 @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a 219 219 device error. 220 @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because 221 the firmware volume that 220 @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because 221 the firmware volume that 222 222 contains the matching FFS section does not allow reads. 223 223 **/ … … 290 290 if (IndexFile == 0) { 291 291 Status = InternalGetSectionFromFv ( 292 HandleBuffer[IndexFv], 292 HandleBuffer[IndexFv], 293 293 &NameGuid, 294 294 SectionType, … … 305 305 306 306 // 307 // The required FFS section file is not found. 307 // The required FFS section file is not found. 308 308 // 309 309 if (IndexFv == HandleCount) { … … 312 312 313 313 Done: 314 if (HandleBuffer != NULL) { 314 if (HandleBuffer != NULL) { 315 315 FreePool(HandleBuffer); 316 316 } … … 320 320 321 321 /** 322 Searches all the availables firmware volumes and returns the first matching FFS section. 323 324 This function searches all the firmware volumes for FFS files with an FFS filename specified by NameGuid. 325 The order that the firmware volumes is searched is not deterministic. For each FFS file found a search 326 is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance instances 327 of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer. 328 Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size. 329 It is the caller's responsibility to use FreePool() to free the allocated buffer. 330 See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections 322 Searches all the availables firmware volumes and returns the first matching FFS section. 323 324 This function searches all the firmware volumes for FFS files with an FFS filename specified by NameGuid. 325 The order that the firmware volumes is searched is not deterministic. For each FFS file found a search 326 is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance instances 327 of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer. 328 Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size. 329 It is the caller's responsibility to use FreePool() to free the allocated buffer. 330 See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections 331 331 are retrieved from an FFS file based on SectionType and SectionInstance. 332 332 333 If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, 333 If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, 334 334 the search will be retried with a section type of EFI_SECTION_PE32. 335 335 This function must be called with a TPL <= TPL_NOTIFY. … … 340 340 341 341 342 @param NameGuid A pointer to to the FFS filename GUID to search for 343 within any of the firmware volumes in the platform. 344 @param SectionType Indicates the FFS section type to search for within 342 @param NameGuid A pointer to to the FFS filename GUID to search for 343 within any of the firmware volumes in the platform. 344 @param SectionType Indicates the FFS section type to search for within 345 345 the FFS file specified by NameGuid. 346 @param SectionInstance Indicates which section instance within the FFS file 346 @param SectionInstance Indicates which section instance within the FFS file 347 347 specified by NameGuid to retrieve. 348 @param Buffer On output, a pointer to a callee allocated buffer 349 containing the FFS file section that was found. 350 Is it the caller's responsibility to free this buffer 348 @param Buffer On output, a pointer to a callee allocated buffer 349 containing the FFS file section that was found. 350 Is it the caller's responsibility to free this buffer 351 351 using FreePool(). 352 352 @param Size On output, a pointer to the size, in bytes, of Buffer. … … 354 354 @retval EFI_SUCCESS The specified FFS section was returned. 355 355 @retval EFI_NOT_FOUND The specified FFS section could not be found. 356 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to 356 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to 357 357 retrieve the matching FFS section. 358 @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a 358 @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a 359 359 device error. 360 @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the 361 firmware volume that 360 @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the 361 firmware volume that 362 362 contains the matching FFS section does not allow reads. 363 363 **/ … … 415 415 if (HandleBuffer[Index] != FvHandle) { 416 416 Status = InternalGetSectionFromFv ( 417 HandleBuffer[Index], 418 NameGuid, 419 SectionType, 417 HandleBuffer[Index], 418 NameGuid, 419 SectionType, 420 420 SectionInstance, 421 Buffer, 421 Buffer, 422 422 Size 423 423 ); … … 435 435 436 436 Done: 437 438 if (HandleBuffer != NULL) { 437 438 if (HandleBuffer != NULL) { 439 439 FreePool(HandleBuffer); 440 440 } 441 441 return Status; 442 442 443 443 } 444 444 445 445 /** 446 Searches the firmware volume that the currently executing module was loaded from and returns the first matching FFS section. 447 448 This function searches the firmware volume that the currently executing module was loaded 449 from for an FFS file with an FFS filename specified by NameGuid. If the FFS file is found a search 450 is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance 446 Searches the firmware volume that the currently executing module was loaded from and returns the first matching FFS section. 447 448 This function searches the firmware volume that the currently executing module was loaded 449 from for an FFS file with an FFS filename specified by NameGuid. If the FFS file is found a search 450 is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance 451 451 instances of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer. 452 Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size. 453 It is the caller's responsibility to use FreePool() to free the allocated buffer. 454 See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections are retrieved from 452 Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size. 453 It is the caller's responsibility to use FreePool() to free the allocated buffer. 454 See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections are retrieved from 455 455 an FFS file based on SectionType and SectionInstance. 456 456 457 457 If the currently executing module was not loaded from a firmware volume, then EFI_NOT_FOUND is returned. 458 If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, 458 If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, 459 459 the search will be retried with a section type of EFI_SECTION_PE32. 460 460 461 461 This function must be called with a TPL <= TPL_NOTIFY. 462 462 If NameGuid is NULL, then ASSERT(). … … 464 464 If Size is NULL, then ASSERT(). 465 465 466 @param NameGuid A pointer to to the FFS filename GUID to search for 467 within the firmware volumes that the currently 466 @param NameGuid A pointer to to the FFS filename GUID to search for 467 within the firmware volumes that the currently 468 468 executing module was loaded from. 469 @param SectionType Indicates the FFS section type to search for within 469 @param SectionType Indicates the FFS section type to search for within 470 470 the FFS file specified by NameGuid. 471 @param SectionInstance Indicates which section instance within the FFS file 471 @param SectionInstance Indicates which section instance within the FFS file 472 472 specified by NameGuid to retrieve. 473 @param Buffer On output, a pointer to a callee allocated buffer 474 containing the FFS file section that was found. 475 Is it the caller's responsibility to free this buffer 473 @param Buffer On output, a pointer to a callee allocated buffer 474 containing the FFS file section that was found. 475 Is it the caller's responsibility to free this buffer 476 476 using FreePool(). 477 477 @param Size On output, a pointer to the size, in bytes, of Buffer. … … 480 480 @retval EFI_SUCCESS The specified FFS section was returned. 481 481 @retval EFI_NOT_FOUND The specified FFS section could not be found. 482 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve 482 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve 483 483 the matching FFS section. 484 @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a 484 @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a 485 485 device error. 486 @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the 487 firmware volume that contains the matching FFS 488 section does not allow reads. 486 @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the 487 firmware volume that contains the matching FFS 488 section does not allow reads. 489 489 **/ 490 490 EFI_STATUS … … 513 513 514 514 This function searches the FFS file that the currently executing module was loaded from for a FFS sections of type SectionType. 515 If the FFS file contains at least SectionInstance instances of the FFS section specified by SectionType, 516 then the SectionInstance instance is returned in Buffer. Buffer is allocated using AllocatePool(), 517 and the size of the allocated buffer is returned in Size. It is the caller's responsibility 518 to use FreePool() to free the allocated buffer. See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for 515 If the FFS file contains at least SectionInstance instances of the FFS section specified by SectionType, 516 then the SectionInstance instance is returned in Buffer. Buffer is allocated using AllocatePool(), 517 and the size of the allocated buffer is returned in Size. It is the caller's responsibility 518 to use FreePool() to free the allocated buffer. See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for 519 519 details on how sections are retrieved from an FFS file based on SectionType and SectionInstance. 520 520 521 521 If the currently executing module was not loaded from an FFS file, then EFI_NOT_FOUND is returned. 522 If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, 522 If SectionType is EFI_SECTION_TE, and the search with an FFS file fails, 523 523 the search will be retried with a section type of EFI_SECTION_PE32. 524 524 This function must be called with a TPL <= TPL_NOTIFY. 525 525 526 526 If Buffer is NULL, then ASSERT(). 527 527 If Size is NULL, then ASSERT(). 528 528 529 529 530 @param SectionType Indicates the FFS section type to search for within 531 the FFS file that the currently executing module 530 @param SectionType Indicates the FFS section type to search for within 531 the FFS file that the currently executing module 532 532 was loaded from. 533 @param SectionInstance Indicates which section instance to retrieve within 534 the FFS file that the currently executing module 533 @param SectionInstance Indicates which section instance to retrieve within 534 the FFS file that the currently executing module 535 535 was loaded from. 536 @param Buffer On output, a pointer to a callee allocated buffer 537 containing the FFS file section that was found. 538 Is it the caller's responsibility to free this buffer 536 @param Buffer On output, a pointer to a callee allocated buffer 537 containing the FFS file section that was found. 538 Is it the caller's responsibility to free this buffer 539 539 using FreePool(). 540 540 @param Size On output, a pointer to the size, in bytes, of Buffer. … … 542 542 @retval EFI_SUCCESS The specified FFS section was returned. 543 543 @retval EFI_NOT_FOUND The specified FFS section could not be found. 544 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve 544 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve 545 545 the matching FFS section. 546 @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a 546 @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a 547 547 device error. 548 @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the 549 firmware volume that contains the matching FFS 550 section does not allow reads. 551 548 @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the 549 firmware volume that contains the matching FFS 550 section does not allow reads. 551 552 552 **/ 553 553 EFI_STATUS … … 572 572 573 573 /** 574 Get the image file buffer data and buffer size by its device path. 575 576 Access the file either from a firmware volume, from a file system interface, 574 Get the image file buffer data and buffer size by its device path. 575 576 Access the file either from a firmware volume, from a file system interface, 577 577 or from the load file interface. 578 578 579 579 Allocate memory to store the found image. The caller is responsible to free memory. 580 580 … … 583 583 If AuthenticationStatus is NULL, then NULL is returned. 584 584 585 @param[in] BootPolicy Policy for Open Image File.If TRUE, indicates 586 that the request originates from the boot 585 @param[in] BootPolicy Policy for Open Image File.If TRUE, indicates 586 that the request originates from the boot 587 587 manager, and that the boot manager is 588 588 attempting to load FilePath as a boot 589 selection. If FALSE, then FilePath must 589 selection. If FALSE, then FilePath must 590 590 match an exact file to be loaded. 591 591 @param[in] FilePath The pointer to the device path of the file 592 592 that is absracted to the file buffer. 593 @param[out] FileSize The pointer to the size of the abstracted 593 @param[out] FileSize The pointer to the size of the abstracted 594 594 file buffer. 595 595 @param[out] AuthenticationStatus Pointer to the authentication status. … … 644 644 ImageBufferSize = 0; 645 645 *AuthenticationStatus = 0; 646 646 647 647 // 648 648 // Copy File Device Path … … 748 748 break; 749 749 } 750 750 751 751 LastHandle = FileHandle; 752 752 FileHandle = NULL; 753 753 754 754 Status = LastHandle->Open ( 755 755 LastHandle, … … 759 759 0 760 760 ); 761 761 762 762 // 763 763 // Close the previous node 764 764 // 765 765 LastHandle->Close (LastHandle); 766 766 767 767 DevicePathNode = NextDevicePathNode (DevicePathNode); 768 768 } 769 769 770 770 if (!EFI_ERROR (Status)) { 771 771 // … … 781 781 FileInfo 782 782 ); 783 783 784 784 if (Status == EFI_BUFFER_TOO_SMALL) { 785 785 FileInfo = AllocatePool (FileInfoSize); … … 795 795 } 796 796 } 797 797 798 798 if (!EFI_ERROR (Status) && (FileInfo != NULL)) { 799 799 // … … 814 814 // 815 815 // Close the file and Free FileInfo and TempDevicePathNode since we are done 816 // 816 // 817 817 if (FileInfo != NULL) { 818 818 FreePool (FileInfo); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
r58459 r58466 3 3 # 4 4 # DXE Services Library provides access data from sections of FFS files based on FV protocol. 5 # It also provides access file based on file path from a firmware volume, 5 # It also provides access file based on file path from a firmware volume, 6 6 # from a file system interface, or from the load file interface. 7 7 # … … 52 52 gEfiLoadedImageProtocolGuid ## SOMETIMES_CONSUMES 53 53 gEfiLoadFileProtocolGuid ## SOMETIMES_CONSUMES 54 gEfiLoadFile2ProtocolGuid ## SOMETIMES_CONSUMES 55 gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CONSUMES 54 gEfiLoadFile2ProtocolGuid ## SOMETIMES_CONSUMES 55 gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CONSUMES 56 56 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c
r48674 r58466 2 2 This library implement library class DxeServiceTableLib. 3 3 It produce EFI_DXE_SERVICE pointer in global variable gDS in library's constructure. 4 4 5 5 A DXE driver can use gDS pointer to access services in EFI_DXE_SERVICE, if this 6 DXE driver declare that use DxeServicesTableLib library class and link to this 6 DXE driver declare that use DxeServicesTableLib library class and link to this 7 7 library instance. 8 8 9 Please attention this library instance can not be used util EFI_SYSTEM_TABLE was 9 Please attention this library instance can not be used util EFI_SYSTEM_TABLE was 10 10 initialized. 11 11 12 12 This library contains contruct function to retrieve EFI_DXE_SERIVCE, this construct 13 13 function will be invoked in DXE driver's autogen file. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.c
r48674 r58466 58 58 the Length byte, word, or a block of data. 59 59 60 @param SmbusOperation Signifies which particular SMBus hardware protocol instance 60 @param SmbusOperation Signifies which particular SMBus hardware protocol instance 61 61 that it will use to execute the SMBus transactions. 62 62 @param SmBusAddress The address that encodes the SMBUS Slave Address, 63 63 SMBUS Command, SMBUS Data Length, and PEC. 64 @param Length Signifies the number of bytes that this operation will do. 65 The maximum number of bytes can be revision specific 64 @param Length Signifies the number of bytes that this operation will do. 65 The maximum number of bytes can be revision specific 66 66 and operation specific. 67 @param Buffer Contains the value of data to execute to the SMBus slave 68 device. Not all operations require this argument. The 67 @param Buffer Contains the value of data to execute to the SMBus slave 68 device. Not all operations require this argument. The 69 69 length of this buffer is identified by Length. 70 70 @param Status Return status for the executed command. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeSmbusLib/InternalSmbusLib.h
r48674 r58466 39 39 the Length byte, word, or a block of data. 40 40 41 @param SmbusOperation Signifies which particular SMBus hardware protocol instance 41 @param SmbusOperation Signifies which particular SMBus hardware protocol instance 42 42 that it will use toexecute the SMBus transactions. 43 43 @param SmBusAddress The address that encodes the SMBUS Slave Address, 44 44 SMBUS Command, SMBUS Data Length, and PEC. 45 @param Length Signifies the number of bytes that this operation will 46 do. The maximum number of bytes can be revision specific 45 @param Length Signifies the number of bytes that this operation will 46 do. The maximum number of bytes can be revision specific 47 47 and operation specific. 48 48 @param Buffer Contains the value of data to execute to the SMBus slave 49 device. Not all operations require this argument. The 49 device. Not all operations require this argument. The 50 50 length of this buffer is identified by Length. 51 51 @param Status Return status for the executed command. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeSmbusLib/SmbusLib.c
r48674 r58466 32 32 This is an optional parameter and may be NULL. 33 33 RETURN_SUCCESS: The SMBUS command was executed. 34 RETURN_TIMEOUT: A timeout occurred while executing the 35 SMBUS command. 36 RETURN_DEVICE_ERROR: The request was not 37 completed because a failure reflected in the Host Status 38 Register bit. Device errors are a result of a transaction 39 collision, illegal command field, unclaimed cycle (host 40 initiated), or bus errors (collisions). 34 RETURN_TIMEOUT: A timeout occurred while executing the 35 SMBUS command. 36 RETURN_DEVICE_ERROR: The request was not 37 completed because a failure reflected in the Host Status 38 Register bit. Device errors are a result of a transaction 39 collision, illegal command field, unclaimed cycle (host 40 initiated), or bus errors (collisions). 41 41 RETURN_UNSUPPORTED: The SMBus operation is not supported. 42 42 … … 73 73 This is an optional parameter and may be NULL. 74 74 RETURN_SUCCESS: The SMBUS command was executed. 75 RETURN_TIMEOUT: A timeout occurred while executing the 76 SMBUS command. 77 RETURN_DEVICE_ERROR: The request was not completed because 78 a failure reflected in the Host Status Register bit. 79 Device errors are a result of a transaction collision, 80 illegal command field, unclaimed cycle (host initiated), 75 RETURN_TIMEOUT: A timeout occurred while executing the 76 SMBUS command. 77 RETURN_DEVICE_ERROR: The request was not completed because 78 a failure reflected in the Host Status Register bit. 79 Device errors are a result of a transaction collision, 80 illegal command field, unclaimed cycle (host initiated), 81 81 or bus errors (collisions). 82 82 RETURN_UNSUPPORTED: The SMBus operation is not supported. … … 114 114 This is an optional parameter and may be NULL. 115 115 RETURN_SUCCESS: The SMBUS command was executed. 116 RETURN_TIMEOUT: A timeout occurred while executing the 117 SMBUS command. 118 RETURN_DEVICE_ERROR: The request was not completed because 116 RETURN_TIMEOUT: A timeout occurred while executing the 117 SMBUS command. 118 RETURN_DEVICE_ERROR: The request was not completed because 119 119 a failure reflected in the Host Status Register bit. Device 120 errors are a result of a transaction collision, illegal 121 command field, unclaimed cycle(host initiated), or bus 120 errors are a result of a transaction collision, illegal 121 command field, unclaimed cycle(host initiated), or bus 122 122 errors (collisions). 123 123 RETURN_CRC_ERROR: The checksum is not correct. (PEC is incorrect.) … … 162 162 This is an optional parameter and may be NULL. 163 163 RETURN_SUCCESS: The SMBUS command was executed. 164 RETURN_TIMEOUT: A timeout occurred while executing the 165 SMBUS command. 166 RETURN_DEVICE_ERROR: The request was not completed because 167 a failure reflected in the Host Status Register bit. Device 168 errors are a result of a transaction collision, illegal 169 command field, unclaimed cycle(host initiated), or bus 164 RETURN_TIMEOUT: A timeout occurred while executing the 165 SMBUS command. 166 RETURN_DEVICE_ERROR: The request was not completed because 167 a failure reflected in the Host Status Register bit. Device 168 errors are a result of a transaction collision, illegal 169 command field, unclaimed cycle(host initiated), or bus 170 170 errors (collisions). 171 171 RETURN_CRC_ERROR: The checksum is not correct (PEC is incorrect) … … 210 210 This is an optional parameter and may be NULL. 211 211 RETURN_SUCCESS: The SMBUS command was executed. 212 RETURN_TIMEOUT: A timeout occurred while executing the 213 SMBUS command. 214 RETURN_DEVICE_ERROR: The request was not completed because 215 a failurereflected in the Host Status Register bit. Device 216 errors are a result of a transaction collision, illegal 217 command field, unclaimed cycle (host initiated), or bus 212 RETURN_TIMEOUT: A timeout occurred while executing the 213 SMBUS command. 214 RETURN_DEVICE_ERROR: The request was not completed because 215 a failurereflected in the Host Status Register bit. Device 216 errors are a result of a transaction collision, illegal 217 command field, unclaimed cycle (host initiated), or bus 218 218 errors (collisions). 219 219 RETURN_CRC_ERROR: The checksum is not correct (PEC is incorrect) … … 257 257 This is an optional parameter and may be NULL. 258 258 RETURN_SUCCESS: The SMBUS command was executed. 259 RETURN_TIMEOUT: A timeout occurred while executing the 260 SMBUS command. 261 RETURN_DEVICE_ERROR: The request was not completed because 262 a failure reflected in the Host Status Register bit. Device 263 errors are a result of a transaction collision, illegal 264 command field, unclaimed cycle host initiated), or bus 259 RETURN_TIMEOUT: A timeout occurred while executing the 260 SMBUS command. 261 RETURN_DEVICE_ERROR: The request was not completed because 262 a failure reflected in the Host Status Register bit. Device 263 errors are a result of a transaction collision, illegal 264 command field, unclaimed cycle host initiated), or bus 265 265 errors (collisions). 266 266 RETURN_CRC_ERROR: The checksum is not correct. (PEC is incorrect.) … … 298 298 If Length in SmBusAddress is not zero, then ASSERT(). 299 299 If any reserved bits of SmBusAddress are set, then ASSERT(). 300 301 @param SmBusAddress The address that encodes the SMBUS Slave Address, 302 SMBUS Command, SMBUS Data Length, and PEC. 303 @param Status Return status for the executed command. 304 This is an optional parameter and may be NULL. 305 RETURN_SUCCESS: The SMBUS command was executed. 306 RETURN_TIMEOUT: A timeout occurred while executing the 307 SMBUS command. 308 RETURN_DEVICE_ERROR: The request was not completed because 309 a failure reflected in the Host Status Register bit. 310 Device errors are a result of a transaction collision, 311 illegal command field, unclaimed cycle (host initiated), 300 301 @param SmBusAddress The address that encodes the SMBUS Slave Address, 302 SMBUS Command, SMBUS Data Length, and PEC. 303 @param Status Return status for the executed command. 304 This is an optional parameter and may be NULL. 305 RETURN_SUCCESS: The SMBUS command was executed. 306 RETURN_TIMEOUT: A timeout occurred while executing the 307 SMBUS command. 308 RETURN_DEVICE_ERROR: The request was not completed because 309 a failure reflected in the Host Status Register bit. 310 Device errors are a result of a transaction collision, 311 illegal command field, unclaimed cycle (host initiated), 312 312 or bus errors (collisions). 313 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 313 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 314 314 incorrect.) 315 315 RETURN_UNSUPPORTED: The SMBus operation is not supported. … … 352 352 This is an optional parameter and may be NULL. 353 353 RETURN_SUCCESS: The SMBUS command was executed. 354 RETURN_TIMEOUT: A timeout occurred while executing the SMBUS 354 RETURN_TIMEOUT: A timeout occurred while executing the SMBUS 355 355 command. 356 RETURN_DEVICE_ERROR: The request was not completed because 357 a failure reflected in the Host Status Register bit. 358 Device errors are a result of a transaction collision, 359 illegal command field, unclaimed cycle (host initiated), 356 RETURN_DEVICE_ERROR: The request was not completed because 357 a failure reflected in the Host Status Register bit. 358 Device errors are a result of a transaction collision, 359 illegal command field, unclaimed cycle (host initiated), 360 360 or bus errors (collisions). 361 RETURN_CRC_ERROR: The checksum is not correct. 361 RETURN_CRC_ERROR: The checksum is not correct. 362 362 (PEC is incorrect.) 363 363 RETURN_UNSUPPORTED: The SMBus operation is not supported. … … 402 402 This is an optional parameter and may be NULL. 403 403 RETURN_SUCCESS: The SMBUS command was executed. 404 RETURN_TIMEOUT: A timeout occurred while executing the 405 SMBUS command. 406 RETURN_DEVICE_ERROR: The request was not completed because 407 a failure reflected in the Host Status Register bit. 408 Device errors are a result of a transaction collision, 409 illegal command field, unclaimed cycle (host initiated), 404 RETURN_TIMEOUT: A timeout occurred while executing the 405 SMBUS command. 406 RETURN_DEVICE_ERROR: The request was not completed because 407 a failure reflected in the Host Status Register bit. 408 Device errors are a result of a transaction collision, 409 illegal command field, unclaimed cycle (host initiated), 410 410 or bus errors (collisions). 411 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 411 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 412 412 incorrect.) 413 413 RETURN_UNSUPPORTED: The SMBus operation is not supported. … … 448 448 @param SmBusAddress The address that encodes the SMBUS Slave Address, 449 449 SMBUS Command, SMBUS Data Length, and PEC. 450 @param Buffer The pointer to the buffer to store the bytes read from 450 @param Buffer The pointer to the buffer to store the bytes read from 451 451 the SMBUS. 452 452 @param Status Return status for the executed command. 453 453 This is an optional parameter and may be NULL. 454 454 RETURN_SUCCESS: The SMBUS command was executed. 455 RETURN_TIMEOUT: A timeout occurred while executing the SMBUS 455 RETURN_TIMEOUT: A timeout occurred while executing the SMBUS 456 456 command. 457 RETURN_DEVICE_ERROR: The request was not completed because 458 a failure reflected in the Host Status Register bit. Device 459 errors are a result of a transaction collision, illegal 460 command field, unclaimed cycle (host initiated), or bus 461 errors (collisions). 462 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 457 RETURN_DEVICE_ERROR: The request was not completed because 458 a failure reflected in the Host Status Register bit. Device 459 errors are a result of a transaction collision, illegal 460 command field, unclaimed cycle (host initiated), or bus 461 errors (collisions). 462 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 463 463 incorrect.) 464 464 RETURN_UNSUPPORTED: The SMBus operation is not supported. … … 489 489 Bytes are written to the SMBUS from Buffer. 490 490 The number of bytes written is returned, and will never return a value larger than 32-bytes. 491 If Status is not NULL, then the status of the executed command is returned in Status. 491 If Status is not NULL, then the status of the executed command is returned in Status. 492 492 If Length in SmBusAddress is zero or greater than 32, then ASSERT(). 493 493 If Buffer is NULL, then ASSERT(). … … 496 496 @param SmBusAddress The address that encodes the SMBUS Slave Address, 497 497 MBUS Command, SMBUS Data Length, and PEC. 498 @param Buffer The pointer to the buffer to store the bytes read from 498 @param Buffer The pointer to the buffer to store the bytes read from 499 499 the SMBUS. 500 500 @param Status Return status for the executed command. 501 501 This is an optional parameter and may be NULL. 502 RETURN_TIMEOUT: A timeout occurred while executing the 503 SMBUS command. 504 RETURN_DEVICE_ERROR: The request was not completed because 505 a failure reflected in the Host Status Register bit. Device 506 errors are a result of a transaction collision, illegal 507 command field, unclaimed cycle (host initiated), or bus 508 errors (collisions). 509 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 502 RETURN_TIMEOUT: A timeout occurred while executing the 503 SMBUS command. 504 RETURN_DEVICE_ERROR: The request was not completed because 505 a failure reflected in the Host Status Register bit. Device 506 errors are a result of a transaction collision, illegal 507 command field, unclaimed cycle (host initiated), or bus 508 errors (collisions). 509 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 510 510 incorrect.) 511 511 RETURN_UNSUPPORTED: The SMBus operation is not supported. … … 553 553 @param Status Return status for the executed command. 554 554 This is an optional parameter and may be NULL. 555 RETURN_TIMEOUT: A timeout occurred while executing the 556 SMBUS command. 557 RETURN_DEVICE_ERROR: The request was not completed because 558 a failure reflected in the Host Status Register bit. Device 559 errors are a result of a transaction collision, illegal 560 command field, unclaimed cycle (host initiated), or bus 561 errors (collisions). 562 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 555 RETURN_TIMEOUT: A timeout occurred while executing the 556 SMBUS command. 557 RETURN_DEVICE_ERROR: The request was not completed because 558 a failure reflected in the Host Status Register bit. Device 559 errors are a result of a transaction collision, illegal 560 command field, unclaimed cycle (host initiated), or bus 561 errors (collisions). 562 RETURN_CRC_ERROR: The checksum is not correct. (PEC is 563 563 incorrect.) 564 564 RETURN_UNSUPPORTED: The SMBus operation is not supported. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeTimerLibEsal/DxeTimerLibEsal.c
r48674 r58466 43 43 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO, 44 44 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI, 45 StallFunctionId, 46 MicroSeconds, 47 0, 48 0, 49 0, 50 0, 51 0, 45 StallFunctionId, 46 MicroSeconds, 47 0, 48 0, 49 0, 50 0, 51 0, 52 52 0 53 53 ); … … 83 83 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO, 84 84 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI, 85 StallFunctionId, 86 MicroSeconds, 87 0, 88 0, 89 0, 90 0, 91 0, 85 StallFunctionId, 86 MicroSeconds, 87 0, 88 0, 89 0, 90 0, 91 0, 92 92 0 93 93 ); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/DxeTimerLibEsal/DxeTimerLibEsal.inf
r58459 r58466 20 20 MODULE_TYPE = DXE_DRIVER 21 21 VERSION_STRING = 1.0 22 LIBRARY_CLASS = TimerLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION 22 LIBRARY_CLASS = TimerLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION 23 23 24 24 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.c
r48674 r58466 40 40 If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system. 41 41 42 @param SecCoreData Points to a data structure containing information about the 43 PEI core's operating environment, such as the size and 44 location of temporary RAM, the stack location and the BFV 42 @param SecCoreData Points to a data structure containing information about the 43 PEI core's operating environment, such as the size and 44 location of temporary RAM, the stack location and the BFV 45 45 location. 46 47 @param PpiList Points to a list of one or more PPI descriptors to be 48 installed initially by the PEI core. An empty PPI list 49 consists of a single descriptor with the end-tag 46 47 @param PpiList Points to a list of one or more PPI descriptors to be 48 installed initially by the PEI core. An empty PPI list 49 consists of a single descriptor with the end-tag 50 50 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. 51 51 As part of its initialization phase, the PEI Foundation will 52 add these SEC-hosted PPIs to its PPI database, such that both 53 the PEI Foundation and any modules can leverage the associated 52 add these SEC-hosted PPIs to its PPI database, such that both 53 the PEI Foundation and any modules can leverage the associated 54 54 service calls and/or code in these early PPIs. 55 55 56 56 **/ 57 57 VOID 58 EFIAPI 58 EFIAPI 59 59 _ModuleEntryPoint( 60 60 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, … … 63 63 { 64 64 ProcessModuleEntryPointList (SecCoreData, PpiList, NULL); 65 65 66 66 // 67 67 // Should never return 68 68 // 69 69 ASSERT(FALSE); 70 CpuDeadLoop (); 70 CpuDeadLoop (); 71 71 } 72 72 … … 79 79 @param SecCoreData Points to a data structure containing information about the PEI core's 80 80 operating environment, such as the size and location of temporary RAM, 81 the stack location and the BFV location. 81 the stack location and the BFV location. 82 82 83 83 @param PpiList Points to a list of one or more PPI descriptors to be installed 84 initially by the PEI core. An empty PPI list consists of 85 a single descriptor with the end-tag 84 initially by the PEI core. An empty PPI list consists of 85 a single descriptor with the end-tag 86 86 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. 87 As part of its initialization phase, the PEI Foundation will 88 add these SEC-hosted PPIs to its PPI database, such that both 89 the PEI Foundationand any modules can leverage the associated 87 As part of its initialization phase, the PEI Foundation will 88 add these SEC-hosted PPIs to its PPI database, such that both 89 the PEI Foundationand any modules can leverage the associated 90 90 service calls and/or code in these early PPIs. 91 91 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c
r48674 r58466 40 40 Sends an 32-bit value to a POST card. 41 41 42 Sends the 32-bit value specified by Value to a POST card, and returns Value. 43 Some implementations of this library function may perform I/O operations 44 directly to a POST card device. Other implementations may send Value to 45 ReportStatusCode(), and the status code reporting mechanism will eventually 42 Sends the 32-bit value specified by Value to a POST card, and returns Value. 43 Some implementations of this library function may perform I/O operations 44 directly to a POST card device. Other implementations may send Value to 45 ReportStatusCode(), and the status code reporting mechanism will eventually 46 46 display the 32-bit value on the status reporting device. 47 48 PostCode() must actively prevent recursion. If PostCode() is called while 49 processing another any other Post Code Library function, then 47 48 PostCode() must actively prevent recursion. If PostCode() is called while 49 processing another any other Post Code Library function, then 50 50 PostCode() must return Value immediately. 51 51 … … 70 70 71 71 Sends the 32-bit value specified by Value to a POST card, and returns Value. 72 If Description is not NULL, then the ASCII string specified by Description is 73 also passed to the handler that displays the POST card value. Some 74 implementations of this library function may perform I/O operations directly 75 to a POST card device. Other implementations may send Value to ReportStatusCode(), 76 and the status code reporting mechanism will eventually display the 32-bit 77 value on the status reporting device. 72 If Description is not NULL, then the ASCII string specified by Description is 73 also passed to the handler that displays the POST card value. Some 74 implementations of this library function may perform I/O operations directly 75 to a POST card device. Other implementations may send Value to ReportStatusCode(), 76 and the status code reporting mechanism will eventually display the 32-bit 77 value on the status reporting device. 78 78 79 PostCodeWithDescription()must actively prevent recursion. If 80 PostCodeWithDescription() is called while processing another any other Post 81 Code Library function, then PostCodeWithDescription() must return Value 79 PostCodeWithDescription()must actively prevent recursion. If 80 PostCodeWithDescription() is called while processing another any other Post 81 Code Library function, then PostCodeWithDescription() must return Value 82 82 immediately. 83 83 84 84 @param Value The 32-bit value to write to the POST card. 85 @param Description The pointer to an ASCII string that is a description of the 86 POST code value. This is an optional parameter that may 85 @param Description The pointer to an ASCII string that is a description of the 86 POST code value. This is an optional parameter that may 87 87 be NULL. 88 88 … … 118 118 Returns TRUE if POST Codes are enabled. 119 119 120 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED 120 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED 121 121 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned. 122 122 123 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 123 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 124 124 PcdPostCodeProperyMask is set. 125 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 125 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of 126 126 PcdPostCodeProperyMask is clear. 127 127 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
r58459 r58466 47 47 PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo; 48 48 EFI_PEI_HOB_POINTERS Hob; 49 49 50 50 // 51 51 // First try to get handler information from guid hob specified by CallerId. … … 62 62 HandlerInfo->ExtractHandlerGuidTable = (GUID *) (HandlerInfo + 1); 63 63 HandlerInfo->ExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *) ( 64 (UINT8 *)HandlerInfo->ExtractHandlerGuidTable + 64 (UINT8 *)HandlerInfo->ExtractHandlerGuidTable + 65 65 PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (GUID) 66 66 ); 67 67 HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) ( 68 (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + 69 PcdGet32 (PcdMaximumGuidedExtractHandler) * 68 (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + 69 PcdGet32 (PcdMaximumGuidedExtractHandler) * 70 70 sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER) 71 71 ); … … 81 81 Hob.Raw = GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, Hob.Raw); 82 82 } 83 83 84 84 // 85 85 // If Guid Hob is not found, Build CallerId Guid hob to store Handler Info 86 86 // 87 87 HandlerInfo = BuildGuidHob ( 88 &gEfiCallerIdGuid, 88 &gEfiCallerIdGuid, 89 89 sizeof (PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO) + 90 PcdGet32 (PcdMaximumGuidedExtractHandler) * 90 PcdGet32 (PcdMaximumGuidedExtractHandler) * 91 91 (sizeof (GUID) + sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER) + sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER)) 92 92 ); … … 105 105 HandlerInfo->ExtractHandlerGuidTable = (GUID *) (HandlerInfo + 1); 106 106 HandlerInfo->ExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *) ( 107 (UINT8 *)HandlerInfo->ExtractHandlerGuidTable + 107 (UINT8 *)HandlerInfo->ExtractHandlerGuidTable + 108 108 PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (GUID) 109 109 ); 110 110 HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) ( 111 (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + 112 PcdGet32 (PcdMaximumGuidedExtractHandler) * 111 (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + 112 PcdGet32 (PcdMaximumGuidedExtractHandler) * 113 113 sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER) 114 114 ); … … 125 125 Sets ExtractHandlerGuidTable so it points at a callee allocated array of registered GUIDs. 126 126 The total number of GUIDs in the array are returned. Since the array of GUIDs is callee allocated 127 and caller must treat this array of GUIDs as read-only data. 127 and caller must treat this array of GUIDs as read-only data. 128 128 If ExtractHandlerGuidTable is NULL, then ASSERT(). 129 129 … … 169 169 If the GUID value specified by SectionGuid has already been registered, then return RETURN_ALREADY_STARTED. 170 170 If there are not enough resources available to register the handlers then RETURN_OUT_OF_RESOURCES is returned. 171 171 172 172 If SectionGuid is NULL, then ASSERT(). 173 173 If GetInfoHandler is NULL, then ASSERT(). … … 180 180 required to actually decode the data in a GUIDed section. 181 181 @param[in] DecodeHandler The pointer to a function that decodes a GUIDed section into a caller 182 allocated output buffer. 182 allocated output buffer. 183 183 184 184 @retval RETURN_SUCCESS The handlers were registered. … … 236 236 return RETURN_OUT_OF_RESOURCES; 237 237 } 238 238 239 239 // 240 240 // Register new Handler and guid value. … … 263 263 optional scratch buffer required to actually decode the data in a GUIDed section. 264 264 265 Examines a GUIDed section specified by InputSection. 265 Examines a GUIDed section specified by InputSection. 266 266 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(), 267 then RETURN_UNSUPPORTED is returned. 268 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler 267 then RETURN_UNSUPPORTED is returned. 268 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler 269 269 of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers() 270 270 is used to retrieve the OututBufferSize, ScratchSize, and Attributes values. The return status from the handler of 271 271 type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER is returned. 272 272 273 273 If InputSection is NULL, then ASSERT(). 274 274 If OutputBufferSize is NULL, then ASSERT(). … … 297 297 OUT UINT32 *OutputBufferSize, 298 298 OUT UINT32 *ScratchBufferSize, 299 OUT UINT16 *SectionAttribute 299 OUT UINT16 *SectionAttribute 300 300 ) 301 301 { … … 304 304 PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo; 305 305 EFI_GUID *SectionDefinitionGuid; 306 306 307 307 // 308 308 // Check input paramter … … 346 346 347 347 // 348 // Not found, the input guided section is not supported. 348 // Not found, the input guided section is not supported. 349 349 // 350 350 return RETURN_UNSUPPORTED; … … 357 357 allocated output buffer. 358 358 359 Decodes the GUIDed section specified by InputSection. 359 Decodes the GUIDed section specified by InputSection. 360 360 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(), 361 then RETURN_UNSUPPORTED is returned. 361 then RETURN_UNSUPPORTED is returned. 362 362 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler 363 363 of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers() … … 366 366 then OutputBuffer is set to point at the data in InputSection. Otherwise, the decoded data will be placed in caller 367 367 allocated buffer specified by OutputBuffer. This function is responsible for computing the EFI_AUTH_STATUS_PLATFORM_OVERRIDE 368 bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned. 369 368 bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned. 369 370 370 If InputSection is NULL, then ASSERT(). 371 371 If OutputBuffer is NULL, then ASSERT(). 372 372 If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT(). 373 If AuthenticationStatus is NULL, then ASSERT(). 373 If AuthenticationStatus is NULL, then ASSERT(). 374 374 375 375 @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file. 376 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 377 @param[in] ScratchBuffer A caller allocated buffer that may be required by this function as a scratch buffer to perform the decode operation. 378 @param[out] AuthenticationStatus 376 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 377 @param[in] ScratchBuffer A caller allocated buffer that may be required by this function as a scratch buffer to perform the decode operation. 378 @param[out] AuthenticationStatus 379 379 A pointer to the authentication status of the decoded output buffer. See the definition 380 380 of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI section of the PI … … 392 392 OUT VOID **OutputBuffer, 393 393 IN VOID *ScratchBuffer, OPTIONAL 394 OUT UINT32 *AuthenticationStatus 394 OUT UINT32 *AuthenticationStatus 395 395 ) 396 396 { … … 399 399 PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo; 400 400 EFI_GUID *SectionDefinitionGuid; 401 401 402 402 // 403 403 // Check input parameter … … 409 409 // 410 410 // Get all registered handler information. 411 // 411 // 412 412 Status = PeiGetExtractGuidedSectionHandlerInfo (&HandlerInfo); 413 413 if (EFI_ERROR (Status)) { … … 440 440 441 441 // 442 // Not found, the input guided section is not supported. 442 // Not found, the input guided section is not supported. 443 443 // 444 444 return RETURN_UNSUPPORTED; … … 446 446 447 447 /** 448 Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and 448 Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and 449 449 EXTRACT_GUIDED_SECTION_DECODE_HANDLER for a specific GUID section type. 450 451 Retrieves the handlers associated with SectionGuid and returns them in 450 451 Retrieves the handlers associated with SectionGuid and returns them in 452 452 GetInfoHandler and DecodeHandler. 453 453 454 If the GUID value specified by SectionGuid has not been registered, then 454 If the GUID value specified by SectionGuid has not been registered, then 455 455 return RETURN_NOT_FOUND. 456 456 457 457 If SectionGuid is NULL, then ASSERT(). 458 458 459 @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed 459 @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed 460 460 section type being retrieved. 461 @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns 462 the size of the decoded buffer and the size of an optional scratch 463 buffer required to actually decode the data in a GUIDed section. 464 This is an optional parameter that may be NULL. If it is NULL, then 461 @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns 462 the size of the decoded buffer and the size of an optional scratch 463 buffer required to actually decode the data in a GUIDed section. 464 This is an optional parameter that may be NULL. If it is NULL, then 465 465 the previously registered handler is not returned. 466 466 @param[out] DecodeHandler Pointer to a function that decodes a GUIDed section into a caller -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiHobLib/HobLib.c
r58459 r58466 26 26 27 27 This function returns the pointer to first HOB in the list. 28 For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer 28 For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer 29 29 to the HOB list. For the DXE phase, the HOB list pointer can be retrieved through 30 30 the EFI System Table by looking up theHOB list GUID in the System Configuration Table. 31 Since the System Configuration Table does not exist that the time the DXE Core is 32 launched, the DXE Core uses a global variable from the DXE Core Entry Point Library 31 Since the System Configuration Table does not exist that the time the DXE Core is 32 launched, the DXE Core uses a global variable from the DXE Core Entry Point Library 33 33 to manage the pointer to the HOB list. 34 34 35 35 If the pointer to the HOB list is NULL, then ASSERT(). 36 36 37 37 @return The pointer to the HOB list. 38 38 … … 57 57 Returns the next instance of a HOB type from the starting HOB. 58 58 59 This function searches the first instance of a HOB type from the starting HOB pointer. 59 This function searches the first instance of a HOB type from the starting HOB pointer. 60 60 If there does not exist such HOB type from the starting HOB pointer, it will return NULL. 61 61 In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer 62 62 unconditionally: it returns HobStart back if HobStart itself meets the requirement; 63 63 caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. 64 64 65 65 If HobStart is NULL, then ASSERT(). 66 66 … … 81 81 82 82 ASSERT (HobStart != NULL); 83 83 84 84 Hob.Raw = (UINT8 *) HobStart; 85 85 // … … 98 98 Returns the first instance of a HOB type among the whole HOB list. 99 99 100 This function searches the first instance of a HOB type among the whole HOB list. 101 If there does not exist such HOB type in the HOB list, it will return NULL. 102 100 This function searches the first instance of a HOB type among the whole HOB list. 101 If there does not exist such HOB type in the HOB list, it will return NULL. 102 103 103 If the pointer to the HOB list is NULL, then ASSERT(). 104 104 … … 122 122 /** 123 123 Returns the next instance of the matched GUID HOB from the starting HOB. 124 125 This function searches the first instance of a HOB from the starting HOB pointer. 126 Such HOB should satisfy two conditions: 127 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. 128 If there does not exist such HOB from the starting HOB pointer, it will return NULL. 124 125 This function searches the first instance of a HOB from the starting HOB pointer. 126 Such HOB should satisfy two conditions: 127 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. 128 If there does not exist such HOB from the starting HOB pointer, it will return NULL. 129 129 Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () 130 130 to extract the data section and its size information, respectively. … … 132 132 unconditionally: it returns HobStart back if HobStart itself meets the requirement; 133 133 caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. 134 134 135 135 If Guid is NULL, then ASSERT(). 136 136 If HobStart is NULL, then ASSERT(). … … 163 163 /** 164 164 Returns the first instance of the matched GUID HOB among the whole HOB list. 165 166 This function searches the first instance of a HOB among the whole HOB list. 165 166 This function searches the first instance of a HOB among the whole HOB list. 167 167 Such HOB should satisfy two conditions: 168 168 its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. … … 170 170 Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () 171 171 to extract the data section and its size information, respectively. 172 172 173 173 If the pointer to the HOB list is NULL, then ASSERT(). 174 174 If Guid is NULL, then ASSERT(). … … 194 194 Get the system boot mode from the HOB list. 195 195 196 This function returns the system boot mode information from the 196 This function returns the system boot mode information from the 197 197 PHIT HOB in HOB list. 198 198 199 199 If the pointer to the HOB list is NULL, then ASSERT(). 200 200 201 201 @param VOID. 202 202 … … 258 258 It can only be invoked during PEI phase; 259 259 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 260 260 261 261 If ModuleName is NULL, then ASSERT(). 262 262 If there is no additional space for HOB creation, then ASSERT(). … … 296 296 // 297 297 ZeroMem (Hob->MemoryAllocationHeader.Reserved, sizeof (Hob->MemoryAllocationHeader.Reserved)); 298 298 299 299 CopyGuid (&Hob->ModuleName, ModuleName); 300 300 Hob->EntryPoint = EntryPoint; … … 307 307 It can only be invoked during PEI phase; 308 308 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 309 309 310 310 If there is no additional space for HOB creation, then ASSERT(). 311 311 … … 348 348 It can only be invoked during PEI phase; 349 349 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 350 350 351 351 If there is no additional space for HOB creation, then ASSERT(). 352 352 … … 381 381 382 382 /** 383 Builds a customized HOB tagged with a GUID for identification and returns 383 Builds a customized HOB tagged with a GUID for identification and returns 384 384 the start address of GUID HOB data. 385 385 386 This function builds a customized HOB tagged with a GUID for identification 387 and returns the start address of GUID HOB data so that caller can fill the customized data. 386 This function builds a customized HOB tagged with a GUID for identification 387 and returns the start address of GUID HOB data so that caller can fill the customized data. 388 388 The HOB Header and Name field is already stripped. 389 389 It can only be invoked during PEI phase; 390 390 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 391 391 392 392 If Guid is NULL, then ASSERT(). 393 393 If there is no additional space for HOB creation, then ASSERT(). … … 415 415 // 416 416 ASSERT (Guid != NULL); 417 417 418 418 // 419 419 // Make sure that data length is not too long. … … 430 430 431 431 /** 432 Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB 432 Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB 433 433 data field, and returns the start address of the GUID HOB data. 434 434 435 435 This function builds a customized HOB tagged with a GUID for identification and copies the input 436 data to the HOB data field and returns the start address of the GUID HOB data. It can only be 437 invoked during PEI phase; for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 436 data to the HOB data field and returns the start address of the GUID HOB data. It can only be 437 invoked during PEI phase; for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 438 438 The HOB Header and Name field is already stripped. 439 439 It can only be invoked during PEI phase; 440 440 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 441 441 442 442 If Guid is NULL, then ASSERT(). 443 443 If Data is NULL and DataLength > 0, then ASSERT(). … … 480 480 It can only be invoked during PEI phase; 481 481 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 482 482 483 483 If there is no additional space for HOB creation, then ASSERT(). 484 484 … … 511 511 It can only be invoked during PEI phase; 512 512 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 513 513 514 514 If there is no additional space for HOB creation, then ASSERT(). 515 515 … … 518 518 @param FvName The name of the Firmware Volume. 519 519 @param FileName The name of the file. 520 520 521 521 **/ 522 522 VOID … … 548 548 It can only be invoked during PEI phase; 549 549 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 550 550 551 551 If the platform does not support Capsule Volume HOBs, then ASSERT(). 552 552 If there is no additional space for HOB creation, then ASSERT(). … … 580 580 It can only be invoked during PEI phase; 581 581 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 582 582 583 583 If there is no additional space for HOB creation, then ASSERT(). 584 584 … … 607 607 // Zero the reserved space to match HOB spec 608 608 // 609 ZeroMem (Hob->Reserved, sizeof (Hob->Reserved)); 609 ZeroMem (Hob->Reserved, sizeof (Hob->Reserved)); 610 610 } 611 611 … … 616 616 It can only be invoked during PEI phase; 617 617 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 618 618 619 619 If there is no additional space for HOB creation, then ASSERT(). 620 620 … … 657 657 It can only be invoked during PEI phase; 658 658 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 659 659 660 660 If there is no additional space for HOB creation, then ASSERT(). 661 661 … … 700 700 It can only be invoked during PEI phase; 701 701 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 702 702 703 703 If there is no additional space for HOB creation, then ASSERT(). 704 704 … … 720 720 ASSERT (((BaseAddress & (EFI_PAGE_SIZE - 1)) == 0) && 721 721 ((Length & (EFI_PAGE_SIZE - 1)) == 0)); 722 722 723 723 Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION)); 724 724 if (Hob == NULL) { 725 725 return; 726 726 } 727 727 728 728 ZeroMem (&(Hob->AllocDescriptor.Name), sizeof (EFI_GUID)); 729 729 Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress; -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiHobLib/PeiHobLib.inf
r58459 r58466 53 53 # RESOURCE_DESCRIPTOR ## SOMETIMES_PRODUCES 54 54 # FIRMWARE_VOLUME ## SOMETIMES_PRODUCES 55 # 55 # 56 56 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c
r58459 r58466 81 81 82 82 /** 83 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise 83 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise 84 84 OR, and writes the result back to the 8-bit I/O port. 85 85 … … 147 147 Writes Value to the bit field of the I/O register. The bit field is specified 148 148 by the StartBit and the EndBit. All other bits in the destination I/O 149 register are preserved. The value written to the I/O port is returned. 149 register are preserved. The value written to the I/O port is returned. 150 150 151 151 If 8-bit I/O port operations are not supported, then ASSERT(). … … 349 349 If 16-bit I/O port operations are not supported, then ASSERT(). 350 350 If Port is not aligned on a 16-bit boundary, then ASSERT(). 351 351 352 352 @param Port The I/O port to write. 353 353 @param AndData The value to AND with the read value from the I/O port. … … 367 367 368 368 /** 369 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise 369 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise 370 370 OR, and writes the result back to the 16-bit I/O port. 371 371 … … 379 379 If 16-bit I/O port operations are not supported, then ASSERT(). 380 380 If Port is not aligned on a 16-bit boundary, then ASSERT(). 381 381 382 382 @param Port The I/O port to write. 383 383 @param AndData The value to AND with the read value from the I/O port. … … 660 660 661 661 /** 662 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise 662 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise 663 663 OR, and writes the result back to the 32-bit I/O port. 664 664 … … 953 953 954 954 /** 955 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise 955 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise 956 956 OR, and writes the result back to the 64-bit I/O port. 957 957 … … 1191 1191 result back to the 8-bit MMIO register. 1192 1192 1193 Reads the 8-bit MMIO register specified by Address, performs a bitwise 1193 Reads the 8-bit MMIO register specified by Address, performs a bitwise 1194 1194 OR between the read result and the value specified by OrData, and 1195 1195 writes the result to the 8-bit MMIO register specified by Address. The value … … 1244 1244 1245 1245 /** 1246 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise 1246 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise 1247 1247 OR, and writes the result back to the 8-bit MMIO register. 1248 1248 … … 1348 1348 writes the result back to the bit field in the 8-bit MMIO register. 1349 1349 1350 Reads the 8-bit MMIO register specified by Address, performs a bitwise 1350 Reads the 8-bit MMIO register specified by Address, performs a bitwise 1351 1351 OR between the read result and the value specified by OrData, and 1352 1352 writes the result to the 8-bit MMIO register specified by Address. The value … … 1478 1478 result back to the 16-bit MMIO register. 1479 1479 1480 Reads the 16-bit MMIO register specified by Address, performs a bitwise 1480 Reads the 16-bit MMIO register specified by Address, performs a bitwise 1481 1481 OR between the read result and the value specified by OrData, and 1482 1482 writes the result to the 16-bit MMIO register specified by Address. The value … … 1533 1533 1534 1534 /** 1535 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise 1535 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise 1536 1536 OR, and writes the result back to the 16-bit MMIO register. 1537 1537 … … 1639 1639 writes the result back to the bit field in the 16-bit MMIO register. 1640 1640 1641 Reads the 16-bit MMIO register specified by Address, performs a bitwise 1641 Reads the 16-bit MMIO register specified by Address, performs a bitwise 1642 1642 OR between the read result and the value specified by OrData, and 1643 1643 writes the result to the 16-bit MMIO register specified by Address. The value … … 1772 1772 result back to the 32-bit MMIO register. 1773 1773 1774 Reads the 32-bit MMIO register specified by Address, performs a bitwise 1774 Reads the 32-bit MMIO register specified by Address, performs a bitwise 1775 1775 OR between the read result and the value specified by OrData, and 1776 1776 writes the result to the 32-bit MMIO register specified by Address. The value … … 1827 1827 1828 1828 /** 1829 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise 1829 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise 1830 1830 OR, and writes the result back to the 32-bit MMIO register. 1831 1831 … … 1933 1933 writes the result back to the bit field in the 32-bit MMIO register. 1934 1934 1935 Reads the 32-bit MMIO register specified by Address, performs a bitwise 1935 Reads the 32-bit MMIO register specified by Address, performs a bitwise 1936 1936 OR between the read result and the value specified by OrData, and 1937 1937 writes the result to the 32-bit MMIO register specified by Address. The value … … 2066 2066 result back to the 64-bit MMIO register. 2067 2067 2068 Reads the 64-bit MMIO register specified by Address, performs a bitwise 2068 Reads the 64-bit MMIO register specified by Address, performs a bitwise 2069 2069 OR between the read result and the value specified by OrData, and 2070 2070 writes the result to the 64-bit MMIO register specified by Address. The value … … 2121 2121 2122 2122 /** 2123 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise 2123 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise 2124 2124 OR, and writes the result back to the 64-bit MMIO register. 2125 2125 … … 2227 2227 writes the result back to the bit field in the 64-bit MMIO register. 2228 2228 2229 Reads the 64-bit MMIO register specified by Address, performs a bitwise 2229 Reads the 64-bit MMIO register specified by Address, performs a bitwise 2230 2230 OR between the read result and the value specified by OrData, and 2231 2231 writes the result to the 64-bit MMIO register specified by Address. The value -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiIoLibCpuIo/IoLib.c
r48674 r58466 127 127 If 16-bit I/O port operations are not supported, then ASSERT(). 128 128 If Port is not aligned on a 16-bit boundary, then ASSERT(). 129 129 130 130 @param Port The I/O port to write. 131 131 @param Value The value to write to the I/O port. … … 164 164 If 32-bit I/O port operations are not supported, then ASSERT(). 165 165 If Port is not aligned on a 32-bit boundary, then ASSERT(). 166 166 167 167 @param Port The I/O port to read. 168 168 … … 198 198 If 32-bit I/O port operations are not supported, then ASSERT(). 199 199 If Port is not aligned on a 32-bit boundary, then ASSERT(). 200 200 201 201 @param Port The I/O port to write. 202 202 @param Value The value to write to the I/O port. … … 338 338 @param Address The MMIO register to write. 339 339 @param Value The value to write to the MMIO register. 340 340 341 341 @return Value. 342 342 … … 407 407 @param Address The MMIO register to write. 408 408 @param Value The value to write to the MMIO register. 409 409 410 410 @return Value. 411 411 … … 479 479 @param Address The MMIO register to write. 480 480 @param Value The value to write to the MMIO register. 481 481 482 482 @return Value. 483 483 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiIoLibCpuIo/IoLibMmioBuffer.c
r48674 r58466 25 25 Copy data from MMIO region to system memory by using 8-bit access. 26 26 27 Copy data from MMIO region specified by starting address StartAddress 28 to system memory specified by Buffer by using 8-bit access. The total 27 Copy data from MMIO region specified by starting address StartAddress 28 to system memory specified by Buffer by using 8-bit access. The total 29 29 number of byte to be copied is specified by Length. Buffer is returned. 30 31 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 30 31 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 32 32 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 33 33 … … 52 52 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 53 53 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); 54 54 55 55 ReturnBuffer = Buffer; 56 56 57 57 while (Length-- != 0) { 58 58 *(Buffer++) = MmioRead8 (StartAddress++); … … 65 65 Copy data from MMIO region to system memory by using 16-bit access. 66 66 67 Copy data from MMIO region specified by starting address StartAddress 68 to system memory specified by Buffer by using 16-bit access. The total 67 Copy data from MMIO region specified by starting address StartAddress 68 to system memory specified by Buffer by using 16-bit access. The total 69 69 number of byte to be copied is specified by Length. Buffer is returned. 70 70 71 71 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 72 72 73 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 73 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 74 74 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 75 75 … … 95 95 96 96 ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0); 97 97 98 98 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 99 99 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 101 101 ASSERT ((Length & (sizeof (UINT16) - 1)) == 0); 102 102 ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0); 103 103 104 104 ReturnBuffer = Buffer; 105 105 106 106 while (Length != 0) { 107 107 *(Buffer++) = MmioRead16 (StartAddress); … … 116 116 Copy data from MMIO region to system memory by using 32-bit access. 117 117 118 Copy data from MMIO region specified by starting address StartAddress 119 to system memory specified by Buffer by using 32-bit access. The total 118 Copy data from MMIO region specified by starting address StartAddress 119 to system memory specified by Buffer by using 32-bit access. The total 120 120 number of byte to be copied is specified by Length. Buffer is returned. 121 121 122 122 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 123 123 124 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 124 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 125 125 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 126 126 … … 146 146 147 147 ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0); 148 148 149 149 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 150 150 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 152 152 ASSERT ((Length & (sizeof (UINT32) - 1)) == 0); 153 153 ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0); 154 154 155 155 ReturnBuffer = Buffer; 156 156 157 157 while (Length != 0) { 158 158 *(Buffer++) = MmioRead32 (StartAddress); … … 167 167 Copy data from MMIO region to system memory by using 64-bit access. 168 168 169 Copy data from MMIO region specified by starting address StartAddress 170 to system memory specified by Buffer by using 64-bit access. The total 169 Copy data from MMIO region specified by starting address StartAddress 170 to system memory specified by Buffer by using 64-bit access. The total 171 171 number of byte to be copied is specified by Length. Buffer is returned. 172 172 173 173 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 174 174 175 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 175 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 176 176 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 177 177 … … 197 197 198 198 ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0); 199 199 200 200 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 201 201 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 203 203 ASSERT ((Length & (sizeof (UINT64) - 1)) == 0); 204 204 ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0); 205 205 206 206 ReturnBuffer = Buffer; 207 207 208 208 while (Length != 0) { 209 209 *(Buffer++) = MmioRead64 (StartAddress); … … 219 219 Copy data from system memory to MMIO region by using 8-bit access. 220 220 221 Copy data from system memory specified by Buffer to MMIO region specified 222 by starting address StartAddress by using 8-bit access. The total number 221 Copy data from system memory specified by Buffer to MMIO region specified 222 by starting address StartAddress by using 8-bit access. The total number 223 223 of byte to be copied is specified by Length. Buffer is returned. 224 225 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 224 225 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 226 226 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 227 227 … … 246 246 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 247 247 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); 248 248 249 249 ReturnBuffer = (UINT8 *) Buffer; 250 250 251 251 while (Length-- != 0) { 252 252 MmioWrite8 (StartAddress++, *(Buffer++)); … … 254 254 255 255 return ReturnBuffer; 256 256 257 257 } 258 258 … … 260 260 Copy data from system memory to MMIO region by using 16-bit access. 261 261 262 Copy data from system memory specified by Buffer to MMIO region specified 263 by starting address StartAddress by using 16-bit access. The total number 262 Copy data from system memory specified by Buffer to MMIO region specified 263 by starting address StartAddress by using 16-bit access. The total number 264 264 of byte to be copied is specified by Length. Buffer is returned. 265 265 266 266 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 267 267 268 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 268 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 269 269 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 270 270 … … 291 291 292 292 ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0); 293 293 294 294 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 295 295 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 299 299 300 300 ReturnBuffer = (UINT16 *) Buffer; 301 301 302 302 while (Length != 0) { 303 303 MmioWrite16 (StartAddress, *(Buffer++)); 304 304 305 305 StartAddress += sizeof (UINT16); 306 306 Length -= sizeof (UINT16); … … 314 314 Copy data from system memory to MMIO region by using 32-bit access. 315 315 316 Copy data from system memory specified by Buffer to MMIO region specified 317 by starting address StartAddress by using 32-bit access. The total number 316 Copy data from system memory specified by Buffer to MMIO region specified 317 by starting address StartAddress by using 32-bit access. The total number 318 318 of byte to be copied is specified by Length. Buffer is returned. 319 319 320 320 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 321 321 322 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 322 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 323 323 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 324 324 … … 345 345 346 346 ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0); 347 347 348 348 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 349 349 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 353 353 354 354 ReturnBuffer = (UINT32 *) Buffer; 355 355 356 356 while (Length != 0) { 357 357 MmioWrite32 (StartAddress, *(Buffer++)); 358 358 359 359 StartAddress += sizeof (UINT32); 360 360 Length -= sizeof (UINT32); … … 367 367 Copy data from system memory to MMIO region by using 64-bit access. 368 368 369 Copy data from system memory specified by Buffer to MMIO region specified 370 by starting address StartAddress by using 64-bit access. The total number 369 Copy data from system memory specified by Buffer to MMIO region specified 370 by starting address StartAddress by using 64-bit access. The total number 371 371 of byte to be copied is specified by Length. Buffer is returned. 372 372 373 373 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 374 374 375 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 375 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 376 376 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 377 377 … … 398 398 399 399 ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0); 400 400 401 401 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 402 402 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 406 406 407 407 ReturnBuffer = (UINT64 *) Buffer; 408 408 409 409 while (Length != 0) { 410 410 MmioWrite64 (StartAddress, *(Buffer++)); 411 411 412 412 StartAddress += sizeof (UINT64); 413 413 Length -= sizeof (UINT64); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
r58459 r58466 35 35 IoLib.c 36 36 IoLibMmioBuffer.c 37 37 38 38 [Packages] 39 39 MdePkg/MdePkg.dec -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
r58459 r58466 1 1 /** @file 2 Support routines for memory allocation routines 2 Support routines for memory allocation routines 3 3 based on PeiService for PEI phase drivers. 4 4 5 5 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php. 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php. 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 13 14 14 **/ … … 40 40 VOID * 41 41 InternalAllocatePages ( 42 IN EFI_MEMORY_TYPE MemoryType, 42 IN EFI_MEMORY_TYPE MemoryType, 43 43 IN UINTN Pages 44 44 ) 45 45 { 46 46 EFI_STATUS Status; 47 EFI_PHYSICAL_ADDRESS Memory; 47 EFI_PHYSICAL_ADDRESS Memory; 48 48 EFI_MEMORY_TYPE RequestType; 49 49 EFI_PEI_HOB_POINTERS Hob; … … 56 56 if (MemoryType == EfiReservedMemoryType) { 57 57 // 58 // PEI AllocatePages() doesn't support EfiReservedMemoryType. 58 // PEI AllocatePages() doesn't support EfiReservedMemoryType. 59 59 // Change RequestType to EfiBootServicesData for memory allocation. 60 60 // … … 66 66 return NULL; 67 67 } 68 68 69 69 if (MemoryType == EfiReservedMemoryType) { 70 70 // 71 // Memory type needs to be updated to EfiReservedMemoryType. Per PI spec Volume 1, 72 // PEI AllocatePages() will automate the creation of the Memory Allocation HOB types. 71 // Memory type needs to be updated to EfiReservedMemoryType. Per PI spec Volume 1, 72 // PEI AllocatePages() will automate the creation of the Memory Allocation HOB types. 73 73 // Search Memory Allocation HOB and find the matched memory region, 74 74 // then change its memory type to EfiReservedMemoryType. … … 160 160 Allocation Library. If it is not possible to free allocated pages, then this function will 161 161 perform no actions. 162 162 163 163 If Buffer was not allocated with a page allocation function in the Memory Allocation Library, 164 164 then ASSERT(). 165 165 If Pages is zero, then ASSERT(). 166 166 167 167 @param Buffer The pointer to the buffer of pages to free. 168 168 @param Pages The number of 4 KB pages to free. … … 194 194 @param MemoryType The type of memory to allocate. 195 195 @param Pages The number of 4 KB pages to allocate. 196 @param Alignment The requested alignment of the allocation. 196 @param Alignment The requested alignment of the allocation. 197 197 Must be a power of two. 198 198 If Alignment is zero, then byte alignment is used. … … 203 203 VOID * 204 204 InternalAllocateAlignedPages ( 205 IN EFI_MEMORY_TYPE MemoryType, 205 IN EFI_MEMORY_TYPE MemoryType, 206 206 IN UINTN Pages, 207 207 IN UINTN Alignment … … 229 229 // Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow. 230 230 // 231 ASSERT (Pages <= (MAX_ADDRESS - EFI_SIZE_TO_PAGES (Alignment))); 231 ASSERT (Pages <= (MAX_ADDRESS - EFI_SIZE_TO_PAGES (Alignment))); 232 232 233 233 // … … 236 236 // we simply reserve an overhead memory equal to Alignmemt(page-aligned), no matter what. 237 237 // The overhead mem size could be reduced later with more involved malloc mechanisms 238 // (e.g., somthing that can detect the alignment boundary before allocating memory or 238 // (e.g., somthing that can detect the alignment boundary before allocating memory or 239 239 // can request that memory be allocated at a certain address that is aleady aligned). 240 240 // … … 282 282 } 283 283 284 // 285 // Search for the mem HOB referring to the original(unaligned) allocation 284 // 285 // Search for the mem HOB referring to the original(unaligned) allocation 286 286 // and update the size and type if needed. 287 287 // … … 303 303 } else { 304 304 // 305 // Use this HOB as before mem HOB and create a new HOB for the aligned portion 305 // Use this HOB as before mem HOB and create a new HOB for the aligned portion 306 306 // 307 HobLength = (AlignedMemory - Memory); 307 HobLength = (AlignedMemory - Memory); 308 308 Hob.MemoryAllocation->AllocDescriptor.MemoryLength = HobLength; 309 309 Hob.MemoryAllocation->AllocDescriptor.MemoryType = EfiConventionalMemory; … … 368 368 returned. If there is not enough memory at the specified alignment remaining to satisfy the 369 369 request, then NULL is returned. 370 370 371 371 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 372 372 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). 373 373 374 374 @param Pages The number of 4 KB pages to allocate. 375 @param Alignment The requested alignment of the allocation. 375 @param Alignment The requested alignment of the allocation. 376 376 Must be a power of two. 377 377 If Alignment is zero, then byte alignment is used. … … 397 397 returned. If there is not enough memory at the specified alignment remaining to satisfy the 398 398 request, then NULL is returned. 399 399 400 400 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 401 401 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). 402 402 403 403 @param Pages The number of 4 KB pages to allocate. 404 @param Alignment The requested alignment of the allocation. 404 @param Alignment The requested alignment of the allocation. 405 405 Must be a power of two. 406 406 If Alignment is zero, then byte alignment is used. … … 426 426 returned. If there is not enough memory at the specified alignment remaining to satisfy the 427 427 request, then NULL is returned. 428 428 429 429 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 430 430 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). 431 431 432 432 @param Pages The number of 4 KB pages to allocate. 433 @param Alignment The requested alignment of the allocation. 433 @param Alignment The requested alignment of the allocation. 434 434 Must be a power of two. 435 435 If Alignment is zero, then byte alignment is used. … … 454 454 Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer 455 455 must have been allocated on a previous call to the aligned page allocation services of the Memory 456 Allocation Library. If it is not possible to free allocated pages, then this function will 456 Allocation Library. If it is not possible to free allocated pages, then this function will 457 457 perform no actions. 458 458 459 459 If Buffer was not allocated with an aligned page allocation function in the Memory Allocation 460 460 Library, then ASSERT(). 461 461 If Pages is zero, then ASSERT(). 462 462 463 463 @param Buffer The pointer to the buffer of pages to free. 464 464 @param Pages The number of 4 KB pages to free. … … 493 493 VOID * 494 494 InternalAllocatePool ( 495 IN EFI_MEMORY_TYPE MemoryType, 495 IN EFI_MEMORY_TYPE MemoryType, 496 496 IN UINTN AllocationSize 497 497 ) 498 498 { 499 499 // 500 // If we need lots of small runtime/reserved memory type from PEI in the future, 501 // we can consider providing a more complex algorithm that allocates runtime pages and 502 // provide pool allocations from those pages. 500 // If we need lots of small runtime/reserved memory type from PEI in the future, 501 // we can consider providing a more complex algorithm that allocates runtime pages and 502 // provide pool allocations from those pages. 503 503 // 504 504 return InternalAllocatePages (MemoryType, EFI_SIZE_TO_PAGES (AllocationSize)); … … 525 525 EFI_STATUS Status; 526 526 VOID *Buffer; 527 527 528 528 Status = PeiServicesAllocatePool (AllocationSize, &Buffer); 529 529 if (EFI_ERROR (Status)) { … … 591 591 VOID * 592 592 InternalAllocateZeroPool ( 593 IN EFI_MEMORY_TYPE PoolType, 593 IN EFI_MEMORY_TYPE PoolType, 594 594 IN UINTN AllocationSize 595 ) 595 ) 596 596 { 597 597 VOID *Memory; … … 684 684 is not enough memory remaining to satisfy the request, then NULL is returned. 685 685 If Buffer is NULL, then ASSERT(). 686 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 686 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 687 687 688 688 @param PoolType The type of pool to allocate. … … 695 695 VOID * 696 696 InternalAllocateCopyPool ( 697 IN EFI_MEMORY_TYPE PoolType, 697 IN EFI_MEMORY_TYPE PoolType, 698 698 IN UINTN AllocationSize, 699 699 IN CONST VOID *Buffer 700 ) 700 ) 701 701 { 702 702 VOID *Memory; … … 710 710 } 711 711 return Memory; 712 } 712 } 713 713 714 714 /** … … 719 719 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 720 720 is not enough memory remaining to satisfy the request, then NULL is returned. 721 721 722 722 If Buffer is NULL, then ASSERT(). 723 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 723 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 724 724 725 725 @param AllocationSize The number of bytes to allocate and zero. … … 755 755 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 756 756 is not enough memory remaining to satisfy the request, then NULL is returned. 757 757 758 758 If Buffer is NULL, then ASSERT(). 759 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 759 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 760 760 761 761 @param AllocationSize The number of bytes to allocate and zero. … … 782 782 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 783 783 is not enough memory remaining to satisfy the request, then NULL is returned. 784 784 785 785 If Buffer is NULL, then ASSERT(). 786 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 786 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 787 787 788 788 @param AllocationSize The number of bytes to allocate and zero. … … 806 806 807 807 Allocates and zeros the number bytes specified by NewSize from memory of the type 808 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 809 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 810 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 811 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 808 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 809 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 810 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 811 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 812 812 enough memory remaining to satisfy the request, then NULL is returned. 813 813 814 814 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize 815 815 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). … … 818 818 @param OldSize The size, in bytes, of OldBuffer. 819 819 @param NewSize The size, in bytes, of the buffer to reallocate. 820 @param OldBuffer The buffer to copy to the allocated buffer. This is an 820 @param OldBuffer The buffer to copy to the allocated buffer. This is an 821 821 optional parameter that may be NULL. 822 822 … … 826 826 VOID * 827 827 InternalReallocatePool ( 828 IN EFI_MEMORY_TYPE PoolType, 828 IN EFI_MEMORY_TYPE PoolType, 829 829 IN UINTN OldSize, 830 830 IN UINTN NewSize, … … 846 846 847 847 Allocates and zeros the number bytes specified by NewSize from memory of type 848 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 849 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 850 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 851 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 848 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 849 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 850 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 851 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 852 852 enough memory remaining to satisfy the request, then NULL is returned. 853 853 854 854 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize 855 855 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). … … 857 857 @param OldSize The size, in bytes, of OldBuffer. 858 858 @param NewSize The size, in bytes, of the buffer to reallocate. 859 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 859 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 860 860 parameter that may be NULL. 861 861 … … 878 878 879 879 Allocates and zeros the number bytes specified by NewSize from memory of type 880 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 881 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 882 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 883 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 880 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 881 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 882 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 883 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 884 884 enough memory remaining to satisfy the request, then NULL is returned. 885 885 … … 889 889 @param OldSize The size, in bytes, of OldBuffer. 890 890 @param NewSize The size, in bytes, of the buffer to reallocate. 891 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 891 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 892 892 parameter that may be NULL. 893 893 … … 910 910 911 911 Allocates and zeros the number bytes specified by NewSize from memory of type 912 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and 913 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 914 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 915 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 912 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and 913 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 914 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 915 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 916 916 enough memory remaining to satisfy the request, then NULL is returned. 917 917 … … 921 921 @param OldSize The size, in bytes, of OldBuffer. 922 922 @param NewSize The size, in bytes, of the buffer to reallocate. 923 @param OldBuffer The buffer to copy to the allocated buffer. This is an 923 @param OldBuffer The buffer to copy to the allocated buffer. This is an 924 924 optional parameter that may be NULL. 925 925 … … 945 945 pool allocation services of the Memory Allocation Library. If it is not possible to free pool 946 946 resources, then this function will perform no actions. 947 947 948 948 If Buffer was not allocated with a pool allocation function in the Memory Allocation Library, 949 949 then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c
r48674 r58466 32 32 value returned is the first mismatched byte in SourceBuffer subtracted from the first 33 33 mismatched byte in DestinationBuffer. 34 34 35 35 If Length > 0 and DestinationBuffer is NULL, then ASSERT(). 36 36 If Length > 0 and SourceBuffer is NULL, then ASSERT(). … … 45 45 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first 46 46 mismatched byte in DestinationBuffer. 47 47 48 48 **/ 49 49 INTN -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/CopyMemWrapper.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 32 32 DestinationBuffer. The implementation must be reentrant, and it must handle the case 33 33 where SourceBuffer overlaps DestinationBuffer. 34 34 35 35 If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). 36 36 If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/MemLib.c
r48674 r58466 19 19 20 20 This function wraps the gPS->CopyMem (). 21 21 22 22 @param DestinationBuffer The pointer to the destination buffer of the memory copy. 23 23 @param SourceBuffer The pointer to the source buffer of the memory copy. … … 47 47 48 48 This function wraps the gPS->SetMem (). 49 49 50 50 @param Buffer Memory to set. 51 51 @param Size The number of bytes to set. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/MemLibGuid.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 31 31 This function copies the contents of the 128-bit GUID specified by SourceGuid to 32 32 DestinationGuid, and returns DestinationGuid. 33 33 34 34 If DestinationGuid is NULL, then ASSERT(). 35 35 If SourceGuid is NULL, then ASSERT(). … … 64 64 This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. 65 65 If there are any bit differences in the two GUIDs, then FALSE is returned. 66 66 67 67 If Guid1 is NULL, then ASSERT(). 68 68 If Guid2 is NULL, then ASSERT(). … … 104 104 GUID in the target buffer is returned. If no match is found, then NULL is returned. 105 105 If Length is 0, then NULL is returned. 106 106 107 107 If Length > 0 and Buffer is NULL, then ASSERT(). 108 108 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/MemLibInternals.h
r48674 r58466 27 27 28 28 This function wraps the (*PeiServices)->CopyMem (). 29 29 30 30 @param DestinationBuffer The pointer to the destination buffer of the memory copy. 31 31 @param SourceBuffer The pointer to the source buffer of the memory copy. … … 47 47 48 48 This function wraps the (*PeiServices)->SetMem (). 49 49 50 50 @param Buffer The memory to set. 51 51 @param Size The number of bytes to set. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c
r48674 r58466 33 33 then a pointer to the matching byte in the target buffer is returned. If no match is found, 34 34 then NULL is returned. If Length is 0, then NULL is returned. 35 35 36 36 If Length > 0 and Buffer is NULL, then ASSERT(). 37 37 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). … … 58 58 ASSERT (Buffer != NULL); 59 59 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); 60 60 61 61 return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); 62 62 } 63 63 64 64 /** 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 66 66 UINTN sized value in the target buffer. 67 67 … … 70 70 then a pointer to the matching byte in the target buffer is returned. If no match is found, 71 71 then NULL is returned. If Length is 0, then NULL is returned. 72 72 73 73 If Length > 0 and Buffer is NULL, then ASSERT(). 74 74 If Buffer is not aligned on a UINTN boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c
r48674 r58466 30 30 31 31 This function fills Length bytes of Buffer with Value, and returns Buffer. 32 32 33 33 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 34 34 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c
r48674 r58466 12 12 PeiMemoryLib 13 13 UefiMemoryLib 14 14 15 15 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> 16 16 This program and the accompanying materials … … 30 30 31 31 This function fills Length bytes of Buffer with zeros, and returns Buffer. 32 32 33 33 If Length > 0 and Buffer is NULL, then ASSERT(). 34 34 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiPalLib/PeiPalLib.c
r48674 r58466 3 3 4 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 13 13 **/ 14 14 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
r58459 r58466 3 3 4 4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 … … 32 32 Retrieve the PCD_PPI pointer. 33 33 34 This function is to locate PCD_PPI PPI via PeiService. 34 This function is to locate PCD_PPI PPI via PeiService. 35 35 If fail to locate PCD_PPI, then ASSERT_EFI_ERROR(). 36 36 37 37 @retval PCD_PPI * The pointer to the PCD_PPI. 38 38 … … 41 41 GetPcdPpiPointer ( 42 42 VOID 43 ) 43 ) 44 44 { 45 45 EFI_STATUS Status; 46 46 PCD_PPI *PcdPpi; 47 47 48 48 Status = PeiServicesLocatePpi (&gPcdPpiGuid, 0, NULL, (VOID **)&PcdPpi); 49 49 ASSERT_EFI_ERROR (Status); … … 55 55 Retrieve the pointer of EFI_PEI_PCD_PPI defined in PI 1.2 Vol 3. 56 56 57 This function is to locate EFI_PEI_PCD_PPI PPI via PeiService. 57 This function is to locate EFI_PEI_PCD_PPI PPI via PeiService. 58 58 If fail to locate EFI_PEI_PCD_PPI, then ASSERT_EFI_ERROR(). 59 59 60 60 @retval EFI_PEI_PCD_PPI * The pointer to the EFI_PEI_PCD_PPI. 61 61 … … 68 68 EFI_STATUS Status; 69 69 EFI_PEI_PCD_PPI *PiPcdPpi; 70 70 71 71 Status = PeiServicesLocatePpi (&gEfiPeiPcdPpiGuid, 0, NULL, (VOID **)&PiPcdPpi); 72 72 ASSERT_EFI_ERROR (Status); 73 73 74 74 return PiPcdPpi; 75 } 75 } 76 76 77 77 /** 78 78 Retrieve the GET_PCD_INFO_PPI pointer. 79 79 80 This function is to locate GET_PCD_INFO_PPI PPI via PeiService. 80 This function is to locate GET_PCD_INFO_PPI PPI via PeiService. 81 81 If fail to locate GET_PCD_INFO_PPI, then ASSERT_EFI_ERROR(). 82 82 … … 87 87 GetPcdInfoPpiPointer ( 88 88 VOID 89 ) 89 ) 90 90 { 91 91 EFI_STATUS Status; 92 92 GET_PCD_INFO_PPI *PcdInfoPpi; 93 93 94 94 Status = PeiServicesLocatePpi (&gGetPcdInfoPpiGuid, 0, NULL, (VOID **)&PcdInfoPpi); 95 95 ASSERT_EFI_ERROR (Status); … … 101 101 Retrieve the pointer of EFI_GET_PCD_INFO_PPI defined in PI 1.2.1 Vol 3. 102 102 103 This function is to locate EFI_GET_PCD_INFO_PPI PPI via PeiService. 103 This function is to locate EFI_GET_PCD_INFO_PPI PPI via PeiService. 104 104 If fail to locate EFI_GET_PCD_INFO_PPI, then ASSERT_EFI_ERROR(). 105 105 … … 114 114 EFI_STATUS Status; 115 115 EFI_GET_PCD_INFO_PPI *PiPcdInfoPpi; 116 116 117 117 Status = PeiServicesLocatePpi (&gEfiGetPcdInfoPpiGuid, 0, NULL, (VOID **)&PiPcdInfoPpi); 118 118 ASSERT_EFI_ERROR (Status); 119 119 120 120 return PiPcdInfoPpi; 121 } 121 } 122 122 123 123 /** … … 125 125 126 126 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned. 127 If SkuId >= PCD_MAX_SKU_ID, then ASSERT(). 128 129 @param SkuId The SKU value that will be used when the PCD service retrieves 127 If SkuId >= PCD_MAX_SKU_ID, then ASSERT(). 128 129 @param SkuId The SKU value that will be used when the PCD service retrieves 130 130 and sets values associated with a PCD token. 131 131 … … 143 143 144 144 GetPiPcdPpiPointer()->SetSku (SkuId); 145 145 146 146 return SkuId; 147 147 } … … 151 151 /** 152 152 This function provides a means by which to retrieve a value for a given PCD token. 153 154 Returns the 8-bit value for the token specified by TokenNumber. 153 154 Returns the 8-bit value for the token specified by TokenNumber. 155 155 156 156 @param[in] TokenNumber The PCD token number to retrieve a current value for. 157 157 158 @return Returns the 8-bit value for the token specified by TokenNumber. 158 @return Returns the 8-bit value for the token specified by TokenNumber. 159 159 160 160 **/ … … 172 172 /** 173 173 This function provides a means by which to retrieve a value for a given PCD token. 174 175 Returns the 16-bit value for the token specified by TokenNumber. 174 175 Returns the 16-bit value for the token specified by TokenNumber. 176 176 177 177 @param[in] TokenNumber The PCD token number to retrieve a current value for. 178 178 179 @return Returns the 16-bit value for the token specified by TokenNumber. 179 @return Returns the 16-bit value for the token specified by TokenNumber. 180 180 181 181 **/ … … 193 193 /** 194 194 This function provides a means by which to retrieve a value for a given PCD token. 195 196 Returns the 32-bit value for the token specified by TokenNumber. 195 196 Returns the 32-bit value for the token specified by TokenNumber. 197 197 198 198 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 214 214 /** 215 215 This function provides a means by which to retrieve a value for a given PCD token. 216 216 217 217 Returns the 64-bit value for the token specified by TokenNumber. 218 218 … … 235 235 /** 236 236 This function provides a means by which to retrieve a value for a given PCD token. 237 237 238 238 Returns the pointer to the buffer of the token specified by TokenNumber. 239 239 … … 256 256 /** 257 257 This function provides a means by which to retrieve a value for a given PCD token. 258 259 Returns the Boolean value of the token specified by TokenNumber. 258 259 Returns the Boolean value of the token specified by TokenNumber. 260 260 261 261 @param[in] TokenNumber The PCD token number to retrieve a current value for. 262 262 263 @return Returns the Boolean value of the token specified by TokenNumber. 264 265 **/ 266 BOOLEAN 263 @return Returns the Boolean value of the token specified by TokenNumber. 264 265 **/ 266 BOOLEAN 267 267 EFIAPI 268 268 LibPcdGetBool ( … … 280 280 @param[in] TokenNumber The PCD token number to retrieve a current value for. 281 281 282 @return Returns the size of the token specified by TokenNumber. 282 @return Returns the size of the token specified by TokenNumber. 283 283 284 284 **/ … … 296 296 /** 297 297 This function provides a means by which to retrieve a value for a given PCD token. 298 298 299 299 Returns the 8-bit value for the token specified by TokenNumber and Guid. 300 301 If Guid is NULL, then ASSERT(). 302 303 @param[in] Guid The pointer to a 128-bit unique value that designates 300 301 If Guid is NULL, then ASSERT(). 302 303 @param[in] Guid The pointer to a 128-bit unique value that designates 304 304 which namespace to retrieve a value from. 305 305 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 326 326 327 327 Returns the 16-bit value for the token specified by TokenNumber and Guid. 328 329 If Guid is NULL, then ASSERT(). 330 331 @param[in] Guid The pointer to a 128-bit unique value that designates 328 329 If Guid is NULL, then ASSERT(). 330 331 @param[in] Guid The pointer to a 128-bit unique value that designates 332 332 which namespace to retrieve a value from. 333 333 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 353 353 /** 354 354 Returns the 32-bit value for the token specified by TokenNumber and Guid. 355 If Guid is NULL, then ASSERT(). 356 357 @param[in] Guid The pointer to a 128-bit unique value that designates 355 If Guid is NULL, then ASSERT(). 356 357 @param[in] Guid The pointer to a 128-bit unique value that designates 358 358 which namespace to retrieve a value from. 359 359 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 379 379 /** 380 380 This function provides a means by which to retrieve a value for a given PCD token. 381 381 382 382 Returns the 64-bit value for the token specified by TokenNumber and Guid. 383 384 If Guid is NULL, then ASSERT(). 385 386 @param[in] Guid The pointer to a 128-bit unique value that designates 383 384 If Guid is NULL, then ASSERT(). 385 386 @param[in] Guid The pointer to a 128-bit unique value that designates 387 387 which namespace to retrieve a value from. 388 388 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 406 406 /** 407 407 This function provides a means by which to retrieve a value for a given PCD token. 408 408 409 409 Returns the pointer to the buffer of token specified by TokenNumber and Guid. 410 411 If Guid is NULL, then ASSERT(). 412 413 @param[in] Guid The pointer to a 128-bit unique value that designates 410 411 If Guid is NULL, then ASSERT(). 412 413 @param[in] Guid The pointer to a 128-bit unique value that designates 414 414 which namespace to retrieve a value from. 415 415 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 434 434 /** 435 435 This function provides a means by which to retrieve a value for a given PCD token. 436 437 Returns the Boolean value of the token specified by TokenNumber and Guid. 438 439 If Guid is NULL, then ASSERT(). 440 441 @param[in] Guid The pointer to a 128-bit unique value that designates 436 437 Returns the Boolean value of the token specified by TokenNumber and Guid. 438 439 If Guid is NULL, then ASSERT(). 440 441 @param[in] Guid The pointer to a 128-bit unique value that designates 442 442 which namespace to retrieve a value from. 443 443 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 461 461 /** 462 462 This function provides a means by which to retrieve the size of a given PCD token. 463 464 Returns the size of the token specified by TokenNumber and Guid. 465 466 If Guid is NULL, then ASSERT(). 467 468 @param[in] Guid The pointer to a 128-bit unique value that designates 463 464 Returns the size of the token specified by TokenNumber and Guid. 465 466 If Guid is NULL, then ASSERT(). 467 468 @param[in] Guid The pointer to a 128-bit unique value that designates 469 469 which namespace to retrieve a value from. 470 470 @param[in] TokenNumber The PCD token number to retrieve a current value for. … … 488 488 /** 489 489 This function provides a means by which to set a value for a given PCD token. 490 491 Sets the 8-bit value for the token specified by TokenNumber 490 491 Sets the 8-bit value for the token specified by TokenNumber 492 492 to the value specified by Value. Value is returned. 493 493 … … 512 512 513 513 ASSERT_EFI_ERROR (Status); 514 514 515 515 return Value; 516 516 } … … 520 520 /** 521 521 This function provides a means by which to set a value for a given PCD token. 522 523 Sets the 16-bit value for the token specified by TokenNumber 522 523 Sets the 16-bit value for the token specified by TokenNumber 524 524 to the value specified by Value. Value is returned. 525 525 … … 544 544 545 545 ASSERT_EFI_ERROR (Status); 546 546 547 547 return Value; 548 548 } … … 552 552 /** 553 553 This function provides a means by which to set a value for a given PCD token. 554 555 Sets the 32-bit value for the token specified by TokenNumber 554 555 Sets the 32-bit value for the token specified by TokenNumber 556 556 to the value specified by Value. Value is returned. 557 557 … … 584 584 /** 585 585 This function provides a means by which to set a value for a given PCD token. 586 587 Sets the 64-bit value for the token specified by TokenNumber 586 587 Sets the 64-bit value for the token specified by TokenNumber 588 588 to the value specified by Value. Value is returned. 589 589 … … 616 616 /** 617 617 This function provides a means by which to set a value for a given PCD token. 618 619 Sets a buffer for the token specified by TokenNumber to the value 620 specified by Buffer and SizeOfBuffer. Buffer is returned. 621 If SizeOfBuffer is greater than the maximum size support by TokenNumber, 622 then set SizeOfBuffer to the maximum size supported by TokenNumber and 618 619 Sets a buffer for the token specified by TokenNumber to the value 620 specified by Buffer and SizeOfBuffer. Buffer is returned. 621 If SizeOfBuffer is greater than the maximum size support by TokenNumber, 622 then set SizeOfBuffer to the maximum size supported by TokenNumber and 623 623 return NULL to indicate that the set operation was not actually performed, 624 624 or ASSERT() if the set operation was not corretly performed. 625 625 626 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the 626 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the 627 627 maximum size supported by TokenName and NULL must be returned. 628 628 629 629 If SizeOfBuffer is NULL, then ASSERT(). 630 630 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 631 631 632 632 @param[in] TokenNumber The PCD token number to set a current value for. 633 633 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. … … 668 668 /** 669 669 This function provides a means by which to set a value for a given PCD token. 670 671 Sets the Boolean value for the token specified by TokenNumber 670 671 Sets the Boolean value for the token specified by TokenNumber 672 672 to the value specified by Value. Value is returned. 673 673 … … 700 700 /** 701 701 This function provides a means by which to set a value for a given PCD token. 702 703 Sets the 8-bit value for the token specified by TokenNumber and 702 703 Sets the 8-bit value for the token specified by TokenNumber and 704 704 Guid to the value specified by Value. Value is returned. 705 705 … … 707 707 If the set operation was not correctly performed, then ASSERT(). 708 708 709 @param[in] Guid The pointer to a 128-bit unique value that 709 @param[in] Guid The pointer to a 128-bit unique value that 710 710 designates which namespace to set a value from. 711 711 @param[in] TokenNumber The PCD token number to set a current value for. … … 738 738 /** 739 739 This function provides a means by which to set a value for a given PCD token. 740 741 Sets the 16-bit value for the token specified by TokenNumber and 740 741 Sets the 16-bit value for the token specified by TokenNumber and 742 742 Guid to the value specified by Value. Value is returned. 743 743 … … 745 745 If the set operation was not correctly performed, then ASSERT(). 746 746 747 @param[in] Guid The pointer to a 128-bit unique value that 747 @param[in] Guid The pointer to a 128-bit unique value that 748 748 designates which namespace to set a value from. 749 749 @param[in] TokenNumber The PCD token number to set a current value for. … … 774 774 /** 775 775 This function provides a means by which to set a value for a given PCD token. 776 777 Sets the 32-bit value for the token specified by TokenNumber and 776 777 Sets the 32-bit value for the token specified by TokenNumber and 778 778 Guid to the value specified by Value. Value is returned. 779 779 … … 781 781 If the set operation was not correctly performed, then ASSERT(). 782 782 783 @param[in] Guid The pointer to a 128-bit unique value that 783 @param[in] Guid The pointer to a 128-bit unique value that 784 784 designates which namespace to set a value from. 785 785 @param[in] TokenNumber The PCD token number to set a current value for. … … 812 812 /** 813 813 This function provides a means by which to set a value for a given PCD token. 814 815 Sets the 64-bit value for the token specified by TokenNumber and 814 815 Sets the 64-bit value for the token specified by TokenNumber and 816 816 Guid to the value specified by Value. Value is returned. 817 817 … … 819 819 If the set operation was not correctly performed, then ASSERT(). 820 820 821 @param[in] Guid The pointer to a 128-bit unique value that 821 @param[in] Guid The pointer to a 128-bit unique value that 822 822 designates which namespace to set a value from. 823 823 @param[in] TokenNumber The PCD token number to set a current value for. … … 849 849 /** 850 850 This function provides a means by which to set a value for a given PCD token. 851 852 Sets a buffer for the token specified by TokenNumber to the value specified by 853 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 854 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size 855 supported by TokenNumber and return NULL to indicate that the set operation 851 852 Sets a buffer for the token specified by TokenNumber to the value specified by 853 Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 854 the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size 855 supported by TokenNumber and return NULL to indicate that the set operation 856 856 was not actually performed, or ASSERT() if the set operation was not corretly performed. 857 857 858 858 If Guid is NULL, then ASSERT(). 859 859 If SizeOfBuffer is NULL, then ASSERT(). 860 860 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 861 862 @param[in] Guid The pointer to a 128-bit unique value that 861 862 @param[in] Guid The pointer to a 128-bit unique value that 863 863 designates which namespace to set a value from. 864 864 @param[in] TokenNumber The PCD token number to set a current value for. … … 902 902 /** 903 903 This function provides a means by which to set a value for a given PCD token. 904 905 Sets the Boolean value for the token specified by TokenNumber and 904 905 Sets the Boolean value for the token specified by TokenNumber and 906 906 Guid to the value specified by Value. Value is returned. 907 907 … … 909 909 If the set operation was not correctly performed, then ASSERT(). 910 910 911 @param[in] Guid The pointer to a 128-bit unique value that 911 @param[in] Guid The pointer to a 128-bit unique value that 912 912 designates which namespace to set a value from. 913 913 @param[in] TokenNumber The PCD token number to set a current value for. … … 939 939 /** 940 940 Set up a notification function that is called when a specified token is set. 941 942 When the token specified by TokenNumber and Guid is set, 943 then notification function specified by NotificationFunction is called. 941 942 When the token specified by TokenNumber and Guid is set, 943 then notification function specified by NotificationFunction is called. 944 944 If Guid is NULL, then the default token space is used. 945 945 If NotificationFunction is NULL, then ASSERT(). 946 946 947 @param[in] Guid The pointer to a 128-bit unique value that 948 designates which namespace to set a value from. 947 @param[in] Guid The pointer to a 128-bit unique value that 948 designates which namespace to set a value from. 949 949 If NULL, then the default token space is used. 950 950 @param[in] TokenNumber The PCD token number to monitor. 951 @param[in] NotificationFunction The function to call when the token 951 @param[in] NotificationFunction The function to call when the token 952 952 specified by Guid and TokenNumber is set. 953 953 … … 976 976 /** 977 977 Disable a notification function that was established with LibPcdCallbackonSet(). 978 978 979 979 Disable a notification function that was previously established with LibPcdCallbackOnSet(). 980 980 If NotificationFunction is NULL, then ASSERT(). 981 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, 981 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, 982 982 and NotificationFunction, then ASSERT(). 983 983 984 984 @param[in] Guid Specify the GUID token space. 985 985 @param[in] TokenNumber Specify the token number. … … 1010 1010 /** 1011 1011 Retrieves the next token in a token space. 1012 1013 Retrieves the next PCD token number from the token space specified by Guid. 1014 If Guid is NULL, then the default token space is used. If TokenNumber is 0, 1015 then the first token number is returned. Otherwise, the token number that 1016 follows TokenNumber in the token space is returned. If TokenNumber is the last 1017 token number in the token space, then 0 is returned. 1018 1012 1013 Retrieves the next PCD token number from the token space specified by Guid. 1014 If Guid is NULL, then the default token space is used. If TokenNumber is 0, 1015 then the first token number is returned. Otherwise, the token number that 1016 follows TokenNumber in the token space is returned. If TokenNumber is the last 1017 token number in the token space, then 0 is returned. 1018 1019 1019 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT(). 1020 1020 1021 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace 1021 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace 1022 1022 to set a value from. If NULL, then the default token space is used. 1023 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD 1023 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD 1024 1024 token number. 1025 1025 … … 1027 1027 1028 1028 **/ 1029 UINTN 1029 UINTN 1030 1030 EFIAPI 1031 1031 LibPcdGetNextToken ( … … 1045 1045 /** 1046 1046 Used to retrieve the list of available PCD token space GUIDs. 1047 1047 1048 1048 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces 1049 1049 in the platform. 1050 1050 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned. 1051 1051 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned. 1052 1052 1053 1053 @param TokenSpaceGuid The pointer to the a PCD token space GUID 1054 1054 … … 1071 1071 /** 1072 1072 Sets a value of a patchable PCD entry that is type pointer. 1073 1074 Sets the PCD entry specified by PatchVariable to the value specified by Buffer 1075 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 1076 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 1077 NULL to indicate that the set operation was not actually performed. 1078 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 1073 1074 Sets the PCD entry specified by PatchVariable to the value specified by Buffer 1075 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 1076 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 1077 NULL to indicate that the set operation was not actually performed. 1078 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 1079 1079 MaximumDatumSize and NULL must be returned. 1080 1080 1081 1081 If PatchVariable is NULL, then ASSERT(). 1082 1082 If SizeOfBuffer is NULL, then ASSERT(). 1083 1083 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1084 1084 1085 @param[in] PatchVariable A pointer to the global variable in a module that is 1085 @param[in] PatchVariable A pointer to the global variable in a module that is 1086 1086 the target of the set operation. 1087 1087 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 1088 1088 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 1089 1089 @param[in] Buffer A pointer to the buffer to used to set the target variable. 1090 1090 1091 1091 @return Return the pointer to the buffer been set. 1092 1092 … … 1103 1103 ASSERT (PatchVariable != NULL); 1104 1104 ASSERT (SizeOfBuffer != NULL); 1105 1105 1106 1106 if (*SizeOfBuffer > 0) { 1107 1107 ASSERT (Buffer != NULL); … … 1113 1113 return NULL; 1114 1114 } 1115 1115 1116 1116 CopyMem (PatchVariable, Buffer, *SizeOfBuffer); 1117 1117 1118 1118 return (VOID *) Buffer; 1119 1119 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
r58459 r58466 3 3 # 4 4 # There are two PCD PPIs as follows: 5 # 1) PCD_PPI 5 # 1) PCD_PPI 6 6 # It is EDKII implementation which support Dynamic/DynamicEx Pcds. 7 7 # 2) EFI_PEI_PCD_PPI 8 # It is defined by PI specification 1.2, Vol 3 which only support dynamicEx 8 # It is defined by PI specification 1.2, Vol 3 which only support dynamicEx 9 9 # type Pcd. 10 10 # For dynamicEx type PCD, it is compatible between PCD_PPI and EFI_PEI_PCD_PPI. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiPciLibPciCfg2/PciLib.c
r58459 r58466 8 8 text of the license may be found at 9 9 http://opensource.org/licenses/bsd-license.php. 10 10 11 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. … … 130 130 131 131 /** 132 Registers a PCI device so PCI configuration registers may be accessed after 132 Registers a PCI device so PCI configuration registers may be accessed after 133 133 SetVirtualAddressMap(). 134 135 Registers the PCI device specified by Address so all the PCI configuration registers 134 135 Registers the PCI device specified by Address so all the PCI configuration registers 136 136 associated with that PCI device may be accessed after SetVirtualAddressMap() is called. 137 138 If Address > 0x0FFFFFFF, then ASSERT(). 139 140 @param Address The address that encodes the PCI Bus, Device, Function and 141 Register. 142 137 138 If Address > 0x0FFFFFFF, then ASSERT(). 139 140 @param Address The address that encodes the PCI Bus, Device, Function and 141 Register. 142 143 143 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 144 @retval RETURN_UNSUPPORTED An attempt was made to call this function 144 @retval RETURN_UNSUPPORTED An attempt was made to call this function 145 145 after ExitBootServices(). 146 146 @retval RETURN_UNSUPPORTED The resources required to access the PCI device -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c
r58459 r58466 8 8 text of the license may be found at 9 9 http://opensource.org/licenses/bsd-license.php. 10 10 11 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. … … 50 50 This internal function retrieves PCI CFG2 PPI from PPI database. 51 51 52 @param Address The address that encodes the PCI Segment, Bus, Device, 52 @param Address The address that encodes the PCI Segment, Bus, Device, 53 53 Function and Register. 54 54 … … 164 164 165 165 /** 166 Register a PCI device so PCI configuration registers may be accessed after 166 Register a PCI device so PCI configuration registers may be accessed after 167 167 SetVirtualAddressMap(). 168 168 169 169 If any reserved bits in Address are set, then ASSERT(). 170 170 171 171 @param Address The address that encodes the PCI Bus, Device, Function and 172 172 Register. 173 173 174 174 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 175 @retval RETURN_UNSUPPORTED An attempt was made to call this function 175 @retval RETURN_UNSUPPORTED An attempt was made to call this function 176 176 after ExitBootServices(). 177 177 @retval RETURN_UNSUPPORTED The resources required to access the PCI device … … 196 196 Reads and returns the 8-bit PCI configuration register specified by Address. 197 197 This function must guarantee that all PCI read and write operations are serialized. 198 199 If any reserved bits in Address are set, then ASSERT(). 200 201 @param Address The address that encodes the PCI Segment, Bus, Device, Function, 198 199 If any reserved bits in Address are set, then ASSERT(). 200 201 @param Address The address that encodes the PCI Segment, Bus, Device, Function, 202 202 and Register. 203 203 … … 221 221 Writes the 8-bit PCI configuration register specified by Address with the value specified by Value. 222 222 Value is returned. This function must guarantee that all PCI read and write operations are serialized. 223 223 224 224 If any reserved bits in Address are set, then ASSERT(). 225 225 … … 250 250 The value written to the PCI configuration register is returned. 251 251 This function must guarantee that all PCI read and write operations are serialized. 252 252 253 253 If any reserved bits in Address are set, then ASSERT(). 254 254 … … 298 298 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value, 299 299 followed a bitwise OR with another 8-bit value. 300 300 301 301 Reads the 8-bit PCI configuration register specified by Address, 302 302 performs a bitwise AND between the read result and the value specified by AndData, … … 305 305 The value written to the PCI configuration register is returned. 306 306 This function must guarantee that all PCI read and write operations are serialized. 307 307 308 308 If any reserved bits in Address are set, then ASSERT(). 309 309 … … 533 533 Reads and returns the 16-bit PCI configuration register specified by Address. 534 534 This function must guarantee that all PCI read and write operations are serialized. 535 535 536 536 If any reserved bits in Address are set, then ASSERT(). 537 537 If Address is not aligned on a 16-bit boundary, then ASSERT(). 538 538 539 539 @param Address The address that encodes the PCI Segment, Bus, Device, Function, and Register. 540 540 … … 558 558 Writes the 16-bit PCI configuration register specified by Address with the value specified by Value. 559 559 Value is returned. This function must guarantee that all PCI read and write operations are serialized. 560 560 561 561 If any reserved bits in Address are set, then ASSERT(). 562 562 If Address is not aligned on a 16-bit boundary, then ASSERT(). … … 619 619 The value written to the PCI configuration register is returned. 620 620 This function must guarantee that all PCI read and write operations are serialized. 621 621 622 622 If any reserved bits in Address are set, then ASSERT(). 623 623 If Address is not aligned on a 16-bit boundary, then ASSERT(). 624 624 625 625 @param Address The address that encodes the PCI Segment, Bus, Device, Function, and Register. 626 626 @param AndData The value to AND with the PCI configuration register. … … 642 642 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value, 643 643 followed a bitwise OR with another 16-bit value. 644 644 645 645 Reads the 16-bit PCI configuration register specified by Address, 646 646 performs a bitwise AND between the read result and the value specified by AndData, … … 649 649 The value written to the PCI configuration register is returned. 650 650 This function must guarantee that all PCI read and write operations are serialized. 651 651 652 652 If any reserved bits in Address are set, then ASSERT(). 653 653 If Address is not aligned on a 16-bit boundary, then ASSERT(). … … 747 747 Reads the 16-bit PCI configuration register specified by Address, 748 748 performs a bitwise OR between the read result and the value specified by OrData, 749 and writes the result to the 16-bit PCI configuration register specified by Address. 749 and writes the result to the 16-bit PCI configuration register specified by Address. 750 750 751 751 If any reserved bits in Address are set, then ASSERT(). … … 791 791 This function must guarantee that all PCI read and write operations are serialized. 792 792 Extra left bits in OrData are stripped. 793 793 794 794 If any reserved bits in Address are set, then ASSERT(). 795 795 If Address is not aligned on a 16-bit boundary, then ASSERT(). … … 876 876 Reads and returns the 32-bit PCI configuration register specified by Address. 877 877 This function must guarantee that all PCI read and write operations are serialized. 878 878 879 879 If any reserved bits in Address are set, then ASSERT(). 880 880 If Address is not aligned on a 32-bit boundary, then ASSERT(). 881 881 882 @param Address The address that encodes the PCI Segment, Bus, Device, Function, 882 @param Address The address that encodes the PCI Segment, Bus, Device, Function, 883 883 and Register. 884 884 … … 902 902 Writes the 32-bit PCI configuration register specified by Address with the value specified by Value. 903 903 Value is returned. This function must guarantee that all PCI read and write operations are serialized. 904 904 905 905 If any reserved bits in Address are set, then ASSERT(). 906 906 If Address is not aligned on a 32-bit boundary, then ASSERT(). 907 907 908 @param Address The address that encodes the PCI Segment, Bus, Device, 908 @param Address The address that encodes the PCI Segment, Bus, Device, 909 909 Function, and Register. 910 910 @param Value The value to write. … … 933 933 The value written to the PCI configuration register is returned. 934 934 This function must guarantee that all PCI read and write operations are serialized. 935 935 936 936 If any reserved bits in Address are set, then ASSERT(). 937 937 If Address is not aligned on a 32-bit boundary, then ASSERT(). … … 961 961 The value written to the PCI configuration register is returned. 962 962 This function must guarantee that all PCI read and write operations are serialized. 963 963 964 964 If any reserved bits in Address are set, then ASSERT(). 965 965 If Address is not aligned on a 32-bit boundary, then ASSERT(). 966 966 967 @param Address The address that encodes the PCI Segment, Bus, Device, Function, 967 @param Address The address that encodes the PCI Segment, Bus, Device, Function, 968 968 and Register. 969 969 @param AndData The value to AND with the PCI configuration register. … … 985 985 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value, 986 986 followed a bitwise OR with another 32-bit value. 987 987 988 988 Reads the 32-bit PCI configuration register specified by Address, 989 989 performs a bitwise AND between the read result and the value specified by AndData, … … 992 992 The value written to the PCI configuration register is returned. 993 993 This function must guarantee that all PCI read and write operations are serialized. 994 994 995 995 If any reserved bits in Address are set, then ASSERT(). 996 996 If Address is not aligned on a 32-bit boundary, then ASSERT(). … … 1134 1134 AND, and writes the result back to the bit field in the 32-bit register. 1135 1135 1136 1136 1137 1137 Reads the 32-bit PCI configuration register specified by Address, performs a bitwise 1138 1138 AND between the read result and the value specified by AndData, and writes the result … … 1234 1234 If Size > 0 and Buffer is NULL, then ASSERT(). 1235 1235 1236 @param StartAddress The starting address that encodes the PCI Segment, Bus, 1236 @param StartAddress The starting address that encodes the PCI Segment, Bus, 1237 1237 Device, Function and Register. 1238 1238 @param Size The size in bytes of the transfer. … … 1333 1333 If Size > 0 and Buffer is NULL, then ASSERT(). 1334 1334 1335 @param StartAddress The starting address that encodes the PCI Segment, Bus, 1335 @param StartAddress The starting address that encodes the PCI Segment, Bus, 1336 1336 Device, Function and Register. 1337 1337 @param Size The size in bytes of the transfer. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c
r48674 r58466 3 3 4 4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 29 29 as permanent memory that may be used for general purpose use by software. 30 30 The amount of memory available to software may be less than MemoryLength 31 if published memory has alignment restrictions. 31 if published memory has alignment restrictions. 32 32 If MemoryLength is 0, then ASSERT(). 33 If MemoryLength is greater than (MAX_ADDRESS - MemoryBegin + 1), then ASSERT(). 33 If MemoryLength is greater than (MAX_ADDRESS - MemoryBegin + 1), then ASSERT(). 34 34 35 35 @param MemoryBegin The start address of the memory being declared. … … 53 53 54 54 Status = PeiServicesInstallPeiMemory (MemoryBegin, MemoryLength); 55 55 56 56 return (RETURN_STATUS) Status; 57 57 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
r58459 r58466 110 110 installed or reinstalled. 111 111 112 @param NotifyList A pointer to the list of notification interfaces 112 @param NotifyList A pointer to the list of notification interfaces 113 113 that the caller shall install. 114 114 … … 177 177 This service enables a PEIM to ascertain the address of the list of HOBs in memory. 178 178 179 @param HobList A pointer to the list of HOBs that the PEI Foundation 179 @param HobList A pointer to the list of HOBs that the PEI Foundation 180 180 will initialize. 181 181 182 182 @retval EFI_SUCCESS The list was successfully returned. 183 183 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published. … … 201 201 @param Type The type of HOB to be installed. 202 202 @param Length The length of the HOB to be added. 203 @param Hob The address of a pointer that will contain the 203 @param Hob The address of a pointer that will contain the 204 204 HOB header. 205 205 … … 225 225 This service enables PEIMs to discover additional firmware volumes. 226 226 227 @param Instance This instance of the firmware volume to find. The 227 @param Instance This instance of the firmware volume to find. The 228 228 value 0 is the Boot Firmware Volume (BFV). 229 229 @param VolumeHandle Handle of the firmware volume header of the volume … … 252 252 253 253 @param SearchType A filter to find files only of this type. 254 @param VolumeHandle The pointer to the firmware volume header of the 255 volume to search. This parameter must point to a 256 valid FFS volume. 254 @param VolumeHandle The pointer to the firmware volume header of the 255 volume to search. This parameter must point to a 256 valid FFS volume. 257 257 @param FileHandle Handle of the current file from which to begin searching. 258 258 … … 280 280 281 281 @param SectionType The value of the section type to find. 282 @param FileHandle A pointer to the file header that contains the set 282 @param FileHandle A pointer to the file header that contains the set 283 283 of sections to be searched. 284 284 @param SectionData A pointer to the discovered section, if successful. … … 307 307 @param SectionType The value of the section type to find. 308 308 @param SectionInstance Section instance to find. 309 @param FileHandle A pointer to the file header that contains the set 309 @param FileHandle A pointer to the file header that contains the set 310 310 of sections to be searched. 311 311 @param SectionData A pointer to the discovered section, if successful. … … 389 389 390 390 @param Size The number of bytes to allocate from the pool. 391 @param Buffer If the call succeeds, a pointer to a pointer to 391 @param Buffer If the call succeeds, a pointer to a pointer to 392 392 the allocate buffer; otherwise, undefined. 393 393 … … 429 429 430 430 /** 431 This service is a wrapper for the PEI Service RegisterForShadow(), except the 432 pointer to the PEI Services Table has been removed. See the Platform 433 Initialization Pre-EFI Initialization Core Interface Specification for details. 431 This service is a wrapper for the PEI Service RegisterForShadow(), except the 432 pointer to the PEI Services Table has been removed. See the Platform 433 Initialization Pre-EFI Initialization Core Interface Specification for details. 434 434 435 435 @param FileHandle PEIM's file handle. Must be the currently 436 436 executing PEIM. 437 437 438 438 @retval EFI_SUCCESS The PEIM was successfully registered for 439 439 shadowing. … … 455 455 456 456 /** 457 This service is a wrapper for the PEI Service FfsGetFileInfo(), except the pointer to the PEI Services 458 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface 459 Specification for details. 457 This service is a wrapper for the PEI Service FfsGetFileInfo(), except the pointer to the PEI Services 458 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface 459 Specification for details. 460 460 461 461 @param FileHandle The handle of the file. … … 465 465 466 466 @retval EFI_SUCCESS File information returned. 467 467 468 468 @retval EFI_INVALID_PARAMETER If FileHandle does not 469 469 represent a valid file. 470 470 471 471 @retval EFI_INVALID_PARAMETER FileInfo is NULL. 472 473 **/ 474 EFI_STATUS 475 EFIAPI 472 473 **/ 474 EFI_STATUS 475 EFIAPI 476 476 PeiServicesFfsGetFileInfo ( 477 477 IN CONST EFI_PEI_FILE_HANDLE FileHandle, … … 508 508 509 509 /** 510 This service is a wrapper for the PEI Service FfsFindByName(), except the pointer to the PEI Services 511 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface 512 Specification for details. 510 This service is a wrapper for the PEI Service FfsFindByName(), except the pointer to the PEI Services 511 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface 512 Specification for details. 513 513 514 514 @param FileName A pointer to the name of the file to … … 518 518 Upon exit, points to the found file's 519 519 handle or NULL if it could not be found. 520 @param FileHandle The pointer to found file handle 520 @param FileHandle The pointer to found file handle 521 521 522 522 @retval EFI_SUCCESS File was found. … … 541 541 542 542 /** 543 This service is a wrapper for the PEI Service FfsGetVolumeInfo(), except the pointer to the PEI Services 544 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface 545 Specification for details. 543 This service is a wrapper for the PEI Service FfsGetVolumeInfo(), except the pointer to the PEI Services 544 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface 545 Specification for details. 546 546 547 547 @param VolumeHandle Handle of the volume. … … 551 551 552 552 @retval EFI_SUCCESS File information returned. 553 553 554 554 @retval EFI_INVALID_PARAMETER If FileHandle does not 555 555 represent a valid file. 556 556 557 557 @retval EFI_INVALID_PARAMETER If FileInfo is NULL. 558 558 … … 611 611 ) 612 612 { 613 EFI_STATUS Status; 613 EFI_STATUS Status; 614 614 EFI_PEI_FIRMWARE_VOLUME_INFO_PPI *FvInfoPpi; 615 615 EFI_PEI_PPI_DESCRIPTOR *FvInfoPpiDescriptor; -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
r58459 r58466 21 21 MODULE_TYPE = PEIM 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = PeiServicesLib|SEC PEIM PEI_CORE 23 LIBRARY_CLASS = PeiServicesLib|SEC PEIM PEI_CORE 24 24 PI_SPECIFICATION_VERSION = 0x0001000A 25 25 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
r58459 r58466 1 1 /** @file 2 2 PEI Services Table Pointer Library. 3 3 4 4 This library is used for PEIM which does executed from flash device directly but 5 5 executed in memory. … … 23 23 24 24 /** 25 Caches a pointer PEI Services Table. 26 27 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer 28 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization 29 Pre-EFI Initialization Core Interface Specification. 30 25 Caches a pointer PEI Services Table. 26 27 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer 28 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization 29 Pre-EFI Initialization Core Interface Specification. 30 31 31 If PeiServicesTablePointer is NULL, then ASSERT(). 32 32 33 33 @param PeiServicesTablePointer The address of PeiServices pointer. 34 34 **/ … … 46 46 Retrieves the cached value of the PEI Services Table pointer. 47 47 48 Returns the cached value of the PEI Services Table pointer in a CPU specific manner 49 as specified in the CPU binding section of the Platform Initialization Pre-EFI 48 Returns the cached value of the PEI Services Table pointer in a CPU specific manner 49 as specified in the CPU binding section of the Platform Initialization Pre-EFI 50 50 Initialization Core Interface Specification. 51 51 52 52 If the cached PEI Services Table pointer is NULL, then ASSERT(). 53 53 … … 68 68 /** 69 69 The constructor function caches the pointer to PEI services. 70 70 71 71 The constructor function caches the pointer to PEI services. 72 72 It will always return EFI_SUCCESS. … … 90 90 91 91 /** 92 Perform CPU specific actions required to migrate the PEI Services Table 92 Perform CPU specific actions required to migrate the PEI Services Table 93 93 pointer from temporary RAM to permanent RAM. 94 94 95 For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes 95 For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes 96 96 immediately preceding the Interrupt Descriptor Table (IDT) in memory. 97 For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes 97 For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes 98 98 immediately preceding the Interrupt Descriptor Table (IDT) in memory. 99 99 For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in 100 a dedicated CPU register. This means that there is no memory storage 101 associated with storing the PEI Services Table pointer, so no additional 100 a dedicated CPU register. This means that there is no memory storage 101 associated with storing the PEI Services Table pointer, so no additional 102 102 migration actions are required for Itanium or ARM CPUs. 103 103 … … 110 110 { 111 111 // 112 // PEI Services Table pointer is cached in the global variable. No additional 112 // PEI Services Table pointer is cached in the global variable. No additional 113 113 // migration actions are required. 114 114 // -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c
r58459 r58466 4 4 According to PI specification, the peiservice pointer is stored prior at IDT 5 5 table in IA32 and x64 architecture. 6 6 7 7 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 8 This program and the accompanying materials 9 are licensed and made available under the terms and conditions of the BSD License 10 which accompanies this distribution. The full text of the license may be found at 11 http://opensource.org/licenses/bsd-license.php. 8 This program and the accompanying materials 9 are licensed and made available under the terms and conditions of the BSD License 10 which accompanies this distribution. The full text of the license may be found at 11 http://opensource.org/licenses/bsd-license.php. 12 12 13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 15 16 16 **/ … … 26 26 Retrieves the cached value of the PEI Services Table pointer. 27 27 28 Returns the cached value of the PEI Services Table pointer in a CPU specific manner 29 as specified in the CPU binding section of the Platform Initialization Pre-EFI 28 Returns the cached value of the PEI Services Table pointer in a CPU specific manner 29 as specified in the CPU binding section of the Platform Initialization Pre-EFI 30 30 Initialization Core Interface Specification. 31 31 32 32 If the cached PEI Services Table pointer is NULL, then ASSERT(). 33 33 … … 43 43 CONST EFI_PEI_SERVICES **PeiServices; 44 44 IA32_DESCRIPTOR Idtr; 45 45 46 46 AsmReadIdtr (&Idtr); 47 47 PeiServices = (CONST EFI_PEI_SERVICES **) (*(UINTN*)(Idtr.Base - sizeof (UINTN))); … … 51 51 52 52 /** 53 Caches a pointer PEI Services Table. 54 55 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer 56 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization 57 Pre-EFI Initialization Core Interface Specification. 53 Caches a pointer PEI Services Table. 54 55 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer 56 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization 57 Pre-EFI Initialization Core Interface Specification. 58 58 The function set the pointer of PEI services immediately preceding the IDT table 59 59 according to PI specification. 60 60 61 61 If PeiServicesTablePointer is NULL, then ASSERT(). 62 62 63 63 @param PeiServicesTablePointer The address of PeiServices pointer. 64 64 **/ … … 70 70 { 71 71 IA32_DESCRIPTOR Idtr; 72 72 73 73 ASSERT (PeiServicesTablePointer != NULL); 74 74 AsmReadIdtr (&Idtr); … … 77 77 78 78 /** 79 Perform CPU specific actions required to migrate the PEI Services Table 79 Perform CPU specific actions required to migrate the PEI Services Table 80 80 pointer from temporary RAM to permanent RAM. 81 81 82 For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes 82 For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes 83 83 immediately preceding the Interrupt Descriptor Table (IDT) in memory. 84 For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes 84 For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes 85 85 immediately preceding the Interrupt Descriptor Table (IDT) in memory. 86 86 For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in 87 a dedicated CPU register. This means that there is no memory storage 88 associated with storing the PEI Services Table pointer, so no additional 87 a dedicated CPU register. This means that there is no memory storage 88 associated with storing the PEI Services Table pointer, so no additional 89 89 migration actions are required for Itanium or ARM CPUs. 90 90 … … 113 113 // 114 114 Status = (*PeiServices)->AllocatePages ( 115 PeiServices, 115 PeiServices, 116 116 EfiBootServicesCode, 117 117 EFI_SIZE_TO_PAGES(Idtr.Limit + 1 + sizeof (UINTN)), … … 125 125 Idtr.Base = (UINTN) IdtBase + sizeof (UINTN); 126 126 AsmWriteIdtr (&Idtr); 127 127 128 128 return; 129 129 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c
r58459 r58466 21 21 Retrieves the cached value of the PEI Services Table pointer. 22 22 23 Returns the cached value of the PEI Services Table pointer in a CPU specific manner 24 as specified in the CPU binding section of the Platform Initialization Pre-EFI 23 Returns the cached value of the PEI Services Table pointer in a CPU specific manner 24 as specified in the CPU binding section of the Platform Initialization Pre-EFI 25 25 Initialization Core Interface Specification. 26 26 27 27 If the cached PEI Services Table pointer is NULL, then ASSERT(). 28 28 … … 45 45 46 46 /** 47 Caches a pointer PEI Services Table. 48 49 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer 50 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization 51 Pre-EFI Initialization Core Interface Specification. 52 The function set the pointer of PEI services in KR7 register 47 Caches a pointer PEI Services Table. 48 49 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer 50 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization 51 Pre-EFI Initialization Core Interface Specification. 52 The function set the pointer of PEI services in KR7 register 53 53 according to PI specification. 54 54 55 55 If PeiServicesTablePointer is NULL, then ASSERT(). 56 56 57 57 @param PeiServicesTablePointer The address of PeiServices pointer. 58 58 **/ … … 66 66 AsmWriteKr7 ((UINT64)(UINTN)PeiServicesTablePointer); 67 67 } 68 68 69 69 /** 70 Perform CPU specific actions required to migrate the PEI Services Table 70 Perform CPU specific actions required to migrate the PEI Services Table 71 71 pointer from temporary RAM to permanent RAM. 72 72 73 For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes 73 For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes 74 74 immediately preceding the Interrupt Descriptor Table (IDT) in memory. 75 For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes 75 For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes 76 76 immediately preceding the Interrupt Descriptor Table (IDT) in memory. 77 77 For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in 78 a dedicated CPU register. This means that there is no memory storage 79 associated with storing the PEI Services Table pointer, so no additional 78 a dedicated CPU register. This means that there is no memory storage 79 associated with storing the PEI Services Table pointer, so no additional 80 80 migration actions are required for Itanium or ARM CPUs. 81 81 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiSmbusLibSmbus2Ppi/InternalSmbusLib.h
r48674 r58466 53 53 the Length byte, word, or a block of data. 54 54 55 @param SmbusOperation Signifies which particular SMBus hardware protocol 55 @param SmbusOperation Signifies which particular SMBus hardware protocol 56 56 instance that it will use to execute the SMBus transactions. 57 57 @param SmBusAddress The address that encodes the SMBUS Slave Address, 58 58 SMBUS Command, SMBUS Data Length, and PEC. 59 @param Length Signifies the number of bytes that this operation will 60 do. The maximum number of bytes can be revision specific 59 @param Length Signifies the number of bytes that this operation will 60 do. The maximum number of bytes can be revision specific 61 61 and operation specific. 62 @param Buffer Contains the value of data to execute to the SMBus slave 63 device. Not all operations require this argument. The 62 @param Buffer Contains the value of data to execute to the SMBus slave 63 device. Not all operations require this argument. The 64 64 length of this buffer is identified by Length. 65 65 @param Status Return status for the executed command. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiSmbusLibSmbus2Ppi/PeiSmbusLib.c
r48674 r58466 47 47 the Length byte, word, or a block of data. 48 48 49 @param SmbusOperation Signifies which particular SMBus hardware protocol instance 49 @param SmbusOperation Signifies which particular SMBus hardware protocol instance 50 50 that it will use to execute the SMBus transactions. 51 51 @param SmBusAddress The address that encodes the SMBUS Slave Address, 52 52 SMBUS Command, SMBUS Data Length, and PEC. 53 @param Length Signifies the number of bytes that this operation will 54 do. The maximum number of bytes can be revision specific 53 @param Length Signifies the number of bytes that this operation will 54 do. The maximum number of bytes can be revision specific 55 55 and operation specific. 56 @param Buffer Contains the value of data to execute to the SMBus slave 57 device. Not all operations require this argument. The 56 @param Buffer Contains the value of data to execute to the SMBus slave 57 device. Not all operations require this argument. The 58 58 length of this buffer is identified by Length. 59 59 @param Status Return status for the executed command. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiSmbusLibSmbus2Ppi/PeiSmbusLibSmbus2Ppi.inf
r58459 r58466 47 47 48 48 [Depex.common.PEIM] 49 gEfiPeiSmbus2PpiGuid 49 gEfiPeiSmbus2PpiGuid 50 50 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiSmbusLibSmbus2Ppi/SmbusLib.c
r48674 r58466 32 32 This is an optional parameter and may be NULL. 33 33 RETURN_SUCCESS: The SMBUS command was executed. 34 RETURN_TIMEOUT: A timeout occurred while executing the 35 SMBUS command. 36 RETURN_DEVICE_ERROR: The request was not completed because 37 a failure reflected in the Host Status Register bit. 38 Device errors are a result of a transaction collision, 34 RETURN_TIMEOUT: A timeout occurred while executing the 35 SMBUS command. 36 RETURN_DEVICE_ERROR: The request was not completed because 37 a failure reflected in the Host Status Register bit. 38 Device errors are a result of a transaction collision, 39 39 illegal command field, unclaimed cycle 40 40 (host initiated), or bus errors (collisions). … … 73 73 This is an optional parameter and may be NULL. 74 74 RETURN_SUCCESS: The SMBUS command was executed. 75 RETURN_TIMEOUT: A timeout occurred while executing the 76 SMBUS command. 77 RETURN_DEVICE_ERROR: The request was not completed because 78 a failure reflected in the Host Status Register bit. Device 79 errors are a result of a transaction collision, illegal 80 command field, unclaimed cycle (host initiated), or bus 75 RETURN_TIMEOUT: A timeout occurred while executing the 76 SMBUS command. 77 RETURN_DEVICE_ERROR: The request was not completed because 78 a failure reflected in the Host Status Register bit. Device 79 errors are a result of a transaction collision, illegal 80 command field, unclaimed cycle (host initiated), or bus 81 81 errors (collisions). 82 82 RETURN_UNSUPPORTED:: The SMBus operation is not supported. … … 114 114 This is an optional parameter and may be NULL. 115 115 RETURN_SUCCESS: The SMBUS command was executed. 116 RETURN_TIMEOUT: A timeout occurred while executing the 117 SMBUS command. 118 RETURN_DEVICE_ERROR: The request was not completed because 119 a failure reflected in the Host Status Register bit. 120 Device errors are a result of a transaction collision, 116 RETURN_TIMEOUT: A timeout occurred while executing the 117 SMBUS command. 118 RETURN_DEVICE_ERROR: The request was not completed because 119 a failure reflected in the Host Status Register bit. 120 Device errors are a result of a transaction collision, 121 121 illegal command field, unclaimed cycle (host initiated), 122 122 or bus errors (collisions). … … 162 162 This is an optional parameter and may be NULL. 163 163 RETURN_SUCCESS: The SMBUS command was executed. 164 RETURN_TIMEOUT: A timeout occurred while executing the 165 SMBUS command. 166 RETURN_DEVICE_ERROR: The request was not completed because 167 a failure reflected in the Host Status Register bit. Device 168 errors are a result of a transaction collision, illegal 169 command field, unclaimed cycle (host initiated), or bus 164 RETURN_TIMEOUT: A timeout occurred while executing the 165 SMBUS command. 166 RETURN_DEVICE_ERROR: The request was not completed because 167 a failure reflected in the Host Status Register bit. Device 168 errors are a result of a transaction collision, illegal 169 command field, unclaimed cycle (host initiated), or bus 170 170 errors (collisions). 171 171 RETURN_CRC_ERROR: The checksum is not correct. (PEC is incorrect.) … … 210 210 This is an optional parameter and may be NULL. 211 211 RETURN_SUCCESS: The SMBUS command was executed. 212 RETURN_TIMEOUT: A timeout occurred while executing the 213 SMBUS command. 214 RETURN_DEVICE_ERROR: The request was not completed because 215 a failure reflected in the Host Status Register bit. 216 Device errors are a result of a transaction collision, 212 RETURN_TIMEOUT: A timeout occurred while executing the 213 SMBUS command. 214 RETURN_DEVICE_ERROR: The request was not completed because 215 a failure reflected in the Host Status Register bit. 216 Device errors are a result of a transaction collision, 217 217 illegal command field, unclaimed cycle (host initiated), 218 218 or bus errors (collisions). … … 257 257 This is an optional parameter and may be NULL. 258 258 RETURN_SUCCESS: The SMBUS command was executed. 259 RETURN_TIMEOUT: A timeout occurred while executing the 260 SMBUS command. 261 RETURN_DEVICE_ERROR: The request was not completed because 262 a failure reflected in the Host Status Register bit. 263 Device errors are a result of a transaction collision, 259 RETURN_TIMEOUT: A timeout occurred while executing the 260 SMBUS command. 261 RETURN_DEVICE_ERROR: The request was not completed because 262 a failure reflected in the Host Status Register bit. 263 Device errors are a result of a transaction collision, 264 264 illegal command field, unclaimed cycle (host initiated), 265 265 or bus errors (collisions). … … 298 298 If Length in SmBusAddress is not zero, then ASSERT(). 299 299 If any reserved bits of SmBusAddress are set, then ASSERT(). 300 301 @param SmBusAddress The address that encodes the SMBUS Slave Address, 302 SMBUS Command, SMBUS Data Length, and PEC. 303 @param Status Return status for the executed command. 304 This is an optional parameter and may be NULL. 305 RETURN_SUCCESS: The SMBUS command was executed. 306 RETURN_TIMEOUT: A timeout occurred while executing the 307 SMBUS command. 308 RETURN_DEVICE_ERROR: The request was not completed because 309 a failure reflected in the Host Status Register bit. 310 Device errors are a result of a transaction collision, 300 301 @param SmBusAddress The address that encodes the SMBUS Slave Address, 302 SMBUS Command, SMBUS Data Length, and PEC. 303 @param Status Return status for the executed command. 304 This is an optional parameter and may be NULL. 305 RETURN_SUCCESS: The SMBUS command was executed. 306 RETURN_TIMEOUT: A timeout occurred while executing the 307 SMBUS command. 308 RETURN_DEVICE_ERROR: The request was not completed because 309 a failure reflected in the Host Status Register bit. 310 Device errors are a result of a transaction collision, 311 311 illegal command field, unclaimed cycle (host initiated), 312 312 or bus errors (collisions). … … 351 351 This is an optional parameter and may be NULL. 352 352 RETURN_SUCCESS: The SMBUS command was executed. 353 RETURN_TIMEOUT: A timeout occurred while executing the 354 SMBUS command. 355 RETURN_DEVICE_ERROR: The request was not completed because 356 a failure reflected in the Host Status Register bit. 357 Device errors are a result of a transaction collision, 353 RETURN_TIMEOUT: A timeout occurred while executing the 354 SMBUS command. 355 RETURN_DEVICE_ERROR: The request was not completed because 356 a failure reflected in the Host Status Register bit. 357 Device errors are a result of a transaction collision, 358 358 illegal command field, unclaimed cycle (host initiated), 359 359 or bus errors (collisions). … … 400 400 This is an optional parameter and may be NULL. 401 401 RETURN_SUCCESS: The SMBUS command was executed. 402 RETURN_TIMEOUT: A timeout occurred while executing the 403 SMBUS command. 404 RETURN_DEVICE_ERROR: The request was not completed because 405 a failure reflected in the Host Status Register bit. 406 Device errors are a result of a transaction collision, 402 RETURN_TIMEOUT: A timeout occurred while executing the 403 SMBUS command. 404 RETURN_DEVICE_ERROR: The request was not completed because 405 a failure reflected in the Host Status Register bit. 406 Device errors are a result of a transaction collision, 407 407 illegal command field, unclaimed cycle (host initiated), 408 408 or bus errors (collisions). … … 449 449 This is an optional parameter and may be NULL. 450 450 RETURN_SUCCESS: The SMBUS command was executed. 451 RETURN_TIMEOUT: A timeout occurred while executing the 452 SMBUS command. 453 RETURN_DEVICE_ERROR: The request was not completed because 454 a failure reflected in the Host Status Register bit. 455 Device errors are a result of a transaction collision, 456 illegal command field, unclaimed cycle (host initiated), 451 RETURN_TIMEOUT: A timeout occurred while executing the 452 SMBUS command. 453 RETURN_DEVICE_ERROR: The request was not completed because 454 a failure reflected in the Host Status Register bit. 455 Device errors are a result of a transaction collision, 456 illegal command field, unclaimed cycle (host initiated), 457 457 or bus errors (collisions). 458 458 RETURN_CRC_ERROR: The checksum is not correct. (PEC is incorrect.) … … 484 484 Bytes are written to the SMBUS from Buffer. 485 485 The number of bytes written is returned, and will never return a value larger than 32-bytes. 486 If Status is not NULL, then the status of the executed command is returned in Status. 486 If Status is not NULL, then the status of the executed command is returned in Status. 487 487 If Length in SmBusAddress is zero or greater than 32, then ASSERT(). 488 488 If Buffer is NULL, then ASSERT(). … … 494 494 @param Status Return status for the executed command. 495 495 This is an optional parameter and may be NULL. 496 RETURN_TIMEOUT: A timeout occurred while executing the 497 SMBUS command. 498 RETURN_DEVICE_ERROR: The request was not completed because 499 a failure reflected in the Host Status Register bit. 500 Device errors are a result of a transaction collision, 501 illegal command field, unclaimed cycle (host initiated), 496 RETURN_TIMEOUT: A timeout occurred while executing the 497 SMBUS command. 498 RETURN_DEVICE_ERROR: The request was not completed because 499 a failure reflected in the Host Status Register bit. 500 Device errors are a result of a transaction collision, 501 illegal command field, unclaimed cycle (host initiated), 502 502 or bus errors (collisions). 503 503 RETURN_CRC_ERROR: The checksum is not correct (PEC is incorrect) … … 546 546 @param Status Return status for the executed command. 547 547 This is an optional parameter and may be NULL. 548 RETURN_TIMEOUT: A timeout occurred while executing the 549 SMBUS command. 550 RETURN_DEVICE_ERROR: The request was not completed because 551 a failure reflected in the Host Status Register bit. 552 Device errors are a result of a transaction collision, 553 illegal command field, unclaimed cycle (host initiated), 548 RETURN_TIMEOUT: A timeout occurred while executing the 549 SMBUS command. 550 RETURN_DEVICE_ERROR: The request was not completed because 551 a failure reflected in the Host Status Register bit. 552 Device errors are a result of a transaction collision, 553 illegal command field, unclaimed cycle (host initiated), 554 554 or bus errors (collisions). 555 555 RETURN_CRC_ERROR The checksum is not correct. (PEC is incorrect.) -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.c
r48674 r58466 23 23 The entry point of PE/COFF Image for a PEIM. 24 24 25 This function is the entry point for a PEIM. This function must call ProcessLibraryConstructorList() 25 This function is the entry point for a PEIM. This function must call ProcessLibraryConstructorList() 26 26 and ProcessModuleEntryPointList(). The return value from ProcessModuleEntryPointList() is returned. 27 27 If _gPeimRevision is not zero and PeiServices->Hdr.Revision is less than _gPeimRevison, then ASSERT(). 28 28 29 @param FileHandle Handle of the file being invoked. 29 @param FileHandle Handle of the file being invoked. 30 30 @param PeiServices Describes the list of possible PEI Services. 31 31 … … 61 61 /** 62 62 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint(). 63 63 64 64 This function is required to call _ModuleEntryPoint() passing in FileHandle and PeiServices. 65 65 66 @param FileHandle Handle of the file being invoked. 66 @param FileHandle Handle of the file being invoked. 67 67 @param PeiServices Describes the list of possible PEI Services. 68 68 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
r58459 r58466 21 21 MODULE_TYPE = PEIM 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = PeimEntryPoint|PEIM 23 LIBRARY_CLASS = PeimEntryPoint|PEIM 24 24 25 25 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf
r58459 r58466 4 4 # Timer Library that only uses CPU resources to provide calibrated delays 5 5 # on IA-32, x64, and IPF. 6 # Note: A driver of type DXE_RUNTIME_DRIVER and DXE_SMM_DRIVER can use this TimerLib 7 # in their initialization without any issues. They only have to be careful in 8 # the implementation of runtime services and SMI handlers. 6 # Note: A driver of type DXE_RUNTIME_DRIVER and DXE_SMM_DRIVER can use this TimerLib 7 # in their initialization without any issues. They only have to be careful in 8 # the implementation of runtime services and SMI handlers. 9 9 # Because CPU Local APIC and ITC could be programmed by OS, it cannot be 10 10 # used by SMM drivers and runtime drivers, ACPI timer is recommended for SMM -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLib.c
r48674 r58466 1 1 /** @file 2 2 I/O Library. 3 The implementation of I/O operation for this library instance 3 The implementation of I/O operation for this library instance 4 4 are based on EFI_CPU_IO_PROTOCOL. 5 5 6 6 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 7 7 This program and the accompanying materials … … 119 119 @param Width The width of the I/O operation. 120 120 @param Data The value to write to the I/O port. 121 121 122 122 @return Data read from registers in the EFI system memory space. 123 123 … … 195 195 196 196 If Port is not aligned on a 16-bit boundary, then ASSERT(). 197 197 198 198 If 16-bit I/O port operations are not supported, then ASSERT(). 199 199 … … 253 253 This function must guarantee that all I/O read and write operations are 254 254 serialized. 255 255 256 256 If Port is not aligned on a 32-bit boundary, then ASSERT(). 257 257 … … 344 344 345 345 If Port is not aligned on a 64-bit boundary, then ASSERT(). 346 346 347 347 If 64-bit I/O port operations are not supported, then ASSERT(). 348 348 … … 421 421 422 422 If Address is not aligned on a 16-bit boundary, then ASSERT(). 423 423 424 424 If 16-bit MMIO register operations are not supported, then ASSERT(). 425 425 … … 450 450 451 451 If Address is not aligned on a 16-bit boundary, then ASSERT(). 452 452 453 453 If 16-bit MMIO register operations are not supported, then ASSERT(). 454 454 … … 479 479 480 480 If Address is not aligned on a 32-bit boundary, then ASSERT(). 481 481 482 482 If 32-bit MMIO register operations are not supported, then ASSERT(). 483 483 … … 508 508 509 509 If Address is not aligned on a 32-bit boundary, then ASSERT(). 510 510 511 511 If 32-bit MMIO register operations are not supported, then ASSERT(). 512 512 … … 537 537 538 538 If Address is not aligned on a 64-bit boundary, then ASSERT(). 539 539 540 540 If 64-bit MMIO register operations are not supported, then ASSERT(). 541 541 … … 566 566 567 567 If Address is not aligned on a 64-bit boundary, then ASSERT(). 568 568 569 569 If 64-bit MMIO register operations are not supported, then ASSERT(). 570 570 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmIoLibSmmCpuIo2/IoLibMmioBuffer.c
r48674 r58466 68 68 69 69 If Length is not aligned on a 16-bit boundary, then ASSERT(). 70 70 71 71 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). 72 72 … … 171 171 172 172 If Length is not aligned on a 64-bit boundary, then ASSERT(). 173 173 174 174 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). 175 175 … … 224 224 @param StartAddress The starting address for the MMIO region to be copied to. 225 225 @param Length The size in bytes of the copy. 226 @param Buffer The pointer to a system memory buffer containing the 226 @param Buffer The pointer to a system memory buffer containing the 227 227 data to write. 228 228 … … 271 271 @param StartAddress The starting address for the MMIO region to be copied to. 272 272 @param Length The size in bytes of the copy. 273 @param Buffer The pointer to a system memory buffer containing the 273 @param Buffer The pointer to a system memory buffer containing the 274 274 data to write. 275 275 … … 326 326 @param StartAddress The starting address for the MMIO region to be copied to. 327 327 @param Length The size in bytes of the copy. 328 @param Buffer The pointer to a system memory buffer containing the 328 @param Buffer The pointer to a system memory buffer containing the 329 329 data to write. 330 330 … … 380 380 @param StartAddress The starting address for the MMIO region to be copied to. 381 381 @param Length The size in bytes of the copy. 382 @param Buffer The pointer to a system memory buffer containing the 382 @param Buffer The pointer to a system memory buffer containing the 383 383 data to write. 384 384 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmIoLibSmmCpuIo2/SmmCpuIoLibInternal.h
r48674 r58466 2 2 Internal include file of SMM CPU IO Library. 3 3 It includes all necessary protocol/library class's header file 4 for implementation of IoLib library instance. It is included 4 for implementation of IoLib library instance. It is included 5 5 all source code of this library instance. 6 6 7 7 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 8 8 This program and the accompanying materials … … 104 104 @param Width The width of the I/O operation. 105 105 @param Data The value to write to the I/O port. 106 106 107 107 @return Data read from registers in the EFI system memory space. 108 108 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmLibNull/SmmLibNull.c
r48674 r58466 3 3 4 4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 17 17 18 18 /** 19 Triggers an SMI at boot time. 19 Triggers an SMI at boot time. 20 20 21 21 This function triggers a software SMM interrupt at boot time. … … 33 33 34 34 /** 35 Triggers an SMI at run time. 35 Triggers an SMI at run time. 36 36 37 37 This function triggers a software SMM interrupt at run time. … … 50 50 51 51 /** 52 Test if a boot time software SMI happened. 52 Test if a boot time software SMI happened. 53 53 54 This function tests if a software SMM interrupt happened. If a software SMM 55 interrupt happened and it was triggered at boot time, it returns TRUE. Otherwise, 54 This function tests if a software SMM interrupt happened. If a software SMM 55 interrupt happened and it was triggered at boot time, it returns TRUE. Otherwise, 56 56 it returns FALSE. 57 57 … … 71 71 72 72 /** 73 Test if a run time software SMI happened. 73 Test if a run time software SMI happened. 74 74 75 This function tests if a software SMM interrupt happened. If a software SMM 76 interrupt happened and it was triggered at run time, it returns TRUE. Otherwise, 75 This function tests if a software SMM interrupt happened. If a software SMM 76 interrupt happened and it was triggered at run time, it returns TRUE. Otherwise, 77 77 it returns FALSE. 78 78 … … 91 91 92 92 /** 93 Clear APM SMI Status Bit; Set the EOS bit. 94 93 Clear APM SMI Status Bit; Set the EOS bit. 94 95 95 **/ 96 96 VOID -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmLibNull/SmmLibNull.inf
r58459 r58466 31 31 [Sources] 32 32 SmmLibNull.c 33 33 34 34 35 35 [Packages] -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmMemLib/SmmMemLib.c
r58464 r58466 73 73 PhysicalAddressBits = 48; 74 74 } 75 76 // 77 // Save the maximum support address in one global variable 75 76 // 77 // Save the maximum support address in one global variable 78 78 // 79 79 mSmmMemLibInternalMaximumSupportAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)(LShiftU64 (1, PhysicalAddressBits) - 1); … … 98 98 { 99 99 UINTN Index; 100 100 101 101 // 102 102 // Check override. … … 118 118 return FALSE; 119 119 } 120 120 121 121 for (Index = 0; Index < mSmmMemLibInternalSmramCount; Index ++) { 122 122 if (((Buffer >= mSmmMemLibInternalSmramRanges[Index].CpuStart) && (Buffer < mSmmMemLibInternalSmramRanges[Index].CpuStart + mSmmMemLibInternalSmramRanges[Index].PhysicalSize)) || … … 182 182 If the check fails, it returns EFI_SECURITY_VIOLATION. 183 183 The implementation must be reentrant. 184 184 185 185 @param DestinationBuffer The pointer to the destination buffer of the memory copy. 186 186 @param SourceBuffer The pointer to the source buffer of the memory copy. … … 215 215 If the check fails, it returns EFI_SECURITY_VIOLATION. 216 216 The implementation must be reentrant, and it must handle the case where source buffer overlaps destination buffer. 217 217 218 218 @param DestinationBuffer The pointer to the destination buffer of the memory copy. 219 219 @param SourceBuffer The pointer to the source buffer of the memory copy. … … 252 252 If the check passes, it fills memory and returns EFI_SUCCESS. 253 253 If the check fails, it returns EFI_SECURITY_VIOLATION. 254 254 255 255 @param Buffer The memory to set. 256 256 @param Length The number of bytes to set. 257 257 @param Value The value with which to fill Length bytes of Buffer. 258 258 259 259 @retval EFI_SECURITY_VIOLATION The Buffer is invalid per processor architecture or overlap with SMRAM. 260 260 @retval EFI_SUCCESS Memory is set. … … 296 296 EFI_SMM_ACCESS2_PROTOCOL *SmmAccess; 297 297 UINTN Size; 298 298 299 299 // 300 300 // Get SMRAM information -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmMemLib/SmmMemLib.inf
r58464 r58466 6 6 # all SMRAM range via SMM_ACCESS2_PROTOCOL, including the range for firmware (like SMM Core 7 7 # and SMM driver) and/or specific dedicated hardware. 8 # 8 # 9 9 # Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> 10 10 # This program and the accompanying materials … … 12 12 # which accompanies this distribution. The full text of the license may be found at 13 13 # http://opensource.org/licenses/bsd-license.php 14 # 14 # 15 15 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 16 16 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 17 # 17 # 18 18 ## 19 19 … … 37 37 [Sources] 38 38 SmmMemLib.c 39 39 40 40 [Packages] 41 41 MdePkg/MdePkg.dec 42 42 43 43 [LibraryClasses] 44 44 SmmServicesTableLib -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c
r58459 r58466 1 1 /** @file 2 Support routines for memory allocation routines based 2 Support routines for memory allocation routines based 3 3 on SMM Services Table services for SMM phase drivers. 4 4 5 5 The PI System Management Mode Core Interface Specification only allows the use 6 of EfiRuntimeServicesCode and EfiRuntimeServicesData memory types for memory 7 allocations through the SMM Services Table. The functions in the Memory 6 of EfiRuntimeServicesCode and EfiRuntimeServicesData memory types for memory 7 allocations through the SMM Services Table. The functions in the Memory 8 8 Allocation Library use EfiBootServicesData as the default memory allocation 9 type. For this SMM specific instance of the Memory Allocation Library, 9 type. For this SMM specific instance of the Memory Allocation Library, 10 10 EfiRuntimeServicesData is used as the default memory type for all allocations. 11 In addition, allocation for the Reserved memory types are not supported and 11 In addition, allocation for the Reserved memory types are not supported and 12 12 will always return NULL. 13 13 14 14 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 15 This program and the accompanying materials 16 are licensed and made available under the terms and conditions of the BSD License 17 which accompanies this distribution. The full text of the license may be found at 18 http://opensource.org/licenses/bsd-license.php. 19 20 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 21 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 This program and the accompanying materials 16 are licensed and made available under the terms and conditions of the BSD License 17 which accompanies this distribution. The full text of the license may be found at 18 http://opensource.org/licenses/bsd-license.php. 19 20 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 21 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 22 22 23 23 **/ … … 37 37 /** 38 38 The constructor function caches SMRAM ranges that are present in the system. 39 39 40 40 It will ASSERT() if SMM Access2 Protocol doesn't exist. 41 41 It will ASSERT() if SMRAM ranges can't be got. 42 It will ASSERT() if Resource can't be allocated for cache SMRAM range. 42 It will ASSERT() if Resource can't be allocated for cache SMRAM range. 43 43 It will always return EFI_SUCCESS. 44 44 … … 64 64 // 65 65 Status = gBS->LocateProtocol ( 66 &gEfiSmmAccess2ProtocolGuid, 67 NULL, 66 &gEfiSmmAccess2ProtocolGuid, 67 NULL, 68 68 (VOID **)&SmmAccess 69 69 ); … … 89 89 90 90 /** 91 If SMM driver exits with an error, it must call this routine 91 If SMM driver exits with an error, it must call this routine 92 92 to free the allocated resource before the exiting. 93 93 … … 126 126 127 127 for (Index = 0; Index < mSmramRangeCount; Index ++) { 128 if (((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer >= mSmramRanges[Index].CpuStart) && 128 if (((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer >= mSmramRanges[Index].CpuStart) && 129 129 ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer < (mSmramRanges[Index].CpuStart + mSmramRanges[Index].PhysicalSize))) { 130 130 return TRUE; … … 138 138 Allocates one or more 4KB pages of a certain memory type. 139 139 140 Allocates the number of 4KB pages of a certain memory type and returns a pointer 141 to the allocated buffer. The buffer returned is aligned on a 4KB boundary. If 142 Pages is 0, then NULL is returned. If there is not enough memory remaining to 140 Allocates the number of 4KB pages of a certain memory type and returns a pointer 141 to the allocated buffer. The buffer returned is aligned on a 4KB boundary. If 142 Pages is 0, then NULL is returned. If there is not enough memory remaining to 143 143 satisfy the request, then NULL is returned. 144 144 … … 151 151 VOID * 152 152 InternalAllocatePages ( 153 IN EFI_MEMORY_TYPE MemoryType, 153 IN EFI_MEMORY_TYPE MemoryType, 154 154 IN UINTN Pages 155 155 ) 156 156 { 157 157 EFI_STATUS Status; 158 EFI_PHYSICAL_ADDRESS Memory; 158 EFI_PHYSICAL_ADDRESS Memory; 159 159 160 160 if (Pages == 0) { … … 172 172 Allocates one or more 4KB pages of type EfiBootServicesData. 173 173 174 Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer 175 to the allocated buffer. The buffer returned is aligned on a 4KB boundary. If 176 Pages is 0, then NULL is returned. If there is not enough memory remaining to 174 Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer 175 to the allocated buffer. The buffer returned is aligned on a 4KB boundary. If 176 Pages is 0, then NULL is returned. If there is not enough memory remaining to 177 177 satisfy the request, then NULL is returned. 178 178 … … 194 194 Allocates one or more 4KB pages of type EfiRuntimeServicesData. 195 195 196 Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a 197 pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary. 198 If Pages is 0, then NULL is returned. If there is not enough memory remaining 196 Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a 197 pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary. 198 If Pages is 0, then NULL is returned. If there is not enough memory remaining 199 199 to satisfy the request, then NULL is returned. 200 200 … … 216 216 Allocates one or more 4KB pages of type EfiReservedMemoryType. 217 217 218 Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a 219 pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary. 220 If Pages is 0, then NULL is returned. If there is not enough memory remaining 218 Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a 219 pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary. 220 If Pages is 0, then NULL is returned. If there is not enough memory remaining 221 221 to satisfy the request, then NULL is returned. 222 222 … … 239 239 functions in the Memory Allocation Library. 240 240 241 Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. 242 Buffer must have been allocated on a previous call to the page allocation services 243 of the Memory Allocation Library. If it is not possible to free allocated pages, 241 Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. 242 Buffer must have been allocated on a previous call to the page allocation services 243 of the Memory Allocation Library. If it is not possible to free allocated pages, 244 244 then this function will perform no actions. 245 246 If Buffer was not allocated with a page allocation function in the Memory Allocation 245 246 If Buffer was not allocated with a page allocation function in the Memory Allocation 247 247 Library, then ASSERT(). 248 248 If Pages is zero, then ASSERT(). 249 249 250 250 @param Buffer The pointer to the buffer of pages to free. 251 251 @param Pages The number of 4 KB pages to free. … … 281 281 Allocates one or more 4KB pages of a certain memory type at a specified alignment. 282 282 283 Allocates the number of 4KB pages specified by Pages of a certain memory type 284 with an alignment specified by Alignment. The allocated buffer is returned. 285 If Pages is 0, then NULL is returned. If there is not enough memory at the 283 Allocates the number of 4KB pages specified by Pages of a certain memory type 284 with an alignment specified by Alignment. The allocated buffer is returned. 285 If Pages is 0, then NULL is returned. If there is not enough memory at the 286 286 specified alignment remaining to satisfy the request, then NULL is returned. 287 287 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). … … 290 290 @param MemoryType The type of memory to allocate. 291 291 @param Pages The number of 4 KB pages to allocate. 292 @param Alignment The requested alignment of the allocation. 292 @param Alignment The requested alignment of the allocation. 293 293 Must be a power of two. 294 294 If Alignment is zero, then byte alignment is used. … … 299 299 VOID * 300 300 InternalAllocateAlignedPages ( 301 IN EFI_MEMORY_TYPE MemoryType, 301 IN EFI_MEMORY_TYPE MemoryType, 302 302 IN UINTN Pages, 303 303 IN UINTN Alignment … … 315 315 // 316 316 ASSERT ((Alignment & (Alignment - 1)) == 0); 317 317 318 318 if (Pages == 0) { 319 319 return NULL; … … 329 329 // 330 330 ASSERT (RealPages > Pages); 331 331 332 332 Status = gSmst->SmmAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory); 333 333 if (EFI_ERROR (Status)) { … … 368 368 Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment. 369 369 370 Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData 371 with an alignment specified by Alignment. The allocated buffer is returned. 372 If Pages is 0, then NULL is returned. If there is not enough memory at the 370 Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData 371 with an alignment specified by Alignment. The allocated buffer is returned. 372 If Pages is 0, then NULL is returned. If there is not enough memory at the 373 373 specified alignment remaining to satisfy the request, then NULL is returned. 374 374 375 375 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 376 376 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). 377 377 378 378 @param Pages The number of 4 KB pages to allocate. 379 @param Alignment The requested alignment of the allocation. 379 @param Alignment The requested alignment of the allocation. 380 380 Must be a power of two. 381 381 If Alignment is zero, then byte alignment is used. … … 397 397 Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment. 398 398 399 Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData 400 with an alignment specified by Alignment. The allocated buffer is returned. 401 If Pages is 0, then NULL is returned. If there is not enough memory at the 399 Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData 400 with an alignment specified by Alignment. The allocated buffer is returned. 401 If Pages is 0, then NULL is returned. If there is not enough memory at the 402 402 specified alignment remaining to satisfy the request, then NULL is returned. 403 403 404 404 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 405 405 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). 406 406 407 407 @param Pages The number of 4 KB pages to allocate. 408 @param Alignment The requested alignment of the allocation. 408 @param Alignment The requested alignment of the allocation. 409 409 Must be a power of two. 410 410 If Alignment is zero, then byte alignment is used. … … 426 426 Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment. 427 427 428 Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType 429 with an alignment specified by Alignment. The allocated buffer is returned. 430 If Pages is 0, then NULL is returned. If there is not enough memory at the 428 Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType 429 with an alignment specified by Alignment. The allocated buffer is returned. 430 If Pages is 0, then NULL is returned. If there is not enough memory at the 431 431 specified alignment remaining to satisfy the request, then NULL is returned. 432 432 433 433 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 434 434 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). 435 435 436 436 @param Pages The number of 4 KB pages to allocate. 437 @param Alignment The requested alignment of the allocation. 437 @param Alignment The requested alignment of the allocation. 438 438 Must be a power of two. 439 439 If Alignment is zero, then byte alignment is used. … … 456 456 allocation functions in the Memory Allocation Library. 457 457 458 Frees the number of 4KB pages specified by Pages from the buffer specified by 459 Buffer. Buffer must have been allocated on a previous call to the aligned page 460 allocation services of the Memory Allocation Library. If it is not possible to 458 Frees the number of 4KB pages specified by Pages from the buffer specified by 459 Buffer. Buffer must have been allocated on a previous call to the aligned page 460 allocation services of the Memory Allocation Library. If it is not possible to 461 461 free allocated pages, then this function will perform no actions. 462 463 If Buffer was not allocated with an aligned page allocation function in the 462 463 If Buffer was not allocated with an aligned page allocation function in the 464 464 Memory Allocation Library, then ASSERT(). 465 465 If Pages is zero, then ASSERT(). 466 466 467 467 @param Buffer The pointer to the buffer of pages to free. 468 468 @param Pages The number of 4 KB pages to free. … … 498 498 Allocates a buffer of a certain pool type. 499 499 500 Allocates the number bytes specified by AllocationSize of a certain pool type 501 and returns a pointer to the allocated buffer. If AllocationSize is 0, then a 502 valid buffer of 0 size is returned. If there is not enough memory remaining to 500 Allocates the number bytes specified by AllocationSize of a certain pool type 501 and returns a pointer to the allocated buffer. If AllocationSize is 0, then a 502 valid buffer of 0 size is returned. If there is not enough memory remaining to 503 503 satisfy the request, then NULL is returned. 504 504 … … 511 511 VOID * 512 512 InternalAllocatePool ( 513 IN EFI_MEMORY_TYPE MemoryType, 513 IN EFI_MEMORY_TYPE MemoryType, 514 514 IN UINTN AllocationSize 515 515 ) … … 528 528 Allocates a buffer of type EfiBootServicesData. 529 529 530 Allocates the number bytes specified by AllocationSize of type EfiBootServicesData 531 and returns a pointer to the allocated buffer. If AllocationSize is 0, then a 532 valid buffer of 0 size is returned. If there is not enough memory remaining to 530 Allocates the number bytes specified by AllocationSize of type EfiBootServicesData 531 and returns a pointer to the allocated buffer. If AllocationSize is 0, then a 532 valid buffer of 0 size is returned. If there is not enough memory remaining to 533 533 satisfy the request, then NULL is returned. 534 534 … … 550 550 Allocates a buffer of type EfiRuntimeServicesData. 551 551 552 Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData 553 and returns a pointer to the allocated buffer. If AllocationSize is 0, then a 554 valid buffer of 0 size is returned. If there is not enough memory remaining to 552 Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData 553 and returns a pointer to the allocated buffer. If AllocationSize is 0, then a 554 valid buffer of 0 size is returned. If there is not enough memory remaining to 555 555 satisfy the request, then NULL is returned. 556 556 … … 572 572 Allocates a buffer of type EfiReservedMemoryType. 573 573 574 Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType 575 and returns a pointer to the allocated buffer. If AllocationSize is 0, then a 576 valid buffer of 0 size is returned. If there is not enough memory remaining to 574 Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType 575 and returns a pointer to the allocated buffer. If AllocationSize is 0, then a 576 valid buffer of 0 size is returned. If there is not enough memory remaining to 577 577 satisfy the request, then NULL is returned. 578 578 … … 594 594 Allocates and zeros a buffer of a certain pool type. 595 595 596 Allocates the number bytes specified by AllocationSize of a certain pool type, 597 clears the buffer with zeros, and returns a pointer to the allocated buffer. 598 If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is 596 Allocates the number bytes specified by AllocationSize of a certain pool type, 597 clears the buffer with zeros, and returns a pointer to the allocated buffer. 598 If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is 599 599 not enough memory remaining to satisfy the request, then NULL is returned. 600 600 … … 607 607 VOID * 608 608 InternalAllocateZeroPool ( 609 IN EFI_MEMORY_TYPE PoolType, 609 IN EFI_MEMORY_TYPE PoolType, 610 610 IN UINTN AllocationSize 611 ) 611 ) 612 612 { 613 613 VOID *Memory; … … 623 623 Allocates and zeros a buffer of type EfiBootServicesData. 624 624 625 Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, 626 clears the buffer with zeros, and returns a pointer to the allocated buffer. 627 If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is 625 Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, 626 clears the buffer with zeros, and returns a pointer to the allocated buffer. 627 If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is 628 628 not enough memory remaining to satisfy the request, then NULL is returned. 629 629 … … 645 645 Allocates and zeros a buffer of type EfiRuntimeServicesData. 646 646 647 Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, 648 clears the buffer with zeros, and returns a pointer to the allocated buffer. 649 If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is 647 Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, 648 clears the buffer with zeros, and returns a pointer to the allocated buffer. 649 If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is 650 650 not enough memory remaining to satisfy the request, then NULL is returned. 651 651 … … 667 667 Allocates and zeros a buffer of type EfiReservedMemoryType. 668 668 669 Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, 670 clears the buffer with zeros, and returns a pointer to the allocated buffer. 671 If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is 669 Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, 670 clears the buffer with zeros, and returns a pointer to the allocated buffer. 671 If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is 672 672 not enough memory remaining to satisfy the request, then NULL is returned. 673 673 … … 689 689 Copies a buffer to an allocated buffer of a certain pool type. 690 690 691 Allocates the number bytes specified by AllocationSize of a certain pool type, 692 copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 693 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer 694 of 0 size is returned. If there is not enough memory remaining to satisfy the 691 Allocates the number bytes specified by AllocationSize of a certain pool type, 692 copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 693 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer 694 of 0 size is returned. If there is not enough memory remaining to satisfy the 695 695 request, then NULL is returned. If Buffer is NULL, then ASSERT(). 696 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 696 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 697 697 698 698 @param PoolType The type of pool to allocate. … … 705 705 VOID * 706 706 InternalAllocateCopyPool ( 707 IN EFI_MEMORY_TYPE PoolType, 707 IN EFI_MEMORY_TYPE PoolType, 708 708 IN UINTN AllocationSize, 709 709 IN CONST VOID *Buffer 710 ) 710 ) 711 711 { 712 712 VOID *Memory; … … 720 720 } 721 721 return Memory; 722 } 722 } 723 723 724 724 /** 725 725 Copies a buffer to an allocated buffer of type EfiBootServicesData. 726 726 727 Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, 728 copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 729 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer 730 of 0 size is returned. If there is not enough memory remaining to satisfy the 727 Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, 728 copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 729 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer 730 of 0 size is returned. If there is not enough memory remaining to satisfy the 731 731 request, then NULL is returned. 732 732 733 733 If Buffer is NULL, then ASSERT(). 734 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 734 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 735 735 736 736 @param AllocationSize The number of bytes to allocate and zero. … … 753 753 Copies a buffer to an allocated buffer of type EfiRuntimeServicesData. 754 754 755 Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, 756 copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 757 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer 758 of 0 size is returned. If there is not enough memory remaining to satisfy the 755 Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, 756 copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 757 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer 758 of 0 size is returned. If there is not enough memory remaining to satisfy the 759 759 request, then NULL is returned. 760 760 761 761 If Buffer is NULL, then ASSERT(). 762 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 762 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 763 763 764 764 @param AllocationSize The number of bytes to allocate and zero. … … 781 781 Copies a buffer to an allocated buffer of type EfiReservedMemoryType. 782 782 783 Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, 784 copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 785 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer 786 of 0 size is returned. If there is not enough memory remaining to satisfy the 783 Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, 784 copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 785 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer 786 of 0 size is returned. If there is not enough memory remaining to satisfy the 787 787 request, then NULL is returned. 788 788 789 789 If Buffer is NULL, then ASSERT(). 790 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 790 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 791 791 792 792 @param AllocationSize The number of bytes to allocate and zero. … … 810 810 811 811 Allocates and zeros the number bytes specified by NewSize from memory of the type 812 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 813 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 814 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 815 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 812 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 813 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 814 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 815 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 816 816 enough memory remaining to satisfy the request, then NULL is returned. 817 818 If the allocation of the new buffer is successful and the smaller of NewSize 817 818 If the allocation of the new buffer is successful and the smaller of NewSize 819 819 and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). 820 820 … … 822 822 @param OldSize The size, in bytes, of OldBuffer. 823 823 @param NewSize The size, in bytes, of the buffer to reallocate. 824 @param OldBuffer The buffer to copy to the allocated buffer. This is an 824 @param OldBuffer The buffer to copy to the allocated buffer. This is an 825 825 optional parameter that may be NULL. 826 826 … … 830 830 VOID * 831 831 InternalReallocatePool ( 832 IN EFI_MEMORY_TYPE PoolType, 832 IN EFI_MEMORY_TYPE PoolType, 833 833 IN UINTN OldSize, 834 834 IN UINTN NewSize, … … 850 850 851 851 Allocates and zeros the number bytes specified by NewSize from memory of type 852 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 853 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 854 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 855 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 852 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 853 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 854 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 855 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 856 856 enough memory remaining to satisfy the request, then NULL is returned. 857 858 If the allocation of the new buffer is successful and the smaller of NewSize 857 858 If the allocation of the new buffer is successful and the smaller of NewSize 859 859 and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). 860 860 861 861 @param OldSize The size, in bytes, of OldBuffer. 862 862 @param NewSize The size, in bytes, of the buffer to reallocate. 863 @param OldBuffer The buffer to copy to the allocated buffer. This is an 863 @param OldBuffer The buffer to copy to the allocated buffer. This is an 864 864 optional parameter that may be NULL. 865 865 … … 882 882 883 883 Allocates and zeros the number bytes specified by NewSize from memory of type 884 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize 885 and NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 886 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 887 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 884 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize 885 and NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 886 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 887 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 888 888 enough memory remaining to satisfy the request, then NULL is returned. 889 889 890 If the allocation of the new buffer is successful and the smaller of NewSize 890 If the allocation of the new buffer is successful and the smaller of NewSize 891 891 and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). 892 892 893 893 @param OldSize The size, in bytes, of OldBuffer. 894 894 @param NewSize The size, in bytes, of the buffer to reallocate. 895 @param OldBuffer The buffer to copy to the allocated buffer. This is an 895 @param OldBuffer The buffer to copy to the allocated buffer. This is an 896 896 optional parameter that may be NULL. 897 897 … … 914 914 915 915 Allocates and zeros the number bytes specified by NewSize from memory of type 916 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize 917 and NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 918 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 919 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 916 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize 917 and NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 918 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 919 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 920 920 enough memory remaining to satisfy the request, then NULL is returned. 921 921 922 If the allocation of the new buffer is successful and the smaller of NewSize 922 If the allocation of the new buffer is successful and the smaller of NewSize 923 923 and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). 924 924 925 925 @param OldSize The size, in bytes, of OldBuffer. 926 926 @param NewSize The size, in bytes, of the buffer to reallocate. 927 @param OldBuffer The buffer to copy to the allocated buffer. This is an 927 @param OldBuffer The buffer to copy to the allocated buffer. This is an 928 928 optional parameter that may be NULL. 929 929 … … 943 943 944 944 /** 945 Frees a buffer that was previously allocated with one of the pool allocation 945 Frees a buffer that was previously allocated with one of the pool allocation 946 946 functions in the Memory Allocation Library. 947 947 948 Frees the buffer specified by Buffer. Buffer must have been allocated on a 949 previous call to the pool allocation services of the Memory Allocation Library. 950 If it is not possible to free pool resources, then this function will perform 948 Frees the buffer specified by Buffer. Buffer must have been allocated on a 949 previous call to the pool allocation services of the Memory Allocation Library. 950 If it is not possible to free pool resources, then this function will perform 951 951 no actions. 952 953 If Buffer was not allocated with a pool allocation function in the Memory 952 953 If Buffer was not allocated with a pool allocation function in the Memory 954 954 Allocation Library, then ASSERT(). 955 955 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
r58459 r58466 2 2 # Instance of Memory Allocation Library using SMM Services Table. 3 3 # 4 # Memory Allocation Library that uses services from the SMM Services Table to 4 # Memory Allocation Library that uses services from the SMM Services Table to 5 5 # allocate and free memory. 6 6 # … … 23 23 VERSION_STRING = 1.0 24 24 PI_SPECIFICATION_VERSION = 0x0001000A 25 LIBRARY_CLASS = MemoryAllocationLib|DXE_SMM_DRIVER 25 LIBRARY_CLASS = MemoryAllocationLib|DXE_SMM_DRIVER 26 26 CONSTRUCTOR = SmmMemoryAllocationLibConstructor 27 27 DESTRUCTOR = SmmMemoryAllocationLibDestructor … … 44 44 45 45 [Protocols] 46 gEfiSmmAccess2ProtocolGuid ## CONSUMES 46 gEfiSmmAccess2ProtocolGuid ## CONSUMES 47 47 48 48 [Depex] -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmPciLibPciRootBridgeIo/PciLib.c
r58459 r58466 8 8 text of the license may be found at 9 9 http://opensource.org/licenses/bsd-license.php. 10 10 11 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. … … 45 45 // Global varible to cache pointer to PCI Root Bridge I/O protocol. 46 46 // 47 EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL *mSmmPciRootBridgeIo = NULL; 47 EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL *mSmmPciRootBridgeIo = NULL; 48 48 49 49 /** 50 50 The constructor function caches the pointer to PCI Root Bridge I/O protocol. 51 51 52 52 The constructor function locates PCI Root Bridge I/O protocol from protocol database. 53 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. 53 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. 54 54 55 55 @param ImageHandle The firmware allocated handle for the EFI image. 56 56 @param SystemTable A pointer to the EFI System Table. 57 57 58 58 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. 59 59 … … 67 67 { 68 68 EFI_STATUS Status; 69 69 70 70 Status = gSmst->SmmLocateProtocol (&gEfiSmmPciRootBridgeIoProtocolGuid, NULL, (VOID**) &mSmmPciRootBridgeIo); 71 71 ASSERT_EFI_ERROR (Status); … … 142 142 143 143 /** 144 Registers a PCI device so PCI configuration registers may be accessed after 144 Registers a PCI device so PCI configuration registers may be accessed after 145 145 SetVirtualAddressMap(). 146 147 Registers the PCI device specified by Address so all the PCI configuration registers 146 147 Registers the PCI device specified by Address so all the PCI configuration registers 148 148 associated with that PCI device may be accessed after SetVirtualAddressMap() is called. 149 150 If Address > 0x0FFFFFFF, then ASSERT(). 151 152 @param Address The address that encodes the PCI Bus, Device, Function and 153 Register. 154 149 150 If Address > 0x0FFFFFFF, then ASSERT(). 151 152 @param Address The address that encodes the PCI Bus, Device, Function and 153 Register. 154 155 155 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 156 @retval RETURN_UNSUPPORTED An attempt was made to call this function 156 @retval RETURN_UNSUPPORTED An attempt was made to call this function 157 157 after ExitBootServices(). 158 158 @retval RETURN_UNSUPPORTED The resources required to access the PCI device -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmPciLibPciRootBridgeIo/SmmPciLibPciRootBridgeIo.inf
r58459 r58466 50 50 [Protocols] 51 51 gEfiSmmPciRootBridgeIoProtocolGuid ## CONSUMES 52 52 53 53 [Depex.common.DXE_SMM_DRIVER] 54 54 gEfiSmmPciRootBridgeIoProtocolGuid -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c
r48674 r58466 63 63 UINT64 TickPeriod; 64 64 /// 65 /// The Cpu number that is required to execute DispatchFunction. If Cpu is 66 /// set to PERIODIC_SMI_LIBRARY_ANY_CPU, then DispatchFunction may be executed 65 /// The Cpu number that is required to execute DispatchFunction. If Cpu is 66 /// set to PERIODIC_SMI_LIBRARY_ANY_CPU, then DispatchFunction may be executed 67 67 /// on any CPU. 68 68 /// 69 69 UINTN Cpu; 70 70 /// 71 /// The size, in bytes, of the stack allocated for a periodic SMI handler. 71 /// The size, in bytes, of the stack allocated for a periodic SMI handler. 72 72 /// This value must be a multiple of EFI_PAGE_SIZE. 73 73 /// … … 83 83 SPIN_LOCK DispatchLock; 84 84 /// 85 /// The rate in Hz of the performance counter that is used to measure the 85 /// The rate in Hz of the performance counter that is used to measure the 86 86 /// amount of time that a periodic SMI handler executes. 87 87 /// 88 88 UINT64 PerfomanceCounterRate; 89 89 /// 90 /// The start count value of the performance counter that is used to measure 90 /// The start count value of the performance counter that is used to measure 91 91 /// the amount of time that a periodic SMI handler executes. 92 92 /// 93 93 UINT64 PerfomanceCounterStartValue; 94 94 /// 95 /// The end count value of the performance counter that is used to measure 95 /// The end count value of the performance counter that is used to measure 96 96 /// the amount of time that a periodic SMI handler executes. 97 97 /// 98 98 UINT64 PerfomanceCounterEndValue; 99 99 /// 100 /// The context record passed into the Register() function of the SMM Periodic 100 /// The context record passed into the Register() function of the SMM Periodic 101 101 /// Timer Dispatch Protocol when a periodic SMI handler is enabled. 102 102 /// 103 103 EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT RegisterContext; 104 104 /// 105 /// The handle returned from the Register() function of the SMM Periodic 105 /// The handle returned from the Register() function of the SMM Periodic 106 106 /// Timer Dispatch Protocol when a periodic SMI handler is enabled. 107 107 /// … … 113 113 UINT64 DispatchTotalTime; 114 114 /// 115 /// The performance counter value that was captured the last time that the 115 /// The performance counter value that was captured the last time that the 116 116 /// periodic SMI handler called PeriodcSmiExecutionTime(). This allows the 117 117 /// time value returned by PeriodcSmiExecutionTime() to be accurate even when … … 121 121 /// 122 122 /// Buffer used to save the context when control is transfer from this library 123 /// to an enabled periodic SMI handler. This saved context is used when the 124 /// periodic SMI handler exits or yields. 123 /// to an enabled periodic SMI handler. This saved context is used when the 124 /// periodic SMI handler exits or yields. 125 125 /// 126 126 BASE_LIBRARY_JUMP_BUFFER DispatchJumpBuffer; 127 127 /// 128 /// Flag that is set to TRUE when a periodic SMI handler requests to yield 129 /// using PeriodicSmiYield(). When this flag IS TRUE, YieldJumpBuffer is 128 /// Flag that is set to TRUE when a periodic SMI handler requests to yield 129 /// using PeriodicSmiYield(). When this flag IS TRUE, YieldJumpBuffer is 130 130 /// valid. When this flag is FALSE, YieldJumpBuffer is not valid. 131 131 /// 132 132 BOOLEAN YieldFlag; 133 133 /// 134 /// Buffer used to save the context when a periodic SMI handler requests to 135 /// yield using PeriodicSmiYield(). This context is used to resume the 134 /// Buffer used to save the context when a periodic SMI handler requests to 135 /// yield using PeriodicSmiYield(). This context is used to resume the 136 136 /// execution of a periodic SMI handler the next time control is transferd 137 137 /// to the periodic SMI handler that yielded. … … 146 146 147 147 /** 148 Macro that returns a pointer to a PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT 148 Macro that returns a pointer to a PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT 149 149 structure based on a pointer to a RegisterContext field. 150 150 … … 159 159 160 160 /** 161 Macro that returns a pointer to a PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT 161 Macro that returns a pointer to a PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT 162 162 structure based on a pointer to a Link field. 163 163 … … 177 177 178 178 /// 179 /// Pointer to a table of supported periodic SMI tick periods in 100 ns units 179 /// Pointer to a table of supported periodic SMI tick periods in 100 ns units 180 180 /// sorted from largest to smallest terminated by a tick period value of 0. 181 /// This table is allocated using AllocatePool() in the constructor and filled 182 /// in based on the values returned from the SMM Periodic Timer Dispatch 2 Protocol 181 /// This table is allocated using AllocatePool() in the constructor and filled 182 /// in based on the values returned from the SMM Periodic Timer Dispatch 2 Protocol 183 183 /// function GetNextShorterInterval(). 184 184 /// … … 204 204 205 205 /** 206 Internal worker function that returns a pointer to the 207 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure associated with the periodic 208 SMI handler that is currently being executed. If a periodic SMI handler is 206 Internal worker function that returns a pointer to the 207 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure associated with the periodic 208 SMI handler that is currently being executed. If a periodic SMI handler is 209 209 not currently being executed, the NULL is returned. 210 210 211 211 @retval NULL A periodic SMI handler is not currently being executed. 212 212 @retval other Pointer to the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT 213 213 associated with the active periodic SMI handler. 214 214 215 215 **/ 216 216 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * … … 223 223 224 224 /** 225 Internal worker function that returns a pointer to the 226 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure associated with the 225 Internal worker function that returns a pointer to the 226 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure associated with the 227 227 DispatchHandle that was returned when the periodic SMI handler was enabled 228 with PeriodicSmiEnable(). If DispatchHandle is NULL, then the active 228 with PeriodicSmiEnable(). If DispatchHandle is NULL, then the active 229 229 periodic SMI handler is returned. If DispatchHandle is NULL and there is 230 230 no active periodic SMI handler, then NULL is returned. 231 232 @param[in] DispatchHandle DispatchHandle that was returned when the periodic 233 SMI handler was enabled with PeriodicSmiEnable(). 231 232 @param[in] DispatchHandle DispatchHandle that was returned when the periodic 233 SMI handler was enabled with PeriodicSmiEnable(). 234 234 This is an optional parameter that may be NULL. 235 235 If this parameter is NULL, then the active periodic 236 236 SMI handler is returned. 237 238 @retval NULL DispatchHandle is NULL and there is no active periodic SMI 237 238 @retval NULL DispatchHandle is NULL and there is no active periodic SMI 239 239 handler. 240 240 @retval NULL DispatchHandle does not match any of the periodic SMI handlers … … 242 242 @retval other Pointer to the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT 243 243 associated with the DispatchHandle. 244 244 245 245 **/ 246 246 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * … … 272 272 } 273 273 } 274 274 275 275 // 276 276 // No entries match DispatchHandle, so return NULL … … 280 280 281 281 /** 282 Internal worker function that sets that active periodic SMI handler based on 283 the Context used when the periodic SMI handler was registered with the 284 SMM Periodic Timer Dispatch 2 Protocol. If Context is NULL, then the 282 Internal worker function that sets that active periodic SMI handler based on 283 the Context used when the periodic SMI handler was registered with the 284 SMM Periodic Timer Dispatch 2 Protocol. If Context is NULL, then the 285 285 state is updated to show that there is not active periodic SMI handler. 286 A pointer to the active PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure 286 A pointer to the active PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure 287 287 is returned. 288 288 289 289 @retval NULL Context is NULL. 290 290 @retval other Pointer to the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT 291 291 associated with Context. 292 292 293 293 **/ 294 294 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * … … 363 363 SMI handler. If no free entries are available, then additional 364 364 entries are allocated. 365 365 366 366 @retval NULL There are not enough resources available to to allocate a free entry. 367 367 @retval other Pointer to a free PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure. 368 368 369 369 **/ 370 370 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * … … 374 374 { 375 375 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; 376 376 377 377 if (IsListEmpty (&gFreePeriodicSmiLibraryHandlers)) { 378 378 if (!EnlargeFreePeriodicSmiLibraryHandlerList ()) { … … 395 395 /** 396 396 This function returns a pointer to a table of supported periodic 397 SMI tick periods in 100 ns units sorted from largest to smallest. 398 The table contains a array of UINT64 values terminated by a tick 397 SMI tick periods in 100 ns units sorted from largest to smallest. 398 The table contains a array of UINT64 values terminated by a tick 399 399 period value of 0. The returned table must be treated as read-only 400 400 data and must not be freed. 401 402 @return A pointer to a table of UINT64 tick period values in 403 100ns units sorted from largest to smallest terminated 401 402 @return A pointer to a table of UINT64 tick period values in 403 100ns units sorted from largest to smallest terminated 404 404 by a tick period of 0. 405 405 406 406 **/ 407 407 UINT64 * … … 439 439 440 440 // 441 // If there is no active periodic SMI handler, then return 0 441 // If there is no active periodic SMI handler, then return 0 442 442 // 443 443 PeriodicSmiLibraryHandler = GetActivePeriodicSmiLibraryHandler (); … … 445 445 return 0; 446 446 } 447 447 448 448 // 449 449 // Get the current performance counter value 450 450 // 451 451 Current = GetPerformanceCounter (); 452 453 // 454 // Count the number of performance counter ticks since the periodic SMI handler 455 // was dispatched or the last time this function was called. 452 453 // 454 // Count the number of performance counter ticks since the periodic SMI handler 455 // was dispatched or the last time this function was called. 456 456 // 457 457 if (PeriodicSmiLibraryHandler->PerfomanceCounterEndValue > PeriodicSmiLibraryHandler->PerfomanceCounterStartValue) { … … 474 474 } 475 475 } 476 477 // 478 // Accumulate the total number of performance counter ticks since the periodic 476 477 // 478 // Accumulate the total number of performance counter ticks since the periodic 479 479 // SMI handler was dispatched or resumed. 480 480 // 481 481 PeriodicSmiLibraryHandler->DispatchTotalTime += Count; 482 482 483 483 // 484 484 // Update the checkpoint value to the current performance counter value 485 485 // 486 486 PeriodicSmiLibraryHandler->DispatchCheckPointTime = Current; 487 487 488 488 // 489 489 // Convert the total number of performance counter ticks to 100 ns units 490 490 // 491 491 return DivU64x64Remainder ( 492 MultU64x32 (PeriodicSmiLibraryHandler->DispatchTotalTime, 10000000), 493 PeriodicSmiLibraryHandler->PerfomanceCounterRate, 492 MultU64x32 (PeriodicSmiLibraryHandler->DispatchTotalTime, 10000000), 493 PeriodicSmiLibraryHandler->PerfomanceCounterRate, 494 494 NULL 495 495 ); … … 497 497 498 498 /** 499 This function returns control back to the SMM Foundation. When the next 499 This function returns control back to the SMM Foundation. When the next 500 500 periodic SMI for the currently executing handler is triggered, the periodic 501 501 SMI handler will restarted from its registered DispatchFunction entry point. 502 If this function is not called from within an enabled periodic SMI handler, 502 If this function is not called from within an enabled periodic SMI handler, 503 503 then control is returned to the calling function. 504 504 505 505 **/ 506 506 VOID 507 EFIAPI 507 EFIAPI 508 508 PeriodicSmiExit ( 509 509 VOID … … 511 511 { 512 512 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; 513 514 // 515 // If there is no active periodic SMI handler, then return 513 514 // 515 // If there is no active periodic SMI handler, then return 516 516 // 517 517 PeriodicSmiLibraryHandler = GetActivePeriodicSmiLibraryHandler (); … … 519 519 return; 520 520 } 521 522 // 523 // Perform a long jump back to the point when the currently executing dispatch 521 522 // 523 // Perform a long jump back to the point when the currently executing dispatch 524 524 // function was dispatched. 525 525 // 526 526 LongJump (&PeriodicSmiLibraryHandler->DispatchJumpBuffer, 1); 527 527 528 528 // 529 529 // Must never return … … 534 534 535 535 /** 536 This function yields control back to the SMM Foundation. When the next 536 This function yields control back to the SMM Foundation. When the next 537 537 periodic SMI for the currently executing handler is triggered, the periodic 538 SMI handler will be resumed and this function will return. Use of this 538 SMI handler will be resumed and this function will return. Use of this 539 539 function requires a seperate stack for the periodic SMI handler. A non zero 540 stack size must be specified in PeriodicSmiEnable() for this function to be 541 used. 542 540 stack size must be specified in PeriodicSmiEnable() for this function to be 541 used. 542 543 543 If the stack size passed into PeriodicSmiEnable() was zero, the 0 is returned. 544 545 If this function is not called from within an enabled periodic SMI handler, 544 545 If this function is not called from within an enabled periodic SMI handler, 546 546 then 0 is returned. 547 547 … … 551 551 **/ 552 552 UINT64 553 EFIAPI 553 EFIAPI 554 554 PeriodicSmiYield ( 555 555 VOID … … 560 560 561 561 // 562 // If there is no active periodic SMI handler, then return 562 // If there is no active periodic SMI handler, then return 563 563 // 564 564 PeriodicSmiLibraryHandler = GetActivePeriodicSmiLibraryHandler (); … … 566 566 return 0; 567 567 } 568 569 // 570 // If PeriodicSmiYield() is called without an allocated stack, then just return 568 569 // 570 // If PeriodicSmiYield() is called without an allocated stack, then just return 571 571 // immediately with an elapsed time of 0. 572 572 // … … 574 574 return 0; 575 575 } 576 577 // 578 // Set a flag so the next periodic SMI event will resume at where SetJump() 576 577 // 578 // Set a flag so the next periodic SMI event will resume at where SetJump() 579 579 // is called below. 580 580 // … … 583 583 // 584 584 // Save context in YieldJumpBuffer 585 // 585 // 586 586 SetJumpFlag = SetJump (&PeriodicSmiLibraryHandler->YieldJumpBuffer); 587 587 if (SetJumpFlag == 0) { … … 592 592 PeriodicSmiExit (); 593 593 } 594 594 595 595 // 596 596 // We get here when a LongJump is performed from PeriodicSmiDispatchFunctionOnCpu() 597 // to resume a periodic SMI handler that called PeriodicSmiYield() on the 597 // to resume a periodic SMI handler that called PeriodicSmiYield() on the 598 598 // previous time this periodic SMI handler was dispatched. 599 599 // … … 604 604 // 605 605 // Return the amount elapsed time that occured while yielded 606 // 606 // 607 607 return PeriodicSmiLibraryHandler->ElapsedTime; 608 608 } 609 609 610 610 /** 611 Internal worker function that transfers control to an enabled periodic SMI 612 handler. If the enabled periodic SMI handler was allocated its own stack, 613 then this function is called on that allocated stack through the BaseLin 611 Internal worker function that transfers control to an enabled periodic SMI 612 handler. If the enabled periodic SMI handler was allocated its own stack, 613 then this function is called on that allocated stack through the BaseLin 614 614 function SwitchStack(). 615 615 … … 628 628 629 629 // 630 // Convert Context1 to PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * 631 // 630 // Convert Context1 to PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * 631 // 632 632 PeriodicSmiLibraryHandler = (PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *)Context1; 633 633 634 634 // 635 635 // Dispatch the registered handler passing in the context that was registered 636 // and the amount of time that has elapsed since the previous time this 636 // and the amount of time that has elapsed since the previous time this 637 637 // periodic SMI handler was dispacthed. 638 // 638 // 639 639 PeriodicSmiLibraryHandler->DispatchFunction ( 640 640 PeriodicSmiLibraryHandler->Context, 641 641 PeriodicSmiLibraryHandler->ElapsedTime 642 642 ); 643 643 644 644 // 645 645 // If this DispatchFunction() returns, then unconditially call PeriodicSmiExit() 646 // to perform a LongJump() back to PeriodicSmiDispatchFunctionOnCpu(). The 646 // to perform a LongJump() back to PeriodicSmiDispatchFunctionOnCpu(). The 647 647 // LongJump() will resume exection on the original stack. 648 // 648 // 649 649 PeriodicSmiExit (); 650 650 } 651 651 652 652 /** 653 Internal worker function that transfers control to an enabled periodic SMI 654 handler on the specified logial CPU. This function determines if the periodic 655 SMI handler yielded and needs to be resumed. It also and switches to an 653 Internal worker function that transfers control to an enabled periodic SMI 654 handler on the specified logial CPU. This function determines if the periodic 655 SMI handler yielded and needs to be resumed. It also and switches to an 656 656 allocated stack if one was allocated in PeriodicSmiEnable(). 657 657 658 658 @param[in] PeriodicSmiLibraryHandler A pointer to the context for the periodic 659 659 SMI handler to execute. 660 660 661 661 **/ 662 662 VOID … … 667 667 { 668 668 // 669 // Save context in DispatchJumpBuffer. The intial call to SetJump() always 670 // returns 0. If this is the initial call, then either resume from a prior 671 // call to PeriodicSmiYield() or call the DispatchFunction registerd in 669 // Save context in DispatchJumpBuffer. The intial call to SetJump() always 670 // returns 0. If this is the initial call, then either resume from a prior 671 // call to PeriodicSmiYield() or call the DispatchFunction registerd in 672 672 // PeriodicSmiEnable() using an allocated stack if one was specified. 673 // 673 // 674 674 if (SetJump (&PeriodicSmiLibraryHandler->DispatchJumpBuffer) != 0) { 675 675 return; 676 676 } 677 678 // 679 // Capture the performance counter value just before the periodic SMI handler 680 // is resumed so the amount of time the periodic SMI handler executes can be 677 678 // 679 // Capture the performance counter value just before the periodic SMI handler 680 // is resumed so the amount of time the periodic SMI handler executes can be 681 681 // calculated. 682 682 // 683 683 PeriodicSmiLibraryHandler->DispatchTotalTime = 0; 684 684 PeriodicSmiLibraryHandler->DispatchCheckPointTime = GetPerformanceCounter(); 685 685 686 686 if (PeriodicSmiLibraryHandler->YieldFlag) { 687 687 // 688 // Perform a long jump back to the point where the previously dispatched 689 // function called PeriodicSmiYield(). 688 // Perform a long jump back to the point where the previously dispatched 689 // function called PeriodicSmiYield(). 690 690 // 691 691 LongJump (&PeriodicSmiLibraryHandler->YieldJumpBuffer, 1); 692 692 } else if (PeriodicSmiLibraryHandler->Stack == NULL) { 693 693 // 694 // If Stack is NULL then call DispatchFunction using current stack passing 695 // in the context that was registered and the amount of time that has 694 // If Stack is NULL then call DispatchFunction using current stack passing 695 // in the context that was registered and the amount of time that has 696 696 // elapsed since the previous time this periodic SMI handler was dispacthed. 697 // 697 // 698 698 PeriodicSmiLibraryHandler->DispatchFunction ( 699 699 PeriodicSmiLibraryHandler->Context, 700 700 PeriodicSmiLibraryHandler->ElapsedTime 701 701 ); 702 702 703 703 // 704 704 // If this DispatchFunction() returns, then unconditially call PeriodicSmiExit() 705 705 // to perform a LongJump() back to this function. 706 // 706 // 707 707 PeriodicSmiExit (); 708 708 } else { … … 716 716 (UINT8 *)PeriodicSmiLibraryHandler->Stack + PeriodicSmiLibraryHandler->StackSize 717 717 ); 718 } 718 } 719 719 720 720 // … … 726 726 727 727 /** 728 Internal worker function that transfers control to an enabled periodic SMI 729 handler on the specified logial CPU. This worker function is only called 730 using the SMM Services Table function SmmStartupThisAp() to execute the 731 periodic SMI handler on a logical CPU that is different than the one that is 728 Internal worker function that transfers control to an enabled periodic SMI 729 handler on the specified logial CPU. This worker function is only called 730 using the SMM Services Table function SmmStartupThisAp() to execute the 731 periodic SMI handler on a logical CPU that is different than the one that is 732 732 running the SMM Foundation. When the periodic SMI handler returns, a lock is 733 733 released to notify the CPU that is running the SMM Foundation that the periodic … … 744 744 { 745 745 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; 746 746 747 747 // 748 748 // Get context 749 // 749 // 750 750 PeriodicSmiLibraryHandler = (PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *)Buffer; 751 751 752 752 // 753 753 // Execute dispatch function on the currently excuting logical CPU 754 // 754 // 755 755 PeriodicSmiDispatchFunctionOnCpu (PeriodicSmiLibraryHandler); 756 756 757 757 // 758 758 // Release the dispatch spin lock … … 765 765 was enabled using PeriodicSmiEnable(). 766 766 767 @param[in] DispatchHandle The unique handle assigned to this handler by 767 @param[in] DispatchHandle The unique handle assigned to this handler by 768 768 SmiHandlerRegister(). 769 @param[in] Context Points to an optional handler context which was 769 @param[in] Context Points to an optional handler context which was 770 770 specified when the handler was registered. 771 771 @param[in, out] CommBuffer A pointer to a collection of data in memory that 772 will be conveyed from a non-SMM environment into 772 will be conveyed from a non-SMM environment into 773 773 an SMM environment. 774 774 @param[in, out] CommBufferSize The size of the CommBuffer. … … 781 781 handlers should still be called. 782 782 @retval EFI_INTERRUPT_PENDING The interrupt could not be quiesced. 783 783 784 784 **/ 785 785 EFI_STATUS … … 795 795 EFI_SMM_PERIODIC_TIMER_CONTEXT *TimerContext; 796 796 EFI_STATUS Status; 797 797 798 798 // 799 799 // Set the active periodic SMI handler 800 // 800 // 801 801 PeriodicSmiLibraryHandler = SetActivePeriodicSmiLibraryHandler (Context); 802 802 if (PeriodicSmiLibraryHandler == NULL) { 803 803 return EFI_NOT_FOUND; 804 804 } 805 805 806 806 // 807 807 // Retrieve the elapsed time since the last time this periodic SMI handler was called … … 830 830 // 831 831 AcquireSpinLock (&PeriodicSmiLibraryHandler->DispatchLock); 832 833 // 834 // Execute the periodic SMI handler on the CPU that was specified in 832 833 // 834 // Execute the periodic SMI handler on the CPU that was specified in 835 835 // PeriodicSmiEnable(). 836 836 // … … 848 848 } 849 849 } 850 850 851 851 // 852 852 // Release the spin lock for the periodic SMI handler. … … 861 861 ReclaimPeriodicSmiLibraryHandler (PeriodicSmiLibraryHandler); 862 862 } 863 863 864 864 // 865 865 // Update state to show that there is no active periodic SMI handler 866 // 866 // 867 867 SetActivePeriodicSmiLibraryHandler (NULL); 868 868 869 869 return EFI_SUCCESS; 870 870 } 871 871 872 872 /** 873 873 This function enables a periodic SMI handler. 874 875 @param[in, out] DispatchHandle A pointer to the handle associated with the 876 enabled periodic SMI handler. This is an 877 optional parameter that may be NULL. If it is 878 NULL, then the handle will not be returned, 879 which means that the periodic SMI handler can 874 875 @param[in, out] DispatchHandle A pointer to the handle associated with the 876 enabled periodic SMI handler. This is an 877 optional parameter that may be NULL. If it is 878 NULL, then the handle will not be returned, 879 which means that the periodic SMI handler can 880 880 never be disabled. 881 881 @param[in] DispatchFunction A pointer to a periodic SMI handler function. 882 882 @param[in] Context Optional content to pass into DispatchFunction. 883 @param[in] TickPeriod The requested tick period in 100ns units that 883 @param[in] TickPeriod The requested tick period in 100ns units that 884 884 control should be givien to the periodic SMI 885 885 handler. Must be one of the supported values 886 886 returned by PeriodicSmiSupportedPickPeriod(). 887 887 @param[in] Cpu Specifies the CPU that is required to execute 888 the periodic SMI handler. If Cpu is 889 PERIODIC_SMI_LIBRARY_ANY_CPU, then the periodic 890 SMI handler will always be executed on the SMST 891 CurrentlyExecutingCpu, which may vary across 892 periodic SMIs. If Cpu is between 0 and the SMST 888 the periodic SMI handler. If Cpu is 889 PERIODIC_SMI_LIBRARY_ANY_CPU, then the periodic 890 SMI handler will always be executed on the SMST 891 CurrentlyExecutingCpu, which may vary across 892 periodic SMIs. If Cpu is between 0 and the SMST 893 893 NumberOfCpus, then the periodic SMI will always 894 894 be executed on the requested CPU. … … 896 896 use by the periodic SMI handler. If 0, then the 897 897 default stack will be used. 898 898 899 899 @retval EFI_INVALID_PARAMETER DispatchFunction is NULL. 900 @retval EFI_UNSUPPORTED TickPeriod is not a supported tick period. The 901 supported tick periods can be retrieved using 900 @retval EFI_UNSUPPORTED TickPeriod is not a supported tick period. The 901 supported tick periods can be retrieved using 902 902 PeriodicSmiSupportedTickPeriod(). 903 @retval EFI_INVALID_PARAMETER Cpu is not PERIODIC_SMI_LIBRARY_ANY_CPU or in 903 @retval EFI_INVALID_PARAMETER Cpu is not PERIODIC_SMI_LIBRARY_ANY_CPU or in 904 904 the range 0 to SMST NumberOfCpus. 905 @retval EFI_OUT_OF_RESOURCES There are not enough resources to enable the 905 @retval EFI_OUT_OF_RESOURCES There are not enough resources to enable the 906 906 periodic SMI handler. 907 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the 907 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the 908 908 stack speficied by StackSize. 909 909 @retval EFI_SUCCESS The periodic SMI handler was enabled. 910 911 **/ 912 EFI_STATUS 910 911 **/ 912 EFI_STATUS 913 913 EFIAPI 914 914 PeriodicSmiEnable ( … … 927 927 // 928 928 // Make sure all the input parameters are valid 929 // 929 // 930 930 if (DispatchFunction == NULL) { 931 931 return EFI_INVALID_PARAMETER; 932 932 } 933 933 934 934 for (Index = 0; gSmiTickPeriodTable[Index] != 0; Index++) { 935 935 if (gSmiTickPeriodTable[Index] == TickPeriod) { 936 936 break; 937 937 } 938 } 938 } 939 939 if (gSmiTickPeriodTable[Index] == 0) { 940 940 return EFI_UNSUPPORTED; 941 941 } 942 942 943 943 if (Cpu != PERIODIC_SMI_LIBRARY_ANY_CPU && Cpu >= gSmst->NumberOfCpus) { 944 944 return EFI_INVALID_PARAMETER; … … 947 947 // 948 948 // Find a free periodic SMI handler entry 949 // 949 // 950 950 PeriodicSmiLibraryHandler = FindFreePeriodicSmiLibraryHandler(); 951 951 if (PeriodicSmiLibraryHandler == NULL) { … … 989 989 return EFI_OUT_OF_RESOURCES; 990 990 } 991 991 992 992 // 993 993 // Return the registered handle if the optional DispatchHandle parameter is not NULL … … 996 996 *DispatchHandle = PeriodicSmiLibraryHandler->DispatchHandle; 997 997 } 998 return EFI_SUCCESS; 998 return EFI_SUCCESS; 999 999 } 1000 1000 … … 1002 1002 This function disables a periodic SMI handler that has been previously 1003 1003 enabled with PeriodicSmiEnable(). 1004 1005 @param[in] DispatchHandle A handle associated with a previously enabled periodic 1004 1005 @param[in] DispatchHandle A handle associated with a previously enabled periodic 1006 1006 SMI handler. This is an optional parameter that may 1007 1007 be NULL. If it is NULL, then the active periodic SMI … … 1009 1009 1010 1010 @retval FALSE DispatchHandle is NULL and there is no active periodic SMI handler. 1011 @retval FALSE The periodic SMI handler specified by DispatchHandle has 1011 @retval FALSE The periodic SMI handler specified by DispatchHandle has 1012 1012 not been enabled with PeriodicSmiEnable(). 1013 @retval TRUE The periodic SMI handler specified by DispatchHandle has 1013 @retval TRUE The periodic SMI handler specified by DispatchHandle has 1014 1014 been disabled. If DispatchHandle is NULL, then the active 1015 1015 periodic SMI handler has been disabled. 1016 1017 **/ 1018 BOOLEAN 1016 1017 **/ 1018 BOOLEAN 1019 1019 EFIAPI 1020 1020 PeriodicSmiDisable ( … … 1032 1032 return FALSE; 1033 1033 } 1034 1034 1035 1035 // 1036 1036 // Unregister the periodic SMI handler from the SMM Periodic Timer Dispatch 2 Protocol … … 1058 1058 1059 1059 /** 1060 This constructor function caches the pointer to the SMM Periodic Timer 1060 This constructor function caches the pointer to the SMM Periodic Timer 1061 1061 Dispatch 2 Protocol and collects the list SMI tick rates that the hardware 1062 1062 supports. … … 1091 1091 1092 1092 // 1093 // Count the number of periodic SMI tick intervals that the SMM Periodic Timer 1093 // Count the number of periodic SMI tick intervals that the SMM Periodic Timer 1094 1094 // Dipatch 2 Protocol supports. 1095 1095 // … … 1101 1101 &SmiTickInterval 1102 1102 ); 1103 Count++; 1104 } while (SmiTickInterval != NULL); 1103 Count++; 1104 } while (SmiTickInterval != NULL); 1105 1105 1106 1106 // 1107 1107 // Allocate a buffer for the table of supported periodic SMI tick periods. 1108 // 1108 // 1109 1109 gSmiTickPeriodTable = AllocateZeroPool (Count * sizeof (UINT64)); 1110 1110 ASSERT (gSmiTickPeriodTable != NULL); 1111 1111 1112 1112 // 1113 1113 // Fill in the table of supported periodic SMI tick periods. … … 1136 1136 1137 1137 /** 1138 The constructor function caches the pointer to the SMM Periodic Timer Dispatch 2 1138 The constructor function caches the pointer to the SMM Periodic Timer Dispatch 2 1139 1139 Protocol and collects the list SMI tick rates that the hardware supports. 1140 1140 … … 1174 1174 // Free all the periodic SMI handler entries 1175 1175 // 1176 for (Link = GetFirstNode (&gFreePeriodicSmiLibraryHandlers); !IsNull (&gFreePeriodicSmiLibraryHandlers, Link);) { 1176 for (Link = GetFirstNode (&gFreePeriodicSmiLibraryHandlers); !IsNull (&gFreePeriodicSmiLibraryHandlers, Link);) { 1177 1177 PeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK (Link); 1178 1178 Link = RemoveEntryList (Link); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.inf
r58459 r58466 25 25 CONSTRUCTOR = SmmPeriodicSmiLibConstructor 26 26 DESTRUCTOR = SmmPeriodicSmiLibDestructor 27 27 28 28 # 29 29 # VALID_ARCHITECTURES = IA32 X64 … … 44 44 MemoryAllocationLib 45 45 SmmServicesTableLib 46 46 47 47 [Protocols] 48 48 gEfiSmmPeriodicTimerDispatch2ProtocolGuid ## CONSUMES 49 49 50 50 [Depex] 51 51 gEfiSmmPeriodicTimerDispatch2ProtocolGuid -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.c
r48674 r58466 41 41 // 42 42 // Retrieve SMM Base2 Protocol, Do not use gBS from UefiBootServicesTableLib on purpose 43 // to prevent inclusion of gBS, gST, and gImageHandle from SMM Drivers unless the 44 // SMM driver explicity declares that dependency. 43 // to prevent inclusion of gBS, gST, and gImageHandle from SMM Drivers unless the 44 // SMM driver explicity declares that dependency. 45 45 // 46 46 Status = SystemTable->BootServices->LocateProtocol ( … … 72 72 73 73 /** 74 This function allows the caller to determine if the driver is executing in 74 This function allows the caller to determine if the driver is executing in 75 75 System Management Mode(SMM). 76 76 77 This function returns TRUE if the driver is executing in SMM and FALSE if the 77 This function returns TRUE if the driver is executing in SMM and FALSE if the 78 78 driver is not executing in SMM. 79 79 80 80 @retval TRUE The driver is executing in System Management Mode (SMM). 81 @retval FALSE The driver is not executing in System Management Mode (SMM). 81 @retval FALSE The driver is not executing in System Management Mode (SMM). 82 82 83 83 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiApplicationEntryPoint/ApplicationEntryPoint.c
r48674 r58466 79 79 /** 80 80 Invokes the library destructors for all dependent libraries and terminates 81 the UEFI Application. 81 the UEFI Application. 82 82 83 83 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit() … … 85 85 86 86 @param Status Status returned by the application that is exiting. 87 87 88 88 **/ 89 89 VOID … … 101 101 102 102 /** 103 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint(). 103 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint(). 104 104 105 105 @param ImageHandle The image handle of the UEFI Application. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c
r48674 r58466 1 1 /** @file 2 This library retrieve the EFI_BOOT_SERVICES pointer from EFI system table in 2 This library retrieve the EFI_BOOT_SERVICES pointer from EFI system table in 3 3 library's constructor. 4 4 … … 26 26 /** 27 27 The constructor function caches the pointer of Boot Services Table. 28 28 29 29 The constructor function caches the pointer of Boot Services Table through System Table. 30 30 It will ASSERT() if the pointer of System Table is NULL. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
r58459 r58466 1 1 ## @file 2 2 # UEFI Boot Services Table Library implementation. 3 # 3 # 4 4 # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
r58459 r58466 3 3 4 4 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 24 24 25 25 // 26 // Define the maximum debug and assert message length that this library supports 26 // Define the maximum debug and assert message length that this library supports 27 27 // 28 28 #define MAX_DEBUG_MESSAGE_LENGTH 0x100 … … 31 31 Prints a debug message to the debug output device if the specified error level is enabled. 32 32 33 If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function 34 GetDebugPrintErrorLevel (), then print the message specified by Format and the 33 If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function 34 GetDebugPrintErrorLevel (), then print the message specified by Format and the 35 35 associated variable argument list to the debug output device. 36 36 … … 39 39 @param ErrorLevel The error level of the debug message. 40 40 @param Format Format string for the debug message to print. 41 @param ... A variable argument list whose contents are accessed 41 @param ... A variable argument list whose contents are accessed 42 42 based on the format string specified by Format. 43 43 … … 84 84 85 85 /** 86 Prints an assert message containing a filename, line number, and description. 86 Prints an assert message containing a filename, line number, and description. 87 87 This may be followed by a breakpoint or a dead loop. 88 88 89 89 Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" 90 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 91 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 92 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 93 CpuDeadLoop() is called. If neither of these bits are set, then this function 90 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 91 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 92 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 93 CpuDeadLoop() is called. If neither of these bits are set, then this function 94 94 returns immediately after the message is printed to the debug output device. 95 95 DebugAssert() must actively prevent recursion. If DebugAssert() is called while … … 99 99 If Description is NULL, then a <Description> string of "(NULL) Description" is printed. 100 100 101 @param FileName The pointer to the name of the source file that generated 101 @param FileName The pointer to the name of the source file that generated 102 102 the assert condition. 103 @param LineNumber The line number in the source file that generated the 103 @param LineNumber The line number in the source file that generated the 104 104 assert condition 105 105 @param Description The pointer to the description of the assert condition. … … 120 120 // 121 121 UnicodeSPrintAsciiFormat ( 122 Buffer, 123 sizeof (Buffer), 124 "ASSERT %a(%d): %a\n", 125 FileName, 126 LineNumber, 122 Buffer, 123 sizeof (Buffer), 124 "ASSERT %a(%d): %a\n", 125 FileName, 126 LineNumber, 127 127 Description 128 128 ); 129 129 130 130 // 131 131 // Send the print string to the Console Output device … … 149 149 Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer. 150 150 151 This function fills Length bytes of Buffer with the value specified by 151 This function fills Length bytes of Buffer with the value specified by 152 152 PcdDebugClearMemoryValue, and returns Buffer. 153 153 154 154 If Buffer is NULL, then ASSERT(). 155 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 155 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 156 156 157 157 @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue. 158 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 158 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 159 159 160 160 @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue. … … 183 183 Returns TRUE if ASSERT() macros are enabled. 184 184 185 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 185 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 186 186 PcdDebugProperyMask is set. Otherwise FALSE is returned. 187 187 … … 200 200 201 201 202 /** 202 /** 203 203 Returns TRUE if DEBUG() macros are enabled. 204 204 205 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 205 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 206 206 PcdDebugProperyMask is set. Otherwise FALSE is returned. 207 207 … … 220 220 221 221 222 /** 222 /** 223 223 Returns TRUE if DEBUG_CODE() macros are enabled. 224 224 225 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 225 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 226 226 PcdDebugProperyMask is set. Otherwise FALSE is returned. 227 227 … … 240 240 241 241 242 /** 242 /** 243 243 Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled. 244 244 245 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 245 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 246 246 PcdDebugProperyMask is set. Otherwise FALSE is returned. 247 247 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
r58459 r58466 23 23 MODULE_TYPE = UEFI_DRIVER 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 25 LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 26 26 27 27 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
r58459 r58466 3 3 4 4 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 25 25 26 26 // 27 // Define the maximum debug and assert message length that this library supports 27 // Define the maximum debug and assert message length that this library supports 28 28 // 29 29 #define MAX_DEBUG_MESSAGE_LENGTH 0x100 … … 33 33 Prints a debug message to the debug output device if the specified error level is enabled. 34 34 35 If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function 36 GetDebugPrintErrorLevel (), then print the message specified by Format and the 35 If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function 36 GetDebugPrintErrorLevel (), then print the message specified by Format and the 37 37 associated variable argument list to the debug output device. 38 38 … … 41 41 @param ErrorLevel The error level of the debug message. 42 42 @param Format The format string for the debug message to print. 43 @param ... The variable argument list whose contents are accessed 43 @param ... The variable argument list whose contents are accessed 44 44 based on the format string specified by Format. 45 45 … … 85 85 86 86 /** 87 Prints an assert message containing a filename, line number, and description. 87 Prints an assert message containing a filename, line number, and description. 88 88 This may be followed by a breakpoint or a dead loop. 89 89 90 90 Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" 91 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 92 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 93 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 94 CpuDeadLoop() is called. If neither of these bits are set, then this function 91 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 92 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 93 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 94 CpuDeadLoop() is called. If neither of these bits are set, then this function 95 95 returns immediately after the message is printed to the debug output device. 96 96 DebugAssert() must actively prevent recursion. If DebugAssert() is called while … … 100 100 If Description is NULL, then a <Description> string of "(NULL) Description" is printed. 101 101 102 @param FileName The pointer to the name of the source file that generated 102 @param FileName The pointer to the name of the source file that generated 103 103 the assert condition. 104 @param LineNumber The line number in the source file that generated the 104 @param LineNumber The line number in the source file that generated the 105 105 assert condition 106 106 @param Description The pointer to the description of the assert condition. … … 121 121 // 122 122 UnicodeSPrintAsciiFormat ( 123 Buffer, 123 Buffer, 124 124 sizeof (Buffer), 125 "ASSERT %a(%d): %a\n", 126 FileName, 127 LineNumber, 125 "ASSERT %a(%d): %a\n", 126 FileName, 127 LineNumber, 128 128 Description 129 129 ); 130 130 131 131 // 132 132 // Send the print string to the Standard Error device … … 150 150 Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer. 151 151 152 This function fills Length bytes of Buffer with the value specified by 152 This function fills Length bytes of Buffer with the value specified by 153 153 PcdDebugClearMemoryValue, and returns Buffer. 154 154 155 155 If Buffer is NULL, then ASSERT(). 156 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 156 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 157 157 158 158 @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue. 159 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 159 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 160 160 161 161 @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue. … … 184 184 Returns TRUE if ASSERT() macros are enabled. 185 185 186 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 186 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 187 187 PcdDebugProperyMask is set. Otherwise FALSE is returned. 188 188 … … 201 201 202 202 203 /** 203 /** 204 204 Returns TRUE if DEBUG() macros are enabled. 205 205 206 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 206 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 207 207 PcdDebugProperyMask is set. Otherwise FALSE is returned. 208 208 … … 221 221 222 222 223 /** 223 /** 224 224 Returns TRUE if DEBUG_CODE() macros are enabled. 225 225 226 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 226 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 227 227 PcdDebugProperyMask is set. Otherwise FALSE is returned. 228 228 … … 241 241 242 242 243 /** 243 /** 244 244 Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled. 245 245 246 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 246 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 247 247 PcdDebugProperyMask is set. Otherwise FALSE is returned. 248 248 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
r58459 r58466 23 23 MODULE_TYPE = UEFI_DRIVER 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 25 LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 26 26 27 27 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
r58464 r58466 280 280 Str ++; 281 281 } 282 282 283 283 return (BOOLEAN) (*Str == L'x' || *Str == L'X'); 284 284 } … … 410 410 Str ++; 411 411 } 412 412 413 413 if (IS_HYPHEN (*Str)) { 414 414 Str++; … … 416 416 return EFI_UNSUPPORTED; 417 417 } 418 418 419 419 // 420 420 // Get the second UINT16 data … … 430 430 return EFI_UNSUPPORTED; 431 431 } 432 432 433 433 // 434 434 // Get the third UINT16 data … … 447 447 // 448 448 // Get the following 8 bytes data 449 // 449 // 450 450 StrToBuf (&Guid->Data4[0], 2, Str); 451 451 // … … 1130 1130 SetDevicePathNodeLength (AcpiAdr, Length + sizeof (UINT32)); 1131 1131 } 1132 1132 1133 1133 (&AcpiAdr->ADR)[Index] = (UINT32) Strtoi (DisplayDeviceStr); 1134 1134 } -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
r58464 r58466 54 54 UnicodeVSPrint (&Str->Str[Str->Count], Str->Capacity - Str->Count * sizeof (CHAR16), Fmt, Args); 55 55 Str->Count += Count; 56 56 57 57 VA_END (Args); 58 58 return Str->Str; … … 401 401 // 402 402 // Converts EISA identification to string. 403 // 403 // 404 404 UnicodeSPrint ( 405 405 HIDText, … … 1268 1268 return ; 1269 1269 } 1270 1270 1271 1271 UefiDevicePathLibCatPrint (Str, L","); 1272 1272 CatNetworkProtocol (Str, IPDevPath->Protocol); … … 2044 2044 } 2045 2045 } 2046 2046 2047 2047 AlignedNode = AllocateCopyPool (DevicePathNodeLength (Node), Node); 2048 2048 // … … 2051 2051 ToText (&Str, AlignedNode, DisplayOnly, AllowShortcuts); 2052 2052 FreePool (AlignedNode); 2053 2053 2054 2054 // 2055 2055 // Next device path node -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c
r58464 r58466 10 10 11 11 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 12 This program and the accompanying materials 13 are licensed and made available under the terms and conditions of the BSD License 14 which accompanies this distribution. The full text of the license may be found at 15 http://opensource.org/licenses/bsd-license.php. 16 17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 This program and the accompanying materials 13 are licensed and made available under the terms and conditions of the BSD License 14 which accompanies this distribution. The full text of the license may be found at 15 http://opensource.org/licenses/bsd-license.php. 16 17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 19 19 20 20 **/ … … 136 136 Returns the 16-bit Length field of a device path node. 137 137 138 Returns the 16-bit Length field of the device path node specified by Node. 138 Returns the 16-bit Length field of the device path node specified by Node. 139 139 Node is not required to be aligned on a 16-bit boundary, so it is recommended 140 that a function such as ReadUnaligned16() be used to extract the contents of 140 that a function such as ReadUnaligned16() be used to extract the contents of 141 141 the Length field. 142 142 … … 161 161 Returns a pointer to the next node in a device path. 162 162 163 Returns a pointer to the device path node that follows the device path node 163 Returns a pointer to the device path node that follows the device path node 164 164 specified by Node. 165 165 … … 168 168 @param Node A pointer to a device path node data structure. 169 169 170 @return a pointer to the device path node that follows the device path node 170 @return a pointer to the device path node that follows the device path node 171 171 specified by Node. 172 172 … … 184 184 /** 185 185 Determines if a device path node is an end node of a device path. 186 This includes nodes that are the end of a device path instance and nodes that 186 This includes nodes that are the end of a device path instance and nodes that 187 187 are the end of an entire device path. 188 188 189 Determines if the device path node specified by Node is an end node of a device path. 190 This includes nodes that are the end of a device path instance and nodes that are the 191 end of an entire device path. If Node represents an end node of a device path, 189 Determines if the device path node specified by Node is an end node of a device path. 190 This includes nodes that are the end of a device path instance and nodes that are the 191 end of an entire device path. If Node represents an end node of a device path, 192 192 then TRUE is returned. Otherwise, FALSE is returned. 193 193 … … 196 196 @param Node A pointer to a device path node data structure. 197 197 198 @retval TRUE The device path node specified by Node is an end node of a 198 @retval TRUE The device path node specified by Node is an end node of a 199 199 device path. 200 @retval FALSE The device path node specified by Node is not an end node of 200 @retval FALSE The device path node specified by Node is not an end node of 201 201 a device path. 202 202 203 203 **/ 204 204 BOOLEAN … … 215 215 Determines if a device path node is an end node of an entire device path. 216 216 217 Determines if a device path node specified by Node is an end node of an entire 218 device path. If Node represents the end of an entire device path, then TRUE is 217 Determines if a device path node specified by Node is an end node of an entire 218 device path. If Node represents the end of an entire device path, then TRUE is 219 219 returned. Otherwise, FALSE is returned. 220 220 … … 223 223 @param Node A pointer to a device path node data structure. 224 224 225 @retval TRUE The device path node specified by Node is the end of an entire 225 @retval TRUE The device path node specified by Node is the end of an entire 226 226 device path. 227 @retval FALSE The device path node specified by Node is not the end of an 227 @retval FALSE The device path node specified by Node is not the end of an 228 228 entire device path. 229 229 … … 242 242 Determines if a device path node is an end node of a device path instance. 243 243 244 Determines if a device path node specified by Node is an end node of a device 245 path instance. If Node represents the end of a device path instance, then TRUE 244 Determines if a device path node specified by Node is an end node of a device 245 path instance. If Node represents the end of a device path instance, then TRUE 246 246 is returned. Otherwise, FALSE is returned. 247 247 … … 250 250 @param Node A pointer to a device path node data structure. 251 251 252 @retval TRUE The device path node specified by Node is the end of a device 252 @retval TRUE The device path node specified by Node is the end of a device 253 253 path instance. 254 @retval FALSE The device path node specified by Node is not the end of a 254 @retval FALSE The device path node specified by Node is not the end of a 255 255 device path instance. 256 256 … … 269 269 Sets the length, in bytes, of a device path node. 270 270 271 Sets the length of the device path node specified by Node to the value specified 272 by NodeLength. NodeLength is returned. Node is not required to be aligned on 271 Sets the length of the device path node specified by Node to the value specified 272 by NodeLength. NodeLength is returned. Node is not required to be aligned on 273 273 a 16-bit boundary, so it is recommended that a function such as WriteUnaligned16() 274 274 be used to set the contents of the Length field. … … 299 299 Fills in all the fields of a device path node that is the end of an entire device path. 300 300 301 Fills in all the fields of a device path node specified by Node so Node represents 302 the end of an entire device path. The Type field of Node is set to 303 END_DEVICE_PATH_TYPE, the SubType field of Node is set to 304 END_ENTIRE_DEVICE_PATH_SUBTYPE, and the Length field of Node is set to 305 END_DEVICE_PATH_LENGTH. Node is not required to be aligned on a 16-bit boundary, 306 so it is recommended that a function such as WriteUnaligned16() be used to set 307 the contents of the Length field. 308 309 If Node is NULL, then ASSERT(). 301 Fills in all the fields of a device path node specified by Node so Node represents 302 the end of an entire device path. The Type field of Node is set to 303 END_DEVICE_PATH_TYPE, the SubType field of Node is set to 304 END_ENTIRE_DEVICE_PATH_SUBTYPE, and the Length field of Node is set to 305 END_DEVICE_PATH_LENGTH. Node is not required to be aligned on a 16-bit boundary, 306 so it is recommended that a function such as WriteUnaligned16() be used to set 307 the contents of the Length field. 308 309 If Node is NULL, then ASSERT(). 310 310 311 311 @param Node A pointer to a device path node data structure. … … 325 325 Returns the size of a device path in bytes. 326 326 327 This function returns the size, in bytes, of the device path data structure 327 This function returns the size, in bytes, of the device path data structure 328 328 specified by DevicePath including the end of device path node. 329 329 If DevicePath is NULL or invalid, then 0 is returned. … … 368 368 Creates a new copy of an existing device path. 369 369 370 This function allocates space for a new copy of the device path specified by DevicePath. 371 If DevicePath is NULL, then NULL is returned. If the memory is successfully 372 allocated, then the contents of DevicePath are copied to the newly allocated 373 buffer, and a pointer to that buffer is returned. Otherwise, NULL is returned. 374 The memory for the new device path is allocated from EFI boot services memory. 375 It is the responsibility of the caller to free the memory allocated. 376 370 This function allocates space for a new copy of the device path specified by DevicePath. 371 If DevicePath is NULL, then NULL is returned. If the memory is successfully 372 allocated, then the contents of DevicePath are copied to the newly allocated 373 buffer, and a pointer to that buffer is returned. Otherwise, NULL is returned. 374 The memory for the new device path is allocated from EFI boot services memory. 375 It is the responsibility of the caller to free the memory allocated. 376 377 377 @param DevicePath A pointer to a device path data structure. 378 378 379 379 @retval NULL DevicePath is NULL or invalid. 380 380 @retval Others A pointer to the duplicated device path. 381 381 382 382 **/ 383 383 EFI_DEVICE_PATH_PROTOCOL * … … 407 407 Creates a new device path by appending a second device path to a first device path. 408 408 409 This function creates a new device path by appending a copy of SecondDevicePath 410 to a copy of FirstDevicePath in a newly allocated buffer. Only the end-of-device-path 411 device node from SecondDevicePath is retained. The newly created device path is 412 returned. If FirstDevicePath is NULL, then it is ignored, and a duplicate of 413 SecondDevicePath is returned. If SecondDevicePath is NULL, then it is ignored, 414 and a duplicate of FirstDevicePath is returned. If both FirstDevicePath and 415 SecondDevicePath are NULL, then a copy of an end-of-device-path is returned. 416 409 This function creates a new device path by appending a copy of SecondDevicePath 410 to a copy of FirstDevicePath in a newly allocated buffer. Only the end-of-device-path 411 device node from SecondDevicePath is retained. The newly created device path is 412 returned. If FirstDevicePath is NULL, then it is ignored, and a duplicate of 413 SecondDevicePath is returned. If SecondDevicePath is NULL, then it is ignored, 414 and a duplicate of FirstDevicePath is returned. If both FirstDevicePath and 415 SecondDevicePath are NULL, then a copy of an end-of-device-path is returned. 416 417 417 If there is not enough memory for the newly allocated buffer, then NULL is returned. 418 The memory for the new device path is allocated from EFI boot services memory. 418 The memory for the new device path is allocated from EFI boot services memory. 419 419 It is the responsibility of the caller to free the memory allocated. 420 420 421 421 @param FirstDevicePath A pointer to a device path data structure. 422 422 @param SecondDevicePath A pointer to a device path data structure. 423 423 424 424 @retval NULL If there is not enough memory for the newly allocated buffer. 425 425 @retval NULL If FirstDevicePath or SecondDevicePath is invalid. … … 482 482 Creates a new path by appending the device node to the device path. 483 483 484 This function creates a new device path by appending a copy of the device node 485 specified by DevicePathNode to a copy of the device path specified by DevicePath 486 in an allocated buffer. The end-of-device-path device node is moved after the 484 This function creates a new device path by appending a copy of the device node 485 specified by DevicePathNode to a copy of the device path specified by DevicePath 486 in an allocated buffer. The end-of-device-path device node is moved after the 487 487 end of the appended device node. 488 488 If DevicePathNode is NULL then a copy of DevicePath is returned. 489 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 489 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 490 490 path device node is returned. 491 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 491 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 492 492 device node is returned. 493 If there is not enough memory to allocate space for the new device path, then 494 NULL is returned. 495 The memory is allocated from EFI boot services memory. It is the responsibility 493 If there is not enough memory to allocate space for the new device path, then 494 NULL is returned. 495 The memory is allocated from EFI boot services memory. It is the responsibility 496 496 of the caller to free the memory allocated. 497 497 … … 501 501 @retval NULL If there is not enough memory for the new device path. 502 502 @retval Others A pointer to the new device path if success. 503 A copy of DevicePathNode followed by an end-of-device-path node 503 A copy of DevicePathNode followed by an end-of-device-path node 504 504 if both FirstDevicePath and SecondDevicePath are NULL. 505 A copy of an end-of-device-path node if both FirstDevicePath 505 A copy of an end-of-device-path node if both FirstDevicePath 506 506 and SecondDevicePath are NULL. 507 507 … … 550 550 Creates a new device path by appending the specified device path instance to the specified device 551 551 path. 552 553 This function creates a new device path by appending a copy of the device path 554 instance specified by DevicePathInstance to a copy of the device path specified 552 553 This function creates a new device path by appending a copy of the device path 554 instance specified by DevicePathInstance to a copy of the device path specified 555 555 by DevicePath in a allocated buffer. 556 The end-of-device-path device node is moved after the end of the appended device 557 path instance and a new end-of-device-path-instance node is inserted between. 556 The end-of-device-path device node is moved after the end of the appended device 557 path instance and a new end-of-device-path-instance node is inserted between. 558 558 If DevicePath is NULL, then a copy if DevicePathInstance is returned. 559 559 If DevicePathInstance is NULL, then NULL is returned. 560 560 If DevicePath or DevicePathInstance is invalid, then NULL is returned. 561 If there is not enough memory to allocate space for the new device path, then 562 NULL is returned. 563 The memory is allocated from EFI boot services memory. It is the responsibility 561 If there is not enough memory to allocate space for the new device path, then 562 NULL is returned. 563 The memory is allocated from EFI boot services memory. It is the responsibility 564 564 of the caller to free the memory allocated. 565 565 566 566 @param DevicePath A pointer to a device path data structure. 567 567 @param DevicePathInstance A pointer to a device path instance. … … 599 599 NewDevicePath = AllocatePool (SrcSize + InstanceSize); 600 600 if (NewDevicePath != NULL) { 601 601 602 602 TempDevicePath = CopyMem (NewDevicePath, DevicePath, SrcSize);; 603 603 604 604 while (!IsDevicePathEnd (TempDevicePath)) { 605 605 TempDevicePath = NextDevicePathNode (TempDevicePath); 606 606 } 607 607 608 608 TempDevicePath->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; 609 609 TempDevicePath = NextDevicePathNode (TempDevicePath); … … 618 618 instance. 619 619 620 This function creates a copy of the current device path instance. It also updates 621 DevicePath to point to the next device path instance in the device path (or NULL 620 This function creates a copy of the current device path instance. It also updates 621 DevicePath to point to the next device path instance in the device path (or NULL 622 622 if no more) and updates Size to hold the size of the device path instance copy. 623 623 If DevicePath is NULL, then NULL is returned. 624 624 If DevicePath points to a invalid device path, then NULL is returned. 625 If there is not enough memory to allocate space for the new device path, then 626 NULL is returned. 627 The memory is allocated from EFI boot services memory. It is the responsibility 625 If there is not enough memory to allocate space for the new device path, then 626 NULL is returned. 627 The memory is allocated from EFI boot services memory. It is the responsibility 628 628 of the caller to free the memory allocated. 629 629 If Size is NULL, then ASSERT(). 630 631 @param DevicePath On input, this holds the pointer to the current 632 device path instance. On output, this holds 633 the pointer to the next device path instance 630 631 @param DevicePath On input, this holds the pointer to the current 632 device path instance. On output, this holds 633 the pointer to the next device path instance 634 634 or NULL if there are no more device path 635 instances in the device path pointer to a 635 instances in the device path pointer to a 636 636 device path data structure. 637 @param Size On output, this holds the size of the device 638 path instance, in bytes or zero, if DevicePath 637 @param Size On output, this holds the size of the device 638 path instance, in bytes or zero, if DevicePath 639 639 is NULL. 640 640 … … 676 676 // 677 677 *Size = ((UINTN) DevPath - (UINTN) (*DevicePath)) + sizeof (EFI_DEVICE_PATH_PROTOCOL); 678 678 679 679 // 680 680 // Make a copy and return the device path instance … … 701 701 Creates a device node. 702 702 703 This function creates a new device node in a newly allocated buffer of size 704 NodeLength and initializes the device path node header with NodeType and NodeSubType. 703 This function creates a new device node in a newly allocated buffer of size 704 NodeLength and initializes the device path node header with NodeType and NodeSubType. 705 705 The new device path node is returned. 706 If NodeLength is smaller than a device path header, then NULL is returned. 707 If there is not enough memory to allocate space for the new device path, then 708 NULL is returned. 709 The memory is allocated from EFI boot services memory. It is the responsibility 706 If NodeLength is smaller than a device path header, then NULL is returned. 707 If there is not enough memory to allocate space for the new device path, then 708 NULL is returned. 709 The memory is allocated from EFI boot services memory. It is the responsibility 710 710 of the caller to free the memory allocated. 711 711 … … 733 733 return NULL; 734 734 } 735 735 736 736 DevicePath = AllocateZeroPool (NodeLength); 737 737 if (DevicePath != NULL) { … … 755 755 756 756 @retval TRUE DevicePath is multi-instance. 757 @retval FALSE DevicePath is not multi-instance, or DevicePath 757 @retval FALSE DevicePath is not multi-instance, or DevicePath 758 758 is NULL or invalid. 759 759 … … 791 791 Retrieves the device path protocol from a handle. 792 792 793 This function returns the device path protocol from the handle specified by Handle. 794 If Handle is NULL or Handle does not contain a device path protocol, then NULL 793 This function returns the device path protocol from the handle specified by Handle. 794 If Handle is NULL or Handle does not contain a device path protocol, then NULL 795 795 is returned. 796 797 @param Handle The handle from which to retrieve the device 796 797 @param Handle The handle from which to retrieve the device 798 798 path protocol. 799 799 … … 831 831 The memory for the new device path is allocated from EFI boot services memory. It is the responsibility 832 832 of the caller to free the memory allocated. 833 833 834 834 If FileName is NULL, then ASSERT(). 835 835 If FileName is not aligned on a 16-bit boundary, then ASSERT(). 836 836 837 @param Device A pointer to a device handle. This parameter 837 @param Device A pointer to a device handle. This parameter 838 838 is optional and may be NULL. 839 839 @param FileName A pointer to a Null-terminated Unicode string. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.c
r58459 r58466 10 10 11 11 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 12 This program and the accompanying materials 13 are licensed and made available under the terms and conditions of the BSD License 14 which accompanies this distribution. The full text of the license may be found at 15 http://opensource.org/licenses/bsd-license.php. 16 17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 This program and the accompanying materials 13 are licensed and made available under the terms and conditions of the BSD License 14 which accompanies this distribution. The full text of the license may be found at 15 http://opensource.org/licenses/bsd-license.php. 16 17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 19 19 20 20 **/ … … 26 26 Returns the size of a device path in bytes. 27 27 28 This function returns the size, in bytes, of the device path data structure 28 This function returns the size, in bytes, of the device path data structure 29 29 specified by DevicePath including the end of device path node. 30 30 If DevicePath is NULL or invalid, then 0 is returned. … … 48 48 Creates a new copy of an existing device path. 49 49 50 This function allocates space for a new copy of the device path specified by DevicePath. 51 If DevicePath is NULL, then NULL is returned. If the memory is successfully 52 allocated, then the contents of DevicePath are copied to the newly allocated 53 buffer, and a pointer to that buffer is returned. Otherwise, NULL is returned. 54 The memory for the new device path is allocated from EFI boot services memory. 55 It is the responsibility of the caller to free the memory allocated. 56 50 This function allocates space for a new copy of the device path specified by DevicePath. 51 If DevicePath is NULL, then NULL is returned. If the memory is successfully 52 allocated, then the contents of DevicePath are copied to the newly allocated 53 buffer, and a pointer to that buffer is returned. Otherwise, NULL is returned. 54 The memory for the new device path is allocated from EFI boot services memory. 55 It is the responsibility of the caller to free the memory allocated. 56 57 57 @param DevicePath A pointer to a device path data structure. 58 58 59 59 @retval NULL DevicePath is NULL or invalid. 60 60 @retval Others A pointer to the duplicated device path. 61 61 62 62 **/ 63 63 EFI_DEVICE_PATH_PROTOCOL * … … 73 73 Creates a new device path by appending a second device path to a first device path. 74 74 75 This function creates a new device path by appending a copy of SecondDevicePath 76 to a copy of FirstDevicePath in a newly allocated buffer. Only the end-of-device-path 77 device node from SecondDevicePath is retained. The newly created device path is 78 returned. If FirstDevicePath is NULL, then it is ignored, and a duplicate of 79 SecondDevicePath is returned. If SecondDevicePath is NULL, then it is ignored, 80 and a duplicate of FirstDevicePath is returned. If both FirstDevicePath and 81 SecondDevicePath are NULL, then a copy of an end-of-device-path is returned. 82 75 This function creates a new device path by appending a copy of SecondDevicePath 76 to a copy of FirstDevicePath in a newly allocated buffer. Only the end-of-device-path 77 device node from SecondDevicePath is retained. The newly created device path is 78 returned. If FirstDevicePath is NULL, then it is ignored, and a duplicate of 79 SecondDevicePath is returned. If SecondDevicePath is NULL, then it is ignored, 80 and a duplicate of FirstDevicePath is returned. If both FirstDevicePath and 81 SecondDevicePath are NULL, then a copy of an end-of-device-path is returned. 82 83 83 If there is not enough memory for the newly allocated buffer, then NULL is returned. 84 The memory for the new device path is allocated from EFI boot services memory. 84 The memory for the new device path is allocated from EFI boot services memory. 85 85 It is the responsibility of the caller to free the memory allocated. 86 86 87 87 @param FirstDevicePath A pointer to a device path data structure. 88 88 @param SecondDevicePath A pointer to a device path data structure. 89 89 90 90 @retval NULL If there is not enough memory for the newly allocated buffer. 91 91 @retval NULL If FirstDevicePath or SecondDevicePath is invalid. … … 107 107 Creates a new path by appending the device node to the device path. 108 108 109 This function creates a new device path by appending a copy of the device node 110 specified by DevicePathNode to a copy of the device path specified by DevicePath 111 in an allocated buffer. The end-of-device-path device node is moved after the 109 This function creates a new device path by appending a copy of the device node 110 specified by DevicePathNode to a copy of the device path specified by DevicePath 111 in an allocated buffer. The end-of-device-path device node is moved after the 112 112 end of the appended device node. 113 113 If DevicePathNode is NULL then a copy of DevicePath is returned. 114 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 114 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 115 115 path device node is returned. 116 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 116 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 117 117 device node is returned. 118 If there is not enough memory to allocate space for the new device path, then 119 NULL is returned. 120 The memory is allocated from EFI boot services memory. It is the responsibility 118 If there is not enough memory to allocate space for the new device path, then 119 NULL is returned. 120 The memory is allocated from EFI boot services memory. It is the responsibility 121 121 of the caller to free the memory allocated. 122 122 … … 126 126 @retval NULL If there is not enough memory for the new device path. 127 127 @retval Others A pointer to the new device path if success. 128 A copy of DevicePathNode followed by an end-of-device-path node 128 A copy of DevicePathNode followed by an end-of-device-path node 129 129 if both FirstDevicePath and SecondDevicePath are NULL. 130 A copy of an end-of-device-path node if both FirstDevicePath 130 A copy of an end-of-device-path node if both FirstDevicePath 131 131 and SecondDevicePath are NULL. 132 132 … … 145 145 Creates a new device path by appending the specified device path instance to the specified device 146 146 path. 147 148 This function creates a new device path by appending a copy of the device path 149 instance specified by DevicePathInstance to a copy of the device path specified 147 148 This function creates a new device path by appending a copy of the device path 149 instance specified by DevicePathInstance to a copy of the device path specified 150 150 by DevicePath in a allocated buffer. 151 The end-of-device-path device node is moved after the end of the appended device 152 path instance and a new end-of-device-path-instance node is inserted between. 151 The end-of-device-path device node is moved after the end of the appended device 152 path instance and a new end-of-device-path-instance node is inserted between. 153 153 If DevicePath is NULL, then a copy if DevicePathInstance is returned. 154 154 If DevicePathInstance is NULL, then NULL is returned. 155 155 If DevicePath or DevicePathInstance is invalid, then NULL is returned. 156 If there is not enough memory to allocate space for the new device path, then 157 NULL is returned. 158 The memory is allocated from EFI boot services memory. It is the responsibility 156 If there is not enough memory to allocate space for the new device path, then 157 NULL is returned. 158 The memory is allocated from EFI boot services memory. It is the responsibility 159 159 of the caller to free the memory allocated. 160 160 161 161 @param DevicePath A pointer to a device path data structure. 162 162 @param DevicePathInstance A pointer to a device path instance. … … 179 179 instance. 180 180 181 This function creates a copy of the current device path instance. It also updates 182 DevicePath to point to the next device path instance in the device path (or NULL 181 This function creates a copy of the current device path instance. It also updates 182 DevicePath to point to the next device path instance in the device path (or NULL 183 183 if no more) and updates Size to hold the size of the device path instance copy. 184 184 If DevicePath is NULL, then NULL is returned. 185 185 If DevicePath points to a invalid device path, then NULL is returned. 186 If there is not enough memory to allocate space for the new device path, then 187 NULL is returned. 188 The memory is allocated from EFI boot services memory. It is the responsibility 186 If there is not enough memory to allocate space for the new device path, then 187 NULL is returned. 188 The memory is allocated from EFI boot services memory. It is the responsibility 189 189 of the caller to free the memory allocated. 190 190 If Size is NULL, then ASSERT(). 191 192 @param DevicePath On input, this holds the pointer to the current 193 device path instance. On output, this holds 194 the pointer to the next device path instance 191 192 @param DevicePath On input, this holds the pointer to the current 193 device path instance. On output, this holds 194 the pointer to the next device path instance 195 195 or NULL if there are no more device path 196 instances in the device path pointer to a 196 instances in the device path pointer to a 197 197 device path data structure. 198 @param Size On output, this holds the size of the device 199 path instance, in bytes or zero, if DevicePath 198 @param Size On output, this holds the size of the device 199 path instance, in bytes or zero, if DevicePath 200 200 is NULL. 201 201 … … 216 216 Creates a device node. 217 217 218 This function creates a new device node in a newly allocated buffer of size 219 NodeLength and initializes the device path node header with NodeType and NodeSubType. 218 This function creates a new device node in a newly allocated buffer of size 219 NodeLength and initializes the device path node header with NodeType and NodeSubType. 220 220 The new device path node is returned. 221 If NodeLength is smaller than a device path header, then NULL is returned. 222 If there is not enough memory to allocate space for the new device path, then 223 NULL is returned. 224 The memory is allocated from EFI boot services memory. It is the responsibility 221 If NodeLength is smaller than a device path header, then NULL is returned. 222 If there is not enough memory to allocate space for the new device path, then 223 NULL is returned. 224 The memory is allocated from EFI boot services memory. It is the responsibility 225 225 of the caller to free the memory allocated. 226 226 … … 254 254 255 255 @retval TRUE DevicePath is multi-instance. 256 @retval FALSE DevicePath is not multi-instance, or DevicePath 256 @retval FALSE DevicePath is not multi-instance, or DevicePath 257 257 is NULL or invalid. 258 258 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.h
r58464 r58466 155 155 Returns the size of a device path in bytes. 156 156 157 This function returns the size, in bytes, of the device path data structure 157 This function returns the size, in bytes, of the device path data structure 158 158 specified by DevicePath including the end of device path node. 159 159 If DevicePath is NULL or invalid, then 0 is returned. … … 174 174 Creates a new copy of an existing device path. 175 175 176 This function allocates space for a new copy of the device path specified by DevicePath. 177 If DevicePath is NULL, then NULL is returned. If the memory is successfully 178 allocated, then the contents of DevicePath are copied to the newly allocated 179 buffer, and a pointer to that buffer is returned. Otherwise, NULL is returned. 180 The memory for the new device path is allocated from EFI boot services memory. 181 It is the responsibility of the caller to free the memory allocated. 182 176 This function allocates space for a new copy of the device path specified by DevicePath. 177 If DevicePath is NULL, then NULL is returned. If the memory is successfully 178 allocated, then the contents of DevicePath are copied to the newly allocated 179 buffer, and a pointer to that buffer is returned. Otherwise, NULL is returned. 180 The memory for the new device path is allocated from EFI boot services memory. 181 It is the responsibility of the caller to free the memory allocated. 182 183 183 @param DevicePath A pointer to a device path data structure. 184 184 185 185 @retval NULL DevicePath is NULL or invalid. 186 186 @retval Others A pointer to the duplicated device path. 187 187 188 188 **/ 189 189 EFI_DEVICE_PATH_PROTOCOL * … … 196 196 Creates a new device path by appending a second device path to a first device path. 197 197 198 This function creates a new device path by appending a copy of SecondDevicePath 199 to a copy of FirstDevicePath in a newly allocated buffer. Only the end-of-device-path 200 device node from SecondDevicePath is retained. The newly created device path is 201 returned. If FirstDevicePath is NULL, then it is ignored, and a duplicate of 202 SecondDevicePath is returned. If SecondDevicePath is NULL, then it is ignored, 203 and a duplicate of FirstDevicePath is returned. If both FirstDevicePath and 204 SecondDevicePath are NULL, then a copy of an end-of-device-path is returned. 205 198 This function creates a new device path by appending a copy of SecondDevicePath 199 to a copy of FirstDevicePath in a newly allocated buffer. Only the end-of-device-path 200 device node from SecondDevicePath is retained. The newly created device path is 201 returned. If FirstDevicePath is NULL, then it is ignored, and a duplicate of 202 SecondDevicePath is returned. If SecondDevicePath is NULL, then it is ignored, 203 and a duplicate of FirstDevicePath is returned. If both FirstDevicePath and 204 SecondDevicePath are NULL, then a copy of an end-of-device-path is returned. 205 206 206 If there is not enough memory for the newly allocated buffer, then NULL is returned. 207 The memory for the new device path is allocated from EFI boot services memory. 207 The memory for the new device path is allocated from EFI boot services memory. 208 208 It is the responsibility of the caller to free the memory allocated. 209 209 210 210 @param FirstDevicePath A pointer to a device path data structure. 211 211 @param SecondDevicePath A pointer to a device path data structure. 212 212 213 213 @retval NULL If there is not enough memory for the newly allocated buffer. 214 214 @retval NULL If FirstDevicePath or SecondDevicePath is invalid. … … 227 227 Creates a new path by appending the device node to the device path. 228 228 229 This function creates a new device path by appending a copy of the device node 230 specified by DevicePathNode to a copy of the device path specified by DevicePath 231 in an allocated buffer. The end-of-device-path device node is moved after the 229 This function creates a new device path by appending a copy of the device node 230 specified by DevicePathNode to a copy of the device path specified by DevicePath 231 in an allocated buffer. The end-of-device-path device node is moved after the 232 232 end of the appended device node. 233 233 If DevicePathNode is NULL then a copy of DevicePath is returned. 234 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 234 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 235 235 path device node is returned. 236 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 236 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 237 237 device node is returned. 238 If there is not enough memory to allocate space for the new device path, then 239 NULL is returned. 240 The memory is allocated from EFI boot services memory. It is the responsibility 238 If there is not enough memory to allocate space for the new device path, then 239 NULL is returned. 240 The memory is allocated from EFI boot services memory. It is the responsibility 241 241 of the caller to free the memory allocated. 242 242 … … 246 246 @retval NULL If there is not enough memory for the new device path. 247 247 @retval Others A pointer to the new device path if success. 248 A copy of DevicePathNode followed by an end-of-device-path node 248 A copy of DevicePathNode followed by an end-of-device-path node 249 249 if both FirstDevicePath and SecondDevicePath are NULL. 250 A copy of an end-of-device-path node if both FirstDevicePath 250 A copy of an end-of-device-path node if both FirstDevicePath 251 251 and SecondDevicePath are NULL. 252 252 … … 262 262 Creates a new device path by appending the specified device path instance to the specified device 263 263 path. 264 265 This function creates a new device path by appending a copy of the device path 266 instance specified by DevicePathInstance to a copy of the device path specified 264 265 This function creates a new device path by appending a copy of the device path 266 instance specified by DevicePathInstance to a copy of the device path specified 267 267 by DevicePath in a allocated buffer. 268 The end-of-device-path device node is moved after the end of the appended device 269 path instance and a new end-of-device-path-instance node is inserted between. 268 The end-of-device-path device node is moved after the end of the appended device 269 path instance and a new end-of-device-path-instance node is inserted between. 270 270 If DevicePath is NULL, then a copy if DevicePathInstance is returned. 271 271 If DevicePathInstance is NULL, then NULL is returned. 272 272 If DevicePath or DevicePathInstance is invalid, then NULL is returned. 273 If there is not enough memory to allocate space for the new device path, then 274 NULL is returned. 275 The memory is allocated from EFI boot services memory. It is the responsibility 273 If there is not enough memory to allocate space for the new device path, then 274 NULL is returned. 275 The memory is allocated from EFI boot services memory. It is the responsibility 276 276 of the caller to free the memory allocated. 277 277 278 278 @param DevicePath A pointer to a device path data structure. 279 279 @param DevicePathInstance A pointer to a device path instance. … … 293 293 instance. 294 294 295 This function creates a copy of the current device path instance. It also updates 296 DevicePath to point to the next device path instance in the device path (or NULL 295 This function creates a copy of the current device path instance. It also updates 296 DevicePath to point to the next device path instance in the device path (or NULL 297 297 if no more) and updates Size to hold the size of the device path instance copy. 298 298 If DevicePath is NULL, then NULL is returned. 299 299 If DevicePath points to a invalid device path, then NULL is returned. 300 If there is not enough memory to allocate space for the new device path, then 301 NULL is returned. 302 The memory is allocated from EFI boot services memory. It is the responsibility 300 If there is not enough memory to allocate space for the new device path, then 301 NULL is returned. 302 The memory is allocated from EFI boot services memory. It is the responsibility 303 303 of the caller to free the memory allocated. 304 304 If Size is NULL, then ASSERT(). 305 306 @param DevicePath On input, this holds the pointer to the current 307 device path instance. On output, this holds 308 the pointer to the next device path instance 305 306 @param DevicePath On input, this holds the pointer to the current 307 device path instance. On output, this holds 308 the pointer to the next device path instance 309 309 or NULL if there are no more device path 310 instances in the device path pointer to a 310 instances in the device path pointer to a 311 311 device path data structure. 312 @param Size On output, this holds the size of the device 313 path instance, in bytes or zero, if DevicePath 312 @param Size On output, this holds the size of the device 313 path instance, in bytes or zero, if DevicePath 314 314 is NULL. 315 315 … … 327 327 Creates a device node. 328 328 329 This function creates a new device node in a newly allocated buffer of size 330 NodeLength and initializes the device path node header with NodeType and NodeSubType. 329 This function creates a new device node in a newly allocated buffer of size 330 NodeLength and initializes the device path node header with NodeType and NodeSubType. 331 331 The new device path node is returned. 332 If NodeLength is smaller than a device path header, then NULL is returned. 333 If there is not enough memory to allocate space for the new device path, then 334 NULL is returned. 335 The memory is allocated from EFI boot services memory. It is the responsibility 332 If NodeLength is smaller than a device path header, then NULL is returned. 333 If there is not enough memory to allocate space for the new device path, then 334 NULL is returned. 335 The memory is allocated from EFI boot services memory. It is the responsibility 336 336 of the caller to free the memory allocated. 337 337 … … 362 362 363 363 @retval TRUE DevicePath is multi-instance. 364 @retval FALSE DevicePath is not multi-instance, or DevicePath 364 @retval FALSE DevicePath is not multi-instance, or DevicePath 365 365 is NULL or invalid. 366 366 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.c
r58464 r58466 10 10 11 11 Copyright (c) 2013, Intel Corporation. All rights reserved.<BR> 12 This program and the accompanying materials 13 are licensed and made available under the terms and conditions of the BSD License 14 which accompanies this distribution. The full text of the license may be found at 15 http://opensource.org/licenses/bsd-license.php. 16 17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 This program and the accompanying materials 13 are licensed and made available under the terms and conditions of the BSD License 14 which accompanies this distribution. The full text of the license may be found at 15 http://opensource.org/licenses/bsd-license.php. 16 17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 19 19 20 20 **/ … … 30 30 The constructor function caches the pointer to DevicePathUtilites protocol, 31 31 DevicePathToText protocol and DevicePathFromText protocol. 32 32 33 33 The constructor function locates these three protocols from protocol database. 34 34 It will caches the pointer to local protocol instance if that operation fails 35 and it will always return EFI_SUCCESS. 35 and it will always return EFI_SUCCESS. 36 36 37 37 @param ImageHandle The firmware allocated handle for the EFI image. 38 38 @param SystemTable A pointer to the EFI System Table. 39 39 40 40 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. 41 41 … … 63 63 Returns the size of a device path in bytes. 64 64 65 This function returns the size, in bytes, of the device path data structure 65 This function returns the size, in bytes, of the device path data structure 66 66 specified by DevicePath including the end of device path node. 67 67 If DevicePath is NULL or invalid, then 0 is returned. … … 89 89 Creates a new copy of an existing device path. 90 90 91 This function allocates space for a new copy of the device path specified by DevicePath. 92 If DevicePath is NULL, then NULL is returned. If the memory is successfully 93 allocated, then the contents of DevicePath are copied to the newly allocated 94 buffer, and a pointer to that buffer is returned. Otherwise, NULL is returned. 95 The memory for the new device path is allocated from EFI boot services memory. 96 It is the responsibility of the caller to free the memory allocated. 97 91 This function allocates space for a new copy of the device path specified by DevicePath. 92 If DevicePath is NULL, then NULL is returned. If the memory is successfully 93 allocated, then the contents of DevicePath are copied to the newly allocated 94 buffer, and a pointer to that buffer is returned. Otherwise, NULL is returned. 95 The memory for the new device path is allocated from EFI boot services memory. 96 It is the responsibility of the caller to free the memory allocated. 97 98 98 @param DevicePath A pointer to a device path data structure. 99 99 100 100 @retval NULL DevicePath is NULL or invalid. 101 101 @retval Others A pointer to the duplicated device path. 102 102 103 103 **/ 104 104 EFI_DEVICE_PATH_PROTOCOL * … … 118 118 Creates a new device path by appending a second device path to a first device path. 119 119 120 This function creates a new device path by appending a copy of SecondDevicePath 121 to a copy of FirstDevicePath in a newly allocated buffer. Only the end-of-device-path 122 device node from SecondDevicePath is retained. The newly created device path is 123 returned. If FirstDevicePath is NULL, then it is ignored, and a duplicate of 124 SecondDevicePath is returned. If SecondDevicePath is NULL, then it is ignored, 125 and a duplicate of FirstDevicePath is returned. If both FirstDevicePath and 126 SecondDevicePath are NULL, then a copy of an end-of-device-path is returned. 127 120 This function creates a new device path by appending a copy of SecondDevicePath 121 to a copy of FirstDevicePath in a newly allocated buffer. Only the end-of-device-path 122 device node from SecondDevicePath is retained. The newly created device path is 123 returned. If FirstDevicePath is NULL, then it is ignored, and a duplicate of 124 SecondDevicePath is returned. If SecondDevicePath is NULL, then it is ignored, 125 and a duplicate of FirstDevicePath is returned. If both FirstDevicePath and 126 SecondDevicePath are NULL, then a copy of an end-of-device-path is returned. 127 128 128 If there is not enough memory for the newly allocated buffer, then NULL is returned. 129 The memory for the new device path is allocated from EFI boot services memory. 129 The memory for the new device path is allocated from EFI boot services memory. 130 130 It is the responsibility of the caller to free the memory allocated. 131 131 132 132 @param FirstDevicePath A pointer to a device path data structure. 133 133 @param SecondDevicePath A pointer to a device path data structure. 134 134 135 135 @retval NULL If there is not enough memory for the newly allocated buffer. 136 136 @retval NULL If FirstDevicePath or SecondDevicePath is invalid. … … 156 156 Creates a new path by appending the device node to the device path. 157 157 158 This function creates a new device path by appending a copy of the device node 159 specified by DevicePathNode to a copy of the device path specified by DevicePath 160 in an allocated buffer. The end-of-device-path device node is moved after the 158 This function creates a new device path by appending a copy of the device node 159 specified by DevicePathNode to a copy of the device path specified by DevicePath 160 in an allocated buffer. The end-of-device-path device node is moved after the 161 161 end of the appended device node. 162 162 If DevicePathNode is NULL then a copy of DevicePath is returned. 163 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 163 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 164 164 path device node is returned. 165 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 165 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 166 166 device node is returned. 167 If there is not enough memory to allocate space for the new device path, then 168 NULL is returned. 169 The memory is allocated from EFI boot services memory. It is the responsibility 167 If there is not enough memory to allocate space for the new device path, then 168 NULL is returned. 169 The memory is allocated from EFI boot services memory. It is the responsibility 170 170 of the caller to free the memory allocated. 171 171 … … 175 175 @retval NULL If there is not enough memory for the new device path. 176 176 @retval Others A pointer to the new device path if success. 177 A copy of DevicePathNode followed by an end-of-device-path node 177 A copy of DevicePathNode followed by an end-of-device-path node 178 178 if both FirstDevicePath and SecondDevicePath are NULL. 179 A copy of an end-of-device-path node if both FirstDevicePath 179 A copy of an end-of-device-path node if both FirstDevicePath 180 180 and SecondDevicePath are NULL. 181 181 … … 198 198 Creates a new device path by appending the specified device path instance to the specified device 199 199 path. 200 201 This function creates a new device path by appending a copy of the device path 202 instance specified by DevicePathInstance to a copy of the device path specified 200 201 This function creates a new device path by appending a copy of the device path 202 instance specified by DevicePathInstance to a copy of the device path specified 203 203 by DevicePath in a allocated buffer. 204 The end-of-device-path device node is moved after the end of the appended device 205 path instance and a new end-of-device-path-instance node is inserted between. 204 The end-of-device-path device node is moved after the end of the appended device 205 path instance and a new end-of-device-path-instance node is inserted between. 206 206 If DevicePath is NULL, then a copy if DevicePathInstance is returned. 207 207 If DevicePathInstance is NULL, then NULL is returned. 208 208 If DevicePath or DevicePathInstance is invalid, then NULL is returned. 209 If there is not enough memory to allocate space for the new device path, then 210 NULL is returned. 211 The memory is allocated from EFI boot services memory. It is the responsibility 209 If there is not enough memory to allocate space for the new device path, then 210 NULL is returned. 211 The memory is allocated from EFI boot services memory. It is the responsibility 212 212 of the caller to free the memory allocated. 213 213 214 214 @param DevicePath A pointer to a device path data structure. 215 215 @param DevicePathInstance A pointer to a device path instance. … … 236 236 instance. 237 237 238 This function creates a copy of the current device path instance. It also updates 239 DevicePath to point to the next device path instance in the device path (or NULL 238 This function creates a copy of the current device path instance. It also updates 239 DevicePath to point to the next device path instance in the device path (or NULL 240 240 if no more) and updates Size to hold the size of the device path instance copy. 241 241 If DevicePath is NULL, then NULL is returned. 242 242 If DevicePath points to a invalid device path, then NULL is returned. 243 If there is not enough memory to allocate space for the new device path, then 244 NULL is returned. 245 The memory is allocated from EFI boot services memory. It is the responsibility 243 If there is not enough memory to allocate space for the new device path, then 244 NULL is returned. 245 The memory is allocated from EFI boot services memory. It is the responsibility 246 246 of the caller to free the memory allocated. 247 247 If Size is NULL, then ASSERT(). 248 249 @param DevicePath On input, this holds the pointer to the current 250 device path instance. On output, this holds 251 the pointer to the next device path instance 248 249 @param DevicePath On input, this holds the pointer to the current 250 device path instance. On output, this holds 251 the pointer to the next device path instance 252 252 or NULL if there are no more device path 253 instances in the device path pointer to a 253 instances in the device path pointer to a 254 254 device path data structure. 255 @param Size On output, this holds the size of the device 256 path instance, in bytes or zero, if DevicePath 255 @param Size On output, this holds the size of the device 256 path instance, in bytes or zero, if DevicePath 257 257 is NULL. 258 258 … … 277 277 Creates a device node. 278 278 279 This function creates a new device node in a newly allocated buffer of size 280 NodeLength and initializes the device path node header with NodeType and NodeSubType. 279 This function creates a new device node in a newly allocated buffer of size 280 NodeLength and initializes the device path node header with NodeType and NodeSubType. 281 281 The new device path node is returned. 282 If NodeLength is smaller than a device path header, then NULL is returned. 283 If there is not enough memory to allocate space for the new device path, then 284 NULL is returned. 285 The memory is allocated from EFI boot services memory. It is the responsibility 282 If NodeLength is smaller than a device path header, then NULL is returned. 283 If there is not enough memory to allocate space for the new device path, then 284 NULL is returned. 285 The memory is allocated from EFI boot services memory. It is the responsibility 286 286 of the caller to free the memory allocated. 287 287 … … 319 319 320 320 @retval TRUE DevicePath is multi-instance. 321 @retval FALSE DevicePath is not multi-instance, or DevicePath 321 @retval FALSE DevicePath is not multi-instance, or DevicePath 322 322 is NULL or invalid. 323 323 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
r58459 r58466 47 47 /** 48 48 The constructor function caches the pointer to DevicePathUtilites protocol. 49 49 50 50 The constructor function locates DevicePathUtilities protocol from protocol database. 51 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. 51 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. 52 52 53 53 @param ImageHandle The firmware allocated handle for the EFI image. 54 54 @param SystemTable A pointer to the EFI System Table. 55 55 56 56 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. 57 57 … … 178 178 Returns the 16-bit Length field of a device path node. 179 179 180 Returns the 16-bit Length field of the device path node specified by Node. 180 Returns the 16-bit Length field of the device path node specified by Node. 181 181 Node is not required to be aligned on a 16-bit boundary, so it is recommended 182 that a function such as ReadUnaligned16() be used to extract the contents of 182 that a function such as ReadUnaligned16() be used to extract the contents of 183 183 the Length field. 184 184 … … 203 203 Returns a pointer to the next node in a device path. 204 204 205 Returns a pointer to the device path node that follows the device path node 205 Returns a pointer to the device path node that follows the device path node 206 206 specified by Node. 207 207 … … 210 210 @param Node A pointer to a device path node data structure. 211 211 212 @return a pointer to the device path node that follows the device path node 212 @return a pointer to the device path node that follows the device path node 213 213 specified by Node. 214 214 … … 226 226 /** 227 227 Determines if a device path node is an end node of a device path. 228 This includes nodes that are the end of a device path instance and nodes that 228 This includes nodes that are the end of a device path instance and nodes that 229 229 are the end of an entire device path. 230 230 231 Determines if the device path node specified by Node is an end node of a device path. 232 This includes nodes that are the end of a device path instance and nodes that are the 233 end of an entire device path. If Node represents an end node of a device path, 231 Determines if the device path node specified by Node is an end node of a device path. 232 This includes nodes that are the end of a device path instance and nodes that are the 233 end of an entire device path. If Node represents an end node of a device path, 234 234 then TRUE is returned. Otherwise, FALSE is returned. 235 235 … … 239 239 240 240 @retval TRUE The device path node specified by Node is an end node of a device path. 241 @retval FALSE The device path node specified by Node is not an end node of 241 @retval FALSE The device path node specified by Node is not an end node of 242 242 a device path. 243 243 244 244 **/ 245 245 BOOLEAN … … 256 256 Determines if a device path node is an end node of an entire device path. 257 257 258 Determines if a device path node specified by Node is an end node of an entire 258 Determines if a device path node specified by Node is an end node of an entire 259 259 device path. 260 If Node represents the end of an entire device path, then TRUE is returned. 260 If Node represents the end of an entire device path, then TRUE is returned. 261 261 Otherwise, FALSE is returned. 262 262 … … 282 282 Determines if a device path node is an end node of a device path instance. 283 283 284 Determines if a device path node specified by Node is an end node of a device 284 Determines if a device path node specified by Node is an end node of a device 285 285 path instance. 286 If Node represents the end of a device path instance, then TRUE is returned. 286 If Node represents the end of a device path instance, then TRUE is returned. 287 287 Otherwise, FALSE is returned. 288 288 … … 291 291 @param Node A pointer to a device path node data structure. 292 292 293 @retval TRUE The device path node specified by Node is the end of a device 293 @retval TRUE The device path node specified by Node is the end of a device 294 294 path instance. 295 @retval FALSE The device path node specified by Node is not the end of a 295 @retval FALSE The device path node specified by Node is not the end of a 296 296 device path instance. 297 297 … … 310 310 Sets the length, in bytes, of a device path node. 311 311 312 Sets the length of the device path node specified by Node to the value specified 313 by NodeLength. NodeLength is returned. Node is not required to be aligned on 312 Sets the length of the device path node specified by Node to the value specified 313 by NodeLength. NodeLength is returned. Node is not required to be aligned on 314 314 a 16-bit boundary, so it is recommended that a function such as WriteUnaligned16() 315 315 be used to set the contents of the Length field. … … 340 340 Fills in all the fields of a device path node that is the end of an entire device path. 341 341 342 Fills in all the fields of a device path node specified by Node so Node represents 343 the end of an entire device path. The Type field of Node is set to 344 END_DEVICE_PATH_TYPE, the SubType field of Node is set to 345 END_ENTIRE_DEVICE_PATH_SUBTYPE, and the Length field of Node is set to 346 END_DEVICE_PATH_LENGTH. Node is not required to be aligned on a 16-bit boundary, 347 so it is recommended that a function such as WriteUnaligned16() be used to set 348 the contents of the Length field. 349 350 If Node is NULL, then ASSERT(). 342 Fills in all the fields of a device path node specified by Node so Node represents 343 the end of an entire device path. The Type field of Node is set to 344 END_DEVICE_PATH_TYPE, the SubType field of Node is set to 345 END_ENTIRE_DEVICE_PATH_SUBTYPE, and the Length field of Node is set to 346 END_DEVICE_PATH_LENGTH. Node is not required to be aligned on a 16-bit boundary, 347 so it is recommended that a function such as WriteUnaligned16() be used to set 348 the contents of the Length field. 349 350 If Node is NULL, then ASSERT(). 351 351 352 352 @param Node A pointer to a device path node data structure. … … 366 366 Returns the size of a device path in bytes. 367 367 368 This function returns the size, in bytes, of the device path data structure 368 This function returns the size, in bytes, of the device path data structure 369 369 specified by DevicePath including the end of device path node. 370 370 If DevicePath is NULL or invalid, then 0 is returned. … … 388 388 Creates a new copy of an existing device path. 389 389 390 This function allocates space for a new copy of the device path specified by 391 DevicePath. If DevicePath is NULL, then NULL is returned. 390 This function allocates space for a new copy of the device path specified by 391 DevicePath. If DevicePath is NULL, then NULL is returned. 392 392 If the memory is successfully allocated, then the 393 393 contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer 394 is returned. Otherwise, NULL is returned. 395 The memory for the new device path is allocated from EFI boot services memory. 396 It is the responsibility of the caller to free the memory allocated. 397 394 is returned. Otherwise, NULL is returned. 395 The memory for the new device path is allocated from EFI boot services memory. 396 It is the responsibility of the caller to free the memory allocated. 397 398 398 @param DevicePath A pointer to a device path data structure. 399 399 400 400 @retval NULL If DevicePath is NULL or invalid. 401 401 @retval Others A pointer to the duplicated device path. 402 402 403 403 **/ 404 404 EFI_DEVICE_PATH_PROTOCOL * … … 416 416 This function creates a new device path by appending a copy of SecondDevicePath to a copy of 417 417 FirstDevicePath in a newly allocated buffer. Only the end-of-device-path device node from 418 SecondDevicePath is retained. The newly created device path is returned. 419 If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned. 420 If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned. 418 SecondDevicePath is retained. The newly created device path is returned. 419 If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned. 420 If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned. 421 421 If both FirstDevicePath and SecondDevicePath are NULL, then a copy of an end-of-device-path is 422 returned. 422 returned. 423 423 If there is not enough memory for the newly allocated buffer, then NULL is returned. 424 424 The memory for the new device path is allocated from EFI boot services memory. It is the … … 427 427 @param FirstDevicePath A pointer to a device path data structure. 428 428 @param SecondDevicePath A pointer to a device path data structure. 429 429 430 430 @retval NULL If there is not enough memory for the newly allocated buffer. 431 431 @retval NULL If FirstDevicePath or SecondDevicePath is invalid. 432 432 @retval Others A pointer to the new device path if success. 433 Or a copy an end-of-device-path if both FirstDevicePath and 433 Or a copy an end-of-device-path if both FirstDevicePath and 434 434 SecondDevicePath are NULL. 435 435 … … 448 448 Creates a new path by appending the device node to the device path. 449 449 450 This function creates a new device path by appending a copy of the device node 451 specified by DevicePathNode to a copy of the device path specified by DevicePath 450 This function creates a new device path by appending a copy of the device node 451 specified by DevicePathNode to a copy of the device path specified by DevicePath 452 452 in an allocated buffer. 453 453 The end-of-device-path device node is moved after the end of the appended device node. 454 454 If DevicePathNode is NULL then a copy of DevicePath is returned. 455 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 455 If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device 456 456 path device node is returned. 457 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 457 If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path 458 458 device node is returned. 459 If there is not enough memory to allocate space for the new device path, then 460 NULL is returned. 461 The memory is allocated from EFI boot services memory. It is the responsibility 459 If there is not enough memory to allocate space for the new device path, then 460 NULL is returned. 461 The memory is allocated from EFI boot services memory. It is the responsibility 462 462 of the caller to free the memory allocated. 463 463 … … 467 467 @retval NULL If there is not enough memory for the new device path. 468 468 @retval Others A pointer to the new device path if success. 469 A copy of DevicePathNode followed by an end-of-device-path node 469 A copy of DevicePathNode followed by an end-of-device-path node 470 470 if both FirstDevicePath and SecondDevicePath are NULL. 471 A copy of an end-of-device-path node if both FirstDevicePath 471 A copy of an end-of-device-path node if both FirstDevicePath 472 472 and SecondDevicePath are NULL. 473 473 … … 484 484 485 485 /** 486 Creates a new device path by appending the specified device path instance to 486 Creates a new device path by appending the specified device path instance to 487 487 the specified device path. 488 489 This function creates a new device path by appending a copy of the device path 490 instance specified by DevicePathInstance to a copy of the device path specified 488 489 This function creates a new device path by appending a copy of the device path 490 instance specified by DevicePathInstance to a copy of the device path specified 491 491 by DevicePath in a allocated buffer. 492 The end-of-device-path device node is moved after the end of the appended device 493 path instance and a new end-of-device-path-instance node is inserted between. 492 The end-of-device-path device node is moved after the end of the appended device 493 path instance and a new end-of-device-path-instance node is inserted between. 494 494 If DevicePath is NULL, then a copy if DevicePathInstance is returned. 495 495 If DevicePathInstance is NULL, then NULL is returned. 496 496 If DevicePath or DevicePathInstance is invalid, then NULL is returned. 497 If there is not enough memory to allocate space for the new device path, then 498 NULL is returned. 499 The memory is allocated from EFI boot services memory. It is the responsibility 497 If there is not enough memory to allocate space for the new device path, then 498 NULL is returned. 499 The memory is allocated from EFI boot services memory. It is the responsibility 500 500 of the caller to free the memory allocated. 501 501 502 502 @param DevicePath A pointer to a device path data structure. 503 503 @param DevicePathInstance A pointer to a device path instance. … … 517 517 518 518 /** 519 Creates a copy of the current device path instance and returns a pointer to the 519 Creates a copy of the current device path instance and returns a pointer to the 520 520 next device path instance. 521 521 522 This function creates a copy of the current device path instance. It also updates 523 DevicePath to point to the next device path instance in the device path (or NULL 522 This function creates a copy of the current device path instance. It also updates 523 DevicePath to point to the next device path instance in the device path (or NULL 524 524 if no more) and updates Size to hold the size of the device path instance copy. 525 525 If DevicePath is NULL, then NULL is returned. 526 If there is not enough memory to allocate space for the new device path, then 527 NULL is returned. 528 The memory is allocated from EFI boot services memory. It is the responsibility 526 If there is not enough memory to allocate space for the new device path, then 527 NULL is returned. 528 The memory is allocated from EFI boot services memory. It is the responsibility 529 529 of the caller to free the memory allocated. 530 530 If Size is NULL, then ASSERT(). 531 532 @param DevicePath On input, this holds the pointer to the current 533 device path instance. On output, this holds 534 the pointer to the next device path instance 531 532 @param DevicePath On input, this holds the pointer to the current 533 device path instance. On output, this holds 534 the pointer to the next device path instance 535 535 or NULL if there are no more device path 536 instances in the device path pointer to a 536 instances in the device path pointer to a 537 537 device path data structure. 538 @param Size On output, this holds the size of the device 539 path instance, in bytes or zero, if DevicePath 538 @param Size On output, this holds the size of the device 539 path instance, in bytes or zero, if DevicePath 540 540 is NULL. 541 541 … … 557 557 Creates a device node. 558 558 559 This function creates a new device node in a newly allocated buffer of size 560 NodeLength and initializes the device path node header with NodeType and NodeSubType. 559 This function creates a new device node in a newly allocated buffer of size 560 NodeLength and initializes the device path node header with NodeType and NodeSubType. 561 561 The new device path node is returned. 562 If NodeLength is smaller than a device path header, then NULL is returned. 563 If there is not enough memory to allocate space for the new device path, then 564 NULL is returned. 565 The memory is allocated from EFI boot services memory. It is the responsibility 562 If NodeLength is smaller than a device path header, then NULL is returned. 563 If there is not enough memory to allocate space for the new device path, then 564 NULL is returned. 565 The memory is allocated from EFI boot services memory. It is the responsibility 566 566 of the caller to free the memory allocated. 567 567 … … 595 595 596 596 @retval TRUE DevicePath is multi-instance. 597 @retval FALSE DevicePath is not multi-instance, or DevicePath 597 @retval FALSE DevicePath is not multi-instance, or DevicePath 598 598 is NULL or invalid. 599 599 … … 611 611 Retrieves the device path protocol from a handle. 612 612 613 This function returns the device path protocol from the handle specified by Handle. 614 If Handle is NULL or Handle does not contain a device path protocol, then NULL 613 This function returns the device path protocol from the handle specified by Handle. 614 If Handle is NULL or Handle does not contain a device path protocol, then NULL 615 615 is returned. 616 617 @param Handle The handle from which to retrieve the device 616 617 @param Handle The handle from which to retrieve the device 618 618 path protocol. 619 619 … … 644 644 Allocates a device path for a file and appends it to an existing device path. 645 645 646 If Device is a valid device handle that contains a device path protocol, then 647 a device path for the file specified by FileName is allocated and appended to 648 the device path associated with the handle Device. The allocated device path 649 is returned. If Device is NULL or Device is a handle that does not support the 650 device path protocol, then a device path containing a single device path node 646 If Device is a valid device handle that contains a device path protocol, then 647 a device path for the file specified by FileName is allocated and appended to 648 the device path associated with the handle Device. The allocated device path 649 is returned. If Device is NULL or Device is a handle that does not support the 650 device path protocol, then a device path containing a single device path node 651 651 for the file specified by FileName is allocated and returned. 652 The memory for the new device path is allocated from EFI boot services memory. 652 The memory for the new device path is allocated from EFI boot services memory. 653 653 It is the responsibility of the caller to free the memory allocated. 654 654 655 655 If FileName is NULL, then ASSERT(). 656 656 If FileName is not aligned on a 16-bit boundary, then ASSERT(). 657 657 658 @param Device A pointer to a device handle. This parameter 658 @param Device A pointer to a device handle. This parameter 659 659 is optional and may be NULL. 660 660 @param FileName A pointer to a Null-terminated Unicode string. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c
r48674 r58466 28 28 Unloads an image from memory. 29 29 30 This function is a callback that a driver registers to do cleanup 30 This function is a callback that a driver registers to do cleanup 31 31 when the UnloadImage boot service function is called. 32 32 … … 66 66 67 67 /** 68 The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM 69 Driver, or UEFI Driver. 68 The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM 69 Driver, or UEFI Driver. 70 70 71 71 This function is the entry point for a DXE Driver, DXE Runtime Driver, DXE SMM Driver, 72 72 or UEFI Driver. This function must call ProcessLibraryConstructorList() and 73 73 ProcessModuleEntryPointList(). If the return status from ProcessModuleEntryPointList() 74 is an error status, then ProcessLibraryDestructorList() must be called. The return 75 value from ProcessModuleEntryPointList() is returned. If _gDriverUnloadImageCount 76 is greater than zero, then an unload handler must be registered for this image 74 is an error status, then ProcessLibraryDestructorList() must be called. The return 75 value from ProcessModuleEntryPointList() is returned. If _gDriverUnloadImageCount 76 is greater than zero, then an unload handler must be registered for this image 77 77 and the unload handler must invoke ProcessModuleUnloadList(). 78 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than 78 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than 79 79 _gUefiDriverRevison, then return EFI_INCOMPATIBLE_VERSION. 80 80 81 81 82 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, 82 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, 83 83 DXE SMM Driver, or UEFI Driver. 84 84 @param SystemTable A pointer to the EFI System Table. 85 85 86 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM 86 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM 87 87 Driver, or UEFI Driver exited normally. 88 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than 88 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than 89 89 SystemTable->Hdr.Revision. 90 90 @retval Other Return value from ProcessModuleEntryPointList(). … … 148 148 149 149 /** 150 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint(). 150 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint(). 151 151 152 152 This function is required to call _ModuleEntryPoint() passing in ImageHandle, 153 153 and SystemTable. 154 154 155 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE 155 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE 156 156 SMM Driver, or UEFI Driver. 157 157 @param SystemTable A pointer to the EFI System Table. 158 158 159 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM 159 @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM 160 160 Driver, or UEFI Driver exited normally. 161 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than 161 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than 162 162 SystemTable->Hdr.Revision. 163 163 @retval Other Return value from ProcessModuleEntryPointList(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/Console.c
r58459 r58466 3 3 4 4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 32 32 {(CHAR16)0x1FFF, 1}, 33 33 /* 34 * Merge the blocks and replace them with the above entry as they fall to 34 * Merge the blocks and replace them with the above entry as they fall to 35 35 * the same category and they are all narrow glyph. This will reduce search 36 36 * time and table size. The merge will omit the reserved code. … … 79 79 {(CHAR16)0x2FFF, 1}, 80 80 /* 81 * Merge the blocks and replace them with the above entry as they fall to 81 * Merge the blocks and replace them with the above entry as they fall to 82 82 * the same category and they are all narrow glyph. This will reduce search 83 83 * time and table size. The merge will omit the reserved code. … … 111 111 {(CHAR16)0x33FF, 2}, 112 112 /* 113 * Merge the blocks and replace them with the above entry as they fall to 113 * Merge the blocks and replace them with the above entry as they fall to 114 114 * the same category and they are all wide glyph. This will reduce search 115 115 * time and table size. The merge will omit the reserved code. … … 134 134 {(CHAR16)0x9FFF, 2}, 135 135 /* 136 * Merge the blocks and replace them with the above entry as they fall to 136 * Merge the blocks and replace them with the above entry as they fall to 137 137 * the same category and they are all wide glyph. This will reduce search 138 138 * time and table size. The merge will omit the reserved code. … … 140 140 * Remove the above item if below is un-commented. 141 141 * 142 {(CHAR16)0x4DFF, 0}, // Reserved. 0x3400-0x4DBF as CJK unified ideographs 142 {(CHAR16)0x4DFF, 0}, // Reserved. 0x3400-0x4DBF as CJK unified ideographs 143 143 // extension A in ver3.0. 0x3400-0x4DFF 144 144 {(CHAR16)0x9FFF, 2}, // CJK unified ideographs. 0x4E00-0x9FFF … … 156 156 {(CHAR16)0xD7FF, 2}, 157 157 /* 158 * Merge the blocks and replace them with the above entry as they fall to 158 * Merge the blocks and replace them with the above entry as they fall to 159 159 * the same category and they are all wide glyph. This will reduce search 160 160 * time and table size. The merge will omit the reserved code. … … 252 252 Computes the display length of a Null-terminated Unicode String. 253 253 254 This function computes and returns the display length of the Null-terminated 255 Unicode string specified by String. If String is NULL then 0 is returned. If 256 any of the widths of the Unicode characters in String can not be determined, 257 then 0 is returned. The display width of String can be computed by summing the 258 display widths of each Unicode character in String. Unicode characters that 259 are narrow glyphs have a width of 1, and Unicode characters that are width glyphs 254 This function computes and returns the display length of the Null-terminated 255 Unicode string specified by String. If String is NULL then 0 is returned. If 256 any of the widths of the Unicode characters in String can not be determined, 257 then 0 is returned. The display width of String can be computed by summing the 258 display widths of each Unicode character in String. Unicode characters that 259 are narrow glyphs have a width of 1, and Unicode characters that are width glyphs 260 260 have a width of 2. If String is not aligned on a 16-bit boundary, then ASSERT(). 261 261 … … 263 263 264 264 @return The display length of the Null-terminated Unicode string specified by String. 265 265 266 266 **/ 267 267 UINTN … … 293 293 294 294 /** 295 Count the storage space of a Unicode string. 295 Count the storage space of a Unicode string. 296 296 297 297 This function handles the Unicode string with NARROW_CHAR … … 304 304 @param LimitLen Whether need to limit the string length. 305 305 @param MaxWidth The max length this function supported. 306 @param Offset The max index of the string can be show out. 306 @param Offset The max index of the string can be show out. 307 307 308 308 @return Storage space for the input string. … … 376 376 377 377 /** 378 Draws a dialog box to the console output device specified by 378 Draws a dialog box to the console output device specified by 379 379 ConOut defined in the EFI_SYSTEM_TABLE and waits for a keystroke 380 from the console input device specified by ConIn defined in the 380 from the console input device specified by ConIn defined in the 381 381 EFI_SYSTEM_TABLE. 382 382 … … 385 385 386 386 @param[in] Attribute Specifies the foreground and background color of the popup. 387 @param[out] Key A pointer to the EFI_KEY value of the key that was 387 @param[out] Key A pointer to the EFI_KEY value of the key that was 388 388 pressed. This is an optional parameter that may be NULL. 389 389 If it is NULL then no wait for a keypress will be performed. 390 390 @param[in] ... The variable argument list that contains pointers to Null- 391 terminated Unicode strings to display in the dialog box. 391 terminated Unicode strings to display in the dialog box. 392 392 The variable argument list is terminated by a NULL. 393 393 … … 396 396 EFIAPI 397 397 CreatePopUp ( 398 IN UINTN Attribute, 398 IN UINTN Attribute, 399 399 OUT EFI_INPUT_KEY *Key, OPTIONAL 400 400 ... … … 418 418 419 419 // 420 // Determine the length of the longest line in the popup and the the total 420 // Determine the length of the longest line in the popup and the the total 421 421 // number of lines in the popup 422 422 // … … 444 444 // 445 445 ConOut = gST->ConOut; 446 446 447 447 // 448 448 // Save the current console cursor position and attributes … … 484 484 485 485 // 486 // Draw top of popup box 486 // Draw top of popup box 487 487 // 488 488 SetMem16 (Line, (MaxLength + 2) * 2, BOXDRAW_HORIZONTAL); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiDriverModel.c
r58459 r58466 8 8 which accompanies this distribution. The full text of the license may be found at 9 9 http://opensource.org/licenses/bsd-license.php. 10 10 11 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 13 14 **/ 14 **/ 15 15 16 16 … … 19 19 /** 20 20 Installs and completes the initialization of a Driver Binding Protocol instance. 21 21 22 22 Installs the Driver Binding Protocol specified by DriverBinding onto the handle 23 23 specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding 24 24 is installed onto a newly created handle. DriverBindingHandle is typically the same 25 25 as the driver's ImageHandle, but it can be different if the driver produces multiple 26 Driver Binding Protocols. 27 If DriverBinding is NULL, then ASSERT(). 26 Driver Binding Protocols. 27 If DriverBinding is NULL, then ASSERT(). 28 28 If DriverBinding can not be installed onto a handle, then ASSERT(). 29 29 … … 81 81 then the protocols are installed onto a newly created handle. DriverBindingHandle 82 82 is typically the same as the driver's ImageHandle, but it can be different if the 83 driver produces multiple Driver Binding Protocols. 84 If DriverBinding is NULL, then ASSERT(). 83 driver produces multiple Driver Binding Protocols. 84 If DriverBinding is NULL, then ASSERT(). 85 85 If the installation fails, then ASSERT(). 86 86 87 87 @param ImageHandle The image handle of the driver. 88 88 @param SystemTable The EFI System Table that was passed to the driver's entry point. … … 119 119 DriverBinding->ImageHandle = ImageHandle; 120 120 DriverBinding->DriverBindingHandle = DriverBindingHandle; 121 121 122 122 if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) { 123 123 if (DriverConfiguration == NULL) { … … 211 211 DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed 212 212 onto a newly created handle. DriverBindingHandle is typically the same as the driver's 213 ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. 214 If DriverBinding is NULL, then ASSERT(). 213 ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. 214 If DriverBinding is NULL, then ASSERT(). 215 215 If the installation fails, then ASSERT(). 216 216 … … 300 300 optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle. 301 301 DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver 302 produces multiple Driver Binding Protocols. 303 If DriverBinding is NULL, then ASSERT(). 302 produces multiple Driver Binding Protocols. 303 If DriverBinding is NULL, then ASSERT(). 304 304 If the installation fails, then ASSERT(). 305 305 … … 338 338 EFI_STATUS Status; 339 339 340 ASSERT (DriverBinding != NULL); 340 ASSERT (DriverBinding != NULL); 341 341 342 342 // … … 345 345 DriverBinding->ImageHandle = ImageHandle; 346 346 DriverBinding->DriverBindingHandle = DriverBindingHandle; 347 347 348 348 if (DriverConfiguration2 == NULL) { 349 349 if (DriverConfiguration == NULL) { -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiLib.c
r58459 r58466 1 1 /** @file 2 The UEFI Library provides functions and macros that simplify the development of 3 UEFI Drivers and UEFI Applications. These functions and macros help manage EFI 4 events, build simple locks utilizing EFI Task Priority Levels (TPLs), install 5 EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 2 The UEFI Library provides functions and macros that simplify the development of 3 UEFI Drivers and UEFI Applications. These functions and macros help manage EFI 4 events, build simple locks utilizing EFI Task Priority Levels (TPLs), install 5 EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 6 6 and print messages on the console output and standard error devices. 7 7 … … 21 21 22 22 /** 23 Empty constructor function that is required to resolve dependencies between 23 Empty constructor function that is required to resolve dependencies between 24 24 libraries. 25 25 26 26 ** DO NOT REMOVE ** 27 27 28 28 @param ImageHandle The firmware allocated handle for the EFI image. 29 29 @param SystemTable A pointer to the EFI System Table. 30 30 31 31 @retval EFI_SUCCESS The constructor executed correctly. 32 32 … … 70 70 Retrieves a pointer to the system configuration table from the EFI System Table 71 71 based on a specified GUID. 72 72 73 73 This function searches the list of configuration tables stored in the EFI System Table 74 74 for a table with a GUID that matches TableGuid. If a match is found, then a pointer to … … 119 119 then the notification function is still executed one time. In addition, every time a protocol 120 120 of type ProtocolGuid instance is installed or reinstalled, the notification function is also 121 executed. This function returns the notification event that was created. 121 executed. This function returns the notification event that was created. 122 122 If ProtocolGuid is NULL, then ASSERT(). 123 123 If NotifyTpl is not a legal TPL value, then ASSERT(). … … 132 132 @param Registration A pointer to a memory location to receive the registration value. 133 133 This value is passed to LocateHandle() to obtain new handles that 134 have been added that support the ProtocolGuid-specified protocol. 134 have been added that support the ProtocolGuid-specified protocol. 135 135 136 136 @return The notification event that was created. … … 193 193 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext. 194 194 This event is signaled with EfiNamedEventSignal(). This provides the ability for one or more 195 listeners on the same event named by the GUID specified by Name. 195 listeners on the same event named by the GUID specified by Name. 196 196 If Name is NULL, then ASSERT(). 197 197 If NotifyTpl is not a legal TPL value, then ASSERT(). … … 201 201 @param NotifyTpl Supplies the task priority level of the event notifications. 202 202 @param NotifyFunction Supplies the function to notify when the event is signaled. 203 @param NotifyContext The context parameter to pass to NotifyFunction. 203 @param NotifyContext The context parameter to pass to NotifyFunction. 204 204 @param Registration A pointer to a memory location to receive the registration value. 205 205 … … 225 225 ASSERT (NotifyFunction != NULL); 226 226 ASSERT (NotifyTpl <= TPL_HIGH_LEVEL); 227 227 228 228 // 229 229 // Create event … … 305 305 } 306 306 307 /** 307 /** 308 308 Returns the current TPL. 309 309 310 This function returns the current TPL. There is no EFI service to directly 311 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise 312 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level 313 can then immediately be restored back to the current TPL level with a call 310 This function returns the current TPL. There is no EFI service to directly 311 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise 312 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level 313 can then immediately be restored back to the current TPL level with a call 314 314 to RestoreTPL(). 315 315 … … 335 335 Initializes a basic mutual exclusion lock. 336 336 337 This function initializes a basic mutual exclusion lock to the released state 338 and returns the lock. Each lock provides mutual exclusion access at its task 337 This function initializes a basic mutual exclusion lock to the released state 338 and returns the lock. Each lock provides mutual exclusion access at its task 339 339 priority level. Since there is no preemption or multiprocessor support in EFI, 340 340 acquiring the lock only consists of raising to the locks TPL. … … 367 367 Acquires ownership of a lock. 368 368 369 This function raises the system's current task priority level to the task 370 priority level of the mutual exclusion lock. Then, it places the lock in the 369 This function raises the system's current task priority level to the task 370 priority level of the mutual exclusion lock. Then, it places the lock in the 371 371 acquired state. 372 372 If Lock is NULL, then ASSERT(). … … 433 433 Releases ownership of a lock. 434 434 435 This function transitions a mutual exclusion lock from the acquired state to 436 the released state, and restores the system's task priority level to its 435 This function transitions a mutual exclusion lock from the acquired state to 436 the released state, and restores the system's task priority level to its 437 437 previous level. 438 438 If Lock is NULL, then ASSERT(). … … 468 468 is performed by evaluating if the the protocol specified by ProtocolGuid is 469 469 present on ControllerHandle and is was opened by DriverBindingHandle with an 470 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. 470 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. 471 471 If ProtocolGuid is NULL, then ASSERT(). 472 472 … … 531 531 If ProtocolGuid is NULL, then ASSERT(). 532 532 533 @param ControllerHandle A handle for a (parent) controller to test. 533 @param ControllerHandle A handle for a (parent) controller to test. 534 534 @param ChildHandle A child handle to test. 535 535 @param ProtocolGuid Supplies the protocol that the child controller 536 opens on its parent controller. 536 opens on its parent controller. 537 537 538 538 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle. … … 593 593 is returned in UnicodeString. 594 594 595 @param Language A pointer to the ISO 639-2 language code for the 595 @param Language A pointer to the ISO 639-2 language code for the 596 596 Unicode string to look up and return. 597 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes 598 that the Unicode string table supports. Language 597 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes 598 that the Unicode string table supports. Language 599 599 must be a member of this set. 600 600 @param UnicodeStringTable A pointer to the table of Unicode strings. … … 602 602 that matches the language specified by Language. 603 603 604 @retval EFI_SUCCESS The Unicode string that matches the language 604 @retval EFI_SUCCESS The Unicode string that matches the language 605 605 specified by Language was found 606 in the table of Unicode strings UnicodeStringTable, 606 in the table of Unicode strings UnicodeStringTable, 607 607 and it was returned in UnicodeString. 608 608 @retval EFI_INVALID_PARAMETER Language is NULL. … … 610 610 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 611 611 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL. 612 @retval EFI_UNSUPPORTED The language specified by Language is not a 612 @retval EFI_UNSUPPORTED The language specified by Language is not a 613 613 member of SupportedLanguages. 614 @retval EFI_UNSUPPORTED The language specified by Language is not 614 @retval EFI_UNSUPPORTED The language specified by Language is not 615 615 supported by UnicodeStringTable. 616 616 … … 685 685 not assumed to be Null-terminated, and only the first three 686 686 characters are used. If Iso639Language is FALSE, then this ASCII 687 string must be Null-terminated. 687 string must be Null-terminated. 688 688 @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains a 689 689 set of ISO 639-2 or RFC 4646 language codes that the Unicode … … 705 705 was found in the table of Unicode strings UnicodeStringTable, and 706 706 it was returned in UnicodeString. 707 @retval EFI_INVALID_PARAMETER Language is NULL. 708 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. 709 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 710 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL. 711 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages. 707 @retval EFI_INVALID_PARAMETER Language is NULL. 708 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. 709 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 710 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL. 711 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages. 712 712 @retval EFI_UNSUPPORTED The language specified by Language is not supported by UnicodeStringTable. 713 713 … … 795 795 This function adds a Unicode string to UnicodeStringTable. 796 796 797 If Language is a member of SupportedLanguages then UnicodeString is added to 798 UnicodeStringTable. New buffers are allocated for both Language and 799 UnicodeString. The contents of Language and UnicodeString are copied into 800 these new buffers. These buffers are automatically freed when 797 If Language is a member of SupportedLanguages then UnicodeString is added to 798 UnicodeStringTable. New buffers are allocated for both Language and 799 UnicodeString. The contents of Language and UnicodeString are copied into 800 these new buffers. These buffers are automatically freed when 801 801 FreeUnicodeStringTable() is called. 802 802 803 @param Language A pointer to the ISO 639-2 language code for the Unicode 803 @param Language A pointer to the ISO 639-2 language code for the Unicode 804 804 string to add. 805 805 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes … … 809 809 @param UnicodeString A pointer to the Unicode string to add. 810 810 811 @retval EFI_SUCCESS The Unicode string that matches the language 812 specified by Language was found in the table of 813 Unicode strings UnicodeStringTable, and it was 811 @retval EFI_SUCCESS The Unicode string that matches the language 812 specified by Language was found in the table of 813 Unicode strings UnicodeStringTable, and it was 814 814 returned in UnicodeString. 815 815 @retval EFI_INVALID_PARAMETER Language is NULL. … … 817 817 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string. 818 818 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 819 @retval EFI_ALREADY_STARTED A Unicode string with language Language is 819 @retval EFI_ALREADY_STARTED A Unicode string with language Language is 820 820 already present in UnicodeStringTable. 821 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another 821 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another 822 822 Unicode string to UnicodeStringTable. 823 @retval EFI_UNSUPPORTED The language specified by Language is not a 823 @retval EFI_UNSUPPORTED The language specified by Language is not a 824 824 member of SupportedLanguages. 825 825 … … 984 984 @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE 985 985 is defined in "Related Definitions". 986 @param UnicodeString A pointer to the Unicode string to add. 986 @param UnicodeString A pointer to the Unicode string to add. 987 987 @param Iso639Language Specifies the supported language code format. If it is TRUE, 988 988 then Language and SupportedLanguages follow ISO 639-2 language code format. … … 991 991 @retval EFI_SUCCESS The Unicode string that matches the language specified by 992 992 Language was found in the table of Unicode strings UnicodeStringTable, 993 and it was returned in UnicodeString. 994 @retval EFI_INVALID_PARAMETER Language is NULL. 995 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. 996 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string. 997 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 993 and it was returned in UnicodeString. 994 @retval EFI_INVALID_PARAMETER Language is NULL. 995 @retval EFI_INVALID_PARAMETER UnicodeString is NULL. 996 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string. 997 @retval EFI_UNSUPPORTED SupportedLanguages is NULL. 998 998 @retval EFI_ALREADY_STARTED A Unicode string with language Language is already present in 999 UnicodeStringTable. 1000 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another Unicode string UnicodeStringTable. 999 UnicodeStringTable. 1000 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another Unicode string UnicodeStringTable. 1001 1001 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages. 1002 1002 … … 1082 1082 for (Index = 0; LanguageString[Index] != 0 && LanguageString[Index] != ';'; Index++); 1083 1083 1084 if (AsciiStrnCmp (Language, LanguageString, Index) == 0) { 1084 if (AsciiStrnCmp (Language, LanguageString, Index) == 0) { 1085 1085 return EFI_ALREADY_STARTED; 1086 1086 } … … 1164 1164 1165 1165 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned. 1166 Otherwise, each language code, and each Unicode string in the Unicode string 1166 Otherwise, each language code, and each Unicode string in the Unicode string 1167 1167 table are freed, and EFI_SUCCESS is returned. 1168 1168 … … 1218 1218 [ATTENTION] This function will be deprecated for security reason. 1219 1219 1220 Returns a pointer to an allocated buffer that contains the contents of a 1221 variable retrieved through the UEFI Runtime Service GetVariable(). The 1220 Returns a pointer to an allocated buffer that contains the contents of a 1221 variable retrieved through the UEFI Runtime Service GetVariable(). The 1222 1222 returned buffer is allocated using AllocatePool(). The caller is responsible 1223 1223 for freeing this buffer with FreePool(). … … 1281 1281 [ATTENTION] This function will be deprecated for security reason. 1282 1282 1283 Returns a pointer to an allocated buffer that contains the contents of a 1284 variable retrieved through the UEFI Runtime Service GetVariable(). This 1283 Returns a pointer to an allocated buffer that contains the contents of a 1284 variable retrieved through the UEFI Runtime Service GetVariable(). This 1285 1285 function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables. 1286 The returned buffer is allocated using AllocatePool(). The caller is 1286 The returned buffer is allocated using AllocatePool(). The caller is 1287 1287 responsible for freeing this buffer with FreePool(). 1288 1288 … … 1307 1307 1308 1308 /** 1309 Returns the status whether get the variable success. The function retrieves 1310 variable through the UEFI Runtime Service GetVariable(). The 1309 Returns the status whether get the variable success. The function retrieves 1310 variable through the UEFI Runtime Service GetVariable(). The 1311 1311 returned buffer is allocated using AllocatePool(). The caller is responsible 1312 1312 for freeing this buffer with FreePool(). … … 1348 1348 *Size = 0; 1349 1349 } 1350 1350 1351 1351 Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value); 1352 1352 if (Status != EFI_BUFFER_TOO_SMALL) { … … 1380 1380 1381 1381 /** 1382 Returns a pointer to an allocated buffer that contains the contents of a 1383 variable retrieved through the UEFI Runtime Service GetVariable(). This 1382 Returns a pointer to an allocated buffer that contains the contents of a 1383 variable retrieved through the UEFI Runtime Service GetVariable(). This 1384 1384 function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables. 1385 The returned buffer is allocated using AllocatePool(). The caller is 1385 The returned buffer is allocated using AllocatePool(). The caller is 1386 1386 responsible for freeing this buffer with FreePool(). 1387 1387 … … 1410 1410 1411 1411 /** 1412 Returns a pointer to an allocated buffer that contains the best matching language 1413 from a set of supported languages. 1414 1415 This function supports both ISO 639-2 and RFC 4646 language codes, but language 1416 code types may not be mixed in a single call to this function. The language 1417 code returned is allocated using AllocatePool(). The caller is responsible for 1412 Returns a pointer to an allocated buffer that contains the best matching language 1413 from a set of supported languages. 1414 1415 This function supports both ISO 639-2 and RFC 4646 language codes, but language 1416 code types may not be mixed in a single call to this function. The language 1417 code returned is allocated using AllocatePool(). The caller is responsible for 1418 1418 freeing the allocated buffer using FreePool(). This function supports a variable 1419 argument list that allows the caller to pass in a prioritized list of language 1420 codes to test against all the language codes in SupportedLanguages. 1419 argument list that allows the caller to pass in a prioritized list of language 1420 codes to test against all the language codes in SupportedLanguages. 1421 1421 1422 1422 If SupportedLanguages is NULL, then ASSERT(). 1423 1423 1424 1424 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string that 1425 contains a set of language codes in the format 1425 contains a set of language codes in the format 1426 1426 specified by Iso639Language. 1427 1427 @param[in] Iso639Language If TRUE, then all language codes are assumed to be 1428 1428 in ISO 639-2 format. If FALSE, then all language 1429 1429 codes are assumed to be in RFC 4646 language format 1430 @param[in] ... A variable argument list that contains pointers to 1430 @param[in] ... A variable argument list that contains pointers to 1431 1431 Null-terminated ASCII strings that contain one or more 1432 1432 language codes in the format specified by Iso639Language. 1433 1433 The first language code from each of these language 1434 1434 code lists is used to determine if it is an exact or 1435 close match to any of the language codes in 1435 close match to any of the language codes in 1436 1436 SupportedLanguages. Close matches only apply to RFC 4646 1437 1437 language codes, and the matching algorithm from RFC 4647 1438 is used to determine if a close match is present. If 1438 is used to determine if a close match is present. If 1439 1439 an exact or close match is found, then the matching 1440 1440 language code from SupportedLanguages is returned. If 1441 1441 no matches are found, then the next variable argument 1442 parameter is evaluated. The variable argument list 1442 parameter is evaluated. The variable argument list 1443 1443 is terminated by a NULL. 1444 1444 1445 1445 @retval NULL The best matching language could not be found in SupportedLanguages. 1446 @retval NULL There are not enough resources available to return the best matching 1446 @retval NULL There are not enough resources available to return the best matching 1447 1447 language. 1448 @retval Other A pointer to a Null-terminated ASCII string that is the best matching 1448 @retval Other A pointer to a Null-terminated ASCII string that is the best matching 1449 1449 language in SupportedLanguages. 1450 1450 … … 1453 1453 EFIAPI 1454 1454 GetBestLanguage ( 1455 IN CONST CHAR8 *SupportedLanguages, 1455 IN CONST CHAR8 *SupportedLanguages, 1456 1456 IN BOOLEAN Iso639Language, 1457 1457 ... … … 1532 1532 } else { 1533 1533 // 1534 // If RFC 4646 mode, then trim Language from the right to the next '-' character 1534 // If RFC 4646 mode, then trim Language from the right to the next '-' character 1535 1535 // 1536 1536 for (LanguageLength--; LanguageLength > 0 && Language[LanguageLength] != '-'; LanguageLength--); … … 1541 1541 1542 1542 // 1543 // No matches were found 1543 // No matches were found 1544 1544 // 1545 1545 return NULL; -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiLib.inf
r58459 r58466 2 2 # Instance of UEFI Library. 3 3 # 4 # The UEFI Library provides functions and macros that simplify the development of 5 # UEFI Drivers and UEFI Applications. These functions and macros help manage EFI 6 # events, build simple locks utilizing EFI Task Priority Levels (TPLs), install 7 # EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 4 # The UEFI Library provides functions and macros that simplify the development of 5 # UEFI Drivers and UEFI Applications. These functions and macros help manage EFI 6 # events, build simple locks utilizing EFI Task Priority Levels (TPLs), install 7 # EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, 8 8 # and print messages on the console output and standard error devices. 9 9 # … … 58 58 DevicePathLib 59 59 UefiRuntimeServicesTableLib 60 60 61 61 [Guids] 62 62 gEfiEventReadyToBootGuid ## SOMETIMES_CONSUMES ## Event -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiLibPrint.c
r48674 r58466 91 91 } 92 92 93 /** 94 Prints a formatted Unicode string to the console output device specified by 93 /** 94 Prints a formatted Unicode string to the console output device specified by 95 95 ConOut defined in the EFI_SYSTEM_TABLE. 96 96 97 This function prints a formatted Unicode string to the console output device 98 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode 99 characters that printed to ConOut. If the length of the formatted Unicode 100 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 97 This function prints a formatted Unicode string to the console output device 98 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode 99 characters that printed to ConOut. If the length of the formatted Unicode 100 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 101 101 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut. 102 102 If Format is NULL, then ASSERT(). … … 105 105 106 106 @param Format A Null-terminated Unicode format string. 107 @param ... A Variable argument list whose contents are accessed based 107 @param ... A Variable argument list whose contents are accessed based 108 108 on the format string specified by Format. 109 109 110 110 @return The number of Unicode characters printed to ConOut. 111 111 … … 130 130 } 131 131 132 /** 133 Prints a formatted Unicode string to the console output device specified by 132 /** 133 Prints a formatted Unicode string to the console output device specified by 134 134 StdErr defined in the EFI_SYSTEM_TABLE. 135 135 136 This function prints a formatted Unicode string to the console output device 137 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode 138 characters that printed to StdErr. If the length of the formatted Unicode 139 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 136 This function prints a formatted Unicode string to the console output device 137 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode 138 characters that printed to StdErr. If the length of the formatted Unicode 139 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 140 140 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr. 141 141 If Format is NULL, then ASSERT(). … … 144 144 145 145 @param Format A Null-terminated Unicode format string. 146 @param ... Variable argument list whose contents are accessed based 146 @param ... Variable argument list whose contents are accessed based 147 147 on the format string specified by Format. 148 148 149 149 @return The number of Unicode characters printed to StdErr. 150 150 … … 226 226 } 227 227 228 /** 229 Prints a formatted ASCII string to the console output device specified by 228 /** 229 Prints a formatted ASCII string to the console output device specified by 230 230 ConOut defined in the EFI_SYSTEM_TABLE. 231 231 232 This function prints a formatted ASCII string to the console output device 233 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII 234 characters that printed to ConOut. If the length of the formatted ASCII 235 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 232 This function prints a formatted ASCII string to the console output device 233 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII 234 characters that printed to ConOut. If the length of the formatted ASCII 235 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 236 236 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut. 237 237 If Format is NULL, then ASSERT(). … … 239 239 240 240 @param Format A Null-terminated ASCII format string. 241 @param ... Variable argument list whose contents are accessed based 241 @param ... Variable argument list whose contents are accessed based 242 242 on the format string specified by Format. 243 243 244 244 @return The number of ASCII characters printed to ConOut. 245 245 … … 265 265 } 266 266 267 /** 268 Prints a formatted ASCII string to the console output device specified by 267 /** 268 Prints a formatted ASCII string to the console output device specified by 269 269 StdErr defined in the EFI_SYSTEM_TABLE. 270 270 271 This function prints a formatted ASCII string to the console output device 272 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII 273 characters that printed to StdErr. If the length of the formatted ASCII 274 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 271 This function prints a formatted ASCII string to the console output device 272 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII 273 characters that printed to StdErr. If the length of the formatted ASCII 274 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first 275 275 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr. 276 276 If Format is NULL, then ASSERT(). … … 278 278 279 279 @param Format A Null-terminated ASCII format string. 280 @param ... Variable argument list whose contents are accessed based 280 @param ... Variable argument list whose contents are accessed based 281 281 on the format string specified by Format. 282 282 283 283 @return The number of ASCII characters printed to ConErr. 284 284 … … 372 372 373 373 ConsoleHandle = gST->ConsoleOutHandle; 374 374 375 375 ASSERT( ConsoleHandle != NULL); 376 376 … … 554 554 555 555 /** 556 Prints a formatted Unicode string to a graphics console device specified by 556 Prints a formatted Unicode string to a graphics console device specified by 557 557 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates. 558 558 559 This function prints a formatted Unicode string to the graphics console device 560 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of 561 Unicode characters displayed, not including partial characters that may be clipped 559 This function prints a formatted Unicode string to the graphics console device 560 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of 561 Unicode characters displayed, not including partial characters that may be clipped 562 562 by the right edge of the display. If the length of the formatted Unicode string is 563 greater than PcdUefiLibMaxPrintBufferSize, then at most the first 563 greater than PcdUefiLibMaxPrintBufferSize, then at most the first 564 564 PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL 565 StringToImage() service is used to convert the string to a bitmap using the glyphs 566 registered with the HII database. No wrapping is performed, so any portions of the 567 string the fall outside the active display region will not be displayed. Please see 565 StringToImage() service is used to convert the string to a bitmap using the glyphs 566 registered with the HII database. No wrapping is performed, so any portions of the 567 string the fall outside the active display region will not be displayed. Please see 568 568 Section 27.2.6 of the UEFI Specification for a description of the supported string 569 569 format including the set of control codes supported by the StringToImage() service. 570 570 571 If a graphics console device is not associated with the ConsoleOutputHandle 571 If a graphics console device is not associated with the ConsoleOutputHandle 572 572 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. 573 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no 573 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no 574 574 string is printed, and 0 is returned. 575 575 If Format is NULL, then ASSERT(). … … 584 584 in the EFI_SYSTEM_TABLE is used. 585 585 @param BackGround The background color of the string being printed. This is 586 an optional parameter that may be NULL. If it is NULL, 586 an optional parameter that may be NULL. If it is NULL, 587 587 then the background color of the current ConOut device 588 588 in the EFI_SYSTEM_TABLE is used. 589 @param Format A Null-terminated Unicode format string. See Print Library 589 @param Format A Null-terminated Unicode format string. See Print Library 590 590 for the supported format string syntax. 591 @param ... A Variable argument list whose contents are accessed based on 592 the format string specified by Format. 591 @param ... A Variable argument list whose contents are accessed based on 592 the format string specified by Format. 593 593 594 594 @return The number of Unicode characters printed. … … 634 634 635 635 /** 636 Prints a formatted ASCII string to a graphics console device specified by 636 Prints a formatted ASCII string to a graphics console device specified by 637 637 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates. 638 638 639 This function prints a formatted ASCII string to the graphics console device 640 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of 641 ASCII characters displayed, not including partial characters that may be clipped 639 This function prints a formatted ASCII string to the graphics console device 640 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of 641 ASCII characters displayed, not including partial characters that may be clipped 642 642 by the right edge of the display. If the length of the formatted ASCII string is 643 greater than PcdUefiLibMaxPrintBufferSize, then at most the first 643 greater than PcdUefiLibMaxPrintBufferSize, then at most the first 644 644 PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL 645 StringToImage() service is used to convert the string to a bitmap using the glyphs 646 registered with the HII database. No wrapping is performed, so any portions of the 647 string the fall outside the active display region will not be displayed. Please see 645 StringToImage() service is used to convert the string to a bitmap using the glyphs 646 registered with the HII database. No wrapping is performed, so any portions of the 647 string the fall outside the active display region will not be displayed. Please see 648 648 Section 27.2.6 of the UEFI Specification for a description of the supported string 649 649 format including the set of control codes supported by the StringToImage() service. 650 650 651 If a graphics console device is not associated with the ConsoleOutputHandle 651 If a graphics console device is not associated with the ConsoleOutputHandle 652 652 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. 653 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no 653 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no 654 654 string is printed, and 0 is returned. 655 655 If Format is NULL, then ASSERT(). … … 663 663 in the EFI_SYSTEM_TABLE is used. 664 664 @param BackGround The background color of the string being printed. This is 665 an optional parameter that may be NULL. If it is NULL, 665 an optional parameter that may be NULL. If it is NULL, 666 666 then the background color of the current ConOut device 667 667 in the EFI_SYSTEM_TABLE is used. 668 @param Format A Null-terminated ASCII format string. See Print Library 668 @param Format A Null-terminated ASCII format string. See Print Library 669 669 for the supported format string syntax. 670 @param ... Variable argument list whose contents are accessed based on 671 the format string specified by Format. 670 @param ... Variable argument list whose contents are accessed based on 671 the format string specified by Format. 672 672 673 673 @return The number of ASCII characters printed. … … 711 711 } 712 712 713 /** 713 /** 714 714 Appends a formatted Unicode string to a Null-terminated Unicode string 715 716 This function appends a formatted Unicode string to the Null-terminated 715 716 This function appends a formatted Unicode string to the Null-terminated 717 717 Unicode string specified by String. String is optional and may be NULL. 718 Storage for the formatted Unicode string returned is allocated using 718 Storage for the formatted Unicode string returned is allocated using 719 719 AllocatePool(). The pointer to the appended string is returned. The caller 720 720 is responsible for freeing the returned string. 721 721 722 722 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT(). 723 723 If FormatString is NULL, then ASSERT(). 724 724 If FormatString is not aligned on a 16-bit boundary, then ASSERT(). 725 725 726 726 @param[in] String A Null-terminated Unicode string. 727 727 @param[in] FormatString A Null-terminated Unicode format string. … … 729 729 730 730 @retval NULL There was not enough available memory. 731 @return Null-terminated Unicode string is that is the formatted 731 @return Null-terminated Unicode string is that is the formatted 732 732 string appended to String. 733 733 **/ … … 772 772 } 773 773 774 /** 774 /** 775 775 Appends a formatted Unicode string to a Null-terminated Unicode string 776 777 This function appends a formatted Unicode string to the Null-terminated 776 777 This function appends a formatted Unicode string to the Null-terminated 778 778 Unicode string specified by String. String is optional and may be NULL. 779 Storage for the formatted Unicode string returned is allocated using 779 Storage for the formatted Unicode string returned is allocated using 780 780 AllocatePool(). The pointer to the appended string is returned. The caller 781 781 is responsible for freeing the returned string. 782 782 783 783 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT(). 784 784 If FormatString is NULL, then ASSERT(). 785 785 If FormatString is not aligned on a 16-bit boundary, then ASSERT(). 786 786 787 787 @param[in] String A Null-terminated Unicode string. 788 788 @param[in] FormatString A Null-terminated Unicode format string. 789 @param[in] ... The variable argument list whose contents are 790 accessed based on the format string specified by 789 @param[in] ... The variable argument list whose contents are 790 accessed based on the format string specified by 791 791 FormatString. 792 792 793 793 @retval NULL There was not enough available memory. 794 @return Null-terminated Unicode string is that is the formatted 794 @return Null-terminated Unicode string is that is the formatted 795 795 string appended to String. 796 796 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiLib/UefiNotTiano.c
r58459 r58466 27 27 This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error 28 28 checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0. 29 29 30 30 @param Event Event whose notification function is being invoked. 31 31 @param Context The pointer to the notification function's context, … … 76 76 /** 77 77 Create an EFI event in the Legacy Boot Event Group and allows 78 the caller to specify a notification function. 79 78 the caller to specify a notification function. 79 80 80 This function abstracts the creation of the Legacy Boot Event. 81 81 The Framework moved from a proprietary to UEFI 2.0 based mechanism. … … 142 142 143 143 Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library 144 abstracts the implementation mechanism of this event from the caller. 145 This function abstracts the creation of the Ready to Boot Event. The Framework 146 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts 147 the caller from how this event is created to prevent the code form having to 144 abstracts the implementation mechanism of this event from the caller. 145 This function abstracts the creation of the Ready to Boot Event. The Framework 146 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts 147 the caller from how this event is created to prevent the code form having to 148 148 change with the version of the specification supported. 149 149 If ReadyToBootEvent is NULL, then ASSERT(). … … 171 171 /** 172 172 Create an EFI event in the Ready To Boot Event Group and allows 173 the caller to specify a notification function. 174 173 the caller to specify a notification function. 174 175 175 This function abstracts the creation of the Ready to Boot Event. 176 176 The Framework moved from a proprietary to UEFI 2.0 based mechanism. … … 236 236 /** 237 237 Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot(). 238 238 239 239 This function abstracts the signaling of the Ready to Boot Event. The Framework moved 240 240 from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller … … 286 286 287 287 /** 288 Check to see if the Firmware Volume (FV) Media Device Path is valid 289 290 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. 288 Check to see if the Firmware Volume (FV) Media Device Path is valid 289 290 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. 291 291 This library function abstracts validating a device path node. 292 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid. 293 If it is valid, then return the GUID file name from the device path node. Otherwise, 294 return NULL. This device path changed in the DXE CIS version 0.92 in a non back ward 295 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts 292 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid. 293 If it is valid, then return the GUID file name from the device path node. Otherwise, 294 return NULL. This device path changed in the DXE CIS version 0.92 in a non back ward 295 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts 296 296 the differences from the caller. 297 297 If FvDevicePathNode is NULL, then ASSERT(). … … 322 322 /** 323 323 Initialize a Firmware Volume (FV) Media Device Path node. 324 325 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. 326 This library function abstracts initializing a device path node. 327 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device 328 path changed in the DXE CIS version 0.92 in a non back ward compatible way to 329 not conflict with the UEFI 2.0 specification. This function abstracts the 324 325 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification. 326 This library function abstracts initializing a device path node. 327 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device 328 path changed in the DXE CIS version 0.92 in a non back ward compatible way to 329 not conflict with the UEFI 2.0 specification. This function abstracts the 330 330 differences from the caller. 331 331 If FvDevicePathNode is NULL, then ASSERT(). 332 332 If NameGuid is NULL, then ASSERT(). 333 333 334 334 @param FvDevicePathNode The pointer to a FV device path node to initialize 335 335 @param NameGuid FV file name to use in FvDevicePathNode -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c
r58459 r58466 1 1 /** @file 2 Support routines for memory allocation routines based 2 Support routines for memory allocation routines based 3 3 on boot services for Dxe phase drivers. 4 4 5 5 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php. 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php. 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 13 14 14 **/ … … 38 38 VOID * 39 39 InternalAllocatePages ( 40 IN EFI_MEMORY_TYPE MemoryType, 40 IN EFI_MEMORY_TYPE MemoryType, 41 41 IN UINTN Pages 42 42 ) 43 43 { 44 44 EFI_STATUS Status; 45 EFI_PHYSICAL_ADDRESS Memory; 45 EFI_PHYSICAL_ADDRESS Memory; 46 46 47 47 if (Pages == 0) { … … 130 130 Allocation Library. If it is not possible to free allocated pages, then this function will 131 131 perform no actions. 132 132 133 133 If Buffer was not allocated with a page allocation function in the Memory Allocation Library, 134 134 then ASSERT(). 135 135 If Pages is zero, then ASSERT(). 136 136 137 137 @param Buffer The pointer to the buffer of pages to free. 138 138 @param Pages The number of 4 KB pages to free. … … 173 173 VOID * 174 174 InternalAllocateAlignedPages ( 175 IN EFI_MEMORY_TYPE MemoryType, 175 IN EFI_MEMORY_TYPE MemoryType, 176 176 IN UINTN Pages, 177 177 IN UINTN Alignment … … 189 189 // 190 190 ASSERT ((Alignment & (Alignment - 1)) == 0); 191 191 192 192 if (Pages == 0) { 193 193 return NULL; … … 203 203 // 204 204 ASSERT (RealPages > Pages); 205 205 206 206 Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory); 207 207 if (EFI_ERROR (Status)) { … … 246 246 returned. If there is not enough memory at the specified alignment remaining to satisfy the 247 247 request, then NULL is returned. 248 248 249 249 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 250 250 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). … … 274 274 returned. If there is not enough memory at the specified alignment remaining to satisfy the 275 275 request, then NULL is returned. 276 276 277 277 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 278 278 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). … … 302 302 returned. If there is not enough memory at the specified alignment remaining to satisfy the 303 303 request, then NULL is returned. 304 304 305 305 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 306 306 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). … … 329 329 Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer 330 330 must have been allocated on a previous call to the aligned page allocation services of the Memory 331 Allocation Library. If it is not possible to free allocated pages, then this function will 331 Allocation Library. If it is not possible to free allocated pages, then this function will 332 332 perform no actions. 333 333 334 334 If Buffer was not allocated with an aligned page allocation function in the Memory Allocation 335 335 Library, then ASSERT(). 336 336 If Pages is zero, then ASSERT(). 337 337 338 338 @param Buffer The pointer to the buffer of pages to free. 339 339 @param Pages The number of 4 KB pages to free. … … 369 369 VOID * 370 370 InternalAllocatePool ( 371 IN EFI_MEMORY_TYPE MemoryType, 371 IN EFI_MEMORY_TYPE MemoryType, 372 372 IN UINTN AllocationSize 373 373 ) … … 462 462 VOID * 463 463 InternalAllocateZeroPool ( 464 IN EFI_MEMORY_TYPE PoolType, 464 IN EFI_MEMORY_TYPE PoolType, 465 465 IN UINTN AllocationSize 466 ) 466 ) 467 467 { 468 468 VOID *Memory; … … 549 549 is not enough memory remaining to satisfy the request, then NULL is returned. 550 550 If Buffer is NULL, then ASSERT(). 551 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 551 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 552 552 553 553 @param PoolType The type of pool to allocate. … … 560 560 VOID * 561 561 InternalAllocateCopyPool ( 562 IN EFI_MEMORY_TYPE PoolType, 562 IN EFI_MEMORY_TYPE PoolType, 563 563 IN UINTN AllocationSize, 564 564 IN CONST VOID *Buffer 565 ) 565 ) 566 566 { 567 567 VOID *Memory; … … 575 575 } 576 576 return Memory; 577 } 577 } 578 578 579 579 /** … … 584 584 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 585 585 is not enough memory remaining to satisfy the request, then NULL is returned. 586 586 587 587 If Buffer is NULL, then ASSERT(). 588 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 588 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 589 589 590 590 @param AllocationSize The number of bytes to allocate and zero. … … 611 611 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 612 612 is not enough memory remaining to satisfy the request, then NULL is returned. 613 613 614 614 If Buffer is NULL, then ASSERT(). 615 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 615 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 616 616 617 617 @param AllocationSize The number of bytes to allocate and zero. … … 638 638 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 639 639 is not enough memory remaining to satisfy the request, then NULL is returned. 640 640 641 641 If Buffer is NULL, then ASSERT(). 642 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 642 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 643 643 644 644 @param AllocationSize The number of bytes to allocate and zero. … … 662 662 663 663 Allocates and zeros the number bytes specified by NewSize from memory of the type 664 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 665 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 666 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 667 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 664 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 665 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 666 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 667 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 668 668 enough memory remaining to satisfy the request, then NULL is returned. 669 669 670 670 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize 671 671 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). … … 674 674 @param OldSize The size, in bytes, of OldBuffer. 675 675 @param NewSize The size, in bytes, of the buffer to reallocate. 676 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 676 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 677 677 parameter that may be NULL. 678 678 … … 682 682 VOID * 683 683 InternalReallocatePool ( 684 IN EFI_MEMORY_TYPE PoolType, 684 IN EFI_MEMORY_TYPE PoolType, 685 685 IN UINTN OldSize, 686 686 IN UINTN NewSize, … … 702 702 703 703 Allocates and zeros the number bytes specified by NewSize from memory of type 704 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 705 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 706 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 707 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 704 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 705 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 706 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 707 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 708 708 enough memory remaining to satisfy the request, then NULL is returned. 709 709 710 710 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize 711 711 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). … … 713 713 @param OldSize The size, in bytes, of OldBuffer. 714 714 @param NewSize The size, in bytes, of the buffer to reallocate. 715 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 715 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 716 716 parameter that may be NULL. 717 717 … … 734 734 735 735 Allocates and zeros the number bytes specified by NewSize from memory of type 736 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 737 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 738 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 739 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 736 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 737 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 738 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 739 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 740 740 enough memory remaining to satisfy the request, then NULL is returned. 741 741 … … 745 745 @param OldSize The size, in bytes, of OldBuffer. 746 746 @param NewSize The size, in bytes, of the buffer to reallocate. 747 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 747 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 748 748 parameter that may be NULL. 749 749 … … 766 766 767 767 Allocates and zeros the number bytes specified by NewSize from memory of type 768 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and 769 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 770 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 771 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 768 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and 769 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 770 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 771 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 772 772 enough memory remaining to satisfy the request, then NULL is returned. 773 773 … … 777 777 @param OldSize The size, in bytes, of OldBuffer. 778 778 @param NewSize The size, in bytes, of the buffer to reallocate. 779 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 779 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 780 780 parameter that may be NULL. 781 781 … … 801 801 pool allocation services of the Memory Allocation Library. If it is not possible to free pool 802 802 resources, then this function will perform no actions. 803 803 804 804 If Buffer was not allocated with a pool allocation function in the Memory Allocation Library, 805 805 then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c
r48674 r58466 32 32 value returned is the first mismatched byte in SourceBuffer subtracted from the first 33 33 mismatched byte in DestinationBuffer. 34 34 35 35 If Length > 0 and DestinationBuffer is NULL, then ASSERT(). 36 36 If Length > 0 and SourceBuffer is NULL, then ASSERT(). … … 45 45 @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first 46 46 mismatched byte in DestinationBuffer. 47 47 48 48 **/ 49 49 INTN -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/CopyMemWrapper.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 32 32 DestinationBuffer. The implementation must be reentrant, and it must handle the case 33 33 where SourceBuffer overlaps DestinationBuffer. 34 34 35 35 If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). 36 36 If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/MemLibGuid.c
r48674 r58466 3 3 4 4 The following BaseMemoryLib instances contain the same copy of this file: 5 5 6 6 BaseMemoryLib 7 7 BaseMemoryLibMmx … … 31 31 This function copies the contents of the 128-bit GUID specified by SourceGuid to 32 32 DestinationGuid, and returns DestinationGuid. 33 33 34 34 If DestinationGuid is NULL, then ASSERT(). 35 35 If SourceGuid is NULL, then ASSERT(). … … 64 64 This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. 65 65 If there are any bit differences in the two GUIDs, then FALSE is returned. 66 66 67 67 If Guid1 is NULL, then ASSERT(). 68 68 If Guid2 is NULL, then ASSERT(). … … 104 104 GUID in the target buffer is returned. If no match is found, then NULL is returned. 105 105 If Length is 0, then NULL is returned. 106 106 107 107 If Length > 0 and Buffer is NULL, then ASSERT(). 108 108 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 16-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c
r48674 r58466 33 33 then a pointer to the matching byte in the target buffer is returned. If no match is found, 34 34 then NULL is returned. If Length is 0, then NULL is returned. 35 35 36 36 If Length > 0 and Buffer is NULL, then ASSERT(). 37 37 If Buffer is not aligned on a 32-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Buffer is not aligned on a 64-bit boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c
r48674 r58466 34 34 then a pointer to the matching byte in the target buffer is returned. If no match is found, 35 35 then NULL is returned. If Length is 0, then NULL is returned. 36 36 37 37 If Length > 0 and Buffer is NULL, then ASSERT(). 38 38 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). … … 58 58 ASSERT (Buffer != NULL); 59 59 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); 60 60 61 61 return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); 62 62 } 63 63 64 64 /** 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 65 Scans a target buffer for a UINTN sized value, and returns a pointer to the matching 66 66 UINTN sized value in the target buffer. 67 67 … … 70 70 then a pointer to the matching byte in the target buffer is returned. If no match is found, 71 71 then NULL is returned. If Length is 0, then NULL is returned. 72 72 73 73 If Length > 0 and Buffer is NULL, then ASSERT(). 74 74 If Buffer is not aligned on a UINTN boundary, then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c
r48674 r58466 30 30 31 31 This function fills Length bytes of Buffer with Value, and returns Buffer. 32 32 33 33 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 34 34 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/UefiMemoryLib.inf
r58459 r58466 24 24 MODULE_TYPE = UEFI_DRIVER 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = BaseMemoryLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 26 LIBRARY_CLASS = BaseMemoryLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryLib/ZeroMemWrapper.c
r48674 r58466 12 12 PeiMemoryLib 13 13 UefiMemoryLib 14 14 15 15 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> 16 16 This program and the accompanying materials … … 30 30 31 31 This function fills Length bytes of Buffer with zeros, and returns Buffer. 32 32 33 33 If Length > 0 and Buffer is NULL, then ASSERT(). 34 34 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiPalLib/UefiPalLib.c
r48674 r58466 9 9 text of the license may be found at 10 10 http://opensource.org/licenses/bsd-license.php. 11 11 12 12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c
r58459 r58466 8 8 text of the license may be found at 9 9 http://opensource.org/licenses/bsd-license.php. 10 10 11 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. … … 47 47 // Global varible to cache pointer to PCI Root Bridge I/O protocol. 48 48 // 49 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *mPciRootBridgeIo = NULL; 49 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *mPciRootBridgeIo = NULL; 50 50 51 51 /** 52 52 The constructor function caches the pointer to PCI Root Bridge I/O protocol. 53 53 54 54 The constructor function locates PCI Root Bridge I/O protocol from protocol database. 55 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. 55 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. 56 56 57 57 @param ImageHandle The firmware allocated handle for the EFI image. 58 58 @param SystemTable A pointer to the EFI System Table. 59 59 60 60 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. 61 61 … … 69 69 { 70 70 EFI_STATUS Status; 71 71 72 72 Status = gBS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**) &mPciRootBridgeIo); 73 73 ASSERT_EFI_ERROR (Status); … … 144 144 145 145 /** 146 Registers a PCI device so PCI configuration registers may be accessed after 146 Registers a PCI device so PCI configuration registers may be accessed after 147 147 SetVirtualAddressMap(). 148 149 Registers the PCI device specified by Address so all the PCI configuration registers 148 149 Registers the PCI device specified by Address so all the PCI configuration registers 150 150 associated with that PCI device may be accessed after SetVirtualAddressMap() is called. 151 152 If Address > 0x0FFFFFFF, then ASSERT(). 153 154 @param Address The address that encodes the PCI Bus, Device, Function and 155 Register. 156 151 152 If Address > 0x0FFFFFFF, then ASSERT(). 153 154 @param Address The address that encodes the PCI Bus, Device, Function and 155 Register. 156 157 157 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 158 @retval RETURN_UNSUPPORTED An attempt was made to call this function 158 @retval RETURN_UNSUPPORTED An attempt was made to call this function 159 159 after ExitBootServices(). 160 160 @retval RETURN_UNSUPPORTED The resources required to access the PCI device -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c
r58459 r58466 8 8 text of the license may be found at 9 9 http://opensource.org/licenses/bsd-license.php. 10 10 11 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. … … 24 24 /** 25 25 The constructor function caches data of PCI Root Bridge I/O Protocol instances. 26 26 27 27 The constructor function locates PCI Root Bridge I/O protocol instances, 28 28 and caches the protocol instances, together with their segment numbers and bus ranges. 29 It will ASSERT() if that related operation fails and it will always return EFI_SUCCESS. 29 It will ASSERT() if that related operation fails and it will always return EFI_SUCCESS. 30 30 31 31 @param ImageHandle The firmware allocated handle for the EFI image. 32 32 @param SystemTable A pointer to the EFI System Table. 33 33 34 34 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. 35 35 … … 46 46 UINTN HandleCount; 47 47 EFI_HANDLE *HandleBuffer; 48 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo; 48 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo; 49 49 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptors; 50 50 … … 104 104 /** 105 105 The destructor function frees memory allocated by constructor. 106 106 107 107 The destructor function frees memory for data of protocol instances allocated by constructor. 108 It will ASSERT() if that related operation fails and it will always return EFI_SUCCESS. 108 It will ASSERT() if that related operation fails and it will always return EFI_SUCCESS. 109 109 110 110 @param ImageHandle The firmware allocated handle for the EFI image. 111 111 @param SystemTable A pointer to the EFI System Table. 112 112 113 113 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. 114 114 … … 160 160 return mPciRootBridgeData[Index].PciRootBridgeIo; 161 161 } 162 } 162 } 163 163 } 164 164 return NULL; … … 186 186 { 187 187 UINT32 Data; 188 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo; 188 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo; 189 189 190 190 PciRootBridgeIo = PciSegmentLibSearchForRootBridge (Address); … … 225 225 ) 226 226 { 227 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo; 227 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo; 228 228 229 229 PciRootBridgeIo = PciSegmentLibSearchForRootBridge (Address); … … 242 242 243 243 /** 244 Register a PCI device so PCI configuration registers may be accessed after 244 Register a PCI device so PCI configuration registers may be accessed after 245 245 SetVirtualAddressMap(). 246 246 247 247 If any reserved bits in Address are set, then ASSERT(). 248 248 249 249 @param Address The address that encodes the PCI Bus, Device, Function and 250 250 Register. 251 251 252 252 @retval RETURN_SUCCESS The PCI device was registered for runtime access. 253 @retval RETURN_UNSUPPORTED An attempt was made to call this function 253 @retval RETURN_UNSUPPORTED An attempt was made to call this function 254 254 after ExitBootServices(). 255 255 @retval RETURN_UNSUPPORTED The resources required to access the PCI device … … 274 274 Reads and returns the 8-bit PCI configuration register specified by Address. 275 275 This function must guarantee that all PCI read and write operations are serialized. 276 277 If any reserved bits in Address are set, then ASSERT(). 278 276 277 If any reserved bits in Address are set, then ASSERT(). 278 279 279 @param Address The address that encodes the PCI Segment, Bus, Device, Function, and Register. 280 280 … … 298 298 Writes the 8-bit PCI configuration register specified by Address with the value specified by Value. 299 299 Value is returned. This function must guarantee that all PCI read and write operations are serialized. 300 300 301 301 If any reserved bits in Address are set, then ASSERT(). 302 302 … … 327 327 The value written to the PCI configuration register is returned. 328 328 This function must guarantee that all PCI read and write operations are serialized. 329 329 330 330 If any reserved bits in Address are set, then ASSERT(). 331 331 … … 375 375 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value, 376 376 followed a bitwise OR with another 8-bit value. 377 377 378 378 Reads the 8-bit PCI configuration register specified by Address, 379 379 performs a bitwise AND between the read result and the value specified by AndData, … … 382 382 The value written to the PCI configuration register is returned. 383 383 This function must guarantee that all PCI read and write operations are serialized. 384 384 385 385 If any reserved bits in Address are set, then ASSERT(). 386 386 … … 610 610 Reads and returns the 16-bit PCI configuration register specified by Address. 611 611 This function must guarantee that all PCI read and write operations are serialized. 612 612 613 613 If any reserved bits in Address are set, then ASSERT(). 614 614 If Address is not aligned on a 16-bit boundary, then ASSERT(). 615 615 616 616 @param Address The address that encodes the PCI Segment, Bus, Device, Function, and Register. 617 617 … … 635 635 Writes the 16-bit PCI configuration register specified by Address with the value specified by Value. 636 636 Value is returned. This function must guarantee that all PCI read and write operations are serialized. 637 637 638 638 If any reserved bits in Address are set, then ASSERT(). 639 639 If Address is not aligned on a 16-bit boundary, then ASSERT(). … … 696 696 The value written to the PCI configuration register is returned. 697 697 This function must guarantee that all PCI read and write operations are serialized. 698 698 699 699 If any reserved bits in Address are set, then ASSERT(). 700 700 If Address is not aligned on a 16-bit boundary, then ASSERT(). 701 701 702 702 @param Address The address that encodes the PCI Segment, Bus, Device, Function, and Register. 703 703 @param AndData The value to AND with the PCI configuration register. … … 719 719 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value, 720 720 followed a bitwise OR with another 16-bit value. 721 721 722 722 Reads the 16-bit PCI configuration register specified by Address, 723 723 performs a bitwise AND between the read result and the value specified by AndData, … … 726 726 The value written to the PCI configuration register is returned. 727 727 This function must guarantee that all PCI read and write operations are serialized. 728 728 729 729 If any reserved bits in Address are set, then ASSERT(). 730 730 If Address is not aligned on a 16-bit boundary, then ASSERT(). … … 824 824 Reads the 16-bit PCI configuration register specified by Address, 825 825 performs a bitwise OR between the read result and the value specified by OrData, 826 and writes the result to the 16-bit PCI configuration register specified by Address. 826 and writes the result to the 16-bit PCI configuration register specified by Address. 827 827 828 828 If any reserved bits in Address are set, then ASSERT(). … … 868 868 This function must guarantee that all PCI read and write operations are serialized. 869 869 Extra left bits in OrData are stripped. 870 870 871 871 If any reserved bits in Address are set, then ASSERT(). 872 872 If Address is not aligned on a 16-bit boundary, then ASSERT(). … … 953 953 Reads and returns the 32-bit PCI configuration register specified by Address. 954 954 This function must guarantee that all PCI read and write operations are serialized. 955 955 956 956 If any reserved bits in Address are set, then ASSERT(). 957 957 If Address is not aligned on a 32-bit boundary, then ASSERT(). … … 978 978 Writes the 32-bit PCI configuration register specified by Address with the value specified by Value. 979 979 Value is returned. This function must guarantee that all PCI read and write operations are serialized. 980 980 981 981 If any reserved bits in Address are set, then ASSERT(). 982 982 If Address is not aligned on a 32-bit boundary, then ASSERT(). … … 1008 1008 The value written to the PCI configuration register is returned. 1009 1009 This function must guarantee that all PCI read and write operations are serialized. 1010 1010 1011 1011 If any reserved bits in Address are set, then ASSERT(). 1012 1012 If Address is not aligned on a 32-bit boundary, then ASSERT(). … … 1036 1036 The value written to the PCI configuration register is returned. 1037 1037 This function must guarantee that all PCI read and write operations are serialized. 1038 1038 1039 1039 If any reserved bits in Address are set, then ASSERT(). 1040 1040 If Address is not aligned on a 32-bit boundary, then ASSERT(). … … 1059 1059 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value, 1060 1060 followed a bitwise OR with another 32-bit value. 1061 1061 1062 1062 Reads the 32-bit PCI configuration register specified by Address, 1063 1063 performs a bitwise AND between the read result and the value specified by AndData, … … 1066 1066 The value written to the PCI configuration register is returned. 1067 1067 This function must guarantee that all PCI read and write operations are serialized. 1068 1068 1069 1069 If any reserved bits in Address are set, then ASSERT(). 1070 1070 If Address is not aligned on a 32-bit boundary, then ASSERT(). … … 1207 1207 AND, and writes the result back to the bit field in the 32-bit register. 1208 1208 1209 1209 1210 1210 Reads the 32-bit PCI configuration register specified by Address, performs a bitwise 1211 1211 AND between the read result and the value specified by AndData, and writes the result -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.h
r48674 r58466 8 8 text of the license may be found at 9 9 http://opensource.org/licenses/bsd-license.php. 10 10 11 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
r48674 r58466 4 4 This library hides the global variable for the EFI Runtime Services so the 5 5 caller does not need to deal with the possibility of being called from an 6 OS virtual address space. All pointer values are different for a virtual 6 OS virtual address space. All pointer values are different for a virtual 7 7 mapping than from the normal physical mapping at boot services time. 8 8 … … 126 126 127 127 /** 128 If a runtime driver exits with an error, it must call this routine 128 If a runtime driver exits with an error, it must call this routine 129 129 to free the allocated resource before the exiting. 130 130 It will ASSERT() if gBS is NULL. … … 181 181 182 182 /** 183 This function allows the caller to determine if UEFI SetVirtualAddressMap() has been called. 183 This function allows the caller to determine if UEFI SetVirtualAddressMap() has been called. 184 184 185 185 This function returns TRUE after all the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE functions have … … 467 467 may create and manage its own variables without the risk of name conflicts by using a unique VendorGuid. 468 468 469 @param VariableName The name of the vendor's variable; it's a Null-Terminated 469 @param VariableName The name of the vendor's variable; it's a Null-Terminated 470 470 Unicode String 471 471 @param VendorGuid Unify identifier for vendor. … … 531 531 532 532 /** 533 This service is a wrapper for the UEFI Runtime Service ConvertPointer(). 533 This service is a wrapper for the UEFI Runtime Service ConvertPointer(). 534 534 535 535 The ConvertPointer() function is used by an EFI component during the SetVirtualAddressMap() operation. … … 563 563 564 564 For IA32, x64, and EBC, this service is a wrapper for the UEFI Runtime Service 565 ConvertPointer(). See the UEFI Specification for details. 565 ConvertPointer(). See the UEFI Specification for details. 566 566 For IPF, this function interprets Address as a pointer to an EFI_PLABEL structure 567 567 and both the EntryPoint and GP fields of an EFI_PLABEL are converted from physical … … 615 615 LIST_ENTRY *Link; 616 616 LIST_ENTRY *NextLink; 617 617 618 618 // 619 619 // For NULL List, return EFI_SUCCESS -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
r58459 r58466 45 45 UefiRuntimeServicesTableLib 46 46 DebugLib 47 47 48 48 [Guids] 49 49 gEfiEventExitBootServicesGuid ## CONSUMES ## Event -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiSalLib/UefiSalLib.c
r48674 r58466 9 9 text of the license may be found at 10 10 http://opensource.org/licenses/bsd-license.php. 11 11 12 12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. … … 29 29 /** 30 30 Makes a SAL procedure call. 31 32 This is a wrapper function to make a SAL procedure call. 31 32 This is a wrapper function to make a SAL procedure call. 33 33 No parameter checking is performed on the 8 input parameters, 34 34 but there are some common rules that the caller should follow -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiScsiLib/UefiScsiLib.c
r58459 r58466 3 3 4 4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php. 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 19 19 #include <Library/UefiScsiLib.h> 20 20 #include <Library/BaseMemoryLib.h> 21 21 22 22 #include <IndustryStandard/Scsi.h> 23 24 23 24 25 25 // 26 26 // Max bytes needed to represent ID of a SCSI device 27 27 // 28 28 #define EFI_SCSI_TARGET_MAX_BYTES (0x10) 29 29 30 30 // 31 31 // bit5..7 are for Logical unit number … … 33 33 // 34 34 #define EFI_SCSI_LOGICAL_UNIT_NUMBER_MASK 0xe0 35 35 36 36 // 37 37 // Scsi Command Length … … 71 71 @param[in, out] SenseDataLength On input, a pointer to the length in bytes of 72 72 the SenseData buffer. On output, a pointer to 73 the number of bytes written to the SenseData buffer. 73 the number of bytes written to the SenseData buffer. 74 74 @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces 75 75 the SCSI bus containing the SCSI target specified by … … 81 81 on the SCSI Host Controller. See the EFI SCSI I/O 82 82 Protocol in the UEFI Specification for details on 83 the possible return values. 83 the possible return values. 84 84 85 85 @retval EFI_SUCCESS The command was executed successfully. … … 187 187 is optional and may be NULL. 188 188 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer. 189 On output, the number of bytes written to the SenseData buffer. 189 On output, the number of bytes written to the SenseData buffer. 190 190 @param[out] HostAdapterStatus The status of the SCSI Host Controller that 191 191 produces the SCSI bus containing the SCSI … … 199 199 See the EFI SCSI I/O Protocol in the UEFI 200 200 Specification for details on the possible 201 return values. 201 return values. 202 202 @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated 203 203 by the execution of the SCSI Request Packet. 204 204 This buffer must be allocated by the caller. 205 205 If InquiryDataLength is 0, then this parameter 206 is optional and may be NULL. 206 is optional and may be NULL. 207 207 @param[in, out] InquiryDataLength On input, a pointer to the length in bytes 208 208 of the InquiryDataBuffer buffer. … … 334 334 is optional and may be NULL. 335 335 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer. 336 On output, the number of bytes written to the SenseData buffer. 336 On output, the number of bytes written to the SenseData buffer. 337 337 @param[out] HostAdapterStatus The status of the SCSI Host Controller that 338 338 produces the SCSI bus containing the SCSI … … 346 346 See the EFI SCSI I/O Protocol in the UEFI 347 347 Specification for details on the possible 348 return values. 348 return values. 349 349 @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated 350 350 by the execution of the SCSI Request Packet. 351 351 This buffer must be allocated by the caller. 352 352 If InquiryDataLength is 0, then this parameter 353 is optional and may be NULL. 353 is optional and may be NULL. 354 354 @param[in, out] InquiryDataLength On input, a pointer to the length in bytes 355 355 of the InquiryDataBuffer buffer. … … 359 359 data is returned in InquiryDataBuffer. 360 360 If FALSE, then the standard inquiry data is 361 returned in InquiryDataBuffer. 361 returned in InquiryDataBuffer. 362 362 363 363 @retval EFI_SUCCESS The command executed successfully. See HostAdapterStatus, … … 443 443 is optional and may be NULL. 444 444 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer. 445 On output, the number of bytes written to the SenseData buffer. 445 On output, the number of bytes written to the SenseData buffer. 446 446 @param[out] HostAdapterStatus The status of the SCSI Host Controller that 447 447 produces the SCSI bus containing the SCSI target … … 459 459 buffer must be allocated by the caller. If 460 460 DataLength is 0, then this parameter is optional 461 and may be NULL. 461 and may be NULL. 462 462 @param[in, out] DataLength On input, a pointer to the length in bytes of 463 463 the DataBuffer buffer. On output, a pointer 464 464 to the number of bytes written to the DataBuffer 465 buffer. 465 buffer. 466 466 @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command. 467 @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command. 468 @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command. 467 @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command. 468 @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command. 469 469 470 470 @retval EFI_SUCCESS The command executed successfully. … … 880 880 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could 881 881 not be transferred. The actual number of bytes transferred is returned in DataLength. 882 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 882 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 883 883 SCSI Command Packets already queued. 884 884 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet. 885 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 885 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 886 886 the SCSI initiator(i.e., SCSI Host Controller) 887 887 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute. … … 978 978 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could 979 979 not be transferred. The actual number of bytes transferred is returned in DataLength. 980 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 980 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 981 981 SCSI Command Packets already queued. 982 982 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet. 983 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 983 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 984 984 the SCSI initiator(i.e., SCSI Host Controller) 985 985 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute. … … 1076 1076 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could 1077 1077 not be transferred. The actual number of bytes transferred is returned in DataLength. 1078 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 1078 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 1079 1079 SCSI Command Packets already queued. 1080 1080 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet. 1081 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 1081 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 1082 1082 the SCSI initiator(i.e., SCSI Host Controller) 1083 1083 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute. … … 1174 1174 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could 1175 1175 not be transferred. The actual number of bytes transferred is returned in DataLength. 1176 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 1176 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many 1177 1177 SCSI Command Packets already queued. 1178 1178 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet. 1179 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 1179 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by 1180 1180 the SCSI initiator(i.e., SCSI Host Controller) 1181 1181 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
r58459 r58466 24 24 MODULE_TYPE = UEFI_DRIVER 25 25 VERSION_STRING = 1.0 26 LIBRARY_CLASS = UefiScsiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 26 LIBRARY_CLASS = UefiScsiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 27 27 28 28 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiUsbLib/Hid.c
r48674 r58466 3 3 The library provides USB HID Class standard and specific requests defined 4 4 in USB HID Firmware Specification 7 section : Requests. 5 5 6 6 Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR> 7 7 This program and the accompanying materials … … 9 9 which accompanies this distribution. The full text of the license may be found at 10 10 http://opensource.org/licenses/bsd-license.php. 11 11 12 12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. … … 17 17 #include "UefiUsbLibInternal.h" 18 18 19 // 19 // 20 20 // Hid RequestType Bits specifying characteristics of request. 21 21 // Valid values are 10100001b (0xa1) or 00100001b (0x21). … … 229 229 230 230 ASSERT (UsbIo != NULL); 231 231 232 232 // 233 233 // Fill Device request packet … … 335 335 EFI_STATUS Result; 336 336 EFI_USB_DEVICE_REQUEST Request; 337 337 338 338 ASSERT (UsbIo != NULL); 339 339 ASSERT (Duration != NULL); -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiUsbLib/UefiUsbLibInternal.h
r48674 r58466 1 1 /** @file 2 2 3 3 Common header file shared by all source files. 4 4 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiUsbLib/UsbDxeLib.c
r48674 r58466 1 1 /** @file 2 2 3 The library provides the USB Standard Device Requests defined 3 The library provides the USB Standard Device Requests defined 4 4 in Usb specification 9.4 section. 5 5 6 6 Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR> 7 7 This program and the accompanying materials are … … 10 10 text of the license may be found at 11 11 http://opensource.org/licenses/bsd-license.php. 12 12 13 13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Note:
See TracChangeset
for help on using the changeset viewer.