Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/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:
-
- 92 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/MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.c
r48674 r58466 19 19 Performs platform specific initialization required for the CPU to access 20 20 the hardware associated with a SerialPortLib instance. This function does 21 not intiailzie the serial port hardware itself. Instead, it initializes 22 hardware devices that are required for the CPU to access the serial port 21 not intiailzie the serial port hardware itself. Instead, it initializes 22 hardware devices that are required for the CPU to access the serial port 23 23 hardware. This function may be called more than once. 24 24 25 25 @retval RETURN_SUCCESS The platform specific initialization succeeded. 26 26 @retval RETURN_DEVICE_ERROR The platform specific initialization could not be completed. 27 27 28 28 **/ 29 29 RETURN_STATUS -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.c
r48674 r58466 20 20 /** 21 21 This function causes a system-wide reset (cold reset), in which 22 all circuitry within the system returns to its initial state. This type of reset 22 all circuitry within the system returns to its initial state. This type of reset 23 23 is asynchronous to system operation and operates without regard to 24 24 cycle boundaries. 25 25 26 If this function returns, it means that the system does not support cold reset. 26 If this function returns, it means that the system does not support cold reset. 27 27 **/ 28 28 VOID … … 36 36 37 37 /** 38 This function causes a system-wide initialization (warm reset), in which all processors 38 This function causes a system-wide initialization (warm reset), in which all processors 39 39 are set to their initial state. Pending cycles are not corrupted. 40 40 … … 51 51 52 52 /** 53 This function causes the system to enter a power state equivalent 53 This function causes the system to enter a power state equivalent 54 54 to the ACPI G2/S5 or G3 states. 55 55 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
r58459 r58466 59 59 60 60 /** 61 Read an 8-bit 16550 register. If PcdSerialUseMmio is TRUE, then the value is read from 61 Read an 8-bit 16550 register. If PcdSerialUseMmio is TRUE, then the value is read from 62 62 MMIO space. If PcdSerialUseMmio is FALSE, then the value is read from I/O space. The 63 parameter Offset is added to the base address of the 16550 registers that is specified 64 by PcdSerialRegisterBase. 65 63 parameter Offset is added to the base address of the 16550 registers that is specified 64 by PcdSerialRegisterBase. 65 66 66 @param Base The base address register of UART device. 67 67 @param Offset The offset of the 16550 register to read. … … 86 86 Write an 8-bit 16550 register. If PcdSerialUseMmio is TRUE, then the value is written to 87 87 MMIO space. If PcdSerialUseMmio is FALSE, then the value is written to I/O space. The 88 parameter Offset is added to the base address of the 16550 registers that is specified 89 by PcdSerialRegisterBase. 90 88 parameter Offset is added to the base address of the 16550 registers that is specified 89 by PcdSerialRegisterBase. 90 91 91 @param Base The base address register of UART device. 92 92 @param Offset The offset of the 16550 register to write. … … 111 111 112 112 /** 113 Update the value of an 16-bit PCI configuration register in a PCI device. If the 114 PCI Configuration register specified by PciAddress is already programmed with a 115 non-zero value, then return the current value. Otherwise update the PCI configuration 113 Update the value of an 16-bit PCI configuration register in a PCI device. If the 114 PCI Configuration register specified by PciAddress is already programmed with a 115 non-zero value, then return the current value. Otherwise update the PCI configuration 116 116 register specified by PciAddress with the value specified by Value and return the 117 value programmed into the PCI configuration register. All values must be masked 117 value programmed into the PCI configuration register. All values must be masked 118 118 using the bitmask specified by Mask. 119 119 … … 131 131 { 132 132 UINT16 CurrentValue; 133 133 134 134 CurrentValue = PciRead16 (PciAddress) & Mask; 135 135 if (CurrentValue != 0) { … … 140 140 141 141 /** 142 Update the value of an 32-bit PCI configuration register in a PCI device. If the 143 PCI Configuration register specified by PciAddress is already programmed with a 144 non-zero value, then return the current value. Otherwise update the PCI configuration 142 Update the value of an 32-bit PCI configuration register in a PCI device. If the 143 PCI Configuration register specified by PciAddress is already programmed with a 144 non-zero value, then return the current value. Otherwise update the PCI configuration 145 145 register specified by PciAddress with the value specified by Value and return the 146 value programmed into the PCI configuration register. All values must be masked 146 value programmed into the PCI configuration register. All values must be masked 147 147 using the bitmask specified by Mask. 148 148 … … 162 162 { 163 163 UINT32 CurrentValue; 164 164 165 165 CurrentValue = PciRead32 (PciAddress) & Mask; 166 166 if (CurrentValue != 0) { … … 171 171 172 172 /** 173 Retrieve the I/O or MMIO base address register for the PCI UART device. 174 175 This function assumes Root Bus Numer is Zero, and enables I/O and MMIO in PCI UART 176 Device if they are not already enabled. 177 173 Retrieve the I/O or MMIO base address register for the PCI UART device. 174 175 This function assumes Root Bus Numer is Zero, and enables I/O and MMIO in PCI UART 176 Device if they are not already enabled. 177 178 178 @return The base address register of the UART device. 179 179 … … 205 205 // 206 206 DeviceInfo = (PCI_UART_DEVICE_INFO *) PcdGetPtr (PcdSerialPciDeviceInfo); 207 207 208 208 // 209 209 // If PCI Device Info is empty, then assume fixed address UART and return PcdSerialRegisterBase 210 // 210 // 211 211 if (DeviceInfo->Device == 0xff) { 212 212 return (UINTN)PcdGet64 (PcdSerialRegisterBase); … … 220 220 ParentIoBase = 0 >> 12; 221 221 ParentIoLimit = 0xf000 >> 12; 222 222 223 223 // 224 224 // Enable I/O and MMIO in PCI Bridge 225 // Assume Root Bus Numer is Zero. 225 // Assume Root Bus Numer is Zero. 226 226 // 227 227 for (BusNumber = 0; (DeviceInfo + 1)->Device != 0xff; DeviceInfo++) { … … 230 230 // 231 231 PciLibAddress = PCI_LIB_ADDRESS (BusNumber, DeviceInfo->Device, DeviceInfo->Function, 0); 232 232 233 233 // 234 234 // Retrieve and verify the bus numbers in the PCI to PCI Bridge … … 254 254 return 0; 255 255 } 256 256 257 257 // 258 258 // If PCI Bridge MMIO window is not in the address range decoded by the parent PCI Bridge, then return 0 259 // 259 // 260 260 if (MemoryBase < ParentMemoryBase || MemoryBase > ParentMemoryLimit || MemoryLimit > ParentMemoryLimit) { 261 261 return 0; … … 276 276 IoBase = (PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.IoBaseUpper16)) << 4) | (IoBase >> 4); 277 277 } 278 278 279 279 // 280 280 // If PCI Bridge I/O window is disabled, then return 0 … … 283 283 return 0; 284 284 } 285 285 286 286 // 287 287 // If PCI Bridge I/O window is not in the address range decoded by the parent PCI Bridge, then return 0 288 // 288 // 289 289 if (IoBase < ParentIoBase || IoBase > ParentIoLimit || IoLimit > ParentIoLimit) { 290 290 return 0; … … 299 299 // 300 300 PciLibAddress = PCI_LIB_ADDRESS (BusNumber, DeviceInfo->Device, DeviceInfo->Function, 0); 301 301 302 302 // 303 303 // Find the first IO or MMIO BAR … … 332 332 // 333 333 // Program UART BAR 334 // 334 // 335 335 SerialRegisterBase = SerialPortLibUpdatePciRegister32 ( 336 336 PciLibAddress + PCI_BASE_ADDRESSREG_OFFSET + BarIndex * 4, 337 (UINT32)PcdGet64 (PcdSerialRegisterBase), 337 (UINT32)PcdGet64 (PcdSerialRegisterBase), 338 338 RegisterBaseMask 339 339 ); … … 341 341 // 342 342 // Verify that the UART BAR is in the address range decoded by the parent PCI Bridge 343 // 343 // 344 344 if (PcdGetBool (PcdSerialUseMmio)) { 345 345 if (((SerialRegisterBase >> 16) & 0xfff0) < ParentMemoryBase || ((SerialRegisterBase >> 16) & 0xfff0) > ParentMemoryLimit) { … … 351 351 } 352 352 } 353 353 354 354 // 355 355 // Enable I/O and MMIO in PCI UART Device if they are not already enabled … … 372 372 } 373 373 } 374 374 375 375 // 376 376 // Get PCI Device Info … … 380 380 // 381 381 // Enable I/O or MMIO in PCI Bridge 382 // Assume Root Bus Numer is Zero. 382 // Assume Root Bus Numer is Zero. 383 383 // 384 384 for (BusNumber = 0; (DeviceInfo + 1)->Device != 0xff; DeviceInfo++) { … … 387 387 // 388 388 PciLibAddress = PCI_LIB_ADDRESS (BusNumber, DeviceInfo->Device, DeviceInfo->Function, 0); 389 389 390 390 // 391 391 // Enable the I/O or MMIO decode windows in the PCI to PCI Bridge 392 392 // 393 393 PciOr16 ( 394 PciLibAddress + PCI_COMMAND_OFFSET, 394 PciLibAddress + PCI_COMMAND_OFFSET, 395 395 PcdGetBool (PcdSerialUseMmio) ? EFI_PCI_COMMAND_MEMORY_SPACE : EFI_PCI_COMMAND_IO_SPACE 396 396 ); 397 397 398 398 // 399 399 // Force D0 state if a Power Management and Status Register is specified … … 404 404 } 405 405 } 406 406 407 407 BusNumber = PciRead8 (PciLibAddress + PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET); 408 408 } 409 409 410 410 return SerialRegisterBase; 411 411 } … … 441 441 } else { 442 442 // 443 // Wait for both DSR and CTS to be set OR for DSR to be clear. 443 // Wait for both DSR and CTS to be set OR for DSR to be clear. 444 444 // DSR is set if a cable is connected. 445 445 // CTS is set if it is ok to transmit data … … 461 461 /** 462 462 Initialize the serial device hardware. 463 463 464 464 If no initialization is required, then return RETURN_SUCCESS. 465 465 If the serial device was successfully initialized, then return RETURN_SUCCESS. 466 466 If the serial device could not be initialized, then return RETURN_DEVICE_ERROR. 467 467 468 468 @retval RETURN_SUCCESS The serial device was initialized. 469 469 @retval RETURN_DEVICE_ERROR The serial device could not be initialized. … … 479 479 UINTN SerialRegisterBase; 480 480 UINT32 Divisor; 481 UINT32 CurrentDivisor; 481 UINT32 CurrentDivisor; 482 482 BOOLEAN Initialized; 483 483 … … 531 531 // 532 532 while ((SerialPortReadRegister (SerialRegisterBase, R_UART_LSR) & (B_UART_LSR_TEMT | B_UART_LSR_TXRDY)) != (B_UART_LSR_TEMT | B_UART_LSR_TXRDY)); 533 533 534 534 // 535 535 // Configure baud rate … … 554 554 // 555 555 // Put Modem Control Register(MCR) into its reset state of 0x00. 556 // 556 // 557 557 SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, 0x00); 558 558 … … 561 561 562 562 /** 563 Write data from buffer to serial device. 564 565 Writes NumberOfBytes data bytes from Buffer to the serial device. 563 Write data from buffer to serial device. 564 565 Writes NumberOfBytes data bytes from Buffer to the serial device. 566 566 The number of bytes actually written to the serial device is returned. 567 567 If the return value is less than NumberOfBytes, then the write operation failed. 568 568 569 If Buffer is NULL, then ASSERT(). 569 If Buffer is NULL, then ASSERT(). 570 570 571 571 If NumberOfBytes is zero, then return 0. … … 575 575 576 576 @retval 0 NumberOfBytes is 0. 577 @retval >0 The number of bytes written to the serial device. 577 @retval >0 The number of bytes written to the serial device. 578 578 If this value is less than NumberOfBytes, then the read operation failed. 579 579 … … 599 599 return 0; 600 600 } 601 601 602 602 if (NumberOfBytes == 0) { 603 603 // … … 662 662 663 663 @retval 0 NumberOfBytes is 0. 664 @retval >0 The number of bytes read from the serial device. 664 @retval >0 The number of bytes read from the serial device. 665 665 If this value is less than NumberOfBytes, then the read operation failed. 666 666 … … 687 687 688 688 Mcr = (UINT8)(SerialPortReadRegister (SerialRegisterBase, R_UART_MCR) & ~B_UART_MCR_RTS); 689 689 690 690 for (Result = 0; NumberOfBytes-- != 0; Result++, Buffer++) { 691 691 // … … 706 706 SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, Mcr); 707 707 } 708 708 709 709 // 710 710 // Read byte from the receive buffer. … … 712 712 *Buffer = SerialPortReadRegister (SerialRegisterBase, R_UART_RXBUF); 713 713 } 714 714 715 715 return Result; 716 716 } … … 735 735 { 736 736 UINTN SerialRegisterBase; 737 737 738 738 SerialRegisterBase = GetSerialRegisterBase (); 739 739 if (SerialRegisterBase ==0) { … … 752 752 } 753 753 return TRUE; 754 } 755 754 } 755 756 756 if (PcdGetBool (PcdSerialUseHardwareFlowControl)) { 757 757 // … … 760 760 SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, (UINT8)(SerialPortReadRegister (SerialRegisterBase, R_UART_MCR) | B_UART_MCR_RTS)); 761 761 } 762 762 763 763 return FALSE; 764 764 } -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
r58459 r58466 34 34 [Sources] 35 35 BaseSerialPortLib16550.c 36 36 37 37 [Pcd] 38 38 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio ## CONSUMES -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
r58464 r58466 17 17 /** 18 18 Initializes all CPU exceptions entries and provides the default exception handlers. 19 19 20 20 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to 21 21 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. 22 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 22 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 23 23 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly. 24 24 25 25 @param[in] VectorInfo Pointer to reserved vector list. 26 27 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 26 27 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 28 28 with default exception handlers. 29 29 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. … … 42 42 /** 43 43 Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers. 44 44 45 45 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to 46 46 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. 47 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 47 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 48 48 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly. 49 49 50 50 @param[in] VectorInfo Pointer to reserved vector list. 51 52 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized 51 52 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized 53 53 with default interrupt/exception handlers. 54 54 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. … … 68 68 Registers a function to be called from the processor interrupt handler. 69 69 70 This function registers and enables the handler specified by InterruptHandler for a processor 71 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the 72 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. 70 This function registers and enables the handler specified by InterruptHandler for a processor 71 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the 72 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. 73 73 The installed handler is called once for each processor interrupt or exception. 74 74 NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c
r58464 r58466 4 4 5 5 Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials are licensed and made available under 7 the terms and conditions of the BSD License that accompanies this distribution. 6 This program and the accompanying materials are licensed and made available under 7 the terms and conditions of the BSD License that accompanies this distribution. 8 8 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, 9 http://opensource.org/licenses/bsd-license.php. 10 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 … … 45 45 46 46 /** 47 This funtion defines Page Frame and Backgroud. 48 49 Based on the above layout, it will be responsible for HeaderHeight, FooterHeight, 50 StatusBarHeight and Backgroud. And, it will reserve Screen for Statement. 47 This funtion defines Page Frame and Backgroud. 48 49 Based on the above layout, it will be responsible for HeaderHeight, FooterHeight, 50 StatusBarHeight and Backgroud. And, it will reserve Screen for Statement. 51 51 52 52 @param[in] FormData Form Data to be shown in Page. 53 53 @param[out] ScreenForStatement Screen to be used for Statement. (Prompt, Value and Help) 54 54 55 55 @return Status 56 56 **/ … … 121 121 The library will prepare those Strings for the basic key, ESC, Enter, Up/Down/Left/Right, +/-. 122 122 and arrange them in Footer panel. 123 124 @param[in] FormData Form Data to be shown in Page. FormData has the highlighted statement. 123 124 @param[in] FormData Form Data to be shown in Page. FormData has the highlighted statement. 125 125 @param[in] Statement The statement current selected. 126 126 @param[in] Selected Whether or not a tag be selected. TRUE means Enter has hit this question. … … 217 217 TimeOp = (EFI_IFR_TIME *) Statement->OpCode; 218 218 HexDisplay = (TimeOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX; 219 } 219 } 220 220 switch (Statement->OpCode->OpCode) { 221 221 case EFI_IFR_ORDERED_LIST_OP: … … 235 235 (Statement->OpCode->OpCode == EFI_IFR_TIME_OP)) { 236 236 PrintAt ( 237 ColumnWidth1, 237 ColumnWidth1, 238 238 StartColumnOfHelp, 239 239 BottomRowOfHelp, … … 262 262 // If it is a selected numeric with manual input, display different message 263 263 // 264 if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) || 264 if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) || 265 265 (Statement->OpCode->OpCode == EFI_IFR_DATE_OP) || 266 266 (Statement->OpCode->OpCode == EFI_IFR_TIME_OP)) { … … 332 332 default: 333 333 break; 334 } 334 } 335 335 } 336 336 … … 338 338 Update status bar. 339 339 340 This function updates the status bar on the bottom of menu screen. It just shows StatusBar. 340 This function updates the status bar on the bottom of menu screen. It just shows StatusBar. 341 341 Original logic in this function should be splitted out. 342 342 343 @param[in] MessageType The type of message to be shown. InputError or Configuration Changed. 343 @param[in] MessageType The type of message to be shown. InputError or Configuration Changed. 344 344 @param[in] State Show or Clear Message. 345 345 **/ … … 398 398 default: 399 399 break; 400 } 401 } 402 403 /** 404 Create popup window. It will replace CreateDialog(). 400 } 401 } 402 403 /** 404 Create popup window. It will replace CreateDialog(). 405 405 406 406 This function draws OEM/Vendor specific pop up windows. … … 408 408 @param[out] Key User Input Key 409 409 @param ... String to be shown in Popup. The variable argument list is terminated by a NULL. 410 410 411 411 **/ 412 412 VOID … … 456 456 while ((String = VA_ARG (Marker, CHAR16 *)) != NULL) { 457 457 LineNum ++; 458 458 459 459 if ((LibGetStringWidth (String) / 2) > LargestString) { 460 460 LargestString = (LibGetStringWidth (String) / 2); 461 461 } 462 } 462 } 463 463 VA_END (Marker); 464 464 … … 466 466 LargestString = DimensionsWidth - 2; 467 467 } 468 468 469 469 CurrentAttribute = gST->ConOut->Mode->Attribute; 470 470 CursorVisible = gST->ConOut->Mode->CursorVisible; … … 554 554 555 555 /** 556 Confirm how to handle the changed data. 557 556 Confirm how to handle the changed data. 557 558 558 @return Action BROWSER_ACTION_SUBMIT, BROWSER_ACTION_DISCARD or other values. 559 559 **/ … … 569 569 570 570 gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); 571 571 572 572 YesResponse = gYesResponse[0]; 573 573 NoResponse = gNoResponse[0]; 574 574 575 575 // 576 576 // If NV flag is up, prompt user … … 584 584 ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (YesResponse | UPPER_LOWER_CASE_OFFSET)) 585 585 ); 586 586 587 587 if (Key.ScanCode == SCAN_ESC) { 588 588 return BROWSER_ACTION_NONE; … … 597 597 OEM specifies whether Setup exits Page by ESC key. 598 598 599 This function customized the behavior that whether Setup exits Page so that 599 This function customized the behavior that whether Setup exits Page so that 600 600 system able to boot when configuration is not changed. 601 601 … … 613 613 614 614 /** 615 Set Timeout value for a ceratain Form to get user response. 616 615 Set Timeout value for a ceratain Form to get user response. 616 617 617 This function allows to set timeout value on a ceratain form if necessary. 618 If timeout is not zero, the form will exit if user has no response in timeout. 619 618 If timeout is not zero, the form will exit if user has no response in timeout. 619 620 620 @param[in] FormData Form Data to be shown in Page 621 621 622 @return 0 No timeout for this form. 622 @return 0 No timeout for this form. 623 623 @return > 0 Timeout value in 100 ns units. 624 624 **/ … … 901 901 **/ 902 902 VOID 903 EFIAPI 903 EFIAPI 904 904 ClearDisplayPage ( 905 905 VOID … … 953 953 { 954 954 HiiRemovePackages(mCDLStringPackHandle); 955 955 956 956 FreeLibStrings (); 957 957 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
r58464 r58466 35 35 CustomizedDisplayLibInternal.c 36 36 CustomizedDisplayLib.uni 37 37 38 38 [Packages] 39 39 MdePkg/MdePkg.dec … … 55 55 [Guids] 56 56 gEfiIfrTianoGuid ## SOMETIMES_CONSUMES ## UNDEFINED 57 57 58 58 [Protocols] 59 59 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
r58464 r58466 4 4 5 5 Copyright (c) 2013, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials are licensed and made available under 7 the terms and conditions of the BSD License that accompanies this distribution. 6 This program and the accompanying materials are licensed and made available under 7 the terms and conditions of the BSD License that accompanies this distribution. 8 8 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, 9 http://opensource.org/licenses/bsd-license.php. 10 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 … … 48 48 49 49 @param[in] FormData Form Data to be shown in Page 50 50 51 51 **/ 52 52 VOID 53 PrintBannerInfo ( 53 PrintBannerInfo ( 54 54 IN FORM_DISPLAY_ENGINE_FORM *FormData 55 55 ) … … 85 85 RowIdx = (UINT8) (Line - (UINT8) gScreenDimensions.TopRow); 86 86 ColumnIdx = (UINT8) (Alignment - (UINT8) gScreenDimensions.LeftColumn); 87 87 88 88 ASSERT (RowIdx < BANNER_HEIGHT && ColumnIdx < BANNER_COLUMNS); 89 89 90 90 if (gBannerData!= NULL && gBannerData->Banner[RowIdx][ColumnIdx] != 0x0000) { 91 91 StrFrontPageBanner = LibGetToken (gBannerData->Banner[RowIdx][ColumnIdx], FormData->HiiHandle); … … 93 93 continue; 94 94 } 95 95 96 96 switch (Alignment - gScreenDimensions.LeftColumn) { 97 97 case 0: … … 101 101 PrintStringAt (gScreenDimensions.LeftColumn + BANNER_LEFT_COLUMN_INDENT, Line, StrFrontPageBanner); 102 102 break; 103 103 104 104 case 1: 105 105 // … … 112 112 ); 113 113 break; 114 114 115 115 case 2: 116 116 // … … 124 124 break; 125 125 } 126 126 127 127 FreePool (StrFrontPageBanner); 128 128 } … … 160 160 return; 161 161 } 162 162 163 163 Buffer = AllocateZeroPool (0x10000); 164 164 ASSERT (Buffer != NULL); … … 188 188 PrintCharAt (gScreenDimensions.RightColumn - 1, Row, Character); 189 189 } 190 190 191 191 // 192 192 // Print Form Title … … 240 240 Character = BOXDRAW_UP_LEFT; 241 241 PrintCharAt ((UINTN) -1, (UINTN) -1, Character); 242 242 243 243 FreePool (Buffer); 244 244 } … … 258 258 { 259 259 switch (OpCodeData->OpCode) { 260 case EFI_IFR_GUID_OP: 260 case EFI_IFR_GUID_OP: 261 261 if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) { 262 262 // … … 282 282 ASSERT (gBannerData != NULL); 283 283 } 284 284 285 285 CopyMem ( 286 286 &gBannerData->Banner[((EFI_IFR_GUID_BANNER *) OpCodeData)->LineNumber][ … … 311 311 /** 312 312 Process some op codes which is out side of current form. 313 313 314 314 @param FormData Pointer to the form data. 315 315 … … 362 362 363 363 **/ 364 EFI_STATUS 364 EFI_STATUS 365 365 ScreenDiemensionInfoValidate ( 366 366 IN FORM_DISPLAY_ENGINE_FORM *FormData … … 371 371 372 372 // 373 // Calculate total number of Register HotKeys. 373 // Calculate total number of Register HotKeys. 374 374 // 375 375 Index = 0; … … 560 560 561 561 // 562 // Calculate total number of Register HotKeys. 562 // Calculate total number of Register HotKeys. 563 563 // 564 564 Index = 0; … … 583 583 584 584 // 585 // Help string can't exceed ColumnWidth. One Row will show three Help information. 585 // Help string can't exceed ColumnWidth. One Row will show three Help information. 586 586 // 587 587 BakChar = L'\0'; … … 608 608 Index ++; 609 609 } 610 610 611 611 if (SetState) { 612 612 // … … 627 627 } 628 628 } 629 629 630 630 return; 631 631 } … … 633 633 /** 634 634 Get step info from numeric opcode. 635 635 636 636 @param[in] OpCode The input numeric op code. 637 637 … … 647 647 648 648 NumericOp = (EFI_IFR_NUMERIC *) OpCode; 649 649 650 650 switch (NumericOp->Flags & EFI_IFR_NUMERIC_SIZE) { 651 651 case EFI_IFR_NUMERIC_SIZE_1: 652 652 Step = NumericOp->data.u8.Step; 653 653 break; 654 654 655 655 case EFI_IFR_NUMERIC_SIZE_2: 656 656 Step = NumericOp->data.u16.Step; 657 657 break; 658 658 659 659 case EFI_IFR_NUMERIC_SIZE_4: 660 660 Step = NumericOp->data.u32.Step; 661 661 break; 662 662 663 663 case EFI_IFR_NUMERIC_SIZE_8: 664 664 Step = NumericOp->data.u64.Step; 665 665 break; 666 666 667 667 default: 668 668 Step = 0; … … 705 705 gNvUpdateMessage = LibGetToken (STRING_TOKEN (NV_UPDATE_MESSAGE), mCDLStringPackHandle); 706 706 gInputErrorMessage = LibGetToken (STRING_TOKEN (INPUT_ERROR_MESSAGE), mCDLStringPackHandle); 707 707 708 708 // 709 709 // SpaceBuffer; … … 746 746 FreePool (gNvUpdateMessage); 747 747 FreePool (gInputErrorMessage); 748 748 749 749 FreePool (mSpaceBuffer); 750 750 } … … 775 775 continue; 776 776 } 777 777 778 778 gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index); 779 779 } … … 821 821 UINTN 822 822 PrintInternal ( 823 IN UINTN Width, 823 IN UINTN Width, 824 824 IN UINTN Column, 825 825 IN UINTN Row, -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
r58464 r58466 4 4 5 5 Copyright (c) 2013, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials are licensed and made available under 7 the terms and conditions of the BSD License that accompanies this distribution. 6 This program and the accompanying materials are licensed and made available under 7 the terms and conditions of the BSD License that accompanies this distribution. 8 8 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, 9 http://opensource.org/licenses/bsd-license.php. 10 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 … … 122 122 123 123 @param[in] FormData Form Data to be shown in Page 124 125 **/ 126 VOID 127 PrintBannerInfo ( 124 125 **/ 126 VOID 127 PrintBannerInfo ( 128 128 IN FORM_DISPLAY_ENGINE_FORM *FormData 129 129 ); … … 148 148 149 149 **/ 150 EFI_STATUS 150 EFI_STATUS 151 151 ScreenDiemensionInfoValidate ( 152 152 IN FORM_DISPLAY_ENGINE_FORM *FormData … … 202 202 IN BOOLEAN SetState 203 203 ); 204 204 205 205 /** 206 206 Get step info from numeric opcode. 207 207 208 208 @param[in] OpCode The input numeric op code. 209 209 … … 286 286 /** 287 287 Process some op codes which is out side of current form. 288 288 289 289 @param FormData Pointer to the form data. 290 290 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.c
r48674 r58466 16 16 17 17 /** 18 The firmware checks whether the capsule image is supported 18 The firmware checks whether the capsule image is supported 19 19 by the CapsuleGuid in CapsuleHeader or other specific information in capsule image. 20 20 21 21 @param CapsuleHeader Point to the UEFI capsule image to be checked. 22 22 23 23 @retval EFI_UNSUPPORTED Input capsule is not supported by the firmware. 24 24 **/ … … 35 35 The firmware specific implementation processes the capsule image 36 36 if it recognized the format of this capsule image. 37 38 @param CapsuleHeader Point to the UEFI capsule image to be processed. 39 37 38 @param CapsuleHeader Point to the UEFI capsule image to be processed. 39 40 40 @retval EFI_UNSUPPORTED Capsule image is not supported by the firmware. 41 41 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
r58459 r58466 3 3 # The implementation borrows the DxeCore Memory Allocation services as the primitive 4 4 # for memory allocation instead of using UEFI boot servces in an indirect way. 5 # It is assumed that this library instance must be linked with DxeCore in this package. 5 # It is assumed that this library instance must be linked with DxeCore in this package. 6 6 # 7 7 # Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR> … … 25 25 VERSION_STRING = 1.0 26 26 LIBRARY_CLASS = MemoryAllocationLib|DXE_CORE 27 27 28 28 # 29 29 # The following information is for reference only and not required by the build tools. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationServices.h
r48674 r58466 3 3 4 4 This header file borrows the DxeCore Memory Allocation services as the primitive 5 for memory allocation. 5 for memory allocation. 6 6 7 7 Copyright (c) 2008, 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 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/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 - 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 **/ … … 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 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 = CoreAllocatePages (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 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 ) … … 464 464 VOID * 465 465 InternalAllocateZeroPool ( 466 IN EFI_MEMORY_TYPE PoolType, 466 IN EFI_MEMORY_TYPE PoolType, 467 467 IN UINTN AllocationSize 468 ) 468 ) 469 469 { 470 470 VOID *Memory; … … 551 551 is not enough memory remaining to satisfy the request, then NULL is returned. 552 552 If Buffer is NULL, then ASSERT(). 553 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 553 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 554 554 555 555 @param PoolType The type of pool to allocate. … … 562 562 VOID * 563 563 InternalAllocateCopyPool ( 564 IN EFI_MEMORY_TYPE PoolType, 564 IN EFI_MEMORY_TYPE PoolType, 565 565 IN UINTN AllocationSize, 566 566 IN CONST VOID *Buffer 567 ) 567 ) 568 568 { 569 569 VOID *Memory; … … 577 577 } 578 578 return Memory; 579 } 579 } 580 580 581 581 /** … … 586 586 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 587 587 is not enough memory remaining to satisfy the request, then NULL is returned. 588 588 589 589 If Buffer is NULL, then ASSERT(). 590 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 590 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 591 591 592 592 @param AllocationSize The number of bytes to allocate and zero. … … 613 613 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 614 614 is not enough memory remaining to satisfy the request, then NULL is returned. 615 615 616 616 If Buffer is NULL, then ASSERT(). 617 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 617 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 618 618 619 619 @param AllocationSize The number of bytes to allocate and zero. … … 640 640 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 641 641 is not enough memory remaining to satisfy the request, then NULL is returned. 642 642 643 643 If Buffer is NULL, then ASSERT(). 644 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 644 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 645 645 646 646 @param AllocationSize The number of bytes to allocate and zero. … … 664 664 665 665 Allocates and zeros the number bytes specified by NewSize from memory of the type 666 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 667 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 668 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 669 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 666 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 667 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 668 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 669 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 670 670 enough memory remaining to satisfy the request, then NULL is returned. 671 671 672 672 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize 673 673 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). … … 676 676 @param OldSize The size, in bytes, of OldBuffer. 677 677 @param NewSize The size, in bytes, of the buffer to reallocate. 678 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 678 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 679 679 parameter that may be NULL. 680 680 … … 684 684 VOID * 685 685 InternalReallocatePool ( 686 IN EFI_MEMORY_TYPE PoolType, 686 IN EFI_MEMORY_TYPE PoolType, 687 687 IN UINTN OldSize, 688 688 IN UINTN NewSize, … … 704 704 705 705 Allocates and zeros the number bytes specified by NewSize from memory of type 706 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 707 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 708 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 709 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 706 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 707 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 708 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 709 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 710 710 enough memory remaining to satisfy the request, then NULL is returned. 711 711 712 712 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize 713 713 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). … … 715 715 @param OldSize The size, in bytes, of OldBuffer. 716 716 @param NewSize The size, in bytes, of the buffer to reallocate. 717 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 717 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 718 718 parameter that may be NULL. 719 719 … … 736 736 737 737 Allocates and zeros the number bytes specified by NewSize from memory of type 738 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 739 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 740 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 741 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 738 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 739 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 740 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 741 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 742 742 enough memory remaining to satisfy the request, then NULL is returned. 743 743 … … 747 747 @param OldSize The size, in bytes, of OldBuffer. 748 748 @param NewSize The size, in bytes, of the buffer to reallocate. 749 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 749 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 750 750 parameter that may be NULL. 751 751 … … 768 768 769 769 Allocates and zeros the number bytes specified by NewSize from memory of type 770 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and 771 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 772 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 773 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 770 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and 771 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 772 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 773 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 774 774 enough memory remaining to satisfy the request, then NULL is returned. 775 775 … … 779 779 @param OldSize The size, in bytes, of OldBuffer. 780 780 @param NewSize The size, in bytes, of the buffer to reallocate. 781 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 781 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 782 782 parameter that may be NULL. 783 783 … … 803 803 pool allocation services of the Memory Allocation Library. If it is not possible to free pool 804 804 resources, then this function will perform no actions. 805 805 806 806 If Buffer was not allocated with a pool allocation function in the Memory Allocation Library, 807 807 then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
r58459 r58466 4 4 This library provides the performance measurement interfaces and initializes performance 5 5 logging for DXE phase. It first initializes its private global data structure for 6 performance logging and saves the performance GUIDed HOB passed from PEI phase. 6 performance logging and saves the performance GUIDed HOB passed from PEI phase. 7 7 It initializes DXE phase performance logging by publishing the Performance and PerformanceEx Protocol, 8 8 which are consumed by DxePerformanceLib to logging performance data in DXE phase. … … 32 32 33 33 // 34 // The current maximum number of logging entries. If current number of 34 // The current maximum number of logging entries. If current number of 35 35 // entries exceeds this value, it will re-allocate a larger array and 36 36 // migration the old data to the larger array. … … 654 654 EFIAPI 655 655 GetPerformanceMeasurementEx ( 656 IN UINTN LogEntryKey, 656 IN UINTN LogEntryKey, 657 657 OUT CONST VOID **Handle, 658 658 OUT CONST CHAR8 **Token, … … 667 667 668 668 GaugeData = NULL; 669 669 670 670 ASSERT (Handle != NULL); 671 671 ASSERT (Token != NULL); -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
r58459 r58466 1 1 ## @file 2 2 # Performance library instance mainly for DxeCore usage. 3 # 3 # 4 4 # This library provides the performance measurement interfaces and initializes performance 5 5 # logging for DXE phase. It first initializes its private global data structure for 6 # performance logging and saves the performance GUIDed HOB passed from PEI phase. 6 # performance logging and saves the performance GUIDed HOB passed from PEI phase. 7 7 # It initializes DXE phase performance logging by publishing the Performance and PerformanceEx Protocol, 8 8 # which is consumed by DxePerformanceLib to logging performance data in DXE phase. 9 9 # This library is mainly used by DxeCore to start performance logging to ensure that 10 10 # Performance and PerformanceEx Protocol are installed at the very beginning of DXE phase. 11 # 11 # 12 12 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 13 13 # This program and the accompanying materials … … 15 15 # which accompanies this distribution. The full text of the license may be found at 16 16 # http://opensource.org/licenses/bsd-license.php 17 # 17 # 18 18 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 19 19 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 20 # 20 # 21 21 ## 22 22 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h
r48674 r58466 15 15 16 16 **/ 17 17 18 18 #ifndef _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_ 19 19 #define _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
r48674 r58466 1 1 /** @file 2 2 3 This library registers CRC32 guided section handler 3 This library registers CRC32 guided section handler 4 4 to parse CRC32 encapsulation section and extract raw data. 5 5 It uses UEFI boot service CalculateCrc32 to authenticate 32 bit CRC value. 6 6 7 7 Copyright (c) 2007 - 2011, 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 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. 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 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 **/ … … 40 40 41 41 GetInfo gets raw data size and attribute of the input guided section. 42 It first checks whether the input guid section is supported. 42 It first checks whether the input guid section is supported. 43 43 If not, EFI_INVALID_PARAMETER will return. 44 44 … … 48 48 @param SectionAttribute The attribute of the input guided section. 49 49 50 @retval EFI_SUCCESS The size of destination buffer, the size of scratch buffer and 50 @retval EFI_SUCCESS The size of destination buffer, the size of scratch buffer and 51 51 the attribute of the input section are successull retrieved. 52 52 @retval EFI_INVALID_PARAMETER The GUID in InputSection does not match this instance guid. … … 101 101 Extraction handler tries to extract raw data from the input guided section. 102 102 It also does authentication check for 32bit CRC value in the input guided section. 103 It first checks whether the input guid section is supported. 103 It first checks whether the input guid section is supported. 104 104 If not, EFI_INVALID_PARAMETER will return. 105 105 … … 138 138 return EFI_INVALID_PARAMETER; 139 139 } 140 140 141 141 // 142 142 // Get section Crc32 checksum. … … 160 160 return EFI_INVALID_PARAMETER; 161 161 } 162 162 163 163 // 164 164 // Get section Crc32 checksum. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
r58459 r58466 2 2 # Dxe Crc32 Guided Section Extract library. 3 3 # 4 # This library doesn't produce any library class. The constructor function uses 4 # This library doesn't produce any library class. The constructor function uses 5 5 # ExtractGuidedSectionLib service to register CRC32 guided section handler 6 6 # that parses CRC32 encapsulation section and extracts raw data. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c
r48674 r58466 1 1 /** @file 2 Debug Print Error Level library instance that provide compatibility with the 2 Debug Print Error Level library instance that provide compatibility with the 3 3 "err" shell command. This includes support for the Debug Mask Protocol 4 4 supports for global debug print error level mask stored in an EFI Variable. … … 33 33 34 34 @param This The protocol instance pointer. 35 @param CurrentDebugMask Pointer to the debug print error level mask that 35 @param CurrentDebugMask Pointer to the debug print error level mask that 36 36 is returned. 37 37 … … 46 46 EFIAPI 47 47 GetDebugMask ( 48 IN EFI_DEBUG_MASK_PROTOCOL *This, 49 IN OUT UINTN *CurrentDebugMask 48 IN EFI_DEBUG_MASK_PROTOCOL *This, 49 IN OUT UINTN *CurrentDebugMask 50 50 ); 51 51 … … 80 80 81 81 /// 82 /// Global variable that is set to TRUE after the first attempt is made to 82 /// Global variable that is set to TRUE after the first attempt is made to 83 83 /// retrieve the global error level mask through the EFI Varibale Services. 84 84 /// This variable prevents the EFI Variable Services from being called fort … … 92 92 /// set to the PcdDebugPrintErrorLevel value. If the EFI Variable exists that 93 93 /// contains the global debug print error level mask, then that overrides the 94 /// PcdDebugPrintErrorLevel value. The EFI Variable can optionally be 94 /// PcdDebugPrintErrorLevel value. The EFI Variable can optionally be 95 95 /// discovered via a HOB so early DXE drivers can access the variable. If the 96 /// Debug Mask Protocol SetDebugMask() service is called, then that overrides 96 /// Debug Mask Protocol SetDebugMask() service is called, then that overrides 97 97 /// the PcdDebugPrintErrorLevel and the EFI Variable setting. 98 98 /// … … 108 108 109 109 /** 110 The constructor function caches the PCI Express Base Address and creates a 110 The constructor function caches the PCI Express Base Address and creates a 111 111 Set Virtual Address Map event to convert physical address to virtual addresses. 112 112 113 113 @param ImageHandle The firmware allocated handle for the EFI image. 114 114 @param SystemTable A pointer to the EFI System Table. 115 115 116 116 @retval EFI_SUCCESS The constructor completed successfully. 117 117 @retval Other value The constructor did not complete successfully. … … 126 126 { 127 127 EFI_STATUS Status; 128 128 129 129 // 130 130 // Initialize the error level mask from PCD setting. 131 131 // 132 132 mDebugPrintErrorLevel = PcdGet32 (PcdDebugPrintErrorLevel); 133 133 134 134 // 135 135 // Install Debug Mask Protocol onto ImageHandle 136 // 136 // 137 137 mSystemTable = SystemTable; 138 138 Status = SystemTable->BootServices->InstallMultipleProtocolInterfaces ( … … 145 145 // Attempt to retrieve the global debug print error level mask from the EFI Variable 146 146 // If the EFI Variable can not be accessed when this module's library constructors are 147 // executed a HOB can be used to set the global debug print error level. If no value 147 // executed a HOB can be used to set the global debug print error level. If no value 148 148 // was found then the EFI Variable access will be reattempted on every DEBUG() print 149 149 // from this module until the EFI Variable services are available. 150 150 // 151 151 GetDebugPrintErrorLevel (); 152 152 153 153 return Status; 154 154 } 155 155 156 156 /** 157 The destructor function frees any allocated buffers and closes the Set Virtual 157 The destructor function frees any allocated buffers and closes the Set Virtual 158 158 Address Map event. 159 159 160 160 @param ImageHandle The firmware allocated handle for the EFI image. 161 161 @param SystemTable A pointer to the EFI System Table. 162 162 163 163 @retval EFI_SUCCESS The destructor completed successfully. 164 164 @retval Other value The destructor did not complete successfully. … … 174 174 // 175 175 // Uninstall the Debug Mask Protocol from ImageHandle 176 // 176 // 177 177 return SystemTable->BootServices->UninstallMultipleProtocolInterfaces ( 178 178 ImageHandle, … … 208 208 return PcdGet32 (PcdDebugPrintErrorLevel); 209 209 } 210 211 // 212 // Check to see if an attempt has been made to retrieve the global debug print 210 211 // 212 // Check to see if an attempt has been made to retrieve the global debug print 213 213 // error level mask. Since this library instance stores the global debug print 214 214 // error level mask in an EFI Variable, the EFI Variable should only be accessed 215 215 // once to reduce the overhead of reading the EFI Variable on every debug print 216 // 216 // 217 217 if (!mGlobalErrorLevelInitialized) { 218 218 // … … 223 223 if (CurrentTpl <= TPL_CALLBACK) { 224 224 // 225 // Attempt to retrieve the global debug print error level mask from the 225 // Attempt to retrieve the global debug print error level mask from the 226 226 // EFI Variable 227 227 // 228 228 Size = sizeof (GlobalErrorLevel); 229 229 Status = mSystemTable->RuntimeServices->GetVariable ( 230 DEBUG_MASK_VARIABLE_NAME, 231 &gEfiGenericVariableGuid, 232 NULL, 233 &Size, 230 DEBUG_MASK_VARIABLE_NAME, 231 &gEfiGenericVariableGuid, 232 NULL, 233 &Size, 234 234 &GlobalErrorLevel 235 235 ); … … 271 271 /** 272 272 Sets the global debug print error level mask fpr the entire platform. 273 273 274 274 @param ErrorLevel Global debug print error level 275 275 276 276 @retval TRUE The debug print error level mask was sucessfully set. 277 277 @retval FALSE The debug print error level mask could not be set. … … 305 305 Size = sizeof (GlobalErrorLevel); 306 306 Status = mSystemTable->RuntimeServices->SetVariable ( 307 DEBUG_MASK_VARIABLE_NAME, 308 &gEfiGenericVariableGuid, 307 DEBUG_MASK_VARIABLE_NAME, 308 &gEfiGenericVariableGuid, 309 309 (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS), 310 310 Size, … … 313 313 if (!EFI_ERROR (Status)) { 314 314 // 315 // If the EFI Variable was updated, then update the mask value for this 315 // If the EFI Variable was updated, then update the mask value for this 316 316 // module and return TRUE. 317 317 // 318 mGlobalErrorLevelInitialized = TRUE; 318 mGlobalErrorLevelInitialized = TRUE; 319 319 mDebugPrintErrorLevel = ErrorLevel; 320 320 return TRUE; … … 333 333 334 334 @param This The protocol instance pointer. 335 @param CurrentDebugMask Pointer to the debug print error level mask that 335 @param CurrentDebugMask Pointer to the debug print error level mask that 336 336 is returned. 337 337 … … 346 346 EFIAPI 347 347 GetDebugMask ( 348 IN EFI_DEBUG_MASK_PROTOCOL *This, 349 IN OUT UINTN *CurrentDebugMask 348 IN EFI_DEBUG_MASK_PROTOCOL *This, 349 IN OUT UINTN *CurrentDebugMask 350 350 ) 351 351 { … … 353 353 return EFI_INVALID_PARAMETER; 354 354 } 355 355 356 356 // 357 357 // Retrieve the current debug mask from mDebugPrintErrorLevel -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.inf
r58459 r58466 23 23 MODULE_TYPE = DXE_DRIVER 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = DebugPrintErrorLevelLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER UEFI_APPLICATION UEFI_DRIVER 25 LIBRARY_CLASS = DebugPrintErrorLevelLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER UEFI_APPLICATION UEFI_DRIVER 26 26 CONSTRUCTOR = DxeDebugPrintErrorLevelLibConstructor 27 27 DESTRUCTOR = DxeDebugPrintErrorLevelLibDestructor … … 41 41 PcdLib 42 42 HobLib 43 43 44 44 [Protocols] 45 45 gEfiDebugMaskProtocolGuid ## PRODUCES 46 46 47 47 [Guids] 48 48 ## SOMETIMES_PRODUCES ## Variable:L"EFIDebug" -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeDpcLib/DpcLib.c
r48674 r58466 1 1 /** @file 2 2 Help functions to access UDP service. 3 3 4 4 Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
r48674 r58466 78 78 {FALSE, TRUE}, // ICMP6_ERR_UNREACH_HOST 79 79 {TRUE, TRUE}, // ICMP6_ERR_UNREACH_PROTOCOL 80 {TRUE, TRUE}, // ICMP6_ERR_UNREACH_PORT 80 {TRUE, TRUE}, // ICMP6_ERR_UNREACH_PORT 81 81 {TRUE, TRUE}, // ICMP6_ERR_PACKAGE_TOOBIG 82 82 {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_HOPLIMIT 83 83 {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_REASS 84 {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_HEADER 84 {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_HEADER 85 85 {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_NEXHEADER 86 86 {FALSE, TRUE} // ICMP6_ERR_PARAMPROB_IPV6OPTION … … 255 255 256 256 /** 257 This function handles ICMPv4 packets. It is the worker function of 257 This function handles ICMPv4 packets. It is the worker function of 258 258 IpIoIcmpHandler. 259 259 … … 380 380 IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, IpIo->RcvdContext); 381 381 382 return EFI_SUCCESS; 383 } 384 385 /** 386 This function handles ICMPv6 packets. It is the worker function of 382 return EFI_SUCCESS; 383 } 384 385 /** 386 This function handles ICMPv6 packets. It is the worker function of 387 387 IpIoIcmpHandler. 388 388 … … 428 428 // 429 429 // Analyze the ICMPv6 Error in this ICMPv6 packet 430 // 430 // 431 431 switch (Type) { 432 432 case ICMP_V6_DEST_UNREACHABLE: … … 487 487 488 488 return EFI_ABORTED; 489 } 489 } 490 490 491 491 // … … 498 498 PayLoadHdr = (UINT8 *) ((UINT8 *) IcmpHdr + sizeof (IP6_ICMP_ERROR_HEAD)); 499 499 Flag = TRUE; 500 500 501 501 do { 502 502 switch (NextHeader) { … … 536 536 537 537 TrimBytes = (UINT32) (PayLoadHdr - (UINT8 *) IcmpHdr); 538 538 539 539 NetbufTrim (Pkt, TrimBytes, TRUE); 540 540 … … 625 625 { 626 626 IP_IO_SEND_ENTRY *SndEntry; 627 EFI_EVENT Event; 627 EFI_EVENT Event; 628 628 EFI_STATUS Status; 629 629 NET_FRAGMENT *ExtFragment; … … 675 675 676 676 // 677 // Build a fragment table to contain the fragments in the packet. 677 // Build a fragment table to contain the fragments in the packet. 678 678 // 679 679 if (IpIo->IpVersion == IP_VERSION_4) { … … 732 732 Ip6TxData->ExtHdrsLength = 0; 733 733 Ip6TxData->ExtHdrs = NULL; 734 734 735 735 // 736 736 // Set the fields of SndToken … … 779 779 /** 780 780 Destroy the SndEntry. 781 781 782 782 This function pairs with IpIoCreateSndEntry(). 783 783 … … 1064 1064 goto CleanUp; 1065 1065 } 1066 1066 1067 1067 // 1068 1068 // Create a netbuffer representing IPv6 packet … … 1084 1084 // 1085 1085 CopyMem ( 1086 &Session.Source, 1086 &Session.Source, 1087 1087 &RxData->Ip6RxData.Header->SourceAddress, 1088 1088 sizeof(EFI_IPv6_ADDRESS) 1089 1089 ); 1090 1090 CopyMem ( 1091 &Session.Dest, 1092 &RxData->Ip6RxData.Header->DestinationAddress, 1091 &Session.Dest, 1092 &RxData->Ip6RxData.Header->DestinationAddress, 1093 1093 sizeof(EFI_IPv6_ADDRESS) 1094 1094 ); … … 1096 1096 Session.IpHdrLen = RxData->Ip6RxData.HeaderLength; 1097 1097 Session.IpVersion = IP_VERSION_6; 1098 } 1098 } 1099 1099 1100 1100 if (EFI_SUCCESS == Status) { … … 1118 1118 gBS->SignalEvent (RxData->Ip4RxData.RecycleSignal); 1119 1119 } else { 1120 gBS->SignalEvent (RxData->Ip6RxData.RecycleSignal); 1120 gBS->SignalEvent (RxData->Ip6RxData.RecycleSignal); 1121 1121 } 1122 1122 … … 1153 1153 /** 1154 1154 Create a new IP_IO instance. 1155 1155 1156 1156 This function uses IP4/IP6 service binding protocol in Controller to create 1157 1157 an IP4/IP6 child (aka IP4/IP6 instance). … … 1162 1162 binding protocol installed. 1163 1163 @param[in] IpVersion The version of the IP protocol to use, either 1164 IPv4 or IPv6. 1164 IPv4 or IPv6. 1165 1165 1166 1166 @return Pointer to a newly created IP_IO instance, or NULL if failed. … … 1217 1217 Image, 1218 1218 &IpIo->ChildHandle, 1219 IpVersion, 1219 IpVersion, 1220 1220 (VOID **)&(IpIo->Ip) 1221 1221 ); … … 1240 1240 /** 1241 1241 Open an IP_IO instance for use. 1242 1242 1243 1243 This function is called after IpIoCreate(). It is used for configuring the IP 1244 1244 instance and register the callbacks and their context data for sending and … … 1252 1252 @retval EFI_SUCCESS The IP_IO instance opened with OpenData 1253 1253 successfully. 1254 @retval EFI_ACCESS_DENIED The IP_IO instance is configured, avoid to 1254 @retval EFI_ACCESS_DENIED The IP_IO instance is configured, avoid to 1255 1255 reopen it. 1256 1256 @retval Others Error condition occurred. … … 1286 1286 1287 1287 Status = IpIo->Ip.Ip6->Configure ( 1288 IpIo->Ip.Ip6, 1288 IpIo->Ip.Ip6, 1289 1289 &OpenData->IpConfigData.Ip6CfgData 1290 1290 ); … … 1359 1359 /** 1360 1360 Stop an IP_IO instance. 1361 1361 1362 1362 This function is paired with IpIoOpen(). The IP_IO will be unconfigured and all 1363 1363 the pending send/receive tokens will be canceled. … … 1436 1436 /** 1437 1437 Destroy an IP_IO instance. 1438 1438 1439 1439 This function is paired with IpIoCreate(). The IP_IO will be closed first. 1440 1440 Resource will be freed afterwards. See IpIoCloseProtocolDestroyIpChild(). … … 1476 1476 /** 1477 1477 Send out an IP packet. 1478 1478 1479 1479 This function is called after IpIoOpen(). The data to be sent are wrapped in 1480 1480 Pkt. The IP instance wrapped in IpIo is used for sending by default but can be … … 1601 1601 /** 1602 1602 Add a new IP instance for sending data. 1603 1603 1604 1604 The function is used to add the IP_IO to the IP_IO sending list. The caller 1605 1605 can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send … … 1760 1760 if (((EFI_IP4_CONFIG_DATA *) IpConfigData)->UseDefaultAddress) { 1761 1761 Ip.Ip4->GetModeData ( 1762 Ip.Ip4, 1763 &Ip4ModeData, 1764 NULL, 1762 Ip.Ip4, 1763 &Ip4ModeData, 1764 NULL, 1765 1765 NULL 1766 1766 ); … … 1771 1771 1772 1772 CopyMem ( 1773 &IpInfo->Addr.Addr, 1774 &((EFI_IP4_CONFIG_DATA *) IpConfigData)->StationAddress, 1773 &IpInfo->Addr.Addr, 1774 &((EFI_IP4_CONFIG_DATA *) IpConfigData)->StationAddress, 1775 1775 sizeof (IP4_ADDR) 1776 1776 ); 1777 1777 CopyMem ( 1778 &IpInfo->PreMask.SubnetMask, 1778 &IpInfo->PreMask.SubnetMask, 1779 1779 &((EFI_IP4_CONFIG_DATA *) IpConfigData)->SubnetMask, 1780 1780 sizeof (IP4_ADDR) … … 1830 1830 Status = EFI_NO_MAPPING; 1831 1831 goto OnExit; 1832 } 1832 } 1833 1833 1834 1834 CopyMem ( 1835 &IpInfo->Addr, 1836 &Ip6ModeData.ConfigData.StationAddress, 1835 &IpInfo->Addr, 1836 &Ip6ModeData.ConfigData.StationAddress, 1837 1837 sizeof (EFI_IPv6_ADDRESS) 1838 1838 ); … … 1845 1845 Ip.Ip6->Configure (Ip.Ip6, NULL); 1846 1846 } 1847 } 1847 } 1848 1848 } else { 1849 1849 // … … 1863 1863 Destroy an IP instance maintained in IpIo->IpList for 1864 1864 sending purpose. 1865 1865 1866 1866 This function pairs with IpIoAddIp(). The IpInfo is previously created by 1867 1867 IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance … … 1935 1935 Find the first IP protocol maintained in IpIo whose local 1936 1936 address is the same as Src. 1937 1937 1938 1938 This function is called when the caller needs the IpIo to send data to the 1939 1939 specified Src. The IpIo was added previously by IpIoAddIp(). … … 1961 1961 IP_IO_IP_INFO *IpInfo; 1962 1962 1963 ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6)); 1963 ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6)); 1964 1964 1965 1965 NET_LIST_FOR_EACH (IpIoEntry, &mActiveIpIoList) { … … 1983 1983 if (EFI_IP6_EQUAL (&IpInfo->Addr.v6, &Src->v6)) { 1984 1984 *IpIo = IpIoPtr; 1985 return IpInfo; 1985 return IpInfo; 1986 1986 } 1987 } 1987 } 1988 1988 1989 1989 } … … 1999 1999 /** 2000 2000 Get the ICMP error map information. 2001 2001 2002 2002 The ErrorStatus will be returned. The IsHard and Notify are optional. If they 2003 2003 are not NULL, this routine will fill them. … … 2005 2005 @param[in] IcmpError IcmpError Type. 2006 2006 @param[in] IpVersion The version of the IP protocol to use, 2007 either IPv4 or IPv6. 2007 either IPv4 or IPv6. 2008 2008 @param[out] IsHard If TRUE, indicates that it is a hard error. 2009 2009 @param[out] Notify If TRUE, SockError needs to be notified. … … 2076 2076 case ICMP6_ERR_UNREACH_HOST: 2077 2077 case ICMP6_ERR_TIMXCEED_HOPLIMIT: 2078 case ICMP6_ERR_TIMXCEED_REASS: 2078 case ICMP6_ERR_TIMXCEED_REASS: 2079 2079 return EFI_HOST_UNREACHABLE; 2080 2080 2081 2081 case ICMP6_ERR_UNREACH_PROTOCOL: 2082 2082 return EFI_PROTOCOL_UNREACHABLE; 2083 2083 2084 2084 case ICMP6_ERR_UNREACH_PORT: 2085 2085 return EFI_PORT_UNREACHABLE; … … 2110 2110 2111 2111 This function is called when the caller needs the IpIo to refresh the existing 2112 IPv6 neighbor cache entries since the neighbor is considered reachable by the 2113 node has recently received a confirmation that packets sent recently to the 2114 neighbor were received by its IP layer. 2112 IPv6 neighbor cache entries since the neighbor is considered reachable by the 2113 node has recently received a confirmation that packets sent recently to the 2114 neighbor were received by its IP layer. 2115 2115 2116 2116 @param[in] IpIo Pointer to an IP_IO instance 2117 2117 @param[in] Neighbor The IP address of the neighbor 2118 2118 @param[in] Timeout Time in 100-ns units that this entry will 2119 remain in the neighbor cache. A value of 2120 zero means that the entry is permanent. 2121 A value of non-zero means that the entry is 2119 remain in the neighbor cache. A value of 2120 zero means that the entry is permanent. 2121 A value of non-zero means that the entry is 2122 2122 dynamic and will be deleted after Timeout. 2123 2123 … … 2125 2125 @retval EFI_NOT_STARTED The IpIo is not configured. 2126 2126 @retval EFI_INVALID_PARAMETER Neighbor Address is invalid. 2127 @retval EFI_NOT_FOUND The neighbor cache entry is not in the 2128 neighbor table. 2127 @retval EFI_NOT_FOUND The neighbor cache entry is not in the 2128 neighbor table. 2129 2129 @retval EFI_OUT_OF_RESOURCES Failed due to resource limit. 2130 2130 … … 2134 2134 IN IP_IO *IpIo, 2135 2135 IN EFI_IP_ADDRESS *Neighbor, 2136 IN UINT32 Timeout 2136 IN UINT32 Timeout 2137 2137 ) 2138 2138 { -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
r58459 r58466 1076 1076 If it hasn't been removed, then continue with the next node directly. 1077 1077 This function will end the iterate and return the CallBack's last return value if error happens, 1078 or retrun EFI_SUCCESS if 2 complete passes are made with no changes in the number of children in the list. 1078 or retrun EFI_SUCCESS if 2 complete passes are made with no changes in the number of children in the list. 1079 1079 1080 1080 @param[in] List The head of the list. … … 1163 1163 { 1164 1164 UINTN Index; 1165 1165 1166 1166 if (NumberOfChildren == 0 || ChildHandleBuffer == NULL) { 1167 1167 return FALSE; … … 1824 1824 continue; 1825 1825 } 1826 1826 1827 1827 // 1828 1828 // Disconnect the driver specified by ImageHandle from all … … 1836 1836 ); 1837 1837 } 1838 1838 1839 1839 // 1840 1840 // Uninstall all the protocols installed in the driver entry point 1841 // 1841 // 1842 1842 gBS->UninstallProtocolInterface ( 1843 1843 DriverBinding->DriverBindingHandle, … … 1845 1845 DriverBinding 1846 1846 ); 1847 1847 1848 1848 Status = gBS->HandleProtocol ( 1849 1849 DeviceHandleBuffer[Index], … … 2985 2985 if (*Ip6Str == ':') { 2986 2986 if (*(Ip6Str + 1) == ':') { 2987 if ((NodeCnt > 6) || 2987 if ((NodeCnt > 6) || 2988 2988 ((*(Ip6Str + 2) != '\0') && (AsciiStrHexToUintn (Ip6Str + 2) == 0))) { 2989 2989 // … … 2992 2992 return EFI_INVALID_PARAMETER; 2993 2993 } 2994 if ((NodeCnt == 6) && (*(Ip6Str + 2) != '\0') && 2994 if ((NodeCnt == 6) && (*(Ip6Str + 2) != '\0') && 2995 2995 (AsciiStrHexToUintn (Ip6Str + 2) != 0)) { 2996 2996 return EFI_INVALID_PARAMETER; … … 3050 3050 } 3051 3051 if (NodeVal != 0) { 3052 if ((*TempStr == '0') && 3053 ((*(TempStr + 2) == ':') || (*(TempStr + 3) == ':') || 3052 if ((*TempStr == '0') && 3053 ((*(TempStr + 2) == ':') || (*(TempStr + 3) == ':') || 3054 3054 (*(TempStr + 2) == '\0') || (*(TempStr + 3) == '\0'))) { 3055 3055 return EFI_INVALID_PARAMETER; 3056 3056 } 3057 if ((*TempStr == '0') && (*(TempStr + 4) != '\0') && 3058 (*(TempStr + 4) != ':')) { 3057 if ((*TempStr == '0') && (*(TempStr + 4) != '\0') && 3058 (*(TempStr + 4) != ':')) { 3059 3059 return EFI_INVALID_PARAMETER; 3060 3060 } 3061 3061 } else { 3062 if (((*TempStr == '0') && (*(TempStr + 1) == '0') && 3062 if (((*TempStr == '0') && (*(TempStr + 1) == '0') && 3063 3063 ((*(TempStr + 2) == ':') || (*(TempStr + 2) == '\0'))) || 3064 ((*TempStr == '0') && (*(TempStr + 1) == '0') && (*(TempStr + 2) == '0') && 3064 ((*TempStr == '0') && (*(TempStr + 1) == '0') && (*(TempStr + 2) == '0') && 3065 3065 ((*(TempStr + 3) == ':') || (*(TempStr + 3) == '\0')))) { 3066 3066 return EFI_INVALID_PARAMETER; … … 3070 3070 Cnt = 0; 3071 3071 while ((TempStr[Cnt] != ':') && (TempStr[Cnt] != '\0')) { 3072 Cnt++; 3072 Cnt++; 3073 3073 } 3074 3074 if (LeadZeroCnt == 0) { … … 3088 3088 return EFI_INVALID_PARAMETER; 3089 3089 } 3090 } 3090 } 3091 3091 3092 3092 Ip6Address->Addr[Index] = (UINT8) (NodeVal >> 8); … … 3292 3292 Convert one EFI_IPv6_ADDRESS to Null-terminated Unicode string. 3293 3293 The text representation of address is defined in RFC 4291. 3294 3294 3295 3295 @param[in] Ip6Address The pointer to the IPv6 address. 3296 3296 @param[out] String The buffer to return the converted string. 3297 3297 @param[in] StringSize The length in bytes of the input String. 3298 3298 3299 3299 @retval EFI_SUCCESS Convert to string successfully. 3300 3300 @retval EFI_INVALID_PARAMETER The input parameter is invalid. 3301 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result. BufferSize has been 3301 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result. BufferSize has been 3302 3302 updated with the size needed to complete the request. 3303 3303 **/ … … 3325 3325 // 3326 3326 // Convert the UINT8 array to an UINT16 array for easy handling. 3327 // 3327 // 3328 3328 ZeroMem (Ip6Addr, sizeof (Ip6Addr)); 3329 3329 for (Index = 0; Index < 16; Index++) { … … 3357 3357 } 3358 3358 } 3359 3359 3360 3360 if (CurrentZerosStart != DEFAULT_ZERO_START && CurrentZerosLength > 2) { 3361 3361 if (LongestZerosStart == DEFAULT_ZERO_START || LongestZerosLength < CurrentZerosLength) { … … 3378 3378 Ptr += UnicodeSPrint(Ptr, 10, L"%x", Ip6Addr[Index]); 3379 3379 } 3380 3380 3381 3381 if (LongestZerosStart != DEFAULT_ZERO_START && LongestZerosStart + LongestZerosLength == 8) { 3382 3382 *Ptr++ = L':'; … … 3432 3432 return EFI_NOT_FOUND; 3433 3433 } 3434 3434 3435 3435 // 3436 3436 // SMBIOS tables are byte packed so we need to do a byte copy to … … 3446 3446 // to skip one SMBIOS structure. 3447 3447 // 3448 3448 3449 3449 // 3450 3450 // Step 1: Skip over formatted section. 3451 3451 // 3452 3452 String = (CHAR8 *) (Smbios.Raw + Smbios.Hdr->Length); 3453 3453 3454 3454 // 3455 3455 // Step 2: Skip over unformated string section. … … 3469 3469 Smbios.Raw = (UINT8 *)++String; 3470 3470 break; 3471 } 3471 } 3472 3472 } while (TRUE); 3473 3473 } while (Smbios.Raw < SmbiosEnd.Raw); -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
r58459 r58466 53 53 [Guids] 54 54 ## SOMETIMES_PRODUCES ## UNDEFINED # HiiConstructConfigHdr EFI_NIC_IP4_CONFIG_VARIABLE 55 ## UNDEFINED # Device Path Node 56 gEfiNicIp4ConfigVariableGuid 55 ## UNDEFINED # Device Path Node 56 gEfiNicIp4ConfigVariableGuid 57 57 gEfiSmbiosTableGuid ## SOMETIMES_CONSUMES ## SystemTable 58 58 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeNetLib/NetBuffer.c
r48674 r58466 1844 1844 1845 1845 /** 1846 The function frees the net buffer which allocated by the IP protocol. It releases 1847 only the net buffer and doesn't call the external free function. 1848 1849 This function should be called after finishing the process of mIpSec->ProcessExt() 1850 for outbound traffic. The (EFI_IPSEC2_PROTOCOL)->ProcessExt() allocates a new 1846 The function frees the net buffer which allocated by the IP protocol. It releases 1847 only the net buffer and doesn't call the external free function. 1848 1849 This function should be called after finishing the process of mIpSec->ProcessExt() 1850 for outbound traffic. The (EFI_IPSEC2_PROTOCOL)->ProcessExt() allocates a new 1851 1851 buffer for the ESP, so there needs a function to free the old net buffer. 1852 1852 … … 1865 1865 1866 1866 if (Nbuf->RefCnt == 0) { 1867 1867 1868 1868 // 1869 1869 // Update Vector only when NBuf is to be released. That is, … … 1880 1880 1881 1881 // 1882 // If NET_VECTOR_OWN_FIRST is set, release the first block since it is 1882 // If NET_VECTOR_OWN_FIRST is set, release the first block since it is 1883 1883 // allocated by us 1884 1884 // … … 1887 1887 } 1888 1888 FreePool (Nbuf->Vector); 1889 FreePool (Nbuf); 1890 } 1891 } 1892 1889 FreePool (Nbuf); 1890 } 1891 } 1892 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c
r58459 r58466 225 225 EFIAPI 226 226 GetPerformanceMeasurementEx ( 227 IN UINTN LogEntryKey, 227 IN UINTN LogEntryKey, 228 228 OUT CONST VOID **Handle, 229 229 OUT CONST CHAR8 **Token, -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
r58459 r58466 1 1 ## @file 2 2 # Performance library instance used in DXE phase. 3 # 3 # 4 4 # This library instance provides infrastructure for DXE phase drivers to log performance 5 5 # data. It consumes PerformanceEx or Performance Protocol published by DxeCorePerformanceLib 6 6 # to log performance data. If both PerformanceEx and Performance Protocol are not available, 7 7 # it does not log any performance information. 8 # 8 # 9 9 # Copyright (c) 2006 - 2014, 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 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
r58459 r58466 2 2 Instance of Print Library based on gEfiPrint2ProtocolGuid. 3 3 4 Implement the print library instance by wrap the interface 4 Implement the print library instance by wrap the interface 5 5 provided in the Print2 protocol. This protocol is defined as the internal 6 protocol related to this implementation, not in the public spec. So, this 6 protocol related to this implementation, not in the public spec. So, this 7 7 library instance is only for this code base. 8 8 … … 31 31 /** 32 32 The constructor function caches the pointer to Print2 protocol. 33 33 34 34 The constructor function locates Print2 protocol from protocol database. 35 It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. 35 It will ASSERT() if that operation fails 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 64 64 /** 65 Worker function that converts a VA_LIST to a BASE_LIST based on a Null-terminated 65 Worker function that converts a VA_LIST to a BASE_LIST based on a Null-terminated 66 66 format string. 67 67 … … 130 130 131 131 switch (FormatCharacter) { 132 case '.': 133 case '-': 134 case '+': 135 case ' ': 136 case ',': 132 case '.': 133 case '-': 134 case '+': 135 case ' ': 136 case ',': 137 137 case '0': 138 138 case '1': … … 147 147 break; 148 148 case 'L': 149 case 'l': 149 case 'l': 150 150 Long = TRUE; 151 151 break; … … 156 156 // 157 157 // Make no output if Format string terminates unexpectedly when 158 // looking up for flag, width, precision and type. 158 // looking up for flag, width, precision and type. 159 159 // 160 160 Format -= BytesPerFormatCharacter; … … 166 166 break; 167 167 } 168 } 169 168 } 169 170 170 // 171 171 // Handle each argument type … … 222 222 223 223 /** 224 Produces a Null-terminated Unicode string in an output buffer based on 224 Produces a Null-terminated Unicode string in an output buffer based on 225 225 a Null-terminated Unicode format string and a VA_LIST argument list 226 226 227 227 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 228 and BufferSize. 229 The Unicode string is produced by parsing the format string specified by FormatString. 230 Arguments are pulled from the variable argument list specified by Marker based on the 231 contents of the format string. 228 and BufferSize. 229 The Unicode string is produced by parsing the format string specified by FormatString. 230 Arguments are pulled from the variable argument list specified by Marker based on the 231 contents of the format string. 232 232 The number of Unicode characters in the produced output buffer is returned not including 233 233 the Null-terminator. … … 238 238 If BufferSize > 1 and FormatString is NULL, then ASSERT(). 239 239 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT(). 240 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 240 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 241 241 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then 242 242 ASSERT(). … … 245 245 Null-terminator, then ASSERT(). 246 246 247 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 247 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 248 248 Unicode string. 249 249 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 250 250 @param FormatString Null-terminated Unicode format string. 251 251 @param Marker VA_LIST marker for the variable argument list. 252 252 253 253 @return The number of Unicode characters in the produced output buffer not including the 254 254 Null-terminator. … … 267 267 268 268 DxePrintLibPrint2ProtocolVaListToBaseList ( 269 FALSE, 270 (CHAR8 *)FormatString, 271 Marker, 272 (BASE_LIST)BaseListMarker, 269 FALSE, 270 (CHAR8 *)FormatString, 271 Marker, 272 (BASE_LIST)BaseListMarker, 273 273 sizeof (BaseListMarker) - 8 274 274 ); … … 278 278 279 279 /** 280 Produces a Null-terminated Unicode string in an output buffer based on 280 Produces a Null-terminated Unicode string in an output buffer based on 281 281 a Null-terminated Unicode format string and a BASE_LIST argument list 282 282 283 283 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 284 and BufferSize. 285 The Unicode string is produced by parsing the format string specified by FormatString. 286 Arguments are pulled from the variable argument list specified by Marker based on the 287 contents of the format string. 284 and BufferSize. 285 The Unicode string is produced by parsing the format string specified by FormatString. 286 Arguments are pulled from the variable argument list specified by Marker based on the 287 contents of the format string. 288 288 The number of Unicode characters in the produced output buffer is returned not including 289 289 the Null-terminator. … … 294 294 If BufferSize > 1 and FormatString is NULL, then ASSERT(). 295 295 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT(). 296 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 296 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 297 297 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then 298 298 ASSERT(). … … 301 301 Null-terminator, then ASSERT(). 302 302 303 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 303 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 304 304 Unicode string. 305 305 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 306 306 @param FormatString Null-terminated Unicode format string. 307 307 @param Marker BASE_LIST marker for the variable argument list. 308 308 309 309 @return The number of Unicode characters in the produced output buffer not including the 310 310 Null-terminator. … … 324 324 325 325 /** 326 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 326 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 327 327 Unicode format string and variable argument list. 328 328 329 329 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 330 330 and BufferSize. … … 339 339 If BufferSize > 1 and FormatString is NULL, then ASSERT(). 340 340 If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT(). 341 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 341 If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than 342 342 PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then 343 343 ASSERT(). … … 346 346 Null-terminator, then ASSERT(). 347 347 348 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 348 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 349 349 Unicode string. 350 350 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 351 351 @param FormatString Null-terminated Unicode format string. 352 @param ... Variable argument list whose contents are accessed based on the 352 @param ... Variable argument list whose contents are accessed based on the 353 353 format string specified by FormatString. 354 354 … … 378 378 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 379 379 ASCII format string and a VA_LIST argument list 380 380 381 381 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 382 382 and BufferSize. 383 383 The Unicode string is produced by parsing the format string specified by FormatString. 384 Arguments are pulled from the variable argument list specified by Marker based on the 384 Arguments are pulled from the variable argument list specified by Marker based on the 385 385 contents of the format string. 386 386 The number of Unicode characters in the produced output buffer is returned not including … … 398 398 Null-terminator, then ASSERT(). 399 399 400 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 400 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 401 401 Unicode string. 402 402 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 403 403 @param FormatString Null-terminated Unicode format string. 404 404 @param Marker VA_LIST marker for the variable argument list. 405 405 406 406 @return The number of Unicode characters in the produced output buffer not including the 407 407 Null-terminator. … … 420 420 421 421 DxePrintLibPrint2ProtocolVaListToBaseList ( 422 TRUE, 423 FormatString, 424 Marker, 425 (BASE_LIST)BaseListMarker, 422 TRUE, 423 FormatString, 424 Marker, 425 (BASE_LIST)BaseListMarker, 426 426 sizeof (BaseListMarker) - 8 427 427 ); … … 433 433 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 434 434 ASCII format string and a BASE_LIST argument list 435 435 436 436 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 437 437 and BufferSize. 438 438 The Unicode string is produced by parsing the format string specified by FormatString. 439 Arguments are pulled from the variable argument list specified by Marker based on the 439 Arguments are pulled from the variable argument list specified by Marker based on the 440 440 contents of the format string. 441 441 The number of Unicode characters in the produced output buffer is returned not including … … 453 453 Null-terminator, then ASSERT(). 454 454 455 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 455 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 456 456 Unicode string. 457 457 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 458 458 @param FormatString Null-terminated Unicode format string. 459 459 @param Marker BASE_LIST marker for the variable argument list. 460 460 461 461 @return The number of Unicode characters in the produced output buffer not including the 462 462 Null-terminator. … … 476 476 477 477 /** 478 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 478 Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated 479 479 ASCII format string and variable argument list. 480 480 481 481 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 482 482 and BufferSize. 483 483 The Unicode string is produced by parsing the format string specified by FormatString. 484 Arguments are pulled from the variable argument list based on the contents of the 484 Arguments are pulled from the variable argument list based on the contents of the 485 485 format string. 486 486 The number of Unicode characters in the produced output buffer is returned not including … … 498 498 Null-terminator, then ASSERT(). 499 499 500 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 500 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 501 501 Unicode string. 502 502 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 503 503 @param FormatString Null-terminated Unicode format string. 504 @param ... Variable argument list whose contents are accessed based on the 504 @param ... Variable argument list whose contents are accessed based on the 505 505 format string specified by FormatString. 506 506 507 507 @return The number of Unicode characters in the produced output buffer not including the 508 508 Null-terminator. … … 529 529 /** 530 530 Converts a decimal value to a Null-terminated Unicode string. 531 532 Converts the decimal number specified by Value to a Null-terminated Unicode 533 string specified by Buffer containing at most Width characters. No padding of spaces 531 532 Converts the decimal number specified by Value to a Null-terminated Unicode 533 string specified by Buffer containing at most Width characters. No padding of spaces 534 534 is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed. 535 535 The number of Unicode characters in Buffer is returned not including the Null-terminator. 536 536 If the conversion contains more than Width characters, then only the first 537 Width characters are returned, and the total number of characters 537 Width characters are returned, and the total number of characters 538 538 required to perform the conversion is returned. 539 Additional conversion parameters are specified in Flags. 540 539 Additional conversion parameters are specified in Flags. 540 541 541 The Flags bit LEFT_JUSTIFY is always ignored. 542 542 All conversions are left justified in Buffer. … … 544 544 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas 545 545 are inserted every 3rd digit starting from the right. 546 If RADIX_HEX is set in Flags, then the output buffer will be 546 If RADIX_HEX is set in Flags, then the output buffer will be 547 547 formatted in hexadecimal format. 548 548 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'. 549 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 550 then Buffer is padded with '0' characters so the combination of the optional '-' 549 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 550 then Buffer is padded with '0' characters so the combination of the optional '-' 551 551 sign character, '0' characters, digit characters for Value, and the Null-terminator 552 552 add up to Width characters. … … 564 564 @param Width The maximum number of Unicode characters to place in Buffer, not including 565 565 the Null-terminator. 566 566 567 567 @return The number of Unicode characters in Buffer not including the Null-terminator. 568 568 … … 583 583 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 584 584 ASCII format string and a VA_LIST argument list. 585 585 586 586 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 587 587 and BufferSize. 588 588 The ASCII string is produced by parsing the format string specified by FormatString. 589 Arguments are pulled from the variable argument list specified by Marker based on 589 Arguments are pulled from the variable argument list specified by Marker based on 590 590 the contents of the format string. 591 591 The number of ASCII characters in the produced output buffer is returned not including … … 602 602 Null-terminator, then ASSERT(). 603 603 604 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 604 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 605 605 ASCII string. 606 606 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 607 607 @param FormatString Null-terminated Unicode format string. 608 608 @param Marker VA_LIST marker for the variable argument list. 609 609 610 610 @return The number of ASCII characters in the produced output buffer not including the 611 611 Null-terminator. … … 624 624 625 625 DxePrintLibPrint2ProtocolVaListToBaseList ( 626 TRUE, 627 FormatString, 628 Marker, 629 (BASE_LIST)BaseListMarker, 626 TRUE, 627 FormatString, 628 Marker, 629 (BASE_LIST)BaseListMarker, 630 630 sizeof (BaseListMarker) - 8 631 631 ); … … 637 637 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 638 638 ASCII format string and a BASE_LIST argument list. 639 639 640 640 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 641 641 and BufferSize. 642 642 The ASCII string is produced by parsing the format string specified by FormatString. 643 Arguments are pulled from the variable argument list specified by Marker based on 643 Arguments are pulled from the variable argument list specified by Marker based on 644 644 the contents of the format string. 645 645 The number of ASCII characters in the produced output buffer is returned not including … … 656 656 Null-terminator, then ASSERT(). 657 657 658 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 658 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 659 659 ASCII string. 660 660 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 661 661 @param FormatString Null-terminated Unicode format string. 662 662 @param Marker BASE_LIST marker for the variable argument list. 663 663 664 664 @return The number of ASCII characters in the produced output buffer not including the 665 665 Null-terminator. … … 681 681 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 682 682 ASCII format string and variable argument list. 683 683 684 684 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 685 685 and BufferSize. 686 686 The ASCII string is produced by parsing the format string specified by FormatString. 687 Arguments are pulled from the variable argument list based on the contents of the 687 Arguments are pulled from the variable argument list based on the contents of the 688 688 format string. 689 689 The number of ASCII characters in the produced output buffer is returned not including … … 700 700 Null-terminator, then ASSERT(). 701 701 702 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 702 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 703 703 ASCII string. 704 704 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 705 705 @param FormatString Null-terminated Unicode format string. 706 @param ... Variable argument list whose contents are accessed based on the 706 @param ... Variable argument list whose contents are accessed based on the 707 707 format string specified by FormatString. 708 708 … … 732 732 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 733 733 ASCII format string and a VA_LIST argument list. 734 734 735 735 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 736 736 and BufferSize. 737 737 The ASCII string is produced by parsing the format string specified by FormatString. 738 Arguments are pulled from the variable argument list specified by Marker based on 738 Arguments are pulled from the variable argument list specified by Marker based on 739 739 the contents of the format string. 740 740 The number of ASCII characters in the produced output buffer is returned not including … … 752 752 Null-terminator, then ASSERT(). 753 753 754 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 754 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 755 755 ASCII string. 756 756 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 757 757 @param FormatString Null-terminated Unicode format string. 758 758 @param Marker VA_LIST marker for the variable argument list. 759 759 760 760 @return The number of ASCII characters in the produced output buffer not including the 761 761 Null-terminator. … … 774 774 775 775 DxePrintLibPrint2ProtocolVaListToBaseList ( 776 FALSE, 777 (CHAR8 *)FormatString, 778 Marker, 779 (BASE_LIST)BaseListMarker, 776 FALSE, 777 (CHAR8 *)FormatString, 778 Marker, 779 (BASE_LIST)BaseListMarker, 780 780 sizeof (BaseListMarker) - 8 781 781 ); … … 787 787 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 788 788 ASCII format string and a BASE_LIST argument list. 789 789 790 790 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 791 791 and BufferSize. 792 792 The ASCII string is produced by parsing the format string specified by FormatString. 793 Arguments are pulled from the variable argument list specified by Marker based on 793 Arguments are pulled from the variable argument list specified by Marker based on 794 794 the contents of the format string. 795 795 The number of ASCII characters in the produced output buffer is returned not including … … 807 807 Null-terminator, then ASSERT(). 808 808 809 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 809 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 810 810 ASCII string. 811 811 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 812 812 @param FormatString Null-terminated Unicode format string. 813 813 @param Marker BASE_LIST marker for the variable argument list. 814 814 815 815 @return The number of ASCII characters in the produced output buffer not including the 816 816 Null-terminator. … … 832 832 Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated 833 833 ASCII format string and variable argument list. 834 834 835 835 Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer 836 836 and BufferSize. 837 837 The ASCII string is produced by parsing the format string specified by FormatString. 838 Arguments are pulled from the variable argument list based on the contents of the 838 Arguments are pulled from the variable argument list based on the contents of the 839 839 format string. 840 840 The number of ASCII characters in the produced output buffer is returned not including … … 852 852 Null-terminator, then ASSERT(). 853 853 854 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 854 @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated 855 855 ASCII string. 856 856 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. 857 857 @param FormatString Null-terminated Unicode format string. 858 @param ... Variable argument list whose contents are accessed based on the 858 @param ... Variable argument list whose contents are accessed based on the 859 859 format string specified by FormatString. 860 860 … … 884 884 /** 885 885 Converts a decimal value to a Null-terminated ASCII string. 886 887 Converts the decimal number specified by Value to a Null-terminated ASCII string 888 specified by Buffer containing at most Width characters. No padding of spaces 886 887 Converts the decimal number specified by Value to a Null-terminated ASCII string 888 specified by Buffer containing at most Width characters. No padding of spaces 889 889 is ever performed. 890 890 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed. … … 893 893 characters are returned, and the total number of characters required to perform 894 894 the conversion is returned. 895 Additional conversion parameters are specified in Flags. 895 Additional conversion parameters are specified in Flags. 896 896 The Flags bit LEFT_JUSTIFY is always ignored. 897 897 All conversions are left justified in Buffer. … … 899 899 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas 900 900 are inserted every 3rd digit starting from the right. 901 If RADIX_HEX is set in Flags, then the output buffer will be 901 If RADIX_HEX is set in Flags, then the output buffer will be 902 902 formatted in hexadecimal format. 903 903 If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'. 904 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 905 then Buffer is padded with '0' characters so the combination of the optional '-' 904 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, 905 then Buffer is padded with '0' characters so the combination of the optional '-' 906 906 sign character, '0' characters, digit characters for Value, and the Null-terminator 907 907 add up to Width characters. 908 908 909 909 If Buffer is NULL, then ASSERT(). 910 910 If unsupported bits are set in Flags, then ASSERT(). … … 918 918 @param Width The maximum number of ASCII characters to place in Buffer, not including 919 919 the Null-terminator. 920 920 921 921 @return The number of ASCII characters in Buffer not including the Null-terminator. 922 922 … … 978 978 CHAR8 * 979 979 InternalPrintLibValueToString ( 980 IN OUT CHAR8 *Buffer, 981 IN INT64 Value, 980 IN OUT CHAR8 *Buffer, 981 IN INT64 Value, 982 982 IN UINTN Radix 983 983 ) … … 1001 1001 1002 1002 /** 1003 Worker function that produces a Null-terminated string in an output buffer 1003 Worker function that produces a Null-terminated string in an output buffer 1004 1004 based on a Null-terminated format string and a VA_LIST argument list. 1005 1005 1006 VSPrint function to process format and place the results in Buffer. Since a 1007 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 1006 VSPrint function to process format and place the results in Buffer. Since a 1007 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 1008 1008 this is the main print working routine. 1009 1009 1010 1010 If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all. 1011 1011 1012 @param[out] Buffer The character buffer to print the results of the 1012 @param[out] Buffer The character buffer to print the results of the 1013 1013 parsing of Format into. 1014 @param[in] BufferSize The maximum number of characters to put into 1014 @param[in] BufferSize The maximum number of characters to put into 1015 1015 buffer. 1016 1016 @param[in] Flags Initial flags value. 1017 Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 1017 Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 1018 1018 and COUNT_ONLY_NO_PRINT set. 1019 1019 @param[in] Format A Null-terminated format string. … … 1039 1039 1040 1040 /** 1041 Worker function that produces a Null-terminated string in an output buffer 1041 Worker function that produces a Null-terminated string in an output buffer 1042 1042 based on a Null-terminated format string and variable argument list. 1043 1043 1044 VSPrint function to process format and place the results in Buffer. Since a 1045 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 1044 VSPrint function to process format and place the results in Buffer. Since a 1045 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 1046 1046 this is the main print working routine 1047 1047 … … 1129 1129 @param Buffer The buffer to place the Unicode or ASCII string. 1130 1130 @param EndBuffer The end of the input Buffer. No characters will be 1131 placed after that. 1131 placed after that. 1132 1132 @param Length The count of character to be placed into Buffer. 1133 1133 (Negative value indicates no buffer fill.) … … 1148 1148 { 1149 1149 INTN Index; 1150 1150 1151 1151 for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) { 1152 1152 *Buffer = (CHAR8) Character; … … 1161 1161 1162 1162 /** 1163 Worker function that produces a Null-terminated string in an output buffer 1163 Worker function that produces a Null-terminated string in an output buffer 1164 1164 based on a Null-terminated format string and a VA_LIST argument list. 1165 1165 1166 VSPrint function to process format and place the results in Buffer. Since a 1167 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 1166 VSPrint function to process format and place the results in Buffer. Since a 1167 VA_LIST is used this routine allows the nesting of Vararg routines. Thus 1168 1168 this is the main print working routine. 1169 1169 1170 1170 If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all. 1171 1171 1172 @param[out] Buffer The character buffer to print the results of the 1172 @param[out] Buffer The character buffer to print the results of the 1173 1173 parsing of Format into. 1174 @param[in] BufferSize The maximum number of characters to put into 1174 @param[in] BufferSize The maximum number of characters to put into 1175 1175 buffer. 1176 1176 @param[in] Flags Initial flags value. 1177 Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 1177 Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 1178 1178 and COUNT_ONLY_NO_PRINT set. 1179 1179 @param[in] Format A Null-terminated format string. … … 1231 1231 // 1232 1232 // If you change this code be sure to match the 2 versions of this function. 1233 // Nearly identical logic is found in the BasePrintLib and 1233 // Nearly identical logic is found in the BasePrintLib and 1234 1234 // DxePrintLibPrint2Protocol (both PrintLib instances). 1235 1235 // … … 1275 1275 // 1276 1276 // Make sure format string cannot contain more than PcdMaximumUnicodeStringLength 1277 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 1277 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 1278 1278 // 1279 1279 ASSERT (StrSize ((CHAR16 *) Format) != 0); … … 1283 1283 // 1284 1284 // Make sure format string cannot contain more than PcdMaximumAsciiStringLength 1285 // Ascii characters if PcdMaximumAsciiStringLength is not zero. 1285 // Ascii characters if PcdMaximumAsciiStringLength is not zero. 1286 1286 // 1287 1287 ASSERT (AsciiStrSize (Format) != 0); … … 1327 1327 FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask; 1328 1328 switch (FormatCharacter) { 1329 case '.': 1330 Flags |= PRECISION; 1329 case '.': 1330 Flags |= PRECISION; 1331 1331 break; 1332 case '-': 1333 Flags |= LEFT_JUSTIFY; 1332 case '-': 1333 Flags |= LEFT_JUSTIFY; 1334 1334 break; 1335 case '+': 1336 Flags |= PREFIX_SIGN; 1335 case '+': 1336 Flags |= PREFIX_SIGN; 1337 1337 break; 1338 case ' ': 1339 Flags |= PREFIX_BLANK; 1338 case ' ': 1339 Flags |= PREFIX_BLANK; 1340 1340 break; 1341 case ',': 1342 Flags |= COMMA_TYPE; 1341 case ',': 1342 Flags |= COMMA_TYPE; 1343 1343 break; 1344 1344 case 'L': 1345 case 'l': 1346 Flags |= LONG_TYPE; 1345 case 'l': 1346 Flags |= LONG_TYPE; 1347 1347 break; 1348 1348 case '*': … … 1388 1388 } 1389 1389 break; 1390 1390 1391 1391 case '\0': 1392 1392 // 1393 1393 // Make no output if Format string terminates unexpectedly when 1394 // looking up for flag, width, precision and type. 1394 // looking up for flag, width, precision and type. 1395 1395 // 1396 1396 Format -= BytesPerFormatCharacter; … … 1403 1403 break; 1404 1404 } 1405 } 1405 } 1406 1406 1407 1407 // … … 1435 1435 // 'd','x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int". 1436 1436 // This assumption is made so the format string definition is compatible with the ANSI C 1437 // Specification for formatted strings. It is recommended that the Base Types be used 1438 // everywhere, but in this one case, compliance with ANSI C is more important, and 1439 // provides an implementation that is compatible with that largest possible set of CPU 1437 // Specification for formatted strings. It is recommended that the Base Types be used 1438 // everywhere, but in this one case, compliance with ANSI C is more important, and 1439 // provides an implementation that is compatible with that largest possible set of CPU 1440 1440 // architectures. This is why the type "int" is used in this one case. 1441 1441 // … … 1479 1479 // 'd','x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int". 1480 1480 // This assumption is made so the format string definition is compatible with the ANSI C 1481 // Specification for formatted strings. It is recommended that the Base Types be used 1482 // everywhere, but in this one case, compliance with ANSI C is more important, and 1483 // provides an implementation that is compatible with that largest possible set of CPU 1481 // Specification for formatted strings. It is recommended that the Base Types be used 1482 // everywhere, but in this one case, compliance with ANSI C is more important, and 1483 // provides an implementation that is compatible with that largest possible set of CPU 1484 1484 // architectures. This is why the type "unsigned int" is used in this one case. 1485 1485 // … … 1495 1495 } 1496 1496 ArgumentString = (CHAR8 *)ValueBuffer + Count; 1497 1497 1498 1498 Digits = Count % 3; 1499 1499 if (Digits != 0) { … … 1568 1568 InternalPrintLibSPrint ( 1569 1569 ValueBuffer, 1570 MAXIMUM_VALUE_CHARACTERS, 1570 MAXIMUM_VALUE_CHARACTERS, 1571 1571 0, 1572 1572 "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", … … 1589 1589 case 't': 1590 1590 if (BaseListMarker == NULL) { 1591 TmpTime = VA_ARG (VaListMarker, TIME *); 1591 TmpTime = VA_ARG (VaListMarker, TIME *); 1592 1592 } else { 1593 TmpTime = BASE_ARG (BaseListMarker, TIME *); 1593 TmpTime = BASE_ARG (BaseListMarker, TIME *); 1594 1594 } 1595 1595 if (TmpTime == NULL) { … … 1676 1676 } 1677 1677 break; 1678 1678 1679 1679 case '\r': 1680 1680 Format += BytesPerFormatCharacter; … … 1842 1842 // 1843 1843 // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength 1844 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 1844 // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 1845 1845 // 1846 1846 ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0)); 1847 1847 // 1848 1848 // Make sure output buffer cannot contain more than PcdMaximumAsciiStringLength 1849 // ASCII characters if PcdMaximumAsciiStringLength is not zero. 1849 // ASCII characters if PcdMaximumAsciiStringLength is not zero. 1850 1850 // 1851 1851 ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0)); … … 1855 1855 1856 1856 /** 1857 Returns the number of characters that would be produced by if the formatted 1857 Returns the number of characters that would be produced by if the formatted 1858 1858 output were produced not including the Null-terminator. 1859 1859 … … 1864 1864 @param[in] Marker VA_LIST marker for the variable argument list. 1865 1865 1866 @return The number of characters that would be produced, not including the 1866 @return The number of characters that would be produced, not including the 1867 1867 Null-terminator. 1868 1868 **/ … … 1879 1879 1880 1880 /** 1881 Returns the number of characters that would be produced by if the formatted 1881 Returns the number of characters that would be produced by if the formatted 1882 1882 output were produced not including the Null-terminator. 1883 1883 … … 1887 1887 @param[in] Marker VA_LIST marker for the variable argument list. 1888 1888 1889 @return The number of characters that would be produced, not including the 1889 @return The number of characters that would be produced, not including the 1890 1890 Null-terminator. 1891 1891 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
r48674 r58466 110 110 return mReportStatusCodeLibStatusCodeProtocol->ReportStatusCode (Type, Value, Instance, (EFI_GUID *)CallerId, Data); 111 111 } 112 112 113 113 return EFI_UNSUPPORTED; 114 114 } … … 506 506 Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL); 507 507 gBS->RestoreTPL (Tpl); 508 508 509 509 StatusCodeData = NULL; 510 510 if (Tpl <= TPL_NOTIFY) { -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
r58459 r58466 65 65 // 66 66 mSecurityTable = ReallocatePool ( 67 mMaxNumberOfSecurityHandler * sizeof (SECURITY_INFO), 68 (mMaxNumberOfSecurityHandler + SECURITY_HANDLER_TABLE_SIZE) * sizeof (SECURITY_INFO), 67 mMaxNumberOfSecurityHandler * sizeof (SECURITY_INFO), 68 (mMaxNumberOfSecurityHandler + SECURITY_HANDLER_TABLE_SIZE) * sizeof (SECURITY_INFO), 69 69 mSecurityTable 70 70 ); … … 85 85 86 86 /** 87 Check whether an operation is valid according to the requirement of current operation, 87 Check whether an operation is valid according to the requirement of current operation, 88 88 which must make sure that the measure image operation is the last one. 89 89 … … 99 99 IN UINT32 CheckAuthOperation 100 100 ) 101 { 101 { 102 102 // 103 103 // Make sure new auth operation can be recognized. 104 104 // 105 105 ASSERT ((CheckAuthOperation & ~(EFI_AUTH_IMAGE_OPERATION_MASK | EFI_AUTH_OPERATION_AUTHENTICATION_STATE | EFI_AUTH_OPERATION_IMAGE_REQUIRED)) == 0); 106 107 // 108 // When current operation includes measure image operation, 106 107 // 108 // When current operation includes measure image operation, 109 109 // only another measure image operation or none operation will be allowed. 110 110 // … … 117 117 } 118 118 } 119 120 // 121 // When current operation doesn't include measure image operation, 119 120 // 121 // When current operation doesn't include measure image operation, 122 122 // any new operation will be allowed. 123 123 // … … 181 181 If none of the handlers return an error, then EFI_SUCCESS is returned. 182 182 183 Before exectue handler, get the image buffer by file device path if a handler 183 Before exectue handler, get the image buffer by file device path if a handler 184 184 requires the image file. And return the image buffer to each handler when exectue handler. 185 185 186 186 The handlers are executed in same order to their registered order. 187 187 188 @param[in] AuthenticationStatus 188 @param[in] AuthenticationStatus 189 189 This is the authentication type returned from the Section 190 190 Extraction protocol. See the Section Extraction Protocol … … 194 194 195 195 @retval EFI_SUCCESS The file specified by File did authenticate when more 196 than one security handler services were registered, 197 or the file did not authenticate when no security 198 handler service was registered. And the platform policy 196 than one security handler services were registered, 197 or the file did not authenticate when no security 198 handler service was registered. And the platform policy 199 199 dictates that the DXE Core may use File. 200 200 @retval EFI_INVALID_PARAMETER File is NULL. … … 220 220 VOID *FileBuffer; 221 221 UINTN FileSize; 222 222 223 223 if (FilePath == NULL) { 224 224 return EFI_INVALID_PARAMETER; … … 231 231 return EFI_SUCCESS; 232 232 } 233 233 234 234 Status = EFI_SUCCESS; 235 235 FileBuffer = NULL; … … 290 290 // 291 291 mSecurity2Table = ReallocatePool ( 292 mMaxNumberOfSecurity2Handler * sizeof (SECURITY2_INFO), 293 (mMaxNumberOfSecurity2Handler + SECURITY_HANDLER_TABLE_SIZE) * sizeof (SECURITY2_INFO), 292 mMaxNumberOfSecurity2Handler * sizeof (SECURITY2_INFO), 293 (mMaxNumberOfSecurity2Handler + SECURITY_HANDLER_TABLE_SIZE) * sizeof (SECURITY2_INFO), 294 294 mSecurity2Table 295 295 ); … … 310 310 311 311 /** 312 Check whether an operation is valid according to the requirement of current operation, 312 Check whether an operation is valid according to the requirement of current operation, 313 313 which must make sure that the measure image operation is the last one. 314 314 315 315 If AuthenticationOperation is not recongnized, return FALSE. 316 316 If AuthenticationOperation is EFI_AUTH_OPERATION_NONE, return FALSE. 317 317 If AuthenticationOperation includes security operation and authentication operation, return FALSE. 318 318 If the previous register handler can't be executed before the later register handler, return FALSE. 319 319 320 320 @param CurrentAuthOperation Current operation. 321 321 @param CheckAuthOperation Operation to be checked. 322 322 323 323 @retval TRUE Operation is valid for current operation. 324 324 @retval FALSE Operation is invalid for current operation. … … 329 329 IN UINT32 CheckAuthOperation 330 330 ) 331 { 331 { 332 332 // 333 333 // Make sure new auth operation can be recognized. … … 336 336 return FALSE; 337 337 } 338 if ((CheckAuthOperation & ~(EFI_AUTH_IMAGE_OPERATION_MASK | 339 EFI_AUTH_NONE_IMAGE_OPERATION_MASK | 338 if ((CheckAuthOperation & ~(EFI_AUTH_IMAGE_OPERATION_MASK | 339 EFI_AUTH_NONE_IMAGE_OPERATION_MASK | 340 340 EFI_AUTH_OPERATION_IMAGE_REQUIRED)) != 0) { 341 341 return FALSE; … … 343 343 344 344 // 345 // When current operation includes measure image operation, 345 // When current operation includes measure image operation, 346 346 // only another measure image or none image operation will be allowed. 347 347 // … … 354 354 } 355 355 } 356 356 357 357 // 358 358 // Any other operation will be allowed. … … 415 415 416 416 /** 417 Execute registered handlers based on input AuthenticationOperation until 418 one returns an error and that error is returned. 419 417 Execute registered handlers based on input AuthenticationOperation until 418 one returns an error and that error is returned. 419 420 420 If none of the handlers return an error, then EFI_SUCCESS is returned. 421 421 The handlers those satisfy AuthenticationOperation will only be executed. 422 422 The handlers are executed in same order to their registered order. 423 423 424 @param[in] AuthenticationOperation 424 @param[in] AuthenticationOperation 425 425 The operation type specifies which handlers will be executed. 426 @param[in] AuthenticationStatus 426 @param[in] AuthenticationStatus 427 427 The authentication status for the input file. 428 428 @param[in] File This is a pointer to the device path of the file that is … … 442 442 UEFI device drivers on the device path specified by DevicePath. 443 443 @retval EFI_SECURITY_VIOLATION The file specified by File or FileBuffer did not 444 authenticate, and the platform policy dictates that 444 authenticate, and the platform policy dictates that 445 445 the file should be placed in the untrusted state. 446 446 @retval EFI_SECURITY_VIOLATION FileBuffer FileBuffer is NULL and the user has no … … 453 453 the platform policy dictates that the DXE 454 454 Foundation may not use File. 455 @retval EFI_INVALID_PARAMETER File and FileBuffer are both NULL. 455 @retval EFI_INVALID_PARAMETER File and FileBuffer are both NULL. 456 456 **/ 457 457 EFI_STATUS -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
r58459 r58466 23 23 MODULE_TYPE = DXE_DRIVER 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = SecurityManagementLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 25 LIBRARY_CLASS = SecurityManagementLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 26 26 27 27 # … … 42 42 DebugLib 43 43 DxeServicesLib 44 44 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c
r58459 r58466 243 243 244 244 // 245 // Initialize communicate buffer 245 // Initialize communicate buffer 246 246 // 247 247 SmmCommBufferHeader = (EFI_SMM_COMMUNICATE_HEADER *)mSmmPerformanceBuffer; 248 248 SmmPerfCommData = (SMM_PERF_COMMUNICATE *)SmmCommBufferHeader->Data; 249 249 ZeroMem((UINT8*)SmmPerfCommData, sizeof(SMM_PERF_COMMUNICATE)); 250 250 251 251 CopyGuid (&SmmCommBufferHeader->HeaderGuid, &gSmmPerformanceProtocolGuid); 252 252 SmmCommBufferHeader->MessageLength = sizeof(SMM_PERF_COMMUNICATE); … … 263 263 264 264 mGaugeNumberOfEntries = SmmPerfCommData->NumberOfEntries; 265 265 266 266 DataSize = mGaugeNumberOfEntries * sizeof(GAUGE_DATA_ENTRY); 267 267 mGaugeData = AllocateZeroPool(DataSize); 268 268 ASSERT (mGaugeData != NULL); 269 269 270 270 // 271 271 // Get all SMM gauge data 272 // 272 // 273 273 SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_DATA; 274 274 SmmPerfCommData->LogEntryKey = 0; … … 313 313 314 314 // 315 // Initialize communicate buffer 315 // Initialize communicate buffer 316 316 // 317 317 SmmCommBufferHeader = (EFI_SMM_COMMUNICATE_HEADER *)mSmmPerformanceBuffer; 318 318 SmmPerfCommData = (SMM_PERF_COMMUNICATE_EX *)SmmCommBufferHeader->Data; 319 319 ZeroMem((UINT8*)SmmPerfCommData, sizeof(SMM_PERF_COMMUNICATE_EX)); 320 320 321 321 CopyGuid (&SmmCommBufferHeader->HeaderGuid, &gSmmPerformanceExProtocolGuid); 322 322 SmmCommBufferHeader->MessageLength = sizeof(SMM_PERF_COMMUNICATE_EX); … … 333 333 334 334 mGaugeNumberOfEntriesEx = SmmPerfCommData->NumberOfEntries; 335 335 336 336 DataSize = mGaugeNumberOfEntriesEx * sizeof(GAUGE_DATA_ENTRY_EX); 337 337 mGaugeDataEx = AllocateZeroPool(DataSize); 338 338 ASSERT (mGaugeDataEx != NULL); 339 339 340 340 // 341 341 // Get all SMM gauge data 342 // 342 // 343 343 SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_DATA; 344 344 SmmPerfCommData->LogEntryKey = 0; … … 351 351 mGaugeNumberOfEntriesEx = 0; 352 352 } 353 353 354 354 return mGaugeDataEx; 355 355 } … … 399 399 EFIAPI 400 400 GetPerformanceMeasurementEx ( 401 IN UINTN LogEntryKey, 401 IN UINTN LogEntryKey, 402 402 OUT CONST VOID **Handle, 403 403 OUT CONST CHAR8 **Token, -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf
r58459 r58466 1 1 ## @file 2 2 # Performance library instance used in DXE phase to dump SMM performance data. 3 # 3 # 4 4 # This library instance allows a DXE driver or UEFI application to dump the SMM performance data. 5 5 # StartPerformanceMeasurement(), EndPerformanceMeasurement(), StartPerformanceMeasurementEx() 6 6 # and EndPerformanceMeasurementEx() are not implemented. 7 # 7 # 8 8 # Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR> 9 9 # This program and the accompanying materials … … 11 11 # which accompanies this distribution. The full text of the license may be found at 12 12 # http://opensource.org/licenses/bsd-license.php 13 # 13 # 14 14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 15 15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 16 # 16 # 17 17 ## 18 18 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
r48674 r58466 24 24 25 25 /** 26 The common notify function associated with various TcpIo events. 26 The common notify function associated with various TcpIo events. 27 27 28 28 @param[in] Event The event signaled. … … 112 112 113 113 /** 114 Create a TCP socket with the specified configuration data. 114 Create a TCP socket with the specified configuration data. 115 115 116 116 @param[in] Image The handle of the driver image. … … 119 119 @param[in] ConfigData The Tcp configuration data. 120 120 @param[out] TcpIo The TcpIo. 121 121 122 122 @retval EFI_SUCCESS The TCP socket is created and configured. 123 123 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. … … 177 177 // 178 178 // Create the TCP child instance and get the TCP protocol. 179 // 179 // 180 180 Status = NetLibCreateServiceChild ( 181 181 Controller, … … 396 396 return Status; 397 397 } 398 398 399 399 /** 400 Destroy the socket. 400 Destroy the socket. 401 401 402 402 @param[in] TcpIo The TcpIo which wraps the socket to be destroyed. … … 532 532 @param[in, out] TcpIo The TcpIo wrapping the TCP socket. 533 533 @param[in] Timeout The time to wait for connection done. 534 534 535 535 @retval EFI_SUCCESS Connect to the other endpoint of the TCP socket 536 536 successfully. … … 600 600 @param[in] Timeout The time to wait for connection done. 601 601 602 602 603 603 @retval EFI_SUCCESS Connect to the other endpoint of the TCP socket 604 604 successfully. … … 608 608 609 609 @retval EFI_TIMEOUT Failed to connect to the other endpoint of the 610 TCP socket in the specified time period. 610 TCP socket in the specified time period. 611 611 @retval Others Other errors as indicated. 612 612 … … 662 662 663 663 // 664 // The new TCP instance handle created for the established connection is 664 // The new TCP instance handle created for the established connection is 665 665 // in ListenToken. 666 666 // … … 671 671 ProtocolGuid = &gEfiTcp6ProtocolGuid; 672 672 } 673 673 674 674 Status = gBS->OpenProtocol ( 675 675 TcpIo->ListenToken.Tcp4Token.NewChildHandle, … … 710 710 Tcp6 = NULL; 711 711 712 if (TcpIo->TcpVersion == TCP_VERSION_4) { 712 if (TcpIo->TcpVersion == TCP_VERSION_4) { 713 713 TcpIo->CloseToken.Tcp4Token.AbortOnClose = TRUE; 714 714 Tcp4 = TcpIo->Tcp.Tcp4; … … 735 735 } 736 736 737 737 738 738 /** 739 739 Transmit the Packet to the other endpoint of the socket. … … 741 741 @param[in] TcpIo The TcpIo wrapping the TCP socket. 742 742 @param[in] Packet The packet to transmit. 743 743 744 744 @retval EFI_SUCCESS The packet is trasmitted. 745 745 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. … … 770 770 if (TcpIo->TcpVersion == TCP_VERSION_4) { 771 771 772 Size = sizeof (EFI_TCP4_TRANSMIT_DATA) + 772 Size = sizeof (EFI_TCP4_TRANSMIT_DATA) + 773 773 (Packet->BlockOpNum - 1) * sizeof (EFI_TCP4_FRAGMENT_DATA); 774 774 } else if (TcpIo->TcpVersion == TCP_VERSION_6) { … … 816 816 goto ON_EXIT; 817 817 } 818 818 819 819 Status = Tcp4->Transmit (Tcp4, &TcpIo->TxToken.Tcp4Token); 820 820 } else { … … 920 920 921 921 if (Tcp6 == NULL) { 922 return EFI_DEVICE_ERROR; 922 return EFI_DEVICE_ERROR; 923 923 } 924 924 … … 952 952 Status = Tcp6->Receive (Tcp6, &TcpIo->RxToken.Tcp6Token); 953 953 } 954 954 955 955 if (EFI_ERROR (Status)) { 956 956 goto ON_EXIT; 957 957 } 958 958 959 959 while (!TcpIo->IsRxDone && ((Timeout == NULL) || EFI_ERROR (gBS->CheckEvent (Timeout)))) { 960 960 // -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
r58459 r58466 1 1 ## @file 2 2 # This library instance provides TCP services by EFI TCPv4/TCPv6 Protocols. 3 # 3 # 4 4 # Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # This program and the accompanying materials -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
r58459 r58466 1 1 ## @file 2 2 # This library instance provides UDP services by consuming EFI UDPv4/UDPv6 Protocols. 3 # 3 # 4 4 # Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # This program and the accompanying materials -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.c
r48674 r58466 104 104 @retval RETURN_SUCCESS the information is restored successfully. 105 105 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or one of Buffer and Length is NULL. 106 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 106 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 107 107 LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute. 108 108 @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
r58459 r58466 28 28 # The following information is for reference only and not required by the build tools. 29 29 # 30 # VALID_ARCHITECTURES = IA32 X64 30 # VALID_ARCHITECTURES = IA32 X64 31 31 # 32 32 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
r58464 r58466 1 1 /** @file 2 LZMA Decompress GUIDed Section Extraction Library, which produces LZMA custom 2 LZMA Decompress GUIDed Section Extraction Library, which produces LZMA custom 3 3 decompression algorithm with the converter for the different arch code. 4 4 It wraps Lzma decompress interfaces to GUIDed Section Extraction interfaces … … 23 23 size of an scratch buffer required to actually decode the data in a GUIDed section. 24 24 25 Examines a GUIDed section specified by InputSection. 25 Examines a GUIDed section specified by InputSection. 26 26 If GUID for InputSection does not match the GUID that this handler supports, 27 then RETURN_UNSUPPORTED is returned. 27 then RETURN_UNSUPPORTED is returned. 28 28 If the required information can not be retrieved from InputSection, 29 29 then RETURN_INVALID_PARAMETER is returned. … … 32 32 the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field 33 33 from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute. 34 34 35 35 If InputSection is NULL, then ASSERT(). 36 36 If OutputBufferSize is NULL, then ASSERT(). … … 101 101 /** 102 102 Decompress a LZAM compressed GUIDed section into a caller allocated output buffer. 103 104 Decodes the GUIDed section specified by InputSection. 105 If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned. 103 104 Decodes the GUIDed section specified by InputSection. 105 If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned. 106 106 If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned. 107 107 If the GUID of InputSection does match the GUID that this handler supports, then InputSection … … 110 110 data in InputSection, then OutputBuffer is set to point at the data in InputSection. Otherwise, 111 111 the decoded data will be placed in caller allocated buffer specified by OutputBuffer. 112 112 113 113 If InputSection is NULL, then ASSERT(). 114 114 If OutputBuffer is NULL, then ASSERT(). … … 118 118 119 119 @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file. 120 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 120 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 121 121 @param[out] ScratchBuffer A caller allocated buffer that may be required by this function 122 as a scratch buffer to perform the decode operation. 123 @param[out] AuthenticationStatus 122 as a scratch buffer to perform the decode operation. 123 @param[out] AuthenticationStatus 124 124 A pointer to the authentication status of the decoded output buffer. 125 125 See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI … … 148 148 UINT32 OutputBufferSize; 149 149 UINT32 ScratchBufferSize; 150 150 151 151 ASSERT (OutputBuffer != NULL); 152 152 ASSERT (InputSection != NULL); … … 179 179 180 180 // 181 // After decompress, the data need to be converted to the raw data. 181 // After decompress, the data need to be converted to the raw data. 182 182 // 183 183 if (!EFI_ERROR (Status)) { … … 188 188 &ScratchBufferSize 189 189 ); 190 190 191 191 if (!EFI_ERROR (Status)) { 192 192 x86_Convert_Init(X86State); … … 194 194 } 195 195 } 196 196 197 197 return Status; 198 198 } -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
r58464 r58466 21 21 size of an scratch buffer required to actually decode the data in a GUIDed section. 22 22 23 Examines a GUIDed section specified by InputSection. 23 Examines a GUIDed section specified by InputSection. 24 24 If GUID for InputSection does not match the GUID that this handler supports, 25 then RETURN_UNSUPPORTED is returned. 25 then RETURN_UNSUPPORTED is returned. 26 26 If the required information can not be retrieved from InputSection, 27 27 then RETURN_INVALID_PARAMETER is returned. … … 30 30 the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field 31 31 from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute. 32 32 33 33 If InputSection is NULL, then ASSERT(). 34 34 If OutputBufferSize is NULL, then ASSERT(). … … 99 99 /** 100 100 Decompress a LZAM compressed GUIDed section into a caller allocated output buffer. 101 102 Decodes the GUIDed section specified by InputSection. 103 If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned. 101 102 Decodes the GUIDed section specified by InputSection. 103 If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned. 104 104 If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned. 105 105 If the GUID of InputSection does match the GUID that this handler supports, then InputSection … … 108 108 data in InputSection, then OutputBuffer is set to point at the data in InputSection. Otherwise, 109 109 the decoded data will be placed in caller allocated buffer specified by OutputBuffer. 110 110 111 111 If InputSection is NULL, then ASSERT(). 112 112 If OutputBuffer is NULL, then ASSERT(). … … 116 116 117 117 @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file. 118 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 118 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. 119 119 @param[out] ScratchBuffer A caller allocated buffer that may be required by this function 120 as a scratch buffer to perform the decode operation. 121 @param[out] AuthenticationStatus 120 as a scratch buffer to perform the decode operation. 121 @param[out] AuthenticationStatus 122 122 A pointer to the authentication status of the decoded output buffer. 123 123 See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI … … 197 197 LzmaGuidedSectionGetInfo, 198 198 LzmaGuidedSectionExtraction 199 ); 199 ); 200 200 } 201 201 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaArchCustomDecompressLib.inf
r58464 r58466 44 44 Sdk/C/LzHash.h 45 45 Sdk/C/LzmaDec.h 46 Sdk/C/Types.h 46 Sdk/C/Types.h 47 47 UefiLzma.h 48 48 LzmaDecompressLibInternal.h -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
r58464 r58466 43 43 Sdk/C/LzHash.h 44 44 Sdk/C/LzmaDec.h 45 Sdk/C/Types.h 45 Sdk/C/Types.h 46 46 GuidedSectionExtraction.c 47 47 UefiLzma.h -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c
r58464 r58466 106 106 107 107 /** 108 Given a Lzma compressed source buffer, this function retrieves the size of 109 the uncompressed buffer and the size of the scratch buffer required 108 Given a Lzma compressed source buffer, this function retrieves the size of 109 the uncompressed buffer and the size of the scratch buffer required 110 110 to decompress the compressed source buffer. 111 111 112 Retrieves the size of the uncompressed buffer and the temporary scratch buffer 112 Retrieves the size of the uncompressed buffer and the temporary scratch buffer 113 113 required to decompress the buffer specified by Source and SourceSize. 114 The size of the uncompressed buffer is returned in DestinationSize, 114 The size of the uncompressed buffer is returned in DestinationSize, 115 115 the size of the scratch buffer is returned in ScratchSize, and RETURN_SUCCESS is returned. 116 This function does not have scratch buffer available to perform a thorough 116 This function does not have scratch buffer available to perform a thorough 117 117 checking of the validity of the source data. It just retrieves the "Original Size" 118 118 field from the LZMA_HEADER_SIZE beginning bytes of the source data and output it as DestinationSize. … … 127 127 by Source and SourceSize is decompressed. 128 128 @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that 129 is required to decompress the compressed buffer specified 129 is required to decompress the compressed buffer specified 130 130 by Source and SourceSize. 131 131 132 @retval RETURN_SUCCESS The size of the uncompressed data was returned 133 in DestinationSize and the size of the scratch 132 @retval RETURN_SUCCESS The size of the uncompressed data was returned 133 in DestinationSize and the size of the scratch 134 134 buffer was returned in ScratchSize. 135 135 … … 159 159 160 160 Extracts decompressed data to its original form. 161 If the compressed source data specified by Source is successfully decompressed 162 into Destination, then RETURN_SUCCESS is returned. If the compressed source data 161 If the compressed source data specified by Source is successfully decompressed 162 into Destination, then RETURN_SUCCESS is returned. If the compressed source data 163 163 specified by Source is not in a valid compressed data format, 164 164 then RETURN_INVALID_PARAMETER is returned. … … 168 168 @param Destination The destination buffer to store the decompressed data 169 169 @param Scratch A temporary scratch buffer that is used to perform the decompression. 170 This is an optional parameter that may be NULL if the 170 This is an optional parameter that may be NULL if the 171 171 required scratch buffer size is 0. 172 173 @retval RETURN_SUCCESS Decompression completed successfully, and 172 173 @retval RETURN_SUCCESS Decompression completed successfully, and 174 174 the uncompressed buffer is returned in Destination. 175 @retval RETURN_INVALID_PARAMETER 176 The source buffer specified by Source is corrupted 175 @retval RETURN_INVALID_PARAMETER 176 The source buffer specified by Source is corrupted 177 177 (not in a valid compressed format). 178 178 **/ … … 196 196 AllocFuncs.Buffer = Scratch; 197 197 AllocFuncs.BufferSize = SCRATCH_BUFFER_REQUEST_SIZE; 198 198 199 199 DecodedBufSize = (SizeT)GetDecodedSizeOfBuf((UINT8*)Source); 200 200 EncodedDataSize = (SizeT) (SourceSize - LZMA_HEADER_SIZE); -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompressLibInternal.h
r58464 r58466 24 24 25 25 /** 26 Given a Lzma compressed source buffer, this function retrieves the size of 27 the uncompressed buffer and the size of the scratch buffer required 26 Given a Lzma compressed source buffer, this function retrieves the size of 27 the uncompressed buffer and the size of the scratch buffer required 28 28 to decompress the compressed source buffer. 29 29 30 Retrieves the size of the uncompressed buffer and the temporary scratch buffer 30 Retrieves the size of the uncompressed buffer and the temporary scratch buffer 31 31 required to decompress the buffer specified by Source and SourceSize. 32 The size of the uncompressed buffer is returned in DestinationSize, 32 The size of the uncompressed buffer is returned in DestinationSize, 33 33 the size of the scratch buffer is returned in ScratchSize, and RETURN_SUCCESS is returned. 34 This function does not have scratch buffer available to perform a thorough 34 This function does not have scratch buffer available to perform a thorough 35 35 checking of the validity of the source data. It just retrieves the "Original Size" 36 36 field from the LZMA_HEADER_SIZE beginning bytes of the source data and output it as DestinationSize. … … 45 45 by Source and SourceSize is decompressed. 46 46 @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that 47 is required to decompress the compressed buffer specified 47 is required to decompress the compressed buffer specified 48 48 by Source and SourceSize. 49 49 50 @retval RETURN_SUCCESS The size of the uncompressed data was returned 51 in DestinationSize and the size of the scratch 50 @retval RETURN_SUCCESS The size of the uncompressed data was returned 51 in DestinationSize and the size of the scratch 52 52 buffer was returned in ScratchSize. 53 53 … … 66 66 67 67 Extracts decompressed data to its original form. 68 If the compressed source data specified by Source is successfully decompressed 69 into Destination, then RETURN_SUCCESS is returned. If the compressed source data 68 If the compressed source data specified by Source is successfully decompressed 69 into Destination, then RETURN_SUCCESS is returned. If the compressed source data 70 70 specified by Source is not in a valid compressed data format, 71 71 then RETURN_INVALID_PARAMETER is returned. … … 75 75 @param Destination The destination buffer to store the decompressed data 76 76 @param Scratch A temporary scratch buffer that is used to perform the decompression. 77 This is an optional parameter that may be NULL if the 77 This is an optional parameter that may be NULL if the 78 78 required scratch buffer size is 0. 79 80 @retval RETURN_SUCCESS Decompression completed successfully, and 79 80 @retval RETURN_SUCCESS Decompression completed successfully, and 81 81 the uncompressed buffer is returned in Destination. 82 @retval RETURN_INVALID_PARAMETER 83 The source buffer specified by Source is corrupted 82 @retval RETURN_INVALID_PARAMETER 83 The source buffer specified by Source is corrupted 84 84 (not in a valid compressed format). 85 85 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/Bra.h
r58464 r58466 10 10 These functions convert relative addresses to absolute addresses 11 11 in CALL instructions to increase the compression ratio. 12 12 13 13 In: 14 14 data - data buffer … … 17 17 state - state variable for x86 converter 18 18 encoding - 0 (for decoding), 1 (for encoding) 19 19 20 20 Out: 21 21 state - state variable for x86 converter … … 24 24 The number of processed bytes. If you call these functions with multiple calls, 25 25 you must start next call with first byte after block of processed bytes. 26 26 27 27 Type Endian Alignment LookAhead 28 28 29 29 x86 little 1 4 30 30 ARMT little 2 2 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzFind.c
r58464 r58466 522 522 delta2 = p->pos - p->hash[hash2Value]; 523 523 curMatch = p->hash[kFix3HashSize + hashValue]; 524 524 525 525 p->hash[hash2Value] = 526 526 p->hash[kFix3HashSize + hashValue] = p->pos; … … 556 556 delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; 557 557 curMatch = p->hash[kFix4HashSize + hashValue]; 558 558 559 559 p->hash[ hash2Value] = 560 560 p->hash[kFix3HashSize + hash3Value] = -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c
r58464 r58466 167 167 SizeT dicBufSize = p->dicBufSize; 168 168 SizeT dicPos = p->dicPos; 169 169 170 170 UInt32 processedPos = p->processedPos; 171 171 UInt32 checkDicSize = p->checkDicSize; … … 351 351 NORMALIZE 352 352 range >>= 1; 353 353 354 354 { 355 355 UInt32 t; … … 749 749 (*srcLen) = 0; 750 750 LzmaDec_WriteRem(p, dicLimit); 751 751 752 752 *status = LZMA_STATUS_NOT_SPECIFIED; 753 753 … … 795 795 if (p->needInitState) 796 796 LzmaDec_InitStateReal(p); 797 797 798 798 if (p->tempBufSize == 0) 799 799 { … … 926 926 UInt32 dicSize; 927 927 Byte d; 928 928 929 929 if (size < LZMA_PROPS_SIZE) 930 930 return SZ_ERROR_UNSUPPORTED; 931 931 else 932 932 dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); 933 933 934 934 if (dicSize < LZMA_DIC_MIN) 935 935 dicSize = LZMA_DIC_MIN; … … 1013 1013 1014 1014 LzmaDec_Init(&p); 1015 1015 1016 1016 *srcLen = inSize; 1017 1017 res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.h
r58464 r58466 127 127 SZ_ERROR_UNSUPPORTED - Unsupported properties 128 128 */ 129 129 130 130 SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); 131 131 void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); … … 156 156 157 157 /* LzmaDec_DecodeToDic 158 158 159 159 The decoding to internal dictionary buffer (CLzmaDec::dic). 160 160 You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c
r48674 r58466 31 31 /** 32 32 Report status code to OEM device. 33 33 34 34 @param CodeType Indicates the type of status code being reported. 35 @param Value Describes the current status of a hardware or software entity. 36 This included information about the class and subclass that is used to classify the entity 37 as well as an operation. For progress codes, the operation is the current activity. 38 For error codes, it is the exception. For debug codes, it is not defined at this time. 39 @param Instance The enumeration of a hardware or software entity within the system. 40 A system may contain multiple entities that match a class/subclass pairing. 41 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, 35 @param Value Describes the current status of a hardware or software entity. 36 This included information about the class and subclass that is used to classify the entity 37 as well as an operation. For progress codes, the operation is the current activity. 38 For error codes, it is the exception. For debug codes, it is not defined at this time. 39 @param Instance The enumeration of a hardware or software entity within the system. 40 A system may contain multiple entities that match a class/subclass pairing. 41 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, 42 42 not meaningful, or not relevant. Valid instance numbers start with 1. 43 @param CallerId This optional parameter may be used to identify the caller. 44 This parameter allows the status code driver to apply different rules to different callers. 43 @param CallerId This optional parameter may be used to identify the caller. 44 This parameter allows the status code driver to apply different rules to different callers. 45 45 @param Data This optional parameter may be used to pass additional data 46 46 47 47 @retval EFI_SUCCESS Always return EFI_SUCCESS. 48 48 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
r58459 r58466 21 21 MODULE_TYPE = DXE_DRIVER 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = OemHookStatusCodeLib 23 LIBRARY_CLASS = OemHookStatusCodeLib 24 24 25 25 # -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.c
r58464 r58466 1 1 /** @file 2 2 3 This library registers CRC32 guided section handler 3 This library registers CRC32 guided section handler 4 4 to parse CRC32 encapsulation section and extract raw data. 5 5 6 6 Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> 7 This program and the accompanying materials 8 are licensed and made available under the terms and conditions of the BSD License 9 which accompanies this distribution. The full text of the license may be found at 10 http://opensource.org/licenses/bsd-license.php 11 12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 7 This program and the accompanying materials 8 are licensed and made available under the terms and conditions of the BSD License 9 which accompanies this distribution. The full text of the license may be found at 10 http://opensource.org/licenses/bsd-license.php 11 12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 14 14 15 15 **/ … … 90 90 return EFI_INVALID_PARAMETER; 91 91 } 92 92 93 93 // 94 94 // Initialize CRC32 table. … … 121 121 122 122 GetInfo gets raw data size and attribute of the input guided section. 123 It first checks whether the input guid section is supported. 123 It first checks whether the input guid section is supported. 124 124 If not, EFI_INVALID_PARAMETER will return. 125 125 … … 129 129 @param SectionAttribute The attribute of the input guided section. 130 130 131 @retval EFI_SUCCESS The size of destination buffer, the size of scratch buffer and 131 @retval EFI_SUCCESS The size of destination buffer, the size of scratch buffer and 132 132 the attribute of the input section are successull retrieved. 133 133 @retval EFI_INVALID_PARAMETER The GUID in InputSection does not match this instance guid. … … 182 182 Extraction handler tries to extract raw data from the input guided section. 183 183 It also does authentication check for 32bit CRC value in the input guided section. 184 It first checks whether the input guid section is supported. 184 It first checks whether the input guid section is supported. 185 185 If not, EFI_INVALID_PARAMETER will return. 186 186 … … 218 218 return EFI_INVALID_PARAMETER; 219 219 } 220 220 221 221 // 222 222 // Get section Crc32 checksum. … … 240 240 return EFI_INVALID_PARAMETER; 241 241 } 242 242 243 243 // 244 244 // Get section Crc32 checksum. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.inf
r58464 r58466 2 2 # Pei Crc32 Guided Section Extract library. 3 3 # 4 # This library doesn't produce any library class. The constructor function uses 4 # This library doesn't produce any library class. The constructor function uses 5 5 # ExtractGuidedSectionLib service to register CRC32 guided section handler 6 6 # that parses CRC32 encapsulation section and extracts raw data. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.c
r48674 r58466 26 26 /** 27 27 The constructor reads variable and sets HOB 28 28 29 29 @param FileHandle The handle of FFS header the loaded driver. 30 30 @param PeiServices The pointer to the PEI services. … … 45 45 UINT64 GlobalErrorLevel; 46 46 UINT32 HobErrorLevel; 47 47 48 48 Status = PeiServicesLocatePpi ( 49 49 &gEfiPeiReadOnlyVariable2PpiGuid, … … 54 54 if (!EFI_ERROR (Status)) { 55 55 Size = sizeof (GlobalErrorLevel); 56 Status = Variable->GetVariable ( 57 Variable, 56 Status = Variable->GetVariable ( 57 Variable, 58 58 DEBUG_MASK_VARIABLE_NAME, 59 59 &gEfiGenericVariableGuid, -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
r58464 r58466 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 … … 42 42 @param ErrorLevel The error level of the debug message. 43 43 @param Format Format string for the debug message to print. 44 @param ... Variable argument list whose contents are accessed 44 @param ... Variable argument list whose contents are accessed 45 45 based on the format string specified by Format. 46 46 … … 76 76 // 77 77 // Compute the total size of the record. 78 // Note that the passing-in format string and variable parameters will be constructed to 78 // Note that the passing-in format string and variable parameters will be constructed to 79 79 // the following layout: 80 80 // … … 166 166 // 167 167 // Make no output if Format string terminates unexpectedly when 168 // looking up for flag, width, precision and type. 168 // looking up for flag, width, precision and type. 169 169 // 170 170 Format--; … … 176 176 break; 177 177 } 178 178 179 179 // 180 180 // Pack variable arguments into the storage area following EFI_DEBUG_INFO. … … 199 199 // 200 200 // If the converted BASE_LIST is larger than the 12 * sizeof (UINT64) allocated bytes, then ASSERT() 201 // This indicates that the DEBUG() macro is passing in more argument than can be handled by 201 // This indicates that the DEBUG() macro is passing in more argument than can be handled by 202 202 // the EFI_DEBUG_INFO record 203 203 // … … 229 229 230 230 /** 231 Prints an assert message containing a filename, line number, and description. 231 Prints an assert message containing a filename, line number, and description. 232 232 This may be followed by a breakpoint or a dead loop. 233 233 234 234 Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" 235 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 236 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 237 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 238 CpuDeadLoop() is called. If neither of these bits are set, then this function 235 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of 236 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if 237 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then 238 CpuDeadLoop() is called. If neither of these bits are set, then this function 239 239 returns immediately after the message is printed to the debug output device. 240 240 DebugAssert() must actively prevent recursion. If DebugAssert() is called while … … 277 277 if (HeaderSize + FileNameSize + DescriptionSize > sizeof (Buffer)) { 278 278 // 279 // FileName + Description is too long to be filled into buffer. 279 // FileName + Description is too long to be filled into buffer. 280 280 // 281 281 if (HeaderSize + FileNameSize < sizeof (Buffer)) { 282 282 // 283 // Description has enough buffer to be truncated. 283 // Description has enough buffer to be truncated. 284 284 // 285 285 DescriptionSize = sizeof (Buffer) - HeaderSize - FileNameSize; … … 293 293 } 294 294 } 295 295 296 296 // 297 297 // Fill in EFI_DEBUG_ASSERT_DATA … … 339 339 Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer. 340 340 341 This function fills Length bytes of Buffer with the value specified by 341 This function fills Length bytes of Buffer with the value specified by 342 342 PcdDebugClearMemoryValue, and returns Buffer. 343 343 344 344 If Buffer is NULL, then ASSERT(). 345 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 345 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 346 346 347 347 @param Buffer Pointer to the target buffer to be filled with PcdDebugClearMemoryValue. 348 @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 348 @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. 349 349 350 350 @return Buffer Pointer to the target buffer filled with PcdDebugClearMemoryValue. … … 367 367 Returns TRUE if ASSERT() macros are enabled. 368 368 369 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 369 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of 370 370 PcdDebugProperyMask is set. Otherwise FALSE is returned. 371 371 … … 384 384 385 385 386 /** 386 /** 387 387 Returns TRUE if DEBUG() macros are enabled. 388 388 389 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 389 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of 390 390 PcdDebugProperyMask is set. Otherwise FALSE is returned. 391 391 … … 404 404 405 405 406 /** 406 /** 407 407 Returns TRUE if DEBUG_CODE() macros are enabled. 408 408 409 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 409 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of 410 410 PcdDebugProperyMask is set. Otherwise FALSE is returned. 411 411 … … 424 424 425 425 426 /** 426 /** 427 427 Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled. 428 428 429 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 429 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of 430 430 PcdDebugProperyMask is set. Otherwise FALSE is returned. 431 431 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
r58464 r58466 37 37 MdePkg/MdePkg.dec 38 38 MdeModulePkg/MdeModulePkg.dec 39 39 40 40 [LibraryClasses] 41 41 PcdLib -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
r58459 r58466 5 5 performance logging GUIDed HOB on the first performance logging and then logs the 6 6 performance data to the GUIDed HOB. Due to the limitation of temporary RAM, the maximum 7 number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries. 7 number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries. 8 8 9 9 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> … … 89 89 otherwise, the the number of log entries in the array is returned. 90 90 91 @param PeiPerformanceLog Pointer to the data structure containing PEI 91 @param PeiPerformanceLog Pointer to the data structure containing PEI 92 92 performance data. 93 93 @param PeiPerformanceIdArray Pointer to PEI performance identifier array. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
r58459 r58466 1 ## @file 1 ## @file 2 2 # Performance library instance used in PEI phase. 3 # 3 # 4 4 # This library provides the performance measurement interfaces in PEI phase, it creates 5 5 # and consumes GUIDed HOB for performance logging. The GUIDed HOB is passed to DXE phase 6 # so that it can be taken over by DxeCorePerformanceLib. 7 # 6 # so that it can be taken over by DxeCorePerformanceLib. 7 # 8 8 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 9 9 # This program and the accompanying materials … … 11 11 # which accompanies this distribution. The full text of the license may be found at 12 12 # http://opensource.org/licenses/bsd-license.php 13 # 13 # 14 14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 15 15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 16 # 16 # 17 17 ## 18 18 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.c
r48674 r58466 4 4 This library instance is no longer used and module using this library 5 5 class should update to directly locate EFI_PEI_RECOVERY_MODULE_PPI defined 6 in PI 1.2 specification. 6 in PI 1.2 specification. 7 7 8 8 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> … … 21 21 /** 22 22 Calling this function causes the system do recovery boot path. 23 23 24 24 @retval EFI_UNSUPPORTED Recovery is not supported. 25 25 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf
r58459 r58466 1 ## @file 1 ## @file 2 2 # Null Recovery library instance for PEIM module 3 3 # This library instance is no longer used and module using this library 4 4 # class should update to directly locate EFI_PEI_RECOVERY_MODULE_PPI defined 5 # in PI 1.2 specification. 6 # 5 # in PI 1.2 specification. 6 # 7 7 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 8 8 # This program and the accompanying materials … … 10 10 # which accompanies this distribution. The full 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. 15 # 15 # 16 16 ## 17 17 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
r58459 r58466 26 26 VERSION_STRING = 1.0 27 27 LIBRARY_CLASS = ReportStatusCodeLib|SEC PEIM PEI_CORE 28 28 29 29 # 30 30 # The following information is for reference only and not required by the build tools. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.c
r48674 r58466 4 4 This library instance is no longer used and module using this library 5 5 class should update to directly locate EFI_PEI_S3_RESUME_PPI defined 6 in PI 1.2 specification. 6 in PI 1.2 specification. 7 7 8 8 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> … … 21 21 /** 22 22 This function is responsible for calling the S3 resume vector in the ACPI Tables. 23 23 24 24 @retval EFI_SUCESS Success to restore config from S3. 25 25 @retval Others Fail to restore config from S3. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf
r58459 r58466 3 3 # This library instance is no longer used and module using this library 4 4 # class should update to directly locate EFI_PEI_S3_RESUME_PPI defined 5 # in PI 1.2 specification. 6 # 5 # in PI 1.2 specification. 6 # 7 7 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 8 8 # … … 11 11 # which accompanies this distribution. The full text of the license may be found at 12 12 # http://opensource.org/licenses/bsd-license.php 13 # 13 # 14 14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 15 15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
r58459 r58466 1 1 /** @file 2 Interpret and execute the S3 data in S3 boot script. 2 Interpret and execute the S3 data in S3 boot script. 3 3 4 4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> … … 24 24 slave devices accept this transaction or that this function returns with error. 25 25 26 @param SmbusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, 26 @param SmbusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, 27 27 and PEC. 28 28 @param Operation Signifies which particular SMBus hardware protocol instance that … … 121 121 } 122 122 123 return Status; 123 return Status; 124 124 } 125 125 … … 131 131 @param Address Address of the operation. 132 132 @param AddressStride Instride for stepping input buffer. 133 @param BufferStride Outstride for stepping output buffer. 133 @param BufferStride Outstride for stepping output buffer. 134 134 135 135 @retval EFI_SUCCESS Successful translation. … … 171 171 /** 172 172 Perform IO read operation 173 173 174 174 @param[in] Width Width of the operation. 175 175 @param[in] Address Address of the operation. 176 176 @param[in] Count Count of the number of accesses to perform. 177 @param[out] Buffer Pointer to the buffer to read from I/O space. 177 @param[out] Buffer Pointer to the buffer to read from I/O space. 178 178 179 179 @retval EFI_SUCCESS The data was written to the EFI System. … … 181 181 Buffer is NULL. 182 182 The Buffer is not aligned for the given Width. 183 Address is outside the legal range of I/O ports. 184 183 Address is outside the legal range of I/O ports. 184 185 185 **/ 186 186 EFI_STATUS … … 275 275 /** 276 276 Perform IO write operation 277 277 278 278 @param[in] Width Width of the operation. 279 279 @param[in] Address Address of the operation. 280 280 @param[in] Count Count of the number of accesses to perform. 281 @param[in] Buffer Pointer to the buffer to write to I/O space. 281 @param[in] Buffer Pointer to the buffer to write to I/O space. 282 282 283 283 @retval EFI_SUCCESS The data was written to the EFI System. … … 285 285 Buffer is NULL. 286 286 The Buffer is not aligned for the given Width. 287 Address is outside the legal range of I/O ports. 288 287 Address is outside the legal range of I/O ports. 288 289 289 **/ 290 290 EFI_STATUS … … 323 323 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8)); 324 324 IoWrite8 ((UINTN) Address, *In.Uint8); 325 break; 325 break; 326 326 case S3BootScriptWidthFifoUint8: 327 327 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8)); 328 328 IoWrite8 ((UINTN) OriginalAddress, *In.Uint8); 329 break; 329 break; 330 330 case S3BootScriptWidthFillUint8: 331 331 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8)); … … 335 335 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16)); 336 336 IoWrite16 ((UINTN) Address, *In.Uint16); 337 break; 337 break; 338 338 case S3BootScriptWidthFifoUint16: 339 339 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16)); 340 340 IoWrite16 ((UINTN) OriginalAddress, *In.Uint16); 341 break; 341 break; 342 342 case S3BootScriptWidthFillUint16: 343 343 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16)); … … 347 347 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32)); 348 348 IoWrite32 ((UINTN) Address, *In.Uint32); 349 break; 349 break; 350 350 case S3BootScriptWidthFifoUint32: 351 351 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32)); … … 359 359 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64)); 360 360 IoWrite64 ((UINTN) Address, *In.Uint64); 361 break; 361 break; 362 362 case S3BootScriptWidthFifoUint64: 363 363 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64)); 364 364 IoWrite64 ((UINTN) OriginalAddress, *In.Uint64); 365 break; 365 break; 366 366 case S3BootScriptWidthFillUint64: 367 367 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64)); … … 372 372 } 373 373 } 374 374 375 375 376 376 return EFI_SUCCESS; … … 378 378 /** 379 379 Interprete the boot script node with EFI_BOOT_SCRIPT_IO_WRITE OP code. 380 380 381 381 @param Script Pointer to the node which is to be interpreted. 382 382 … … 385 385 Buffer is NULL. 386 386 The Buffer is not aligned for the given Width. 387 Address is outside the legal range of I/O ports. 388 387 Address is outside the legal range of I/O ports. 388 389 389 **/ 390 390 EFI_STATUS 391 391 BootScriptExecuteIoWrite ( 392 IN UINT8 *Script 392 IN UINT8 *Script 393 393 ) 394 394 { … … 398 398 VOID *Buffer; 399 399 EFI_BOOT_SCRIPT_IO_WRITE IoWrite; 400 400 401 401 CopyMem ((VOID*)&IoWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_WRITE)); 402 402 Width = (S3_BOOT_SCRIPT_LIB_WIDTH) IoWrite.Width; … … 410 410 /** 411 411 Perform memory read operation 412 412 413 413 @param Width Width of the operation. 414 414 @param Address Address of the operation. 415 415 @param Count Count of the number of accesses to perform. 416 @param Buffer Pointer to the buffer read from memory. 416 @param Buffer Pointer to the buffer read from memory. 417 417 418 418 @retval EFI_SUCCESS The data was written to the EFI System. … … 420 420 Buffer is NULL. 421 421 The Buffer is not aligned for the given Width. 422 @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count 423 is not valid for this EFI System. 424 422 @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count 423 is not valid for this EFI System. 424 425 425 **/ 426 426 EFI_STATUS … … 509 509 /** 510 510 Perform memory write operation 511 511 512 512 @param Width Width of the operation. 513 513 @param Address Address of the operation. 514 514 @param Count Count of the number of accesses to perform. 515 @param Buffer Pointer to the buffer write to memory. 515 @param Buffer Pointer to the buffer write to memory. 516 516 517 517 @retval EFI_SUCCESS The data was written to the EFI System. … … 519 519 Buffer is NULL. 520 520 The Buffer is not aligned for the given Width. 521 @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count 522 is not valid for this EFI System. 523 521 @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count 522 is not valid for this EFI System. 523 524 524 **/ 525 525 EFI_STATUS … … 533 533 EFI_STATUS Status; 534 534 UINTN AddressStride; 535 UINT64 OriginalAddress; 535 UINT64 OriginalAddress; 536 536 UINTN BufferStride; 537 537 PTR In; … … 548 548 // 549 549 OriginalAddress = Address; 550 OriginalIn.Buf = In.Buf; 550 OriginalIn.Buf = In.Buf; 551 551 for (; Count > 0; Count--, Address += AddressStride, In.Buf += BufferStride) { 552 552 switch (Width) { … … 554 554 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8)); 555 555 MmioWrite8 ((UINTN) Address, *In.Uint8); 556 break; 556 break; 557 557 case S3BootScriptWidthFifoUint8: 558 558 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8)); 559 559 MmioWrite8 ((UINTN) OriginalAddress, *In.Uint8); 560 break; 560 break; 561 561 case S3BootScriptWidthFillUint8: 562 562 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8)); … … 566 566 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16)); 567 567 MmioWrite16 ((UINTN) Address, *In.Uint16); 568 break; 568 break; 569 569 case S3BootScriptWidthFifoUint16: 570 570 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16)); 571 571 MmioWrite16 ((UINTN) OriginalAddress, *In.Uint16); 572 break; 572 break; 573 573 case S3BootScriptWidthFillUint16: 574 574 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16)); … … 578 578 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32)); 579 579 MmioWrite32 ((UINTN) Address, *In.Uint32); 580 break; 580 break; 581 581 case S3BootScriptWidthFifoUint32: 582 582 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32)); 583 583 MmioWrite32 ((UINTN) OriginalAddress, *In.Uint32); 584 break; 584 break; 585 585 case S3BootScriptWidthFillUint32: 586 586 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint32)); … … 590 590 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64)); 591 591 MmioWrite64 ((UINTN) Address, *In.Uint64); 592 break; 592 break; 593 593 case S3BootScriptWidthFifoUint64: 594 594 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64)); 595 595 MmioWrite64 ((UINTN) OriginalAddress, *In.Uint64); 596 break; 596 break; 597 597 case S3BootScriptWidthFillUint64: 598 598 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64)); … … 609 609 610 610 @param[in] Script Pointer to the node which is to be interpreted. 611 611 612 612 @retval EFI_SUCCESS The data was written to the EFI System. 613 613 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI System. 614 614 Buffer is NULL. 615 615 The Buffer is not aligned for the given Width. 616 @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count 617 is not valid for this EFI System. 618 616 @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count 617 is not valid for this EFI System. 618 619 619 **/ 620 620 EFI_STATUS … … 628 628 UINTN Count; 629 629 EFI_BOOT_SCRIPT_MEM_WRITE MemWrite; 630 630 631 631 CopyMem((VOID*)&MemWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_WRITE)); 632 632 Width = (S3_BOOT_SCRIPT_LIB_WIDTH)MemWrite.Width; … … 637 637 DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryWrite - 0x%08x, 0x%08x, 0x%08x\n", (UINTN)Address, Count, (UINTN)Width)); 638 638 return ScriptMemoryWrite (Width,Address, Count, Buffer); 639 640 } 639 640 } 641 641 /** 642 642 Performance PCI configuration read operation … … 646 646 @param Count Count of the number of accesses to perform. 647 647 @param Buffer Pointer to the buffer read from PCI config space 648 648 649 649 @retval EFI_SUCCESS The read succeed. 650 @retval EFI_INVALID_PARAMETER if Width is not defined 650 @retval EFI_INVALID_PARAMETER if Width is not defined 651 651 @note A known Limitations in the implementation which is 64bits operations are not supported. 652 652 … … 732 732 @param Count Count of the number of accesses to perform. 733 733 @param Buffer Pointer to the buffer write to PCI config space 734 734 735 735 @retval EFI_SUCCESS The write succeed. 736 @retval EFI_INVALID_PARAMETER if Width is not defined 736 @retval EFI_INVALID_PARAMETER if Width is not defined 737 737 @note A known Limitations in the implementation which is 64bits operations are not supported. 738 738 … … 772 772 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", PciAddress, (UINTN)*In.Uint8)); 773 773 PciWrite8 (PciAddress, *In.Uint8); 774 break; 774 break; 775 775 case S3BootScriptWidthFifoUint8: 776 776 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", OriginalPciAddress, (UINTN)*In.Uint8)); 777 777 PciWrite8 (OriginalPciAddress, *In.Uint8); 778 break; 778 break; 779 779 case S3BootScriptWidthFillUint8: 780 780 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", PciAddress, (UINTN)*OriginalIn.Uint8)); … … 784 784 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", PciAddress, (UINTN)*In.Uint16)); 785 785 PciWrite16 (PciAddress, *In.Uint16); 786 break; 786 break; 787 787 case S3BootScriptWidthFifoUint16: 788 788 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", OriginalPciAddress, (UINTN)*In.Uint16)); 789 789 PciWrite16 (OriginalPciAddress, *In.Uint16); 790 break; 790 break; 791 791 case S3BootScriptWidthFillUint16: 792 792 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", PciAddress, (UINTN)*OriginalIn.Uint16)); … … 796 796 DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", PciAddress, (UINTN)*In.Uint32)); 797 797 PciWrite32 (PciAddress, *In.Uint32); 798 break; 798 break; 799 799 case S3BootScriptWidthFifoUint32: 800 800 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", OriginalPciAddress, (UINTN)*In.Uint32)); 801 801 PciWrite32 (OriginalPciAddress, *In.Uint32); 802 break; 802 break; 803 803 case S3BootScriptWidthFillUint32: 804 804 DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)PciAddress, (UINTN)*OriginalIn.Uint32)); … … 813 813 /** 814 814 Performance PCI configuration 2 read operation 815 815 816 816 @param Width Width of the operation. 817 817 @param Segment Pci segment number … … 825 825 The Buffer is not aligned for the given Width. 826 826 Address is outside the legal range of I/O ports. 827 @note A known Limitations in the implementation which is the 'Segment' parameter is assumed as 827 @note A known Limitations in the implementation which is the 'Segment' parameter is assumed as 828 828 Zero, or else, assert. 829 829 **/ … … 831 831 ScriptPciCfg2Read ( 832 832 IN S3_BOOT_SCRIPT_LIB_WIDTH Width, 833 IN UINT16 Segment, 833 IN UINT16 Segment, 834 834 IN UINT64 Address, 835 835 IN UINTN Count, … … 838 838 { 839 839 ASSERT (Segment==0); 840 840 841 841 return ScriptPciCfgRead (Width, Address, Count, Buffer); 842 842 } 843 843 /** 844 844 Performance PCI configuration 2 write operation 845 845 846 846 @param Width Width of the operation. 847 847 @param Segment Pci segment number … … 855 855 The Buffer is not aligned for the given Width. 856 856 Address is outside the legal range of I/O ports. 857 @note A known Limitations in the implementation which is the 'Segment' parameter is assumed as 857 @note A known Limitations in the implementation which is the 'Segment' parameter is assumed as 858 858 Zero, or else, assert. 859 859 860 860 **/ 861 861 EFI_STATUS … … 863 863 ScriptPciCfg2Write ( 864 864 IN S3_BOOT_SCRIPT_LIB_WIDTH Width, 865 IN UINT16 Segment, 865 IN UINT16 Segment, 866 866 IN UINT64 Address, 867 867 IN UINTN Count, … … 874 874 /** 875 875 Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE OP code. 876 877 @param Script The pointer of typed node in boot script table 878 876 877 @param Script The pointer of typed node in boot script table 878 879 879 @retval EFI_SUCCESS The operation was executed successfully 880 880 **/ … … 903 903 Interprete the boot script node with EFI_BOOT_SCRIPT_IO_READ_WRITE OP code. 904 904 905 @param Script The pointer of typed node in boot script table 905 @param Script The pointer of typed node in boot script table 906 906 @param AndMask Mask value for 'and' operation 907 907 @param OrMask Mask value for 'or' operation … … 920 920 UINT64 Data; 921 921 EFI_BOOT_SCRIPT_IO_READ_WRITE IoReadWrite; 922 922 923 923 Data = 0; 924 924 925 925 CopyMem((VOID*)&IoReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_READ_WRITE)); 926 926 … … 947 947 Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_READ_WRITE OP code. 948 948 949 @param Script The pointer of typed node in boot script table 949 @param Script The pointer of typed node in boot script table 950 950 @param AndMask Mask value for 'and' operation 951 951 @param OrMask Mask value for 'or' operation … … 964 964 UINT64 Data; 965 965 EFI_BOOT_SCRIPT_MEM_READ_WRITE MemReadWrite; 966 966 967 967 Data = 0; 968 968 969 969 CopyMem((VOID*)&MemReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_READ_WRITE)); 970 970 971 971 DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)MemReadWrite.Address, AndMask, OrMask)); 972 972 973 973 Status = ScriptMemoryRead ( 974 974 (S3_BOOT_SCRIPT_LIB_WIDTH) MemReadWrite.Width, … … 991 991 Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CFG_READ_WRITE OP code. 992 992 993 @param Script The pointer of typed node in boot script table 993 @param Script The pointer of typed node in boot script table 994 994 @param AndMask Mask value for 'and' operation 995 995 @param OrMask Mask value for 'or' operation … … 1014 1014 1015 1015 DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfgReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfgReadWrite.Address), AndMask, OrMask)); 1016 1016 1017 1017 Status = ScriptPciCfgRead ( 1018 1018 (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfgReadWrite.Width, … … 1039 1039 Interprete the boot script node with EFI_BOOT_SCRIPT_SMBUS_EXECUTE OP code. 1040 1040 1041 @param Script The pointer of typed node in boot script table 1042 1041 @param Script The pointer of typed node in boot script table 1042 1043 1043 @retval EFI_SUCCESS The operation was executed successfully 1044 1044 @retval EFI_UNSUPPORTED Cannot locate smbus ppi or occur error of script execution 1045 @retval Others Result of script execution 1045 @retval Others Result of script execution 1046 1046 **/ 1047 1047 EFI_STATUS … … 1053 1053 UINTN DataSize; 1054 1054 EFI_BOOT_SCRIPT_SMBUS_EXECUTE SmbusExecuteEntry; 1055 1055 1056 1056 CopyMem ((VOID*)&SmbusExecuteEntry, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_SMBUS_EXECUTE )); 1057 1057 … … 1070 1070 Interprete the boot script node with EFI_BOOT_SCRIPT_STALL OP code. 1071 1071 1072 @param Script The pointer of typed node in boot script table 1073 1072 @param Script The pointer of typed node in boot script table 1073 1074 1074 @retval EFI_SUCCESS The operation was executed successfully 1075 1075 **/ … … 1080 1080 { 1081 1081 EFI_BOOT_SCRIPT_STALL Stall; 1082 1082 1083 1083 CopyMem ((VOID*)&Stall, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_STALL)); 1084 1084 … … 1090 1090 /** 1091 1091 Interprete the boot script node with EFI_BOOT_SCRIPT_DISPATCH OP code. 1092 1093 @param Script The pointer of typed node in boot script table 1092 1093 @param Script The pointer of typed node in boot script table 1094 1094 @retval EFI_SUCCESS The operation was executed successfully 1095 1095 **/ … … 1102 1102 DISPATCH_ENTRYPOINT_FUNC EntryFunc; 1103 1103 EFI_BOOT_SCRIPT_DISPATCH ScriptDispatch; 1104 1104 1105 1105 CopyMem ((VOID*)&ScriptDispatch, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_DISPATCH)); 1106 1106 EntryFunc = (DISPATCH_ENTRYPOINT_FUNC) (UINTN) (ScriptDispatch.EntryPoint); … … 1115 1115 Interprete the boot script node with EFI_BOOT_SCRIPT_DISPATCH_2 OP code. 1116 1116 1117 @param Script The pointer of typed node in boot script table 1117 @param Script The pointer of typed node in boot script table 1118 1118 @retval EFI_SUCCESS The operation was executed successfully 1119 1119 **/ … … 1126 1126 DISPATCH_ENTRYPOINT_FUNC EntryFunc; 1127 1127 EFI_BOOT_SCRIPT_DISPATCH_2 ScriptDispatch2; 1128 1128 1129 1129 CopyMem ((VOID*)&ScriptDispatch2, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_DISPATCH_2)); 1130 1130 1131 1131 DEBUG ((EFI_D_INFO, "BootScriptExecuteDispatch2 - 0x%08x(0x%08x)\n", (UINTN)ScriptDispatch2.EntryPoint, (UINTN)ScriptDispatch2.Context)); 1132 1132 1133 1133 EntryFunc = (DISPATCH_ENTRYPOINT_FUNC) (UINTN) (ScriptDispatch2.EntryPoint); 1134 1134 … … 1140 1140 Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_POLL OP code. 1141 1141 1142 @param Script The pointer of typed node in boot script table 1142 @param Script The pointer of typed node in boot script table 1143 1143 @param AndMask Mask value for 'and' operation 1144 1144 @param OrMask Mask value for 'or' operation 1145 1146 @retval EFI_DEVICE_ERROR Data polled from memory does not equal to 1145 1146 @retval EFI_DEVICE_ERROR Data polled from memory does not equal to 1147 1147 the epecting data within the Loop Times. 1148 1148 @retval EFI_SUCCESS The operation was executed successfully … … 1152 1152 IN UINT8 *Script, 1153 1153 IN UINT64 AndMask, 1154 IN UINT64 OrMask 1155 ) 1156 { 1157 1154 IN UINT64 OrMask 1155 ) 1156 { 1157 1158 1158 UINT64 Data; 1159 1159 UINT64 LoopTimes; 1160 1160 EFI_STATUS Status; 1161 1161 EFI_BOOT_SCRIPT_MEM_POLL MemPoll; 1162 1162 1163 1163 CopyMem ((VOID*)&MemPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_POLL)); 1164 1164 … … 1201 1201 This opcode is a no-op on dispatch and is only used for debugging script issues. 1202 1202 1203 @param Script The pointer of node in boot script table 1204 1203 @param Script The pointer of node in boot script table 1204 1205 1205 **/ 1206 1206 VOID … … 1227 1227 1228 1228 /** 1229 Execute the boot script to interpret the Label information. 1230 1231 @param Script The pointer of node in boot script table 1232 1229 Execute the boot script to interpret the Label information. 1230 1231 @param Script The pointer of node in boot script table 1232 1233 1233 **/ 1234 1234 VOID … … 1256 1256 /** 1257 1257 calculate the mask value for 'and' and 'or' operation 1258 @param ScriptHeader The pointer of header of node in boot script table 1258 @param ScriptHeader The pointer of header of node in boot script table 1259 1259 @param AndMask The Mask value for 'and' operation 1260 1260 @param OrMask The Mask value for 'or' operation … … 1288 1288 Size = sizeof (EFI_BOOT_SCRIPT_MEM_POLL); 1289 1289 break; 1290 1290 1291 1291 case EFI_BOOT_SCRIPT_IO_POLL_OPCODE: 1292 1292 Size = sizeof (EFI_BOOT_SCRIPT_IO_POLL); 1293 break; 1294 1293 break; 1294 1295 1295 case EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE: 1296 1296 Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE); 1297 1297 break; 1298 1298 1299 1299 case EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE: 1300 1300 Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL); 1301 1301 break; 1302 1302 1303 1303 case EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE: 1304 1304 Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL); 1305 1305 break; 1306 1306 1307 1307 default: 1308 1308 return; 1309 1309 } 1310 1310 1311 1311 DataPtr = Script + Size; 1312 1312 … … 1341 1341 Interprete the boot script node with EFI_BOOT_SCRIPT_IO_POLL OP code. 1342 1342 1343 @param Script The pointer of typed node in boot script table 1343 @param Script The pointer of typed node in boot script table 1344 1344 @param AndMask Mask value for 'and' operation 1345 1345 @param OrMask Mask value for 'or' operation 1346 1347 @retval EFI_DEVICE_ERROR Data polled from memory does not equal to 1346 1347 @retval EFI_DEVICE_ERROR Data polled from memory does not equal to 1348 1348 the epecting data within the Loop Times. 1349 1349 @retval EFI_SUCCESS The operation was executed successfully … … 1360 1360 UINT64 LoopTimes; 1361 1361 EFI_BOOT_SCRIPT_IO_POLL IoPoll; 1362 1362 1363 1363 CopyMem ((VOID*)&IoPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_POLL)); 1364 1364 … … 1386 1386 if ((!EFI_ERROR (Status)) &&(Data & AndMask) == OrMask) { 1387 1387 return EFI_SUCCESS; 1388 } 1388 } 1389 1389 } 1390 1390 … … 1414 1414 UINTN Count; 1415 1415 EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE PciCfg2Write; 1416 1416 1417 1417 CopyMem ((VOID*)&PciCfg2Write, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE)); 1418 1418 … … 1430 1430 /** 1431 1431 Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE OP code. 1432 1432 1433 1433 @param Script The pointer of S3 boot script 1434 1434 @param AndMask Mask value for 'and' operation … … 1454 1454 1455 1455 DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfg2ReadWrite - 0x%04x, 0x%08x, 0x%016lx, 0x%016lx\n", PciCfg2ReadWrite.Segment, PCI_ADDRESS_ENCODE (PciCfg2ReadWrite.Address), AndMask, OrMask)); 1456 1456 1457 1457 Status = ScriptPciCfg2Read ( 1458 1458 (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2ReadWrite.Width, … … 1478 1478 /** 1479 1479 Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG_POLL OP code. 1480 1480 1481 1481 @param Script The pointer of S3 boot script 1482 1482 @param AndMask Mask value for 'and' operation … … 1484 1484 1485 1485 @retval EFI_SUCCESS The operation was executed successfully 1486 @retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to 1486 @retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to 1487 1487 epecting data within the Loop Times. 1488 1488 **/ … … 1491 1491 IN UINT8 *Script, 1492 1492 IN UINT64 AndMask, 1493 IN UINT64 OrMask 1493 IN UINT64 OrMask 1494 1494 ) 1495 1495 { … … 1501 1501 1502 1502 DEBUG ((EFI_D_INFO, "BootScriptPciCfgPoll - 0x%08x, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfgPoll.Address), AndMask, OrMask)); 1503 1503 1504 1504 Data = 0; 1505 1505 Status = ScriptPciCfgRead ( … … 1537 1537 /** 1538 1538 Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL OP code. 1539 1539 1540 1540 @param Script The pointer of S3 Boot Script 1541 1541 @param AndMask Mask value for 'and' operation … … 1543 1543 1544 1544 @retval EFI_SUCCESS The operation was executed successfully 1545 @retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to 1545 @retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to 1546 1546 epecting data within the Loop Times. 1547 1547 … … 1551 1551 IN UINT8 *Script, 1552 1552 IN UINT64 AndMask, 1553 IN UINT64 OrMask 1553 IN UINT64 OrMask 1554 1554 ) 1555 1555 { … … 1563 1563 1564 1564 DEBUG ((EFI_D_INFO, "BootScriptPciCfg2Poll - 0x%04x, 0x%08x, 0x%016lx, 0x%016lx\n", PciCfg2Poll.Segment, PCI_ADDRESS_ENCODE (PciCfg2Poll.Address), AndMask, OrMask)); 1565 1565 1566 1566 Status = ScriptPciCfg2Read ( 1567 1567 (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2Poll.Width, … … 1581 1581 Status = ScriptPciCfg2Read ( 1582 1582 (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2Poll.Width, 1583 PciCfg2Poll.Segment, 1583 PciCfg2Poll.Segment, 1584 1584 PciCfg2Poll.Address, 1585 1585 1, … … 1596 1596 return EFI_DEVICE_ERROR; 1597 1597 } 1598 1598 1599 1599 } 1600 1600 1601 1601 /** 1602 1602 Executes the S3 boot script table. 1603 1603 1604 1604 @retval RETURN_SUCCESS The boot script table was executed successfully. 1605 @retval RETURN_UNSUPPORTED Invalid script table or opcode. 1606 1605 @retval RETURN_UNSUPPORTED Invalid script table or opcode. 1606 1607 1607 @note A known Limitations in the implementation: When interpreting the opcode EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE 1608 EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as 1608 EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as 1609 1609 Zero, or else, assert. 1610 1610 **/ … … 1624 1624 EFI_BOOT_SCRIPT_TABLE_HEADER TableHeader; 1625 1625 Script = mS3BootScriptTablePtr->TableBase; 1626 if (Script != 0) { 1626 if (Script != 0) { 1627 1627 CopyMem ((VOID*)&TableHeader, Script, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER)); 1628 1628 } else { … … 1636 1636 1637 1637 DEBUG ((EFI_D_INFO, "TableHeader - 0x%08x\n", Script)); 1638 1638 1639 1639 StartAddress = (UINTN) Script; 1640 1640 TableLength = TableHeader.TableLength; … … 1648 1648 while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) { 1649 1649 DEBUG ((EFI_D_INFO, "ExecuteBootScript - %08x\n", (UINTN)Script)); 1650 1650 1651 1651 CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 1652 1652 switch (ScriptHeader.OpCode) { … … 1713 1713 DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_INFORMATION_OPCODE\n")); 1714 1714 BootScriptExecuteInformation (Script); 1715 break; 1715 break; 1716 1716 1717 1717 case S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE: … … 1744 1744 CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script); 1745 1745 Status = BootScriptExecuteMemPoll (Script, AndMask, OrMask); 1746 1747 break; 1748 1746 1747 break; 1748 1749 1749 case EFI_BOOT_SCRIPT_IO_POLL_OPCODE: 1750 1750 DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_IO_POLL_OPCODE\n")); … … 1752 1752 Status = BootScriptExecuteIoPoll (Script, AndMask, OrMask); 1753 1753 break; 1754 1754 1755 1755 case EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE: 1756 1756 DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE\n")); … … 1758 1758 Status = BootScriptPciCfgPoll (Script, AndMask, OrMask); 1759 1759 break; 1760 1760 1761 1761 case EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE: 1762 1762 DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE\n")); -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h
r58459 r58466 170 170 UINT32 Width; 171 171 UINT64 Address; 172 UINT16 Segment; 172 UINT16 Segment; 173 173 UINT64 Delay; 174 174 } EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL; -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
r58459 r58466 1 1 /** @file 2 Save the S3 data to S3 boot script. 3 2 Save the S3 data to S3 boot script. 3 4 4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 … … 60 60 61 61 /** 62 This is an internal function to add a terminate node the entry, recalculate the table 63 length and fill into the table. 64 65 @return the base address of the boot script table. 62 This is an internal function to add a terminate node the entry, recalculate the table 63 length and fill into the table. 64 65 @return the base address of the boot script table. 66 66 **/ 67 67 UINT8* … … 74 74 EFI_BOOT_SCRIPT_TABLE_HEADER *ScriptTableInfo; 75 75 S3TableBase = mS3BootScriptTablePtr->TableBase; 76 76 77 77 if (S3TableBase == NULL) { 78 78 // … … 92 92 ScriptTableInfo = (EFI_BOOT_SCRIPT_TABLE_HEADER*)(mS3BootScriptTablePtr->TableBase); 93 93 ScriptTableInfo->TableLength = mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE); 94 95 96 94 95 96 97 97 return S3TableBase; 98 98 // 99 // NOTE: Here we did NOT adjust the mS3BootScriptTablePtr->TableLength to 100 // mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE). Because 99 // NOTE: Here we did NOT adjust the mS3BootScriptTablePtr->TableLength to 100 // mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE). Because 101 101 // maybe in runtime, we still need add entries into the table, and the runtime entry should be 102 102 // added start before this TERMINATE node. 103 103 // 104 } 104 } 105 105 106 106 /** … … 162 162 This is the Event call back function to notify the Library the system is entering 163 163 run time phase. 164 164 165 165 @param Event Pointer to this event 166 @param Context Event handler private data 166 @param Context Event handler private data 167 167 **/ 168 168 VOID … … 190 190 191 191 // 192 // Here we should tell the library that we are enter into runtime phase. and 192 // Here we should tell the library that we are enter into runtime phase. and 193 193 // the memory page number occupied by the table should not grow anymore. 194 194 // … … 207 207 SaveBootScriptDataToLockBox (); 208 208 } 209 } 209 } 210 210 /** 211 211 This is the Event call back function is triggered in SMM to notify the Library the system is entering 212 212 run time phase and set InSmm flag. 213 213 214 214 @param Protocol Points to the protocol's unique identifier 215 215 @param Interface Points to the interface instance … … 265 265 /** 266 266 Library Constructor. 267 this function just identify it is a smm driver or non-smm driver linked against 268 with the library 267 this function just identify it is a smm driver or non-smm driver linked against 268 with the library 269 269 270 270 @param ImageHandle The firmware allocated handle for the EFI image. … … 307 307 S3TablePtr = (VOID *) (UINTN) Buffer; 308 308 309 PcdSet64 (PcdS3BootScriptTablePrivateDataPtr, (UINT64) (UINTN)S3TablePtr); 310 ZeroMem (S3TablePtr, sizeof(SCRIPT_TABLE_PRIVATE_DATA)); 309 PcdSet64 (PcdS3BootScriptTablePrivateDataPtr, (UINT64) (UINTN)S3TablePtr); 310 ZeroMem (S3TablePtr, sizeof(SCRIPT_TABLE_PRIVATE_DATA)); 311 311 // 312 312 // create event to notify the library system enter the runtime phase … … 320 320 ); 321 321 ASSERT (mEnterRuntimeEvent != NULL); 322 } 322 } 323 323 mS3BootScriptTablePtr = S3TablePtr; 324 324 … … 380 380 To get the start address from which a new boot time s3 boot script entry will write into. 381 381 If the table is not exist, the functio will first allocate a buffer for the table 382 If the table buffer is not enough for the new entry, in non-smm mode, the funtion will 382 If the table buffer is not enough for the new entry, in non-smm mode, the funtion will 383 383 invoke reallocate to enlarge buffer. 384 384 385 385 @param EntryLength the new entry length. 386 387 @retval the address from which the a new s3 boot script entry will write into 386 387 @retval the address from which the a new s3 boot script entry will write into 388 388 **/ 389 389 UINT8* … … 399 399 EFI_STATUS Status; 400 400 EFI_BOOT_SCRIPT_TABLE_HEADER *ScriptTableInfo; 401 401 402 402 S3TableBase = (EFI_PHYSICAL_ADDRESS)(UINTN)(mS3BootScriptTablePtr->TableBase); 403 403 if (S3TableBase == 0) { 404 // The table is not exist. This is the first to add entry. 404 // The table is not exist. This is the first to add entry. 405 405 // Allocate ACPI script table space under 4G memory. We need it to save 406 406 // some settings done by CSM, which runs after normal script table closed … … 413 413 (EFI_PHYSICAL_ADDRESS*)&S3TableBase 414 414 ); 415 415 416 416 if (EFI_ERROR(Status)) { 417 417 ASSERT_EFI_ERROR (Status); … … 429 429 mS3BootScriptTablePtr->TableMemoryPageNumber = (UINT16)(2 + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber)); 430 430 } 431 431 432 432 // Here we do not count the reserved memory for runtime script table. 433 PageNumber = (UINT16)(mS3BootScriptTablePtr->TableMemoryPageNumber - PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber)); 433 PageNumber = (UINT16)(mS3BootScriptTablePtr->TableMemoryPageNumber - PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber)); 434 434 TableLength = mS3BootScriptTablePtr->TableLength; 435 435 if ((UINT32)(PageNumber * EFI_PAGE_SIZE) < (TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE))) { 436 // 436 // 437 437 // The buffer is too small to hold the table, Reallocate the buffer 438 438 // … … 444 444 (EFI_PHYSICAL_ADDRESS*)&NewS3TableBase 445 445 ); 446 446 447 447 if (EFI_ERROR(Status)) { 448 448 ASSERT_EFI_ERROR (Status); 449 449 return 0; 450 450 } 451 451 452 452 CopyMem ((VOID*)(UINTN)NewS3TableBase, (VOID*)(UINTN)S3TableBase, TableLength); 453 453 gBS->FreePages (S3TableBase, mS3BootScriptTablePtr->TableMemoryPageNumber); 454 454 455 455 mS3BootScriptTablePtr->TableBase = (UINT8*)(UINTN)NewS3TableBase; 456 mS3BootScriptTablePtr->TableMemoryPageNumber = (UINT16) (2 + PageNumber + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber)); 456 mS3BootScriptTablePtr->TableMemoryPageNumber = (UINT16) (2 + PageNumber + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber)); 457 457 } 458 458 // 459 // calculate the the start address for the new entry. 459 // calculate the the start address for the new entry. 460 460 // 461 461 NewEntryPtr = mS3BootScriptTablePtr->TableBase + TableLength; 462 462 463 463 // 464 464 // update the table lenghth 465 465 // 466 466 mS3BootScriptTablePtr->TableLength = TableLength + EntryLength; 467 467 468 468 // 469 469 // In the boot time, we will not append the termination entry to the boot script 470 // table until the callers think there is no boot time data that should be added and 471 // it is caller's responsibility to explicit call the CloseTable. 470 // table until the callers think there is no boot time data that should be added and 471 // it is caller's responsibility to explicit call the CloseTable. 472 472 // 473 473 // 474 475 return NewEntryPtr; 474 475 return NewEntryPtr; 476 476 } 477 477 /** 478 478 To get the start address from which a new runtime s3 boot script entry will write into. 479 479 In this case, it should be ensured that there is enough buffer to hold the entry. 480 480 481 481 @param EntryLength the new entry length. 482 482 483 483 @retval the address from which the a new s3 runtime script entry will write into 484 484 **/ … … 489 489 { 490 490 UINT8 *NewEntryPtr; 491 492 NewEntryPtr = NULL; 491 492 NewEntryPtr = NULL; 493 493 // 494 // Check if the memory range reserved for S3 Boot Script table is large enough to hold the node. 494 // Check if the memory range reserved for S3 Boot Script table is large enough to hold the node. 495 495 // 496 496 if (mS3BootScriptTablePtr->TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE) <= EFI_PAGES_TO_SIZE((UINT32)(mS3BootScriptTablePtr->TableMemoryPageNumber))) { 497 NewEntryPtr = mS3BootScriptTablePtr->TableBase + mS3BootScriptTablePtr->TableLength; 497 NewEntryPtr = mS3BootScriptTablePtr->TableBase + mS3BootScriptTablePtr->TableLength; 498 498 mS3BootScriptTablePtr->TableLength = mS3BootScriptTablePtr->TableLength + EntryLength; 499 499 // … … 502 502 S3BootScriptInternalCloseTable (); 503 503 } 504 return (UINT8*)NewEntryPtr; 504 return (UINT8*)NewEntryPtr; 505 505 } 506 506 /** 507 507 To get the start address from which a new s3 boot script entry will write into. 508 508 509 509 @param EntryLength the new entry length. 510 511 @retval the address from which the a new s3 runtime script entry will write into 512 **/ 513 UINT8* 510 511 @retval the address from which the a new s3 runtime script entry will write into 512 **/ 513 UINT8* 514 514 S3BootScriptGetEntryAddAddress ( 515 515 UINT8 EntryLength … … 588 588 ASSERT_EFI_ERROR (Status); 589 589 } 590 } else { 590 } else { 591 591 NewEntryPtr = S3BootScriptGetBootTimeEntryAddAddress (EntryLength); 592 } 592 } 593 593 return NewEntryPtr; 594 595 } 594 595 } 596 596 597 597 /** … … 631 631 } 632 632 633 /** 634 This is an function to close the S3 boot script table. The function could only be called in 635 BOOT time phase. To comply with the Framework spec definition on 633 /** 634 This is an function to close the S3 boot script table. The function could only be called in 635 BOOT time phase. To comply with the Framework spec definition on 636 636 EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable(), this function will fulfill following things: 637 637 1. Closes the specified boot script table 638 2. It allocates a new memory pool to duplicate all the boot scripts in the specified table. 639 Once this function is called, the table maintained by the library will be destroyed 638 2. It allocates a new memory pool to duplicate all the boot scripts in the specified table. 639 Once this function is called, the table maintained by the library will be destroyed 640 640 after it is copied into the allocated pool. 641 3. Any attempts to add a script record after calling this function will cause a new table 641 3. Any attempts to add a script record after calling this function will cause a new table 642 642 to be created by the library. 643 4. The base address of the allocated pool will be returned in Address. Note that after 643 4. The base address of the allocated pool will be returned in Address. Note that after 644 644 using the boot script table, the CALLER is responsible for freeing the pool that is allocated 645 by this function. 646 647 In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. To provides this API for now is 645 by this function. 646 647 In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. To provides this API for now is 648 648 for Framework Spec compatibility. 649 650 If anyone does call CloseTable() on a real platform, then the caller is responsible for figuring out 651 how to get the script to run on an S3 resume because the boot script maintained by the lib will be 649 650 If anyone does call CloseTable() on a real platform, then the caller is responsible for figuring out 651 how to get the script to run on an S3 resume because the boot script maintained by the lib will be 652 652 destroyed. 653 654 @return the base address of the new copy of the boot script table. 653 654 @return the base address of the new copy of the boot script table. 655 655 @note this function could only called in boot time phase 656 656 … … 667 667 EFI_STATUS Status; 668 668 EFI_BOOT_SCRIPT_TABLE_HEADER *ScriptTableInfo; 669 670 S3TableBase = mS3BootScriptTablePtr->TableBase; 669 670 S3TableBase = mS3BootScriptTablePtr->TableBase; 671 671 if (S3TableBase == 0) { 672 return 0; 672 return 0; 673 673 } 674 674 // … … 678 678 TableLength = mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE); 679 679 // 680 // Allocate the buffer and copy the boot script to the buffer. 680 // Allocate the buffer and copy the boot script to the buffer. 681 681 // 682 682 Status = gBS->AllocatePool ( … … 686 686 ); 687 687 if (EFI_ERROR (Status)) { 688 return 0; 688 return 0; 689 689 } 690 690 CopyMem (Buffer, S3TableBase, TableLength); 691 692 // 693 // Destroy the table maintained by the library so that the next write operation 691 692 // 693 // Destroy the table maintained by the library so that the next write operation 694 694 // will write the record to the first entry of the table. 695 695 // … … 699 699 ScriptTableInfo->Length = (UINT8) sizeof (EFI_BOOT_SCRIPT_TABLE_HEADER); 700 700 ScriptTableInfo->TableLength = 0; // will be calculate at close the table 701 701 702 702 mS3BootScriptTablePtr->TableLength = sizeof (EFI_BOOT_SCRIPT_TABLE_HEADER); 703 703 return Buffer; 704 704 } 705 705 /** 706 Save I/O write to boot script 706 Save I/O write to boot script 707 707 708 708 @param Width The width of the I/O operations.Enumerated in S3_BOOT_SCRIPT_LIB_WIDTH. … … 731 731 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 732 732 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_IO_WRITE) + (WidthInByte * Count)); 733 733 734 734 Script = S3BootScriptGetEntryAddAddress (Length); 735 735 if (Script == NULL) { … … 779 779 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 780 780 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE) + (WidthInByte * 2)); 781 781 782 782 Script = S3BootScriptGetEntryAddAddress (Length); 783 783 if (Script == NULL) { … … 791 791 ScriptIoReadWrite.Width = Width; 792 792 ScriptIoReadWrite.Address = Address; 793 793 794 794 CopyMem ((VOID*)Script, (VOID*)&ScriptIoReadWrite, sizeof(EFI_BOOT_SCRIPT_IO_READ_WRITE)); 795 795 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE)), Data, WidthInByte); … … 824 824 UINT8 WidthInByte; 825 825 EFI_BOOT_SCRIPT_MEM_WRITE ScriptMemWrite; 826 826 827 827 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 828 828 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_MEM_WRITE) + (WidthInByte * Count)); 829 829 830 830 Script = S3BootScriptGetEntryAddAddress (Length); 831 831 if (Script == NULL) { 832 832 return RETURN_OUT_OF_RESOURCES; 833 } 833 } 834 834 // 835 835 // Build script data … … 840 840 ScriptMemWrite.Address = Address; 841 841 ScriptMemWrite.Count = (UINT32) Count; 842 842 843 843 CopyMem ((VOID*)Script, (VOID*)&ScriptMemWrite, sizeof(EFI_BOOT_SCRIPT_MEM_WRITE)); 844 844 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_WRITE)), Buffer, WidthInByte * Count); 845 845 846 846 SyncBootScript (Script); 847 847 … … 872 872 UINT8 WidthInByte; 873 873 EFI_BOOT_SCRIPT_MEM_READ_WRITE ScriptMemReadWrite; 874 874 875 875 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 876 876 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE) + (WidthInByte * 2)); 877 877 878 878 Script = S3BootScriptGetEntryAddAddress (Length); 879 879 if (Script == NULL) { 880 880 return RETURN_OUT_OF_RESOURCES; 881 } 881 } 882 882 // 883 883 // Build script data 884 // 884 // 885 885 ScriptMemReadWrite.OpCode = EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE; 886 886 ScriptMemReadWrite.Length = Length; 887 887 ScriptMemReadWrite.Width = Width; 888 888 ScriptMemReadWrite.Address = Address; 889 889 890 890 CopyMem ((VOID*)Script, (VOID*)&ScriptMemReadWrite , sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE)); 891 891 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE)), Data, WidthInByte); … … 931 931 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 932 932 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE) + (WidthInByte * Count)); 933 933 934 934 Script = S3BootScriptGetEntryAddAddress (Length); 935 935 if (Script == NULL) { 936 936 return RETURN_OUT_OF_RESOURCES; 937 } 937 } 938 938 // 939 939 // Build script data … … 944 944 ScriptPciWrite.Address = Address; 945 945 ScriptPciWrite.Count = (UINT32) Count; 946 946 947 947 CopyMem ((VOID*)Script, (VOID*)&ScriptPciWrite, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE)); 948 948 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE)), Buffer, WidthInByte * Count); 949 949 950 950 SyncBootScript (Script); 951 951 … … 987 987 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 988 988 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE) + (WidthInByte * 2)); 989 989 990 990 Script = S3BootScriptGetEntryAddAddress (Length); 991 991 if (Script == NULL) { 992 992 return RETURN_OUT_OF_RESOURCES; 993 } 993 } 994 994 // 995 995 // Build script data 996 // 996 // 997 997 ScriptPciReadWrite.OpCode = EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE; 998 998 ScriptPciReadWrite.Length = Length; 999 999 ScriptPciReadWrite.Width = Width; 1000 1000 ScriptPciReadWrite.Address = Address; 1001 1001 1002 1002 CopyMem ((VOID*)Script, (VOID*)&ScriptPciReadWrite, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE)); 1003 1003 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE)), Data, WidthInByte); … … 1050 1050 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 1051 1051 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE) + (WidthInByte * Count)); 1052 1052 1053 1053 Script = S3BootScriptGetEntryAddAddress (Length); 1054 1054 if (Script == NULL) { 1055 1055 return RETURN_OUT_OF_RESOURCES; 1056 } 1056 } 1057 1057 // 1058 1058 // Build script data … … 1064 1064 ScriptPciWrite2.Segment = Segment; 1065 1065 ScriptPciWrite2.Count = (UINT32)Count; 1066 1066 1067 1067 CopyMem ((VOID*)Script, (VOID*)&ScriptPciWrite2, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE)); 1068 1068 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE)), Buffer, WidthInByte * Count); … … 1107 1107 return EFI_INVALID_PARAMETER; 1108 1108 } 1109 1109 1110 1110 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 1111 1111 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE) + (WidthInByte * 2)); 1112 1112 1113 1113 Script = S3BootScriptGetEntryAddAddress (Length); 1114 1114 if (Script == NULL) { 1115 1115 return RETURN_OUT_OF_RESOURCES; 1116 } 1116 } 1117 1117 // 1118 1118 // Build script data … … 1123 1123 ScriptPciReadWrite2.Segment = Segment; 1124 1124 ScriptPciReadWrite2.Address = Address; 1125 1125 1126 1126 CopyMem ((VOID*)Script, (VOID*)&ScriptPciReadWrite2, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE)); 1127 1127 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE)), Data, WidthInByte); … … 1131 1131 WidthInByte 1132 1132 ); 1133 1133 1134 1134 SyncBootScript (Script); 1135 1135 … … 1144 1144 error code based on the input SMBus bus protocol. 1145 1145 1146 @param SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, 1146 @param SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, 1147 1147 and PEC. 1148 1148 @param Operation Signifies which particular SMBus hardware protocol instance that … … 1160 1160 1161 1161 @retval EFI_SUCCESS All the parameters are valid for the corresponding SMBus bus 1162 protocol. 1162 protocol. 1163 1163 @retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION. 1164 1164 @retval EFI_INVALID_PARAMETER Length/Buffer is NULL for operations except for EfiSmbusQuickRead … … 1181 1181 EFI_SMBUS_DEVICE_COMMAND Command; 1182 1182 BOOLEAN PecCheck; 1183 1183 1184 1184 Command = SMBUS_LIB_COMMAND (SmBusAddress); 1185 1185 PecCheck = SMBUS_LIB_PEC (SmBusAddress); 1186 1186 // 1187 1187 // Set default value to be 2: 1188 // for SmbusReadWord, SmbusWriteWord and SmbusProcessCall. 1188 // for SmbusReadWord, SmbusWriteWord and SmbusProcessCall. 1189 1189 // 1190 1190 RequiredLen = 2; … … 1224 1224 case EfiSmbusWriteBlock: 1225 1225 case EfiSmbusBWBRProcessCall: 1226 if ((Buffer == NULL) || 1227 (Length == NULL) || 1226 if ((Buffer == NULL) || 1227 (Length == NULL) || 1228 1228 (*Length < MIN_SMBUS_BLOCK_LEN) || 1229 1229 (*Length > MAX_SMBUS_BLOCK_LEN)) { … … 1245 1245 @param Length A pointer to signify the number of bytes that this operation will do. 1246 1246 @param Buffer Contains the value of data to execute to the SMBUS slave device. 1247 1247 1248 1248 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 1249 1249 @retval RETURN_SUCCESS Opcode is added. … … 1252 1252 EFIAPI 1253 1253 S3BootScriptSaveSmbusExecute ( 1254 IN UINTN SmBusAddress, 1254 IN UINTN SmBusAddress, 1255 1255 IN EFI_SMBUS_OPERATION Operation, 1256 1256 IN UINTN *Length, … … 1276 1276 1277 1277 DataSize = (UINT8)(sizeof (EFI_BOOT_SCRIPT_SMBUS_EXECUTE) + BufferLength); 1278 1278 1279 1279 Script = S3BootScriptGetEntryAddAddress (DataSize); 1280 1280 if (Script == NULL) { … … 1305 1305 1306 1306 @param Duration Duration in microseconds of the stall 1307 1307 1308 1308 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 1309 1309 @retval RETURN_SUCCESS Opcode is added. … … 1320 1320 1321 1321 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_STALL)); 1322 1322 1323 1323 Script = S3BootScriptGetEntryAddAddress (Length); 1324 1324 if (Script == NULL) { 1325 1325 return RETURN_OUT_OF_RESOURCES; 1326 } 1326 } 1327 1327 // 1328 1328 // Build script data … … 1331 1331 ScriptStall.Length = Length; 1332 1332 ScriptStall.Duration = Duration; 1333 1333 1334 1334 CopyMem ((VOID*)Script, (VOID*)&ScriptStall, sizeof (EFI_BOOT_SCRIPT_STALL)); 1335 1335 1336 1336 SyncBootScript (Script); 1337 1337 … … 1343 1343 @param EntryPoint Entry point of the code to be dispatched. 1344 1344 @param Context Argument to be passed into the EntryPoint of the code to be dispatched. 1345 1345 1346 1346 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 1347 1347 @retval RETURN_SUCCESS Opcode is added. … … 1358 1358 EFI_BOOT_SCRIPT_DISPATCH_2 ScriptDispatch2; 1359 1359 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_DISPATCH_2)); 1360 1360 1361 1361 Script = S3BootScriptGetEntryAddAddress (Length); 1362 1362 if (Script == NULL) { 1363 1363 return RETURN_OUT_OF_RESOURCES; 1364 } 1364 } 1365 1365 // 1366 1366 // Build script data … … 1370 1370 ScriptDispatch2.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint; 1371 1371 ScriptDispatch2.Context = (EFI_PHYSICAL_ADDRESS)(UINTN)Context; 1372 1372 1373 1373 CopyMem ((VOID*)Script, (VOID*)&ScriptDispatch2, sizeof (EFI_BOOT_SCRIPT_DISPATCH_2)); 1374 1374 1375 1375 SyncBootScript (Script); 1376 1376 … … 1411 1411 UINT8 Length; 1412 1412 UINT8 *Script; 1413 UINT8 WidthInByte; 1414 EFI_BOOT_SCRIPT_MEM_POLL ScriptMemPoll; 1413 UINT8 WidthInByte; 1414 EFI_BOOT_SCRIPT_MEM_POLL ScriptMemPoll; 1415 1415 1416 1416 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 1417 1417 1418 1418 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_MEM_POLL) + (WidthInByte * 2)); 1419 1419 1420 1420 Script = S3BootScriptGetEntryAddAddress (Length); 1421 1421 if (Script == NULL) { … … 1427 1427 ScriptMemPoll.OpCode = EFI_BOOT_SCRIPT_MEM_POLL_OPCODE; 1428 1428 ScriptMemPoll.Length = Length; 1429 ScriptMemPoll.Width = Width; 1429 ScriptMemPoll.Width = Width; 1430 1430 ScriptMemPoll.Address = Address; 1431 1431 ScriptMemPoll.Duration = Duration; … … 1434 1434 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_MEM_POLL)), BitValue, WidthInByte); 1435 1435 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_MEM_POLL) + WidthInByte), BitMask, WidthInByte); 1436 CopyMem ((VOID*)Script, (VOID*)&ScriptMemPoll, sizeof (EFI_BOOT_SCRIPT_MEM_POLL)); 1436 CopyMem ((VOID*)Script, (VOID*)&ScriptMemPoll, sizeof (EFI_BOOT_SCRIPT_MEM_POLL)); 1437 1437 1438 1438 SyncBootScript (Script); … … 1443 1443 Store arbitrary information in the boot script table. This opcode is a no-op on dispatch and is only 1444 1444 used for debugging script issues. 1445 1445 1446 1446 @param InformationLength Length of the data in bytes 1447 1447 @param Information Information to be logged in the boot scrpit 1448 1448 1449 1449 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 1450 1450 @retval RETURN_SUCCESS Opcode is added. … … 1454 1454 EFIAPI 1455 1455 S3BootScriptSaveInformation ( 1456 IN UINT32 InformationLength, 1456 IN UINT32 InformationLength, 1457 1457 IN VOID *Information 1458 1458 ) … … 1475 1475 1476 1476 1477 ScriptInformation.InformationLength = InformationLength; 1477 ScriptInformation.InformationLength = InformationLength; 1478 1478 1479 1479 CopyMem ((VOID*)Script, (VOID*)&ScriptInformation, sizeof (EFI_BOOT_SCRIPT_INFORMATION)); … … 1488 1488 Store a string in the boot script table. This opcode is a no-op on dispatch and is only 1489 1489 used for debugging script issues. 1490 1490 1491 1491 @param String The string to save to boot script table 1492 1492 1493 1493 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 1494 1494 @retval RETURN_SUCCESS Opcode is added. … … 1501 1501 ) 1502 1502 { 1503 return S3BootScriptSaveInformation ( 1504 (UINT32) AsciiStrLen (String) + 1, 1503 return S3BootScriptSaveInformation ( 1504 (UINT32) AsciiStrLen (String) + 1, 1505 1505 (VOID*) String 1506 1506 ); … … 1510 1510 1511 1511 @param EntryPoint Entry point of the code to be dispatched. 1512 1512 1513 1513 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. 1514 1514 @retval RETURN_SUCCESS Opcode is added. … … 1523 1523 UINT8 *Script; 1524 1524 EFI_BOOT_SCRIPT_DISPATCH ScriptDispatch; 1525 1525 1526 1526 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_DISPATCH)); 1527 1527 1528 1528 Script = S3BootScriptGetEntryAddAddress (Length); 1529 1529 if (Script == NULL) { 1530 1530 return RETURN_OUT_OF_RESOURCES; 1531 } 1531 } 1532 1532 // 1533 1533 // Build script data … … 1536 1536 ScriptDispatch.Length = Length; 1537 1537 ScriptDispatch.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint; 1538 1539 CopyMem ((VOID*)Script, (VOID*)&ScriptDispatch, sizeof (EFI_BOOT_SCRIPT_DISPATCH)); 1540 1538 1539 CopyMem ((VOID*)Script, (VOID*)&ScriptDispatch, sizeof (EFI_BOOT_SCRIPT_DISPATCH)); 1540 1541 1541 SyncBootScript (Script); 1542 1542 … … 1547 1547 Adds a record for I/O reads the I/O location and continues when the exit criteria is satisfied or after a 1548 1548 defined duration. 1549 1550 @param Width The width of the I/O operations. 1549 1550 @param Width The width of the I/O operations. 1551 1551 @param Address The base address of the I/O operations. 1552 1552 @param Data The comparison value used for the polling exit criteria. … … 1566 1566 IN UINT64 Address, 1567 1567 IN VOID *Data, 1568 IN VOID *DataMask, 1569 IN UINT64 Delay 1570 ) 1571 { 1572 UINT8 WidthInByte; 1568 IN VOID *DataMask, 1569 IN UINT64 Delay 1570 ) 1571 { 1572 UINT8 WidthInByte; 1573 1573 UINT8 *Script; 1574 1574 UINT8 Length; 1575 1575 EFI_BOOT_SCRIPT_IO_POLL ScriptIoPoll; 1576 1577 1578 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 1576 1577 1578 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 1579 1579 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_IO_POLL) + (WidthInByte * 2)); 1580 1580 1581 1581 Script = S3BootScriptGetEntryAddAddress (Length); 1582 1582 if (Script == NULL) { 1583 1583 return RETURN_OUT_OF_RESOURCES; 1584 } 1584 } 1585 1585 // 1586 1586 // Build script data … … 1588 1588 ScriptIoPoll.OpCode = EFI_BOOT_SCRIPT_IO_POLL_OPCODE; 1589 1589 ScriptIoPoll.Length = (UINT8) (sizeof (EFI_BOOT_SCRIPT_IO_POLL) + (WidthInByte * 2)); 1590 ScriptIoPoll.Width = Width; 1590 ScriptIoPoll.Width = Width; 1591 1591 ScriptIoPoll.Address = Address; 1592 1592 ScriptIoPoll.Delay = Delay; 1593 1593 1594 CopyMem ((VOID*)Script, (VOID*)&ScriptIoPoll, sizeof (EFI_BOOT_SCRIPT_IO_POLL)); 1594 CopyMem ((VOID*)Script, (VOID*)&ScriptIoPoll, sizeof (EFI_BOOT_SCRIPT_IO_POLL)); 1595 1595 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_IO_POLL)), Data, WidthInByte); 1596 1596 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_IO_POLL) + WidthInByte), DataMask, WidthInByte); 1597 1597 1598 1598 SyncBootScript (Script); 1599 1599 … … 1605 1605 after a defined duration. 1606 1606 1607 @param Width The width of the I/O operations. 1607 @param Width The width of the I/O operations. 1608 1608 @param Address The address within the PCI configuration space. 1609 1609 @param Data The comparison value used for the polling exit criteria. … … 1629 1629 { 1630 1630 UINT8 *Script; 1631 UINT8 WidthInByte; 1631 UINT8 WidthInByte; 1632 1632 UINT8 Length; 1633 1633 EFI_BOOT_SCRIPT_PCI_CONFIG_POLL ScriptPciPoll; … … 1641 1641 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 1642 1642 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + (WidthInByte * 2)); 1643 1643 1644 1644 Script = S3BootScriptGetEntryAddAddress (Length); 1645 1645 if (Script == NULL) { … … 1651 1651 ScriptPciPoll.OpCode = EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE; 1652 1652 ScriptPciPoll.Length = (UINT8) (sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + (WidthInByte * 2)); 1653 ScriptPciPoll.Width = Width; 1653 ScriptPciPoll.Width = Width; 1654 1654 ScriptPciPoll.Address = Address; 1655 1655 ScriptPciPoll.Delay = Delay; … … 1658 1658 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL)), Data, WidthInByte); 1659 1659 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + WidthInByte), DataMask, WidthInByte); 1660 1660 1661 1661 SyncBootScript (Script); 1662 1662 … … 1667 1667 after a defined duration. 1668 1668 1669 @param Width The width of the I/O operations. 1669 @param Width The width of the I/O operations. 1670 1670 @param Segment The PCI segment number for Address. 1671 1671 @param Address The address within the PCI configuration space. … … 1692 1692 ) 1693 1693 { 1694 UINT8 WidthInByte; 1694 UINT8 WidthInByte; 1695 1695 UINT8 *Script; 1696 1696 UINT8 Length; … … 1706 1706 WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 1707 1707 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + (WidthInByte * 2)); 1708 1708 1709 1709 Script = S3BootScriptGetEntryAddAddress (Length); 1710 1710 if (Script == NULL) { 1711 1711 return RETURN_OUT_OF_RESOURCES; 1712 } 1712 } 1713 1713 // 1714 1714 // Build script data … … 1716 1716 ScriptPci2Poll.OpCode = EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE; 1717 1717 ScriptPci2Poll.Length = (UINT8) (sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + (WidthInByte * 2)); 1718 ScriptPci2Poll.Width = Width; 1718 ScriptPci2Poll.Width = Width; 1719 1719 ScriptPci2Poll.Segment = Segment; 1720 1720 ScriptPci2Poll.Address = Address; … … 1724 1724 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL)), Data, WidthInByte); 1725 1725 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + WidthInByte), DataMask, WidthInByte); 1726 1726 1727 1727 SyncBootScript (Script); 1728 1728 … … 1731 1731 /** 1732 1732 Do the calculation of start address from which a new s3 boot script entry will write into. 1733 1733 1734 1734 @param EntryLength The new entry length. 1735 1735 @param Position specifies the position in the boot script table where the opcode will be 1736 inserted, either before or after, depending on BeforeOrAfter. 1736 inserted, either before or after, depending on BeforeOrAfter. 1737 1737 @param BeforeOrAfter The flag to indicate to insert the nod before or after the position. 1738 1738 This parameter is effective when InsertFlag is TRUE … … 1744 1744 IN VOID *Position OPTIONAL, 1745 1745 IN BOOLEAN BeforeOrAfter OPTIONAL, 1746 OUT UINT8 **Script 1746 OUT UINT8 **Script 1747 1747 ) 1748 1748 { 1749 1749 UINTN TableLength; 1750 1750 UINT8 *S3TableBase; 1751 UINTN PositionOffset; 1751 UINTN PositionOffset; 1752 1752 EFI_BOOT_SCRIPT_COMMON_HEADER ScriptHeader; 1753 1753 // … … 1756 1756 TableLength = mS3BootScriptTablePtr->TableLength - EntryLength; 1757 1757 S3TableBase = mS3BootScriptTablePtr->TableBase ; 1758 // 1758 // 1759 1759 // calculate the Position offset 1760 1760 // 1761 1761 if (Position != NULL) { 1762 1762 PositionOffset = (UINTN) ((UINT8 *)Position - S3TableBase); 1763 1763 1764 1764 // 1765 1765 // If the BeforeOrAfter is FALSE, that means to insert the node right after the node. 1766 1766 // 1767 1767 if (!BeforeOrAfter) { 1768 CopyMem ((VOID*)&ScriptHeader, Position, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 1768 CopyMem ((VOID*)&ScriptHeader, Position, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 1769 1769 PositionOffset += (ScriptHeader.Length); 1770 1770 } 1771 // 1771 // 1772 1772 // Insert the node before the adjusted Position 1773 1773 // 1774 CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset); 1774 CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset); 1775 1775 // 1776 // calculate the the start address for the new entry. 1776 // calculate the the start address for the new entry. 1777 1777 // 1778 1778 *Script = S3TableBase + PositionOffset; 1779 1779 1780 1780 } else { 1781 1781 if (!BeforeOrAfter) { … … 1783 1783 // Insert the node to the end of the table 1784 1784 // 1785 *Script = S3TableBase + TableLength; 1785 *Script = S3TableBase + TableLength; 1786 1786 } else { 1787 // 1787 // 1788 1788 // Insert the node to the beginning of the table 1789 1789 // 1790 1790 PositionOffset = (UINTN) sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER); 1791 CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset); 1792 *Script = S3TableBase + PositionOffset; 1791 CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset); 1792 *Script = S3TableBase + PositionOffset; 1793 1793 } 1794 } 1795 } 1796 /** 1797 Move the last boot script entry to the position 1794 } 1795 } 1796 /** 1797 Move the last boot script entry to the position 1798 1798 1799 1799 @param BeforeOrAfter Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position … … 1817 1817 { 1818 1818 UINT8* Script; 1819 VOID *TempPosition; 1819 VOID *TempPosition; 1820 1820 UINTN StartAddress; 1821 1821 UINT32 TableLength; … … 1824 1824 UINT8* LastOpcode; 1825 1825 UINT8 TempBootScriptEntry[BOOT_SCRIPT_NODE_MAX_LENGTH]; 1826 1826 1827 1827 ValidatePosition = FALSE; 1828 1828 TempPosition = (Position == NULL) ? NULL:(*Position); … … 1844 1844 // Find the last boot Script Entry which is not the terminate node 1845 1845 // 1846 while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) { 1847 CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 1846 while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) { 1847 CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 1848 1848 if (TempPosition != NULL && TempPosition == Script) { 1849 1849 // 1850 // If the position is specified, the position must be pointed to a boot script entry start address. 1850 // If the position is specified, the position must be pointed to a boot script entry start address. 1851 1851 // 1852 1852 ValidatePosition = TRUE; … … 1854 1854 if (ScriptHeader.OpCode != S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE) { 1855 1855 LastOpcode = Script; 1856 } 1856 } 1857 1857 Script = Script + ScriptHeader.Length; 1858 1858 } … … 1863 1863 return RETURN_INVALID_PARAMETER; 1864 1864 } 1865 1866 CopyMem ((VOID*)&ScriptHeader, LastOpcode, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 1867 1868 CopyMem((VOID*)TempBootScriptEntry, LastOpcode, ScriptHeader.Length); 1865 1866 CopyMem ((VOID*)&ScriptHeader, LastOpcode, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 1867 1868 CopyMem((VOID*)TempBootScriptEntry, LastOpcode, ScriptHeader.Length); 1869 1869 // 1870 1870 // Find the right position to write the node in … … 1874 1874 TempPosition, 1875 1875 BeforeOrAfter, 1876 &Script 1876 &Script 1877 1877 ); 1878 1878 // … … 1892 1892 } 1893 1893 /** 1894 Create a Label node in the boot script table. 1895 1894 Create a Label node in the boot script table. 1895 1896 1896 @param BeforeOrAfter Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position 1897 1897 in the boot script table specified by Position. If Position is NULL or points to … … 1900 1900 @param Position On entry, specifies the position in the boot script table where the opcode will be 1901 1901 inserted, either before or after, depending on BeforeOrAfter. On exit, specifies 1902 the position of the inserted opcode in the boot script table. 1902 the position of the inserted opcode in the boot script table. 1903 1903 @param InformationLength Length of the label in bytes 1904 1904 @param Information Label to be logged in the boot scrpit 1905 1905 1906 1906 @retval RETURN_INVALID_PARAMETER The Position is not a valid position in the boot script table. 1907 1907 @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation. … … 1913 1913 S3BootScriptLabelInternal ( 1914 1914 IN BOOLEAN BeforeOrAfter, 1915 IN OUT VOID **Position OPTIONAL, 1916 IN UINT32 InformationLength, 1915 IN OUT VOID **Position OPTIONAL, 1916 IN UINT32 InformationLength, 1917 1917 IN CONST CHAR8 *Information 1918 1918 ) … … 1921 1921 UINT8 *Script; 1922 1922 EFI_BOOT_SCRIPT_INFORMATION ScriptInformation; 1923 1923 1924 1924 Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_INFORMATION) + InformationLength); 1925 1925 1926 1926 Script = S3BootScriptGetEntryAddAddress (Length); 1927 1927 if (Script == NULL) { … … 1935 1935 1936 1936 1937 ScriptInformation.InformationLength = InformationLength; 1937 ScriptInformation.InformationLength = InformationLength; 1938 1938 1939 1939 CopyMem ((VOID*)Script, (VOID*)&ScriptInformation, sizeof (EFI_BOOT_SCRIPT_INFORMATION)); … … 1949 1949 1950 1950 @param BeforeOrAfter Specifies whether the opcode is stored before (TRUE) 1951 or after (FALSE) the position in the boot script table 1951 or after (FALSE) the position in the boot script table 1952 1952 specified by Position. 1953 @param CreateIfNotFound Specifies whether the label will be created if the label 1953 @param CreateIfNotFound Specifies whether the label will be created if the label 1954 1954 does not exists (TRUE) or not (FALSE). 1955 1955 @param Position On entry, specifies the position in the boot script table … … 1962 1962 specified script table. 1963 1963 @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported. 1964 If the opcode is unknow or not supported because of the PCD 1964 If the opcode is unknow or not supported because of the PCD 1965 1965 Feature Flags. 1966 1966 @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script. … … 1968 1968 **/ 1969 1969 RETURN_STATUS 1970 EFIAPI 1970 EFIAPI 1971 1971 S3BootScriptLabel ( 1972 1972 IN BOOLEAN BeforeOrAfter, … … 1994 1994 return EFI_INVALID_PARAMETER; 1995 1995 } 1996 1996 1997 1997 // 1998 1998 // Check that the script is initialized and synced without adding an entry to the script. … … 2004 2004 return RETURN_OUT_OF_RESOURCES; 2005 2005 } 2006 2006 2007 2007 // 2008 2008 // Check the header and search for existing label. 2009 // 2009 // 2010 2010 Script = mS3BootScriptTablePtr->TableBase; 2011 2011 CopyMem ((VOID*)&TableHeader, Script, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER)); … … 2017 2017 Script = Script + TableHeader.Length; 2018 2018 while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) { 2019 2020 CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 2019 2020 CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 2021 2021 if (ScriptHeader.OpCode == S3_BOOT_SCRIPT_LIB_LABEL_OPCODE) { 2022 2022 if (AsciiStrCmp ((CHAR8 *)(UINTN)(Script+sizeof(EFI_BOOT_SCRIPT_INFORMATION)), Label) == 0) { 2023 (*Position) = Script; 2023 (*Position) = Script; 2024 2024 return EFI_SUCCESS; 2025 2025 } 2026 } 2026 } 2027 2027 Script = Script + ScriptHeader.Length; 2028 2028 } 2029 2029 if (CreateIfNotFound) { 2030 2030 LabelLength = (UINT32)AsciiStrSize(Label); 2031 return S3BootScriptLabelInternal (BeforeOrAfter,Position, LabelLength, Label); 2031 return S3BootScriptLabelInternal (BeforeOrAfter,Position, LabelLength, Label); 2032 2032 } else { 2033 2033 return EFI_NOT_FOUND; 2034 } 2034 } 2035 2035 } 2036 2036 … … 2044 2044 specified script table. 2045 2045 @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported. 2046 If the opcode is unknow or not supported because of the PCD 2046 If the opcode is unknow or not supported because of the PCD 2047 2047 Feature Flags. 2048 2048 @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script. … … 2050 2050 **/ 2051 2051 RETURN_STATUS 2052 EFIAPI 2052 EFIAPI 2053 2053 S3BootScriptCompare ( 2054 2054 IN UINT8 *Position1, … … 2058 2058 { 2059 2059 UINT8* Script; 2060 UINT32 TableLength; 2060 UINT32 TableLength; 2061 2061 2062 2062 if (RelativePosition == NULL) { … … 2084 2084 } 2085 2085 *RelativePosition = (Position1 < Position2)?-1:((Position1 == Position2)?0:1); 2086 2086 2087 2087 return EFI_SUCCESS; 2088 2088 } -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
r58459 r58466 53 53 SmbusLib 54 54 PciLib 55 IoLib 55 IoLib 56 56 LockBoxLib 57 57 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h
r48674 r58466 1 1 /** @file 2 Support for S3 boot script lib. This file defined some internal macro and internal 2 Support for S3 boot script lib. This file defined some internal macro and internal 3 3 data structure 4 4 5 5 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> 6 6 … … 49 49 ((((UINTN)(A))& 0xff000000) >> 24), ((((UINTN)(A)) &0x00ff0000) >> 16), ((((UINTN)(A)) & 0xff00) >> 8), ((RShiftU64 ((A), 32) & 0xfff) | ((A)& 0xff)) \ 50 50 ) 51 51 52 52 53 53 … … 72 72 typedef struct { 73 73 UINT8 *TableBase; 74 UINT32 TableLength; // Record the actual memory length 75 UINT16 TableMemoryPageNumber; // Record the page number Allocated for the table 74 UINT32 TableLength; // Record the actual memory length 75 UINT16 TableMemoryPageNumber; // Record the page number Allocated for the table 76 76 BOOLEAN AtRuntime; // Record if current state is after SmmReadyToLock 77 77 BOOLEAN InSmm; // Record if this library is in SMM. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.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 **/ … … 27 27 /** 28 28 This function gets and caches SMRAM ranges that are present in the system. 29 29 30 30 It will ASSERT() if SMM Access2 Protocol doesn't exist. 31 31 It will ASSERT() if SMRAM ranges can't be got. 32 It will ASSERT() if Resource can't be allocated for cache SMRAM range. 32 It will ASSERT() if Resource can't be allocated for cache SMRAM range. 33 33 34 34 **/ … … 47 47 // 48 48 Status = gBS->LocateProtocol ( 49 &gEfiSmmAccess2ProtocolGuid, 50 NULL, 49 &gEfiSmmAccess2ProtocolGuid, 50 NULL, 51 51 (VOID **)&SmmAccess 52 52 ); … … 93 93 94 94 for (Index = 0; Index < mSmramRangeCount; Index ++) { 95 if (((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer >= mSmramRanges[Index].CpuStart) && 95 if (((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer >= mSmramRanges[Index].CpuStart) && 96 96 ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer < (mSmramRanges[Index].CpuStart + mSmramRanges[Index].PhysicalSize))) { 97 97 return TRUE; … … 117 117 VOID * 118 118 InternalAllocatePages ( 119 IN EFI_MEMORY_TYPE MemoryType, 119 IN EFI_MEMORY_TYPE MemoryType, 120 120 IN UINTN Pages 121 121 ) 122 122 { 123 123 EFI_STATUS Status; 124 EFI_PHYSICAL_ADDRESS Memory; 124 EFI_PHYSICAL_ADDRESS Memory; 125 125 126 126 if (Pages == 0) { … … 209 209 Allocation Library. If it is not possible to free allocated pages, then this function will 210 210 perform no actions. 211 211 212 212 If Buffer was not allocated with a page allocation function in the Memory Allocation Library, 213 213 then ASSERT(). 214 214 If Pages is zero, then ASSERT(). 215 215 216 216 @param Buffer Pointer to the buffer of pages to free. 217 217 @param Pages The number of 4 KB pages to free. … … 264 264 VOID * 265 265 InternalAllocateAlignedPages ( 266 IN EFI_MEMORY_TYPE MemoryType, 266 IN EFI_MEMORY_TYPE MemoryType, 267 267 IN UINTN Pages, 268 268 IN UINTN Alignment … … 280 280 // 281 281 ASSERT ((Alignment & (Alignment - 1)) == 0); 282 282 283 283 if (Pages == 0) { 284 284 return NULL; … … 294 294 // 295 295 ASSERT (RealPages > Pages); 296 296 297 297 Status = SmmAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory); 298 298 if (EFI_ERROR (Status)) { … … 337 337 returned. If there is not enough memory at the specified alignment remaining to satisfy the 338 338 request, then NULL is returned. 339 339 340 340 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 341 341 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). … … 365 365 returned. If there is not enough memory at the specified alignment remaining to satisfy the 366 366 request, then NULL is returned. 367 367 368 368 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 369 369 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). … … 393 393 returned. If there is not enough memory at the specified alignment remaining to satisfy the 394 394 request, then NULL is returned. 395 395 396 396 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 397 397 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). … … 420 420 Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer 421 421 must have been allocated on a previous call to the aligned page allocation services of the Memory 422 Allocation Library. If it is not possible to free allocated pages, then this function will 422 Allocation Library. If it is not possible to free allocated pages, then this function will 423 423 perform no actions. 424 424 425 425 If Buffer was not allocated with an aligned page allocation function in the Memory Allocation 426 426 Library, then ASSERT(). 427 427 If Pages is zero, then ASSERT(). 428 428 429 429 @param Buffer Pointer to the buffer of pages to free. 430 430 @param Pages The number of 4 KB pages to free. … … 472 472 VOID * 473 473 InternalAllocatePool ( 474 IN EFI_MEMORY_TYPE MemoryType, 474 IN EFI_MEMORY_TYPE MemoryType, 475 475 IN UINTN AllocationSize 476 476 ) … … 567 567 VOID * 568 568 InternalAllocateZeroPool ( 569 IN EFI_MEMORY_TYPE PoolType, 569 IN EFI_MEMORY_TYPE PoolType, 570 570 IN UINTN AllocationSize 571 ) 571 ) 572 572 { 573 573 VOID *Memory; … … 654 654 is not enough memory remaining to satisfy the request, then NULL is returned. 655 655 If Buffer is NULL, then ASSERT(). 656 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 656 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 657 657 658 658 @param PoolType The type of pool to allocate. … … 665 665 VOID * 666 666 InternalAllocateCopyPool ( 667 IN EFI_MEMORY_TYPE PoolType, 667 IN EFI_MEMORY_TYPE PoolType, 668 668 IN UINTN AllocationSize, 669 669 IN CONST VOID *Buffer 670 ) 670 ) 671 671 { 672 672 VOID *Memory; … … 680 680 } 681 681 return Memory; 682 } 682 } 683 683 684 684 /** … … 689 689 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 690 690 is not enough memory remaining to satisfy the request, then NULL is returned. 691 691 692 692 If Buffer is NULL, then ASSERT(). 693 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 693 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 694 694 695 695 @param AllocationSize The number of bytes to allocate and zero. … … 716 716 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 717 717 is not enough memory remaining to satisfy the request, then NULL is returned. 718 718 719 719 If Buffer is NULL, then ASSERT(). 720 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 720 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 721 721 722 722 @param AllocationSize The number of bytes to allocate and zero. … … 743 743 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there 744 744 is not enough memory remaining to satisfy the request, then NULL is returned. 745 745 746 746 If Buffer is NULL, then ASSERT(). 747 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 747 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 748 748 749 749 @param AllocationSize The number of bytes to allocate and zero. … … 767 767 768 768 Allocates and zeros the number bytes specified by NewSize from memory of the type 769 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 770 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 771 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 772 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 769 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and 770 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 771 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 772 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 773 773 enough memory remaining to satisfy the request, then NULL is returned. 774 774 775 775 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize 776 776 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). … … 779 779 @param OldSize The size, in bytes, of OldBuffer. 780 780 @param NewSize The size, in bytes, of the buffer to reallocate. 781 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 781 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 782 782 parameter that may be NULL. 783 783 … … 787 787 VOID * 788 788 InternalReallocatePool ( 789 IN EFI_MEMORY_TYPE PoolType, 789 IN EFI_MEMORY_TYPE PoolType, 790 790 IN UINTN OldSize, 791 791 IN UINTN NewSize, … … 807 807 808 808 Allocates and zeros the number bytes specified by NewSize from memory of type 809 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 810 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 811 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 812 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 809 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 810 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 811 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 812 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 813 813 enough memory remaining to satisfy the request, then NULL is returned. 814 814 815 815 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize 816 816 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 optional 820 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 821 821 parameter that may be NULL. 822 822 … … 839 839 840 840 Allocates and zeros the number bytes specified by NewSize from memory of type 841 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 842 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 843 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 844 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 841 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and 842 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 843 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 844 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 845 845 enough memory remaining to satisfy the request, then NULL is returned. 846 846 … … 850 850 @param OldSize The size, in bytes, of OldBuffer. 851 851 @param NewSize The size, in bytes, of the buffer to reallocate. 852 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 852 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 853 853 parameter that may be NULL. 854 854 … … 871 871 872 872 Allocates and zeros the number bytes specified by NewSize from memory of type 873 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and 874 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 875 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 876 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 873 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and 874 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 875 OldBuffer is freed. A pointer to the newly allocated buffer is returned. 876 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not 877 877 enough memory remaining to satisfy the request, then NULL is returned. 878 878 … … 882 882 @param OldSize The size, in bytes, of OldBuffer. 883 883 @param NewSize The size, in bytes, of the buffer to reallocate. 884 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 884 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional 885 885 parameter that may be NULL. 886 886 … … 906 906 pool allocation services of the Memory Allocation Library. If it is not possible to free pool 907 907 resources, then this function will perform no actions. 908 908 909 909 If Buffer was not allocated with a pool allocation function in the Memory Allocation Library, 910 910 then ASSERT(). -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf
r58459 r58466 3 3 # The implementation borrows the SMM Core Memory Allocation services as the primitive 4 4 # for memory allocation instead of using SMM System Table servces in an indirect way. 5 # It is assumed that this library instance must be linked with SMM Cre in this package. 5 # It is assumed that this library instance must be linked with SMM Cre in this package. 6 6 # 7 7 # Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR> … … 46 46 47 47 [Protocols] 48 gEfiSmmAccess2ProtocolGuid ## CONSUMES 48 gEfiSmmAccess2ProtocolGuid ## CONSUMES -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationServices.h
r58459 r58466 3 3 4 4 This header file borrows the PiSmmCore Memory Allocation services as the primitive 5 for memory allocation. 5 for memory allocation. 6 6 7 7 Copyright (c) 2008 - 2015, 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 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c
r58459 r58466 55 55 return; 56 56 } 57 57 58 58 if (mHaveExitedBootServices) { 59 59 return; 60 60 } 61 61 62 62 // 63 63 // Check gBS just in case ReportStatusCode is called before gBS is initialized. … … 107 107 // 108 108 // Locate the report status code service before enter runtime. 109 // 109 // 110 110 InternalGetReportStatusCode (); 111 111 112 112 mHaveExitedBootServices = TRUE; 113 113 } … … 121 121 @param ImageHandle The firmware allocated handle for the EFI image. 122 122 @param SystemTable A pointer to the EFI System Table. 123 123 124 124 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. 125 125 … … 136 136 // 137 137 // Cache the report status code service 138 // 138 // 139 139 InternalGetReportStatusCode (); 140 140 141 141 // 142 142 // Register notify function for EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 143 // 143 // 144 144 Status = gBS->CreateEventEx ( 145 145 EVT_NOTIFY_SIGNAL, … … 154 154 // 155 155 // Register notify function for EVT_SIGNAL_EXIT_BOOT_SERVICES 156 // 156 // 157 157 Status = gBS->CreateEventEx ( 158 158 EVT_NOTIFY_SIGNAL, … … 170 170 /** 171 171 The destructor function of Runtime DXE Report Status Code Lib. 172 172 173 173 The destructor function frees memory allocated by constructor, and closes related events. 174 It will ASSERT() if that related operation fails and it will always return EFI_SUCCESS. 174 It will ASSERT() if that related operation fails and it will always return EFI_SUCCESS. 175 175 176 176 @param ImageHandle The firmware allocated handle for the EFI image. 177 177 @param SystemTable A pointer to the EFI System Table. 178 178 179 179 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. 180 180 … … 247 247 return mReportStatusCodeLibStatusCodeProtocol->ReportStatusCode (Type, Value, Instance, (EFI_GUID *)CallerId, Data); 248 248 } 249 249 250 250 return EFI_UNSUPPORTED; 251 251 } … … 642 642 return EFI_UNSUPPORTED; 643 643 } 644 644 645 645 // 646 646 // Allocate space for the Status Code Header and its buffer -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
r58459 r58466 32 32 [Sources] 33 33 ReportStatusCodeLib.c 34 34 35 35 [Packages] 36 36 MdePkg/MdePkg.dec -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
r58459 r58466 37 37 38 38 // 39 // The current maximum number of logging entries. If current number of 39 // The current maximum number of logging entries. If current number of 40 40 // entries exceeds this value, it will re-allocate a larger array and 41 41 // migration the old data to the larger array. … … 452 452 453 453 This SMI handler provides services for the performance wrapper driver. 454 454 455 455 Caution: This function may receive untrusted input. 456 456 Communicate buffer and buffer size are external input, so this function will do basic validation. … … 463 463 @param[in, out] CommBufferSize The size of the CommBuffer. 464 464 465 @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers 465 @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers 466 466 should still be called. 467 @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quiesced but other handlers should 467 @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quiesced but other handlers should 468 468 still be called. 469 @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pending and other handlers should still 469 @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pending and other handlers should still 470 470 be called. 471 471 @retval EFI_INTERRUPT_PENDING The interrupt could not be quiesced. … … 508 508 return EFI_SUCCESS; 509 509 } 510 510 511 511 SmmPerfCommData = (SMM_PERF_COMMUNICATE_EX *)CommBuffer; 512 512 … … 552 552 553 553 SmmPerfCommData->ReturnStatus = Status; 554 554 555 555 return EFI_SUCCESS; 556 556 } … … 571 571 @param[in, out] CommBufferSize The size of the CommBuffer. 572 572 573 @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers 573 @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers 574 574 should still be called. 575 @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quiesced but other handlers should 575 @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quiesced but other handlers should 576 576 still be called. 577 @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pending and other handlers should still 577 @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pending and other handlers should still 578 578 be called. 579 579 @retval EFI_INTERRUPT_PENDING The interrupt could not be quiesced. … … 664 664 665 665 SmmPerfCommData->ReturnStatus = Status; 666 666 667 667 return EFI_SUCCESS; 668 668 } 669 669 670 670 /** 671 SmmBase2 protocol notify callback function, when SMST and SMM memory service get initialized 672 this function is callbacked to initialize the Smm Performance Lib 671 SmmBase2 protocol notify callback function, when SMST and SMM memory service get initialized 672 this function is callbacked to initialize the Smm Performance Lib 673 673 674 674 @param Event The event of notify protocol. … … 695 695 mGaugeData = AllocateZeroPool (sizeof (GAUGE_DATA_HEADER) + (sizeof (GAUGE_DATA_ENTRY_EX) * mMaxGaugeRecords)); 696 696 ASSERT (mGaugeData != NULL); 697 697 698 698 // 699 699 // Install the protocol interfaces. … … 726 726 727 727 /** 728 The constructor function initializes the Performance Measurement Enable flag and 728 The constructor function initializes the Performance Measurement Enable flag and 729 729 registers SmmBase2 protocol notify callback. 730 730 It will ASSERT() if one of these operations fails and it will always return EFI_SUCCESS. … … 902 902 EFIAPI 903 903 GetPerformanceMeasurementEx ( 904 IN UINTN LogEntryKey, 904 IN UINTN LogEntryKey, 905 905 OUT CONST VOID **Handle, 906 906 OUT CONST CHAR8 **Token, … … 915 915 916 916 GaugeData = NULL; 917 917 918 918 ASSERT (Handle != NULL); 919 919 ASSERT (Token != NULL); -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf
r58459 r58466 1 1 ## @file 2 2 # Performance library instance used by SMM Core. 3 # 3 # 4 4 # This library provides the performance measurement interfaces and initializes performance 5 5 # logging for the SMM phase. … … 8 8 # This library is mainly used by SMM Core to start performance logging to ensure that 9 9 # SMM Performance and PerformanceEx Protocol are installed at the very beginning of SMM phase. 10 # 10 # 11 11 # Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR> 12 12 # This program and the accompanying materials … … 14 14 # which accompanies this distribution. The full text of the license may be found at 15 15 # http://opensource.org/licenses/bsd-license.php 16 # 16 # 17 17 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 18 18 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 19 # 19 # 20 20 ## 21 21 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLibInternal.h
r58459 r58466 15 15 16 16 **/ 17 17 18 18 #ifndef _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_ 19 19 #define _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_ … … 29 29 #include <Library/TimerLib.h> 30 30 #include <Library/PcdLib.h> 31 #include <Library/UefiLib.h> 31 #include <Library/UefiLib.h> 32 32 #include <Library/UefiBootServicesTableLib.h> 33 33 #include <Library/MemoryAllocationLib.h> -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.c
r48674 r58466 17 17 /** 18 18 Performs platform specific tasks before invoking registered SMI handlers. 19 19 20 20 This function performs platform specific tasks before invoking registered SMI handlers. 21 21 22 22 @retval EFI_SUCCESS The platform hook completes successfully. 23 23 @retval Other values The paltform hook cannot complete due to some error. … … 36 36 /** 37 37 Performs platform specific tasks after invoking registered SMI handlers. 38 38 39 39 This function performs platform specific tasks after invoking registered SMI handlers. 40 40 41 41 @retval EFI_SUCCESS The platform hook completes successfully. 42 42 @retval Other values The paltform hook cannot complete due to some error. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.c
r48674 r58466 297 297 @retval RETURN_SUCCESS the information is restored successfully. 298 298 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or one of Buffer and Length is NULL. 299 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 299 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 300 300 LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute. 301 301 @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf
r58459 r58466 27 27 # The following information is for reference only and not required by the build tools. 28 28 # 29 # VALID_ARCHITECTURES = IA32 X64 29 # VALID_ARCHITECTURES = IA32 X64 30 30 # 31 31 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
r48674 r58466 238 238 239 239 @retval RETURN_SUCCESS the information is restored successfully. 240 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 240 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 241 241 LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute. 242 242 @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information. … … 510 510 @retval RETURN_SUCCESS the information is restored successfully. 511 511 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or one of Buffer and Length is NULL. 512 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 512 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 513 513 LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute. 514 514 @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf
r58459 r58466 27 27 # The following information is for reference only and not required by the build tools. 28 28 # 29 # VALID_ARCHITECTURES = IA32 X64 29 # VALID_ARCHITECTURES = IA32 X64 30 30 # 31 31 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.c
r58459 r58466 69 69 @param[in] SystemTable A Pointer to the EFI System Table. 70 70 71 @retval EFI_SUCEESS 71 @retval EFI_SUCEESS 72 72 @return Others Some error occurs. 73 73 **/ … … 414 414 @retval RETURN_SUCCESS the information is restored successfully. 415 415 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or one of Buffer and Length is NULL. 416 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 416 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no 417 417 LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute. 418 418 @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information. -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.inf
r58459 r58466 28 28 # The following information is for reference only and not required by the build tools. 29 29 # 30 # VALID_ARCHITECTURES = IA32 X64 30 # VALID_ARCHITECTURES = IA32 X64 31 31 # 32 32 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.c
r58459 r58466 50 50 ) 51 51 { 52 52 53 53 mPerformanceMeasurementEnabled = (BOOLEAN) ((PcdGet8(PcdPerformanceLibraryPropertyMask) & PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED) != 0); 54 54 … … 247 247 EFIAPI 248 248 GetPerformanceMeasurementEx ( 249 IN UINTN LogEntryKey, 249 IN UINTN LogEntryKey, 250 250 OUT CONST VOID **Handle, 251 251 OUT CONST CHAR8 **Token, -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf
r58459 r58466 1 1 ## @file 2 2 # Performance library instance used in SMM phase. 3 # 3 # 4 4 # This library instance provides infrastructure for SMM drivers to log performance 5 5 # data. It consumes SMM PerformanceEx or Performance Protocol published by SmmCorePerformanceLib 6 6 # to log performance data. If both SMM PerformanceEx and Performance Protocol are not available, 7 7 # it does not log any performance information. 8 # 8 # 9 9 # Copyright (c) 2011 - 2014, 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 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c
r48674 r58466 93 93 } 94 94 } 95 95 96 96 // 97 97 // A status code service is present in system, so pass in all the parameters to the service. … … 99 99 return (*mReportStatusCode) (mStatusCodeProtocol, Type, Value, Instance, (EFI_GUID *)CallerId, Data); 100 100 } 101 101 102 102 return EFI_UNSUPPORTED; 103 103 } -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c
r48674 r58466 17 17 18 18 /** 19 Retrieves a pointer to the a Null-terminated ASCII string containing the list 20 of languages that an HII handle in the HII Database supports. The returned 19 Retrieves a pointer to the a Null-terminated ASCII string containing the list 20 of languages that an HII handle in the HII Database supports. The returned 21 21 string is allocated using AllocatePool(). The caller is responsible for freeing 22 22 the returned string using FreePool(). The format of the returned string follows 23 23 the language format assumed the HII Database. 24 24 25 25 If HiiHandle is NULL, then ASSERT(). 26 26 … … 28 28 29 29 @retval NULL HiiHandle is not registered in the HII database 30 @retval NULL There are not enough resources available to retrieve the suported 30 @retval NULL There are not enough resources available to retrieve the suported 31 31 languages. 32 32 @retval NULL The list of suported languages could not be retrieved. … … 54 54 55 55 // 56 // If GetLanguages() returns EFI_SUCCESS for a zero size, 57 // then there are no supported languages registered for HiiHandle. If GetLanguages() 56 // If GetLanguages() returns EFI_SUCCESS for a zero size, 57 // then there are no supported languages registered for HiiHandle. If GetLanguages() 58 58 // returns an error other than EFI_BUFFER_TOO_SMALL, then HiiHandle is not present 59 59 // in the HII Database -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
r58459 r58466 45 45 46 46 // 47 // Template used to mark the end of a list of packages 47 // Template used to mark the end of a list of packages 48 48 // 49 49 GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_HII_PACKAGE_HEADER mEndOfPakageList = { … … 86 86 Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &BufferSize, HiiPackageList); 87 87 ASSERT (Status != EFI_NOT_FOUND); 88 88 89 89 if (Status == EFI_BUFFER_TOO_SMALL) { 90 90 HiiPackageList = AllocatePool (BufferSize); … … 116 116 the list of package is 0, then NULL is returned. 117 117 118 The variable arguments are pointers which point to package header that defined 118 The variable arguments are pointers which point to package header that defined 119 119 by UEFI VFR compiler and StringGather tool. 120 120 … … 125 125 } EDKII_AUTOGEN_PACKAGES_HEADER; 126 126 #pragma pack (pop) 127 127 128 128 @param[in] PackageListGuid The GUID of the package list. 129 @param[in] DeviceHandle If not NULL, the Device Handle on which 129 @param[in] DeviceHandle If not NULL, the Device Handle on which 130 130 an instance of DEVICE_PATH_PROTOCOL is installed. 131 This Device Handle uniquely defines the device that 131 This Device Handle uniquely defines the device that 132 132 the added packages are associated with. 133 @param[in] ... The variable argument list that contains pointers 133 @param[in] ... The variable argument list that contains pointers 134 134 to packages terminated by a NULL. 135 135 … … 169 169 170 170 // 171 // If there are no packages in the variable argument list or all the packages 171 // If there are no packages in the variable argument list or all the packages 172 172 // are empty, then return a NULL HII Handle 173 173 // … … 177 177 178 178 // 179 // Add the length of the Package List Header and the terminating Package Header 179 // Add the length of the Package List Header and the terminating Package Header 180 180 // 181 181 Length += sizeof (EFI_HII_PACKAGE_LIST_HEADER) + sizeof (EFI_HII_PACKAGE_HEADER); … … 223 223 // 224 224 Status = gHiiDatabase->NewPackageList ( 225 gHiiDatabase, 226 PackageListHeader, 227 DeviceHandle, 225 gHiiDatabase, 226 PackageListHeader, 227 DeviceHandle, 228 228 &HiiHandle 229 229 ); … … 273 273 The caller is responsible for freeing the array with FreePool(). 274 274 275 @param[in] PackageListGuid An optional parameter that is used to request 275 @param[in] PackageListGuid An optional parameter that is used to request 276 276 HII Handles associated with a specific 277 277 Package List GUID. If this parameter is NULL, 278 278 then all the HII Handles in the HII Database 279 279 are returned. If this parameter is not NULL, 280 then zero or more HII Handles associated with 280 then zero or more HII Handles associated with 281 281 PackageListGuid are returned. 282 282 … … 313 313 314 314 // 315 // If ListPackageLists() returns EFI_SUCCESS for a zero size, 316 // then there are no HII handles in the HII database. If ListPackageLists() 317 // returns an error other than EFI_BUFFER_TOO_SMALL, then there are no HII 315 // If ListPackageLists() returns EFI_SUCCESS for a zero size, 316 // then there are no HII handles in the HII database. If ListPackageLists() 317 // returns an error other than EFI_BUFFER_TOO_SMALL, then there are no HII 318 318 // handles in the HII database. 319 319 // 320 320 if (Status != EFI_BUFFER_TOO_SMALL) { 321 321 // 322 // Return NULL if the size can not be retrieved, or if there are no HII 322 // Return NULL if the size can not be retrieved, or if there are no HII 323 323 // handles in the HII Database 324 324 // … … 365 365 ASSERT_EFI_ERROR (Status); 366 366 if (CompareGuid (&Guid, PackageListGuid)) { 367 HiiHandleBuffer[Index2++] = HiiHandleBuffer[Index1]; 367 HiiHandleBuffer[Index2++] = HiiHandleBuffer[Index1]; 368 368 } 369 369 } … … 379 379 380 380 /** 381 Converts all hex dtring characters in range ['A'..'F'] to ['a'..'f'] for 381 Converts all hex dtring characters in range ['A'..'F'] to ['a'..'f'] for 382 382 hex digits that appear between a '=' and a '&' in a config string. 383 383 … … 417 417 418 418 /** 419 Uses the BlockToConfig() service of the Config Routing Protocol to 419 Uses the BlockToConfig() service of the Config Routing Protocol to 420 420 convert <ConfigRequest> and a buffer to a <ConfigResp> 421 421 … … 464 464 465 465 /** 466 Uses the BrowserCallback() service of the Form Browser Protocol to retrieve 467 or set uncommitted data. If sata i being retrieved, then the buffer is 468 allocated using AllocatePool(). The caller is then responsible for freeing 466 Uses the BrowserCallback() service of the Form Browser Protocol to retrieve 467 or set uncommitted data. If sata i being retrieved, then the buffer is 468 allocated using AllocatePool(). The caller is then responsible for freeing 469 469 the buffer using FreePool(). 470 470 471 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional 471 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional 472 472 parameter that may be NULL. 473 @param[in] VariableName Pointer to a Null-terminated Unicode string. This 473 @param[in] VariableName Pointer to a Null-terminated Unicode string. This 474 474 is an optional parameter that may be NULL. 475 475 @param[in] SetResultsData If not NULL, then this parameter specified the buffer … … 524 524 VariableName 525 525 ); 526 526 527 527 if (!EFI_ERROR (Status)) { 528 528 // … … 565 565 566 566 /** 567 Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing 567 Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing 568 568 information that includes a GUID, an optional Unicode string name, and a device 569 path. The string returned is allocated with AllocatePool(). The caller is 569 path. The string returned is allocated with AllocatePool(). The caller is 570 570 responsible for freeing the allocated string with FreePool(). 571 571 572 572 The format of a <ConfigHdr> is as follows: 573 573 … … 575 575 576 576 @param[in] Guid Pointer to an EFI_GUID that is the routing information 577 GUID. Each of the 16 bytes in Guid is converted to 578 a 2 Unicode character hexidecimal string. This is 577 GUID. Each of the 16 bytes in Guid is converted to 578 a 2 Unicode character hexidecimal string. This is 579 579 an optional parameter that may be NULL. 580 @param[in] Name Pointer to a Null-terminated Unicode string that is 581 the routing information NAME. This is an optional 582 parameter that may be NULL. Each 16-bit Unicode 583 character in Name is converted to a 4 character Unicode 584 hexidecimal string. 580 @param[in] Name Pointer to a Null-terminated Unicode string that is 581 the routing information NAME. This is an optional 582 parameter that may be NULL. Each 16-bit Unicode 583 character in Name is converted to a 4 character Unicode 584 hexidecimal string. 585 585 @param[in] DriverHandle The driver handle which supports a Device Path Protocol 586 586 that is the routing information PATH. Each byte of … … 609 609 610 610 // 611 // Compute the length of Name in Unicode characters. 611 // Compute the length of Name in Unicode characters. 612 612 // If Name is NULL, then the length is 0. 613 613 // … … 656 656 } 657 657 } 658 658 659 659 // 660 660 // Append L"&NAME=" … … 697 697 698 698 /** 699 Convert the hex UNICODE encoding string of UEFI GUID, NAME or device path 699 Convert the hex UNICODE encoding string of UEFI GUID, NAME or device path 700 700 to binary buffer from <ConfigHdr>. 701 701 … … 730 730 return EFI_INVALID_PARAMETER; 731 731 } 732 732 733 733 DataBuffer = NULL; 734 734 StringPtr = NULL; … … 765 765 } 766 766 } 767 767 768 768 *Buffer = DataBuffer; 769 769 break; … … 772 772 // 773 773 // Convert Config String to Unicode String, e.g. "0041004200430044" => "ABCD" 774 // 774 // 775 775 776 776 // … … 808 808 This function checks VarOffset and VarWidth is in the block range. 809 809 810 @param BlockArray The block array is to be checked. 810 @param BlockArray The block array is to be checked. 811 811 @param VarOffset Offset of var to the structure 812 812 @param VarWidth Width of var. 813 813 814 814 @retval TRUE This Var is in the block range. 815 815 @retval FALSE This Var is not in the block range. … … 824 824 LIST_ENTRY *Link; 825 825 IFR_BLOCK_DATA *BlockData; 826 826 827 827 // 828 828 // No Request Block array, all vars are got. … … 831 831 return TRUE; 832 832 } 833 833 834 834 // 835 835 // Check the input var is in the request block range. … … 888 888 } 889 889 Length = StringPtr - ValueString; 890 890 891 891 // 892 892 // Allocate buffer to store the value … … 896 896 return EFI_OUT_OF_RESOURCES; 897 897 } 898 898 899 899 // 900 900 // Convert character one by one to the value buffer … … 910 910 } 911 911 } 912 912 913 913 // 914 914 // Set the converted value and string length. … … 925 925 @param VarName The variable name which need to get value. 926 926 @param VarValue The return value. 927 927 928 928 @retval EFI_SUCCESS Get the value for the VarName 929 929 @retval EFI_OUT_OF_RESOURCES The memory is not enough. … … 983 983 @param HiiHandle The HiiHandle for this formset. 984 984 @param NameValueType Whether current storage is name/value varstore or not. 985 985 986 986 @retval EFI_SUCCESS The current setting is valid. 987 987 @retval EFI_OUT_OF_RESOURCES The memory is not enough. … … 1121 1121 1122 1122 // 1123 // If the length is small than the structure, this is from old efi 1124 // varstore definition. Old efi varstore get config directly from 1123 // If the length is small than the structure, this is from old efi 1124 // varstore definition. Old efi varstore get config directly from 1125 1125 // GetVariable function. 1126 1126 // … … 1169 1169 1170 1170 // 1171 // OneOf question is not in IFR Form. This IFR form is not valid. 1171 // OneOf question is not in IFR Form. This IFR form is not valid. 1172 1172 // 1173 1173 if (VarStoreData.VarStoreId == 0) { 1174 1174 return EFI_INVALID_PARAMETER; 1175 1175 } 1176 // 1176 // 1177 1177 // Check whether this question is for the requested varstore. 1178 1178 // … … 1213 1213 } 1214 1214 // 1215 // Check this var question is in the var storage 1215 // Check this var question is in the var storage 1216 1216 // 1217 1217 if ((Offset + Width) > VarStoreData.Size) { 1218 1218 // 1219 // This question exceeds the var store size. 1219 // This question exceeds the var store size. 1220 1220 // 1221 1221 return EFI_INVALID_PARAMETER; … … 1240 1240 1241 1241 // 1242 // Numeric question is not in IFR Form. This IFR form is not valid. 1242 // Numeric question is not in IFR Form. This IFR form is not valid. 1243 1243 // 1244 1244 if (VarStoreData.VarStoreId == 0) { … … 1263 1263 break; 1264 1264 } 1265 1265 1266 1266 Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue); 1267 1267 if (EFI_ERROR (Status)) { … … 1284 1284 } 1285 1285 // 1286 // Check this var question is in the var storage 1286 // Check this var question is in the var storage 1287 1287 // 1288 1288 if ((Offset + Width) > VarStoreData.Size) { 1289 1289 // 1290 // This question exceeds the var store size. 1290 // This question exceeds the var store size. 1291 1291 // 1292 1292 return EFI_INVALID_PARAMETER; … … 1341 1341 1342 1342 // 1343 // CheckBox question is not in IFR Form. This IFR form is not valid. 1343 // CheckBox question is not in IFR Form. This IFR form is not valid. 1344 1344 // 1345 1345 if (VarStoreData.VarStoreId == 0) { … … 1365 1365 break; 1366 1366 } 1367 1367 1368 1368 Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue); 1369 1369 if (EFI_ERROR (Status)) { … … 1386 1386 } 1387 1387 // 1388 // Check this var question is in the var storage 1388 // Check this var question is in the var storage 1389 1389 // 1390 1390 if ((Offset + Width) > VarStoreData.Size) { 1391 1391 // 1392 // This question exceeds the var store size. 1392 // This question exceeds the var store size. 1393 1393 // 1394 1394 return EFI_INVALID_PARAMETER; … … 1413 1413 1414 1414 // 1415 // CheckBox question is not in IFR Form. This IFR form is not valid. 1415 // CheckBox question is not in IFR Form. This IFR form is not valid. 1416 1416 // 1417 1417 if (VarStoreData.VarStoreId == 0) { … … 1444 1444 // 1445 1445 // Skip the "=". 1446 // 1446 // 1447 1447 StringPtr += 1; 1448 1448 1449 1449 // 1450 1450 // Check current string length is less than maxsize … … 1468 1468 } 1469 1469 // 1470 // Check this var question is in the var storage 1470 // Check this var question is in the var storage 1471 1471 // 1472 1472 if ((Offset + Width) > VarStoreData.Size) { 1473 1473 // 1474 // This question exceeds the var store size. 1474 // This question exceeds the var store size. 1475 1475 // 1476 1476 return EFI_INVALID_PARAMETER; … … 1487 1487 case EFI_IFR_ONE_OF_OPTION_OP: 1488 1488 // 1489 // Opcode Scope is zero. This one of option is not to be checked. 1489 // Opcode Scope is zero. This one of option is not to be checked. 1490 1490 // 1491 1491 if (VarBlockData.Scope == 0) { … … 1522 1522 1523 1523 // 1524 // OneOf value doesn't belong to one of option value. 1524 // OneOf value doesn't belong to one of option value. 1525 1525 // 1526 1526 if ((VarBlockData.Scope == 0) && (VarBlockData.OpCode == EFI_IFR_ONE_OF_OP)) { … … 1563 1563 @param CurrentBlockArray Current block array. 1564 1564 @param VarBuffer Data buffer for this varstore. 1565 1565 1566 1566 @retval EFI_SUCCESS The current setting is valid. 1567 1567 @retval EFI_OUT_OF_RESOURCES The memory is not enough. … … 1587 1587 IFR_BLOCK_DATA *BlockArray; 1588 1588 UINT8 *DataBuffer; 1589 1589 1590 1590 // 1591 1591 // Initialize the local variables. … … 1623 1623 // 1624 1624 // Skip the &OFFSET= string 1625 // 1625 // 1626 1626 StringPtr += StrLen (L"&OFFSET="); 1627 1627 … … 1753 1753 1754 1754 // 1755 // If '\0', parsing is finished. 1755 // If '\0', parsing is finished. 1756 1756 // 1757 1757 if (*StringPtr == 0) { … … 1759 1759 } 1760 1760 // 1761 // Go to next ConfigBlock 1761 // Go to next ConfigBlock 1762 1762 // 1763 1763 } … … 1789 1789 FreePool (DataBuffer); 1790 1790 } 1791 1791 1792 1792 if (BlockArray != NULL) { 1793 1793 // … … 1814 1814 @param VarName Name of the buffer storage. 1815 1815 @param HiiHandle The HiiHandle for this package. 1816 1816 1817 1817 @retval EFI_SUCCESS The current setting is valid. 1818 1818 @retval EFI_OUT_OF_RESOURCES The memory is not enough. … … 1883 1883 FreePool (VarBuffer); 1884 1884 } 1885 1885 1886 1886 if (CurrentBlockArray != NULL) { 1887 1887 // … … 1908 1908 @retval TRUE The input include config request elements. 1909 1909 @retval FALSE The input string not includes. 1910 1910 1911 1911 **/ 1912 1912 BOOLEAN … … 1931 1931 string for setting default value and validating current setting. 1932 1932 1933 1. For setting default action, Reset the default value specified by DefaultId 1933 1. For setting default action, Reset the default value specified by DefaultId 1934 1934 to the driver configuration got by Request string. 1935 2. For validating current setting, Validate the current configuration 1935 2. For validating current setting, Validate the current configuration 1936 1936 by parsing HII form IFR opcode. 1937 1937 1938 1938 NULL request string support depends on the ExportConfig interface of 1939 1939 HiiConfigRouting protocol in UEFI specification. 1940 1941 @param Request A null-terminated Unicode string in 1940 1941 @param Request A null-terminated Unicode string in 1942 1942 <MultiConfigRequest> format. It can be NULL. 1943 1943 If it is NULL, all current configuration for the … … 1947 1947 @param DefaultId Specifies the type of defaults to retrieve only for setting default action. 1948 1948 @param ActionType Action supports setting defaults and validate current setting. 1949 1949 1950 1950 @retval TURE Action runs successfully. 1951 1951 @retval FALSE Action is not valid or Action can't be executed successfully.. … … 1990 1990 HiiHandle = NULL; 1991 1991 HiiPackageList = NULL; 1992 1992 1993 1993 // 1994 1994 // Only support set default and validate setting action. … … 2014 2014 ); 2015 2015 } 2016 2016 2017 2017 if (EFI_ERROR (Status)) { 2018 2018 return FALSE; 2019 2019 } 2020 2020 2021 2021 StringPtr = ConfigAltResp; 2022 2022 2023 2023 while (StringPtr != L'\0') { 2024 2024 // … … 2055 2055 goto Done; 2056 2056 } 2057 2057 2058 2058 // 2059 2059 // Get Path value DevicePath … … 2080 2080 goto Done; 2081 2081 } 2082 2082 2083 2083 // 2084 2084 // Find the matched Hii Handle for the found Driver handle … … 2104 2104 // This request string has no its Hii package. 2105 2105 // Its default value and validating can't execute by parsing IFR data. 2106 // Directly jump into the next ConfigAltResp string for another pair Guid, Name, and Path. 2106 // Directly jump into the next ConfigAltResp string for another pair Guid, Name, and Path. 2107 2107 // 2108 2108 Status = EFI_SUCCESS; … … 2116 2116 HiiPackageList = NULL; 2117 2117 Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, HiiHandle, &PackageListLength, HiiPackageList); 2118 2118 2119 2119 // 2120 2120 // The return status should always be EFI_BUFFER_TOO_SMALL as input buffer's size is 0. … … 2124 2124 goto Done; 2125 2125 } 2126 2126 2127 2127 HiiPackageList = AllocatePool (PackageListLength); 2128 2128 if (HiiPackageList == NULL) { … … 2130 2130 goto Done; 2131 2131 } 2132 2132 2133 2133 // 2134 2134 // Get PackageList on HiiHandle … … 2138 2138 goto Done; 2139 2139 } 2140 2140 2141 2141 // 2142 2142 // 3. Call ConfigRouting GetAltCfg(ConfigRoute, <ConfigResponse>, Guid, Name, DevicePath, AltCfgId, AltCfgResp) … … 2152 2152 &ConfigResp 2153 2153 ); 2154 2154 2155 2155 // 2156 2156 // The required setting can't be found. So, it is not required to be validated and set. … … 2166 2166 goto NextConfigAltResp; 2167 2167 } 2168 2168 2169 2169 // 2170 2170 // 4. Set the default configuration information or Validate current setting by parse IFR code. … … 2195 2195 HiiPackageList = NULL; 2196 2196 } 2197 2197 2198 2198 if (ConfigResp != NULL) { 2199 2199 FreePool (ConfigResp); … … 2206 2206 FreePool (VarGuid); 2207 2207 VarGuid = NULL; 2208 2208 2209 2209 FreePool (VarName); 2210 2210 VarName = NULL; 2211 2211 2212 2212 FreePool (DevicePath); 2213 2213 DevicePath = NULL; … … 2226 2226 break; 2227 2227 } 2228 2229 // 2230 // Construct ConfigAltHdr string "&<ConfigHdr>&ALTCFG=\0" 2228 2229 // 2230 // Construct ConfigAltHdr string "&<ConfigHdr>&ALTCFG=\0" 2231 2231 // | 1 | StrLen (ConfigHdr) | 8 | 1 | 2232 2232 // … … 2239 2239 StrnCat (ConfigAltHdr, StringHdr, StringPtr - StringHdr); 2240 2240 StrCat (ConfigAltHdr, L"&ALTCFG="); 2241 2241 2242 2242 // 2243 2243 // Skip all AltResp (AltConfigHdr ConfigBody) for the same ConfigHdr … … 2249 2249 } 2250 2250 } 2251 2251 2252 2252 // 2253 2253 // Free the allocated ConfigAltHdr string … … 2257 2257 break; 2258 2258 } 2259 2259 2260 2260 // 2261 2261 // Find &GUID as the next ConfigHdr … … 2271 2271 StringPtr ++; 2272 2272 } 2273 2273 2274 2274 Done: 2275 2275 if (VarGuid != NULL) { … … 2292 2292 FreePool (ConfigAltResp); 2293 2293 } 2294 2294 2295 2295 if (HiiPackageList != NULL) { 2296 2296 FreePool (HiiPackageList); 2297 2297 } 2298 2298 2299 2299 if (EFI_ERROR (Status)) { 2300 2300 return FALSE; … … 2309 2309 NULL request string support depends on the ExportConfig interface of 2310 2310 HiiConfigRouting protocol in UEFI specification. 2311 2312 @param Request A null-terminated Unicode string in 2311 2312 @param Request A null-terminated Unicode string in 2313 2313 <MultiConfigRequest> format. It can be NULL. 2314 2314 If it is NULL, all current configuration for the 2315 2315 entirety of the current HII database will be validated. 2316 2316 2317 2317 @retval TRUE Current configuration is valid. 2318 2318 @retval FALSE Current configuration is invalid. 2319 2319 **/ 2320 2320 BOOLEAN 2321 EFIAPI 2321 EFIAPI 2322 2322 HiiValidateSettings ( 2323 2323 IN CONST EFI_STRING Request OPTIONAL … … 2329 2329 /** 2330 2330 Reset the default value specified by DefaultId to the driver 2331 configuration got by Request string. 2331 configuration got by Request string. 2332 2332 2333 2333 NULL request string support depends on the ExportConfig interface of 2334 2334 HiiConfigRouting protocol in UEFI specification. 2335 2336 @param Request A null-terminated Unicode string in 2335 2336 @param Request A null-terminated Unicode string in 2337 2337 <MultiConfigRequest> format. It can be NULL. 2338 2338 If it is NULL, all configuration for the 2339 2339 entirety of the current HII database will be reset. 2340 2340 @param DefaultId Specifies the type of defaults to retrieve. 2341 2341 2342 2342 @retval TURE The default value is set successfully. 2343 2343 @retval FALSE The default value can't be found and set. … … 2356 2356 Determines if two values in config strings match. 2357 2357 2358 Compares the substring between StartSearchString and StopSearchString in 2359 FirstString to the substring between StartSearchString and StopSearchString 2358 Compares the substring between StartSearchString and StopSearchString in 2359 FirstString to the substring between StartSearchString and StopSearchString 2360 2360 in SecondString. If the two substrings match, then TRUE is returned. If the 2361 2361 two substrings do not match, then FALSE is returned. … … 2368 2368 @param FirstString Pointer to the first Null-terminated Unicode string. 2369 2369 @param SecondString Pointer to the second Null-terminated Unicode string. 2370 @param StartSearchString Pointer to the Null-terminated Unicode string that 2370 @param StartSearchString Pointer to the Null-terminated Unicode string that 2371 2371 marks the start of the value string to compare. 2372 @param StopSearchString Pointer to the Null-terminated Unicode string that 2372 @param StopSearchString Pointer to the Null-terminated Unicode string that 2373 2373 marks the end of the value string to compare. 2374 2374 2375 @retval FALSE StartSearchString is not present in FirstString. 2375 @retval FALSE StartSearchString is not present in FirstString. 2376 2376 @retval FALSE StartSearchString is not present in SecondString. 2377 @retval FALSE StopSearchString is not present in FirstString. 2377 @retval FALSE StopSearchString is not present in FirstString. 2378 2378 @retval FALSE StopSearchString is not present in SecondString. 2379 @retval FALSE The length of the substring in FirstString is not the 2379 @retval FALSE The length of the substring in FirstString is not the 2380 2380 same length as the substring in SecondString. 2381 @retval FALSE The value string in FirstString does not matche the 2381 @retval FALSE The value string in FirstString does not matche the 2382 2382 value string in SecondString. 2383 @retval TRUE The value string in FirstString matches the value 2383 @retval TRUE The value string in FirstString matches the value 2384 2384 string in SecondString. 2385 2385 … … 2490 2490 buffer. 2491 2491 2492 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional 2492 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional 2493 2493 parameter that may be NULL. 2494 @param[in] VariableName Pointer to a Null-terminated Unicode string. This 2494 @param[in] VariableName Pointer to a Null-terminated Unicode string. This 2495 2495 is an optional parameter that may be NULL. 2496 @param[in] BufferSize Length in bytes of buffer to hold retrieved data. 2496 @param[in] BufferSize Length in bytes of buffer to hold retrieved data. 2497 2497 @param[out] Buffer Buffer of data to be updated. 2498 2498 … … 2531 2531 ConfigResp = AllocateZeroPool (Size); 2532 2532 UnicodeSPrint (ConfigResp, Size, L"%s&%s", mConfigHdrTemplate, ResultsData); 2533 2533 2534 2534 // 2535 2535 // Free the allocated buffer … … 2576 2576 buffer data will be send back to Browser. If NULL, 2577 2577 the whole buffer of data will be committed to 2578 Browser. 2578 Browser. 2579 2579 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>* 2580 2580 … … 2605 2605 if (RequestElement == NULL) { 2606 2606 // 2607 // Allocate and fill a buffer large enough to hold the <ConfigHdr> template 2607 // Allocate and fill a buffer large enough to hold the <ConfigHdr> template 2608 2608 // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator 2609 2609 // … … 2613 2613 } else { 2614 2614 // 2615 // Allocate and fill a buffer large enough to hold the <ConfigHdr> template 2615 // Allocate and fill a buffer large enough to hold the <ConfigHdr> template 2616 2616 // followed by <RequestElement> followed by a Null-terminator 2617 2617 // … … 2672 2672 2673 2673 /** 2674 Allocates and returns a new OpCode Handle. OpCode Handles must be freed with 2674 Allocates and returns a new OpCode Handle. OpCode Handles must be freed with 2675 2675 HiiFreeOpCodeHandle(). 2676 2676 … … 2730 2730 /** 2731 2731 Internal function gets the current position of opcode buffer. 2732 2732 2733 2733 @param[in] OpCodeHandle Handle to the buffer of opcodes. 2734 2734 … … 2746 2746 /** 2747 2747 Internal function gets the start pointer of opcode buffer. 2748 2748 2749 2749 @param[in] OpCodeHandle Handle to the buffer of opcodes. 2750 2750 … … 2763 2763 Internal function reserves the enough buffer for current opcode. 2764 2764 When the buffer is not enough, Opcode buffer will be extended. 2765 2765 2766 2766 @param[in] OpCodeHandle Handle to the buffer of opcodes. 2767 2767 @param[in] Size Size of current opcode. … … 2784 2784 if (OpCodeBuffer->Position + Size > OpCodeBuffer->BufferSize) { 2785 2785 Buffer = ReallocatePool ( 2786 OpCodeBuffer->BufferSize, 2786 OpCodeBuffer->BufferSize, 2787 2787 OpCodeBuffer->BufferSize + (Size + HII_LIB_OPCODE_ALLOCATION_SIZE), 2788 2788 OpCodeBuffer->Buffer … … 2799 2799 /** 2800 2800 Internal function creates opcode based on the template opcode. 2801 2801 2802 2802 @param[in] OpCodeHandle Handle to the buffer of opcodes. 2803 2803 @param[in] OpCodeTemplate Pointer to the template buffer of opcode. … … 2836 2836 /** 2837 2837 Internal function creates opcode based on the template opcode for the normal opcode. 2838 2838 2839 2839 @param[in] OpCodeHandle Handle to the buffer of opcodes. 2840 2840 @param[in] OpCodeTemplate Pointer to the template buffer of opcode. … … 3021 3021 @param[in] OpCodeHandle Handle to the buffer of opcodes. 3022 3022 @param[in] Guid Pointer to EFI_GUID of this guided opcode. 3023 @param[in] GuidOpCode Pointer to an EFI_IFR_GUID opcode. This is an 3023 @param[in] GuidOpCode Pointer to an EFI_IFR_GUID opcode. This is an 3024 3024 optional parameter that may be NULL. If this 3025 parameter is NULL, then the GUID extension 3025 parameter is NULL, then the GUID extension 3026 3026 region of the created opcode is filled with zeros. 3027 If this parameter is not NULL, then the GUID 3028 extension region of GuidData will be copied to 3027 If this parameter is not NULL, then the GUID 3028 extension region of GuidData will be copied to 3029 3029 the GUID extension region of the created opcode. 3030 @param[in] OpCodeSize The size, in bytes, of created opcode. This value 3030 @param[in] OpCodeSize The size, in bytes, of created opcode. This value 3031 3031 must be >= sizeof(EFI_IFR_GUID). 3032 3032 … … 3054 3054 3055 3055 OpCodePointer = (EFI_IFR_GUID *)InternalHiiCreateOpCodeExtended ( 3056 OpCodeHandle, 3056 OpCodeHandle, 3057 3057 &OpCode, 3058 3058 EFI_IFR_GUID_OP, … … 3148 3148 3149 3149 return InternalHiiCreateOpCodeExtended ( 3150 OpCodeHandle, 3150 OpCodeHandle, 3151 3151 &OpCode, 3152 EFI_IFR_SUBTITLE_OP, 3153 sizeof (OpCode), 3154 0, 3152 EFI_IFR_SUBTITLE_OP, 3153 sizeof (OpCode), 3154 0, 3155 3155 Scope 3156 3156 ); … … 3202 3202 Create EFI_IFR_REF_OP, EFI_IFR_REF2_OP, EFI_IFR_REF3_OP and EFI_IFR_REF4_OP opcode. 3203 3203 3204 When RefDevicePath is not zero, EFI_IFR_REF4 opcode will be created. 3204 When RefDevicePath is not zero, EFI_IFR_REF4 opcode will be created. 3205 3205 When RefDevicePath is zero and RefFormSetId is not NULL, EFI_IFR_REF3 opcode will be created. 3206 3206 When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is not zero, EFI_IFR_REF2 opcode will be created. … … 3216 3216 @param[in] QuestionFlags The flags in Question Header 3217 3217 @param[in] QuestionId Question ID. 3218 @param[in] RefQuestionId The question on the form to which this link is referring. 3218 @param[in] RefQuestionId The question on the form to which this link is referring. 3219 3219 If its value is zero, then the link refers to the top of the form. 3220 @param[in] RefFormSetId The form set to which this link is referring. If its value is NULL, and RefDevicePath is 3220 @param[in] RefFormSetId The form set to which this link is referring. If its value is NULL, and RefDevicePath is 3221 3221 zero, then the link is to the current form set. 3222 @param[in] RefDevicePath The string identifier that specifies the string containing the text representation of 3222 @param[in] RefDevicePath The string identifier that specifies the string containing the text representation of 3223 3223 the device path to which the form set containing the form specified by FormId. 3224 3224 If its value is zero, then the link refers to the current page. … … 3814 3814 @param[in] FormId The Form ID. 3815 3815 @param[in] Package The package header. 3816 @param[in] OpCodeBufferStart An OpCode buffer that contains the set of IFR 3816 @param[in] OpCodeBufferStart An OpCode buffer that contains the set of IFR 3817 3817 opcodes to be inserted or replaced in the form. 3818 3818 @param[in] OpCodeBufferEnd An OpCcode buffer that contains the IFR opcode … … 3861 3861 BufferPos += IfrOpHdr->Length; 3862 3862 UpdatePackageLength += IfrOpHdr->Length; 3863 3863 3864 3864 // 3865 3865 // Find the matched FormSet and Form … … 3878 3878 } 3879 3879 } 3880 3880 3881 3881 // 3882 3882 // The matched Form is found, and Update data in this form … … 3907 3907 IfrOpHdr = (EFI_IFR_OP_HEADER *) ((UINT8 *) (IfrOpHdr) + IfrOpHdr->Length); 3908 3908 } 3909 3909 3910 3910 if (Offset >= PackageHeader.Length) { 3911 3911 // … … 3954 3954 IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length); 3955 3955 } 3956 3956 3957 3957 if (!Updated) { 3958 3958 // … … 3971 3971 3972 3972 /** 3973 This function updates a form that has previously been registered with the HII 3973 This function updates a form that has previously been registered with the HII 3974 3974 Database. This function will perform at most one update operation. 3975 3976 The form to update is specified by Handle, FormSetGuid, and FormId. Binary 3977 comparisons of IFR opcodes are performed from the beginning of the form being 3978 updated until an IFR opcode is found that exactly matches the first IFR opcode 3975 3976 The form to update is specified by Handle, FormSetGuid, and FormId. Binary 3977 comparisons of IFR opcodes are performed from the beginning of the form being 3978 updated until an IFR opcode is found that exactly matches the first IFR opcode 3979 3979 specified by StartOpCodeHandle. The following rules are used to determine if 3980 3980 an insert, replace, or delete operation is performed. 3981 3982 1) If no matches are found, then NULL is returned. 3981 3982 1) If no matches are found, then NULL is returned. 3983 3983 2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes 3984 from StartOpCodeHandle except the first opcode are inserted immediately after 3984 from StartOpCodeHandle except the first opcode are inserted immediately after 3985 3985 the matching IFR opcode in the form to be updated. 3986 3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made 3987 from the matching IFR opcode until an IFR opcode exactly matches the first 3986 3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made 3987 from the matching IFR opcode until an IFR opcode exactly matches the first 3988 3988 IFR opcode specified by EndOpCodeHandle. If no match is found for the first 3989 3989 IFR opcode specified by EndOpCodeHandle, then NULL is returned. If a match 3990 is found, then all of the IFR opcodes between the start match and the end 3990 is found, then all of the IFR opcodes between the start match and the end 3991 3991 match are deleted from the form being updated and all of the IFR opcodes 3992 from StartOpCodeHandle except the first opcode are inserted immediately after 3992 from StartOpCodeHandle except the first opcode are inserted immediately after 3993 3993 the matching start IFR opcode. If StartOpCcodeHandle only contains one 3994 3994 IFR instruction, then the result of this operation will delete all of the IFR … … 4003 4003 If it is NULL, all FormSet will be updated. 4004 4004 @param[in] FormId The ID of the form to update. 4005 @param[in] StartOpCodeHandle An OpCode Handle that contains the set of IFR 4005 @param[in] StartOpCodeHandle An OpCode Handle that contains the set of IFR 4006 4006 opcodes to be inserted or replaced in the form. 4007 The first IFR instruction in StartOpCodeHandle 4008 is used to find matching IFR opcode in the 4009 form. 4007 The first IFR instruction in StartOpCodeHandle 4008 is used to find matching IFR opcode in the 4009 form. 4010 4010 @param[in] EndOpCodeHandle An OpCcode Handle that contains the IFR opcode 4011 4011 that marks the end of a replace operation in 4012 4012 the form. This is an optional parameter that 4013 4013 may be NULL. If it is NULL, then an the IFR 4014 opcodes specified by StartOpCodeHandle are 4014 opcodes specified by StartOpCodeHandle are 4015 4015 inserted into the form. 4016 4016 4017 4017 @retval EFI_OUT_OF_RESOURCES No enough memory resource is allocated. 4018 4018 @retval EFI_NOT_FOUND The following cases will return EFI_NOT_FOUND. 4019 1) The form specified by HiiHandle, FormSetGuid, 4019 1) The form specified by HiiHandle, FormSetGuid, 4020 4020 and FormId could not be found in the HII Database. 4021 4021 2) No IFR opcodes in the target form match the first 4022 4022 IFR opcode in StartOpCodeHandle. 4023 3) EndOpCOde is not NULL, and no IFR opcodes in the 4024 target form following a matching start opcode match 4023 3) EndOpCOde is not NULL, and no IFR opcodes in the 4024 target form following a matching start opcode match 4025 4025 the first IFR opcode in EndOpCodeHandle. 4026 4026 @retval EFI_SUCCESS The matched form is updated by StartOpcode. … … 4030 4030 EFIAPI 4031 4031 HiiUpdateForm ( 4032 IN EFI_HII_HANDLE HiiHandle, 4032 IN EFI_HII_HANDLE HiiHandle, 4033 4033 IN EFI_GUID *FormSetGuid, OPTIONAL 4034 4034 IN EFI_FORM_ID FormId, … … 4039 4039 EFI_STATUS Status; 4040 4040 EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList; 4041 UINT32 PackageListLength; 4041 UINT32 PackageListLength; 4042 4042 UINT32 Offset; 4043 4043 EFI_HII_PACKAGE_LIST_HEADER *UpdatePackageList; … … 4050 4050 HII_LIB_OPCODE_BUFFER *OpCodeBufferStart; 4051 4051 HII_LIB_OPCODE_BUFFER *OpCodeBufferEnd; 4052 4052 4053 4053 // 4054 4054 // Input update data can't be NULL. … … 4059 4059 TempPacakge = NULL; 4060 4060 HiiPackageList = NULL; 4061 4061 4062 4062 // 4063 4063 // Retrieve buffer data from Opcode Handle … … 4065 4065 OpCodeBufferStart = (HII_LIB_OPCODE_BUFFER *) StartOpCodeHandle; 4066 4066 OpCodeBufferEnd = (HII_LIB_OPCODE_BUFFER *) EndOpCodeHandle; 4067 4067 4068 4068 // 4069 4069 // Get the original package list … … 4099 4099 goto Finish; 4100 4100 } 4101 4101 4102 4102 // 4103 4103 // Allocate temp buffer to store the temp updated package buffer … … 4116 4116 CopyMem (UpdateBufferPos, HiiPackageList, sizeof (EFI_HII_PACKAGE_LIST_HEADER)); 4117 4117 UpdateBufferPos += sizeof (EFI_HII_PACKAGE_LIST_HEADER); 4118 4118 4119 4119 // 4120 4120 // Go through each package to find the matched package and update one by one … … 4139 4139 // 4140 4140 // Set Update Flag 4141 // 4141 // 4142 4142 Updated = TRUE; 4143 4143 // … … 4155 4155 UpdateBufferPos += PackageHeader.Length; 4156 4156 } 4157 4157 4158 4158 if (Updated) { 4159 4159 // … … 4162 4162 BufferSize = UpdateBufferPos - (UINT8 *) UpdatePackageList; 4163 4163 WriteUnaligned32 (&UpdatePackageList->PackageLength, (UINT32) BufferSize); 4164 4164 4165 4165 // 4166 4166 // Update Package to show form … … 4178 4178 FreePool (HiiPackageList); 4179 4179 } 4180 4180 4181 4181 if (UpdatePackageList != NULL) { 4182 4182 FreePool (UpdatePackageList); 4183 4183 } 4184 4184 4185 4185 if (TempPacakge != NULL) { 4186 4186 FreePool (TempPacakge); 4187 4187 } 4188 4188 4189 return Status; 4190 } 4189 return Status; 4190 } -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiLib/HiiString.c
r58459 r58466 17 17 18 18 /** 19 This function create a new string in String Package or updates an existing 19 This function create a new string in String Package or updates an existing 20 20 string in a String Package. If StringId is 0, then a new string is added to 21 21 a String Package. If StringId is not zero, then a string in String Package is 22 22 updated. If SupportedLanguages is NULL, then the string is added or updated 23 23 for all the languages that the String Package supports. If SupportedLanguages 24 is not NULL, then the string is added or updated for the set of languages 24 is not NULL, then the string is added or updated for the set of languages 25 25 specified by SupportedLanguages. 26 26 27 27 If HiiHandle is NULL, then ASSERT(). 28 28 If String is NULL, then ASSERT(). 29 29 30 @param[in] HiiHandle A handle that was previously registered in the 30 @param[in] HiiHandle A handle that was previously registered in the 31 31 HII Database. 32 @param[in] StringId If zero, then a new string is created in the 33 String Package associated with HiiHandle. If 34 non-zero, then the string specified by StringId 35 is updated in the String Package associated 36 with HiiHandle. 37 @param[in] String A pointer to the Null-terminated Unicode string 38 to add or update in the String Package associated 32 @param[in] StringId If zero, then a new string is created in the 33 String Package associated with HiiHandle. If 34 non-zero, then the string specified by StringId 35 is updated in the String Package associated 39 36 with HiiHandle. 40 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string of 41 language codes. If this parameter is NULL, then 42 String is added or updated in the String Package 43 associated with HiiHandle for all the languages 44 that the String Package supports. If this 45 parameter is not NULL, then then String is added 46 or updated in the String Package associated with 47 HiiHandle for the set oflanguages specified by 48 SupportedLanguages. The format of 49 SupportedLanguages must follow the language 37 @param[in] String A pointer to the Null-terminated Unicode string 38 to add or update in the String Package associated 39 with HiiHandle. 40 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string of 41 language codes. If this parameter is NULL, then 42 String is added or updated in the String Package 43 associated with HiiHandle for all the languages 44 that the String Package supports. If this 45 parameter is not NULL, then then String is added 46 or updated in the String Package associated with 47 HiiHandle for the set oflanguages specified by 48 SupportedLanguages. The format of 49 SupportedLanguages must follow the language 50 50 format assumed the HII Database. 51 51 … … 139 139 140 140 /** 141 Retrieves a string from a string package names by GUID in a specific language. 142 If the language is not specified, then a string from a string package in the 143 current platform language is retrieved. If the string can not be retrieved 144 using the specified language or the current platform language, then the string 145 is retrieved from the string package in the first language the string package 146 supports. The returned string is allocated using AllocatePool(). The caller 141 Retrieves a string from a string package names by GUID in a specific language. 142 If the language is not specified, then a string from a string package in the 143 current platform language is retrieved. If the string can not be retrieved 144 using the specified language or the current platform language, then the string 145 is retrieved from the string package in the first language the string package 146 supports. The returned string is allocated using AllocatePool(). The caller 147 147 is responsible for freeing the allocated buffer using FreePool(). 148 148 149 149 If PackageListGuid is NULL, then ASSERT(). 150 150 If StringId is 0, then ASSERT. 151 151 152 @param[in] PackageListGuid The GUID of a package list that was previously 152 @param[in] PackageListGuid The GUID of a package list that was previously 153 153 registered in the HII Database. 154 @param[in] StringId The identifier of the string to retrieved from the 154 @param[in] StringId The identifier of the string to retrieved from the 155 155 string package associated with PackageListGuid. 156 @param[in] Language The language of the string to retrieve. If this 157 parameter is NULL, then the current platform 158 language is used. The format of Language must 156 @param[in] Language The language of the string to retrieve. If this 157 parameter is NULL, then the current platform 158 language is used. The format of Language must 159 159 follow the language format assumed the HII Database. 160 160 … … 191 191 /** 192 192 Retrieves a string from a string package in a specific language. If the language 193 is not specified, then a string from a string package in the current platform 194 language is retrieved. If the string can not be retrieved using the specified 195 language or the current platform language, then the string is retrieved from 196 the string package in the first language the string package supports. The 197 returned string is allocated using AllocatePool(). The caller is responsible 193 is not specified, then a string from a string package in the current platform 194 language is retrieved. If the string can not be retrieved using the specified 195 language or the current platform language, then the string is retrieved from 196 the string package in the first language the string package supports. The 197 returned string is allocated using AllocatePool(). The caller is responsible 198 198 for freeing the allocated buffer using FreePool(). 199 199 200 200 If HiiHandle is NULL, then ASSERT(). 201 201 If StringId is 0, then ASSET. 202 202 203 203 @param[in] HiiHandle A handle that was previously registered in the HII Database. 204 @param[in] StringId The identifier of the string to retrieved from the string 204 @param[in] StringId The identifier of the string to retrieved from the string 205 205 package associated with HiiHandle. 206 @param[in] Language The language of the string to retrieve. If this parameter 207 is NULL, then the current platform language is used. The 208 format of Language must follow the language format assumed 206 @param[in] Language The language of the string to retrieve. If this parameter 207 is NULL, then the current platform language is used. The 208 format of Language must follow the language format assumed 209 209 the HII Database. 210 210 … … 234 234 // 235 235 // Initialize all allocated buffers to NULL 236 // 236 // 237 237 SupportedLanguages = NULL; 238 238 PlatformLanguage = NULL; … … 254 254 255 255 // 256 // If Languag is NULL, then set it to an empty string, so it will be 256 // If Languag is NULL, then set it to an empty string, so it will be 257 257 // skipped by GetBestLanguage() 258 258 // … … 265 265 // 266 266 BestLanguage = GetBestLanguage ( 267 SupportedLanguages, 267 SupportedLanguages, 268 268 FALSE, // RFC 4646 mode 269 Language, // Highest priority 269 Language, // Highest priority 270 270 PlatformLanguage != NULL ? PlatformLanguage : "", // Next highest priority 271 SupportedLanguages, // Lowest priority 271 SupportedLanguages, // Lowest priority 272 272 NULL 273 273 ); … … 290 290 ); 291 291 // 292 // If GetString() returns EFI_SUCCESS for a zero size, 293 // then there are no supported languages registered for HiiHandle. If GetString() 292 // If GetString() returns EFI_SUCCESS for a zero size, 293 // then there are no supported languages registered for HiiHandle. If GetString() 294 294 // returns an error other than EFI_BUFFER_TOO_SMALL, then HiiHandle is not present 295 295 // in the HII Database -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiLib/InternalHiiLib.h
r48674 r58466 3 3 4 4 Copyright (c) 2007, 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 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c
r48674 r58466 1 1 /** @file 2 This library retrieves pointers to the UEFI HII Protocol instances in the 3 library's constructor. All of the UEFI HII related protocols are optional, 4 so the consumers of this library class must verify that the global variable 5 pointers are not NULL before use. 2 This library retrieves pointers to the UEFI HII Protocol instances in the 3 library's constructor. All of the UEFI HII related protocols are optional, 4 so the consumers of this library class must verify that the global variable 5 pointers are not NULL before use. 6 6 7 7 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> … … 55 55 /** 56 56 The constructor function retrieves pointers to the UEFI HII protocol instances 57 58 The constructor function retrieves pointers to the four UEFI HII protocols from the 59 handle database. These include the UEFI HII Font Protocol, the UEFI HII String 60 Protocol, the UEFI HII Image Protocol, the UEFI HII Database Protocol, and the 57 58 The constructor function retrieves pointers to the four UEFI HII protocols from the 59 handle database. These include the UEFI HII Font Protocol, the UEFI HII String 60 Protocol, the UEFI HII Image Protocol, the UEFI HII Database Protocol, and the 61 61 UEFI HII Config Routing Protocol. This function always return EFI_SUCCESS. 62 62 All of these protocols are optional if the platform does not support configuration 63 and the UEFI HII Image Protocol and the UEFI HII Font Protocol are optional if 63 and the UEFI HII Image Protocol and the UEFI HII Font Protocol are optional if 64 64 the platform does not support a graphical console. As a result, the consumers 65 65 of this library much check the protocol pointers againt NULL before using them, … … 83 83 84 84 // 85 // Retrieve the pointer to the UEFI HII String Protocol 85 // Retrieve the pointer to the UEFI HII String Protocol 86 86 // 87 87 Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &gHiiString); … … 89 89 90 90 // 91 // Retrieve the pointer to the UEFI HII Database Protocol 91 // Retrieve the pointer to the UEFI HII Database Protocol 92 92 // 93 93 Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &gHiiDatabase); … … 95 95 96 96 // 97 // Retrieve the pointer to the UEFI HII Config Routing Protocol 97 // Retrieve the pointer to the UEFI HII Config Routing Protocol 98 98 // 99 99 Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &gHiiConfigRouting); … … 101 101 102 102 // 103 // Retrieve the pointer to the optional UEFI HII Font Protocol 103 // Retrieve the pointer to the optional UEFI HII Font Protocol 104 104 // 105 105 gBS->LocateProtocol (&gEfiHiiFontProtocolGuid, NULL, (VOID **) &gHiiFont); 106 106 107 107 // 108 // Retrieve the pointer to the optional UEFI HII Image Protocol 108 // Retrieve the pointer to the optional UEFI HII Image Protocol 109 109 // 110 110 gBS->LocateProtocol (&gEfiHiiImageProtocolGuid, NULL, (VOID **) &gHiiImage); -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
r58459 r58466 1 1 ## @file 2 2 # UEFI HII Services Library implementation. 3 # 3 # 4 4 # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # … … 21 21 MODULE_TYPE = UEFI_DRIVER 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = UefiHiiServicesLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 23 LIBRARY_CLASS = UefiHiiServicesLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER 24 24 25 25 CONSTRUCTOR = UefiHiiServicesLibConstructor … … 39 39 UefiBootServicesTableLib 40 40 DebugLib 41 41 42 42 [Protocols] 43 gEfiHiiFontProtocolGuid ## SOMETIMES_CONSUMES 43 gEfiHiiFontProtocolGuid ## SOMETIMES_CONSUMES 44 44 gEfiHiiStringProtocolGuid ## CONSUMES 45 45 gEfiHiiImageProtocolGuid ## SOMETIMES_CONSUMES
Note:
See TracChangeset
for help on using the changeset viewer.