VirtualBox

Ignore:
Timestamp:
Oct 29, 2015 4:30:44 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103777
Message:

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
92 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.c

    r48674 r58466  
    1919  Performs platform specific initialization required for the CPU to access
    2020  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
    2323  hardware.  This function may be called more than once.
    2424
    2525  @retval RETURN_SUCCESS       The platform specific initialization succeeded.
    2626  @retval RETURN_DEVICE_ERROR  The platform specific initialization could not be completed.
    27  
     27
    2828**/
    2929RETURN_STATUS
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.c

    r48674 r58466  
    2020/**
    2121  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
    2323  is asynchronous to system operation and operates without regard to
    2424  cycle boundaries.
    2525
    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.
    2727**/
    2828VOID
     
    3636
    3737/**
    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
    3939  are set to their initial state. Pending cycles are not corrupted.
    4040
     
    5151
    5252/**
    53   This function causes the system to enter a power state equivalent 
     53  This function causes the system to enter a power state equivalent
    5454  to the ACPI G2/S5 or G3 states.
    5555
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c

    r58459 r58466  
    5959
    6060/**
    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
    6262  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
    6666  @param  Base    The base address register of UART device.
    6767  @param  Offset  The offset of the 16550 register to read.
     
    8686  Write an 8-bit 16550 register.  If PcdSerialUseMmio is TRUE, then the value is written to
    8787  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
    9191  @param  Base    The base address register of UART device.
    9292  @param  Offset  The offset of the 16550 register to write.
     
    111111
    112112/**
    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
    116116  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
    118118  using the bitmask specified by Mask.
    119119
     
    131131{
    132132  UINT16  CurrentValue;
    133  
     133
    134134  CurrentValue = PciRead16 (PciAddress) & Mask;
    135135  if (CurrentValue != 0) {
     
    140140
    141141/**
    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
    145145  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
    147147  using the bitmask specified by Mask.
    148148
     
    162162{
    163163  UINT32  CurrentValue;
    164  
     164
    165165  CurrentValue = PciRead32 (PciAddress) & Mask;
    166166  if (CurrentValue != 0) {
     
    171171
    172172/**
    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
    178178  @return  The base address register of the UART device.
    179179
     
    205205  //
    206206  DeviceInfo = (PCI_UART_DEVICE_INFO *) PcdGetPtr (PcdSerialPciDeviceInfo);
    207  
     207
    208208  //
    209209  // If PCI Device Info is empty, then assume fixed address UART and return PcdSerialRegisterBase
    210   // 
     210  //
    211211  if (DeviceInfo->Device == 0xff) {
    212212    return (UINTN)PcdGet64 (PcdSerialRegisterBase);
     
    220220  ParentIoBase      = 0 >> 12;
    221221  ParentIoLimit     = 0xf000 >> 12;
    222  
     222
    223223  //
    224224  // Enable I/O and MMIO in PCI Bridge
    225   // Assume Root Bus Numer is Zero. 
     225  // Assume Root Bus Numer is Zero.
    226226  //
    227227  for (BusNumber = 0; (DeviceInfo + 1)->Device != 0xff; DeviceInfo++) {
     
    230230    //
    231231    PciLibAddress = PCI_LIB_ADDRESS (BusNumber, DeviceInfo->Device, DeviceInfo->Function, 0);
    232    
     232
    233233    //
    234234    // Retrieve and verify the bus numbers in the PCI to PCI Bridge
     
    254254        return 0;
    255255      }
    256      
     256
    257257      //
    258258      // If PCI Bridge MMIO window is not in the address range decoded by the parent PCI Bridge, then return 0
    259       // 
     259      //
    260260      if (MemoryBase < ParentMemoryBase || MemoryBase > ParentMemoryLimit || MemoryLimit > ParentMemoryLimit) {
    261261        return 0;
     
    276276        IoBase = (PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.IoBaseUpper16)) << 4) | (IoBase >> 4);
    277277      }
    278      
     278
    279279      //
    280280      // If PCI Bridge I/O window is disabled, then return 0
     
    283283        return 0;
    284284      }
    285      
     285
    286286      //
    287287      // If PCI Bridge I/O window is not in the address range decoded by the parent PCI Bridge, then return 0
    288       // 
     288      //
    289289      if (IoBase < ParentIoBase || IoBase > ParentIoLimit || IoLimit > ParentIoLimit) {
    290290        return 0;
     
    299299  //
    300300  PciLibAddress = PCI_LIB_ADDRESS (BusNumber, DeviceInfo->Device, DeviceInfo->Function, 0);
    301  
     301
    302302  //
    303303  // Find the first IO or MMIO BAR
     
    332332  //
    333333  // Program UART BAR
    334   // 
     334  //
    335335  SerialRegisterBase = SerialPortLibUpdatePciRegister32 (
    336336                         PciLibAddress + PCI_BASE_ADDRESSREG_OFFSET + BarIndex * 4,
    337                          (UINT32)PcdGet64 (PcdSerialRegisterBase), 
     337                         (UINT32)PcdGet64 (PcdSerialRegisterBase),
    338338                         RegisterBaseMask
    339339                         );
     
    341341  //
    342342  // Verify that the UART BAR is in the address range decoded by the parent PCI Bridge
    343   // 
     343  //
    344344  if (PcdGetBool (PcdSerialUseMmio)) {
    345345    if (((SerialRegisterBase >> 16) & 0xfff0) < ParentMemoryBase || ((SerialRegisterBase >> 16) & 0xfff0) > ParentMemoryLimit) {
     
    351351    }
    352352  }
    353  
     353
    354354  //
    355355  // Enable I/O and MMIO in PCI UART Device if they are not already enabled
     
    372372    }
    373373  }
    374  
     374
    375375  //
    376376  // Get PCI Device Info
     
    380380  //
    381381  // Enable I/O or MMIO in PCI Bridge
    382   // Assume Root Bus Numer is Zero. 
     382  // Assume Root Bus Numer is Zero.
    383383  //
    384384  for (BusNumber = 0; (DeviceInfo + 1)->Device != 0xff; DeviceInfo++) {
     
    387387    //
    388388    PciLibAddress = PCI_LIB_ADDRESS (BusNumber, DeviceInfo->Device, DeviceInfo->Function, 0);
    389    
     389
    390390    //
    391391    // Enable the I/O or MMIO decode windows in the PCI to PCI Bridge
    392392    //
    393393    PciOr16 (
    394       PciLibAddress + PCI_COMMAND_OFFSET, 
     394      PciLibAddress + PCI_COMMAND_OFFSET,
    395395      PcdGetBool (PcdSerialUseMmio) ? EFI_PCI_COMMAND_MEMORY_SPACE : EFI_PCI_COMMAND_IO_SPACE
    396396      );
    397      
     397
    398398    //
    399399    // Force D0 state if a Power Management and Status Register is specified
     
    404404      }
    405405    }
    406      
     406
    407407    BusNumber = PciRead8 (PciLibAddress + PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET);
    408408  }
    409  
     409
    410410  return SerialRegisterBase;
    411411}
     
    441441    } else {
    442442      //
    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.
    444444      //   DSR is set if a cable is connected.
    445445      //   CTS is set if it is ok to transmit data
     
    461461/**
    462462  Initialize the serial device hardware.
    463  
     463
    464464  If no initialization is required, then return RETURN_SUCCESS.
    465465  If the serial device was successfully initialized, then return RETURN_SUCCESS.
    466466  If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.
    467  
     467
    468468  @retval RETURN_SUCCESS        The serial device was initialized.
    469469  @retval RETURN_DEVICE_ERROR   The serial device could not be initialized.
     
    479479  UINTN          SerialRegisterBase;
    480480  UINT32         Divisor;
    481   UINT32         CurrentDivisor; 
     481  UINT32         CurrentDivisor;
    482482  BOOLEAN        Initialized;
    483483
     
    531531  //
    532532  while ((SerialPortReadRegister (SerialRegisterBase, R_UART_LSR) & (B_UART_LSR_TEMT | B_UART_LSR_TXRDY)) != (B_UART_LSR_TEMT | B_UART_LSR_TXRDY));
    533  
     533
    534534  //
    535535  // Configure baud rate
     
    554554  //
    555555  // Put Modem Control Register(MCR) into its reset state of 0x00.
    556   // 
     556  //
    557557  SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, 0x00);
    558558
     
    561561
    562562/**
    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.
    566566  The number of bytes actually written to the serial device is returned.
    567567  If the return value is less than NumberOfBytes, then the write operation failed.
    568568
    569   If Buffer is NULL, then ASSERT(). 
     569  If Buffer is NULL, then ASSERT().
    570570
    571571  If NumberOfBytes is zero, then return 0.
     
    575575
    576576  @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.
    578578                           If this value is less than NumberOfBytes, then the read operation failed.
    579579
     
    599599    return 0;
    600600  }
    601  
     601
    602602  if (NumberOfBytes == 0) {
    603603    //
     
    662662
    663663  @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.
    665665                           If this value is less than NumberOfBytes, then the read operation failed.
    666666
     
    687687
    688688  Mcr = (UINT8)(SerialPortReadRegister (SerialRegisterBase, R_UART_MCR) & ~B_UART_MCR_RTS);
    689  
     689
    690690  for (Result = 0; NumberOfBytes-- != 0; Result++, Buffer++) {
    691691    //
     
    706706      SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, Mcr);
    707707    }
    708    
     708
    709709    //
    710710    // Read byte from the receive buffer.
     
    712712    *Buffer = SerialPortReadRegister (SerialRegisterBase, R_UART_RXBUF);
    713713  }
    714  
     714
    715715  return Result;
    716716}
     
    735735{
    736736  UINTN  SerialRegisterBase;
    737  
     737
    738738  SerialRegisterBase = GetSerialRegisterBase ();
    739739  if (SerialRegisterBase ==0) {
     
    752752    }
    753753    return TRUE;
    754   }   
    755  
     754  }
     755
    756756  if (PcdGetBool (PcdSerialUseHardwareFlowControl)) {
    757757    //
     
    760760    SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, (UINT8)(SerialPortReadRegister (SerialRegisterBase, R_UART_MCR) | B_UART_MCR_RTS));
    761761  }
    762  
     762
    763763  return FALSE;
    764764}
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf

    r58459 r58466  
    3434[Sources]
    3535  BaseSerialPortLib16550.c
    36  
     36
    3737[Pcd]
    3838  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio                 ## CONSUMES
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c

    r58464 r58466  
    1717/**
    1818  Initializes all CPU exceptions entries and provides the default exception handlers.
    19  
     19
    2020  Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
    2121  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.
    2323  If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
    2424
    2525  @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
    2828                                with default exception handlers.
    2929  @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
     
    4242/**
    4343  Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers.
    44  
     44
    4545  Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
    4646  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.
    4848  If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
    4949
    5050  @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
    5353                                with default interrupt/exception handlers.
    5454  @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
     
    6868  Registers a function to be called from the processor interrupt handler.
    6969
    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.
    7373  The installed handler is called once for each processor interrupt or exception.
    7474  NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c

    r58464 r58466  
    44
    55Copyright (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. 
     6This program and the accompanying materials are licensed and made available under
     7the terms and conditions of the BSD License that accompanies this distribution.
    88The 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,                     
     9http://opensource.org/licenses/bsd-license.php.
     10
     11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1212WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1313
     
    4545
    4646/**
    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.
    5151
    5252  @param[in]  FormData             Form Data to be shown in Page.
    5353  @param[out] ScreenForStatement   Screen to be used for Statement. (Prompt, Value and Help)
    54  
     54
    5555  @return Status
    5656**/
     
    121121  The library will prepare those Strings for the basic key, ESC, Enter, Up/Down/Left/Right, +/-.
    122122  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.
    125125  @param[in]  Statement      The statement current selected.
    126126  @param[in]  Selected       Whether or not a tag be selected. TRUE means Enter has hit this question.
     
    217217    TimeOp  = (EFI_IFR_TIME *) Statement->OpCode;
    218218    HexDisplay = (TimeOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
    219   } 
     219  }
    220220  switch (Statement->OpCode->OpCode) {
    221221  case EFI_IFR_ORDERED_LIST_OP:
     
    235235          (Statement->OpCode->OpCode == EFI_IFR_TIME_OP)) {
    236236        PrintAt (
    237           ColumnWidth1, 
     237          ColumnWidth1,
    238238          StartColumnOfHelp,
    239239          BottomRowOfHelp,
     
    262262      // If it is a selected numeric with manual input, display different message
    263263      //
    264       if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) || 
     264      if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) ||
    265265          (Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||
    266266          (Statement->OpCode->OpCode == EFI_IFR_TIME_OP)) {
     
    332332  default:
    333333    break;
    334   } 
     334  }
    335335}
    336336
     
    338338  Update status bar.
    339339
    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.
    341341  Original logic in this function should be splitted out.
    342342
    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.
    344344  @param[in]  State                  Show or Clear Message.
    345345**/
     
    398398  default:
    399399    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().
    405405
    406406  This function draws OEM/Vendor specific pop up windows.
     
    408408  @param[out]  Key    User Input Key
    409409  @param       ...    String to be shown in Popup. The variable argument list is terminated by a NULL.
    410  
     410
    411411**/
    412412VOID
     
    456456  while  ((String = VA_ARG (Marker, CHAR16 *)) != NULL) {
    457457    LineNum ++;
    458    
     458
    459459    if ((LibGetStringWidth (String) / 2) > LargestString) {
    460460      LargestString = (LibGetStringWidth (String) / 2);
    461461    }
    462   } 
     462  }
    463463  VA_END (Marker);
    464464
     
    466466    LargestString = DimensionsWidth - 2;
    467467  }
    468  
     468
    469469  CurrentAttribute  = gST->ConOut->Mode->Attribute;
    470470  CursorVisible     = gST->ConOut->Mode->CursorVisible;
     
    554554
    555555/**
    556   Confirm how to handle the changed data. 
    557  
     556  Confirm how to handle the changed data.
     557
    558558  @return Action BROWSER_ACTION_SUBMIT, BROWSER_ACTION_DISCARD or other values.
    559559**/
     
    569569
    570570  gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
    571  
     571
    572572  YesResponse = gYesResponse[0];
    573573  NoResponse  = gNoResponse[0];
    574  
     574
    575575  //
    576576  // If NV flag is up, prompt user
     
    584584    ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (YesResponse | UPPER_LOWER_CASE_OFFSET))
    585585  );
    586  
     586
    587587  if (Key.ScanCode == SCAN_ESC) {
    588588    return BROWSER_ACTION_NONE;
     
    597597  OEM specifies whether Setup exits Page by ESC key.
    598598
    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
    600600  system able to boot when configuration is not changed.
    601601
     
    613613
    614614/**
    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
    617617  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
    620620  @param[in]  FormData   Form Data to be shown in Page
    621621
    622   @return 0     No timeout for this form. 
     622  @return 0     No timeout for this form.
    623623  @return > 0   Timeout value in 100 ns units.
    624624**/
     
    901901**/
    902902VOID
    903 EFIAPI 
     903EFIAPI
    904904ClearDisplayPage (
    905905  VOID
     
    953953{
    954954  HiiRemovePackages(mCDLStringPackHandle);
    955  
     955
    956956  FreeLibStrings ();
    957957
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf

    r58464 r58466  
    3535  CustomizedDisplayLibInternal.c
    3636  CustomizedDisplayLib.uni
    37  
     37
    3838[Packages]
    3939  MdePkg/MdePkg.dec
     
    5555[Guids]
    5656  gEfiIfrTianoGuid  ## SOMETIMES_CONSUMES   ## UNDEFINED
    57  
     57
    5858[Protocols]
    5959
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c

    r58464 r58466  
    44
    55Copyright (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. 
     6This program and the accompanying materials are licensed and made available under
     7the terms and conditions of the BSD License that accompanies this distribution.
    88The 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,                     
     9http://opensource.org/licenses/bsd-license.php.
     10
     11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1212WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1313
     
    4848
    4949  @param[in]  FormData             Form Data to be shown in Page
    50  
     50
    5151**/
    5252VOID
    53 PrintBannerInfo ( 
     53PrintBannerInfo (
    5454  IN FORM_DISPLAY_ENGINE_FORM       *FormData
    5555  )
     
    8585      RowIdx    = (UINT8) (Line - (UINT8) gScreenDimensions.TopRow);
    8686      ColumnIdx = (UINT8) (Alignment - (UINT8) gScreenDimensions.LeftColumn);
    87  
     87
    8888      ASSERT (RowIdx < BANNER_HEIGHT && ColumnIdx < BANNER_COLUMNS);
    89  
     89
    9090      if (gBannerData!= NULL && gBannerData->Banner[RowIdx][ColumnIdx] != 0x0000) {
    9191        StrFrontPageBanner = LibGetToken (gBannerData->Banner[RowIdx][ColumnIdx], FormData->HiiHandle);
     
    9393        continue;
    9494      }
    95  
     95
    9696      switch (Alignment - gScreenDimensions.LeftColumn) {
    9797      case 0:
     
    101101        PrintStringAt (gScreenDimensions.LeftColumn + BANNER_LEFT_COLUMN_INDENT, Line, StrFrontPageBanner);
    102102        break;
    103  
     103
    104104      case 1:
    105105        //
     
    112112          );
    113113        break;
    114  
     114
    115115      case 2:
    116116        //
     
    124124        break;
    125125      }
    126  
     126
    127127      FreePool (StrFrontPageBanner);
    128128    }
     
    160160    return;
    161161  }
    162    
     162
    163163  Buffer = AllocateZeroPool (0x10000);
    164164  ASSERT (Buffer != NULL);
     
    188188    PrintCharAt (gScreenDimensions.RightColumn - 1, Row, Character);
    189189  }
    190  
     190
    191191  //
    192192  // Print Form Title
     
    240240  Character = BOXDRAW_UP_LEFT;
    241241  PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
    242  
     242
    243243  FreePool (Buffer);
    244244}
     
    258258{
    259259  switch (OpCodeData->OpCode) {
    260     case EFI_IFR_GUID_OP:     
     260    case EFI_IFR_GUID_OP:
    261261      if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
    262262        //
     
    282282              ASSERT (gBannerData != NULL);
    283283            }
    284            
     284
    285285            CopyMem (
    286286              &gBannerData->Banner[((EFI_IFR_GUID_BANNER *) OpCodeData)->LineNumber][
     
    311311/**
    312312  Process some op codes which is out side of current form.
    313  
     313
    314314  @param FormData                Pointer to the form data.
    315315
     
    362362
    363363**/
    364 EFI_STATUS 
     364EFI_STATUS
    365365ScreenDiemensionInfoValidate (
    366366  IN FORM_DISPLAY_ENGINE_FORM       *FormData
     
    371371
    372372  //
    373   // Calculate total number of Register HotKeys. 
     373  // Calculate total number of Register HotKeys.
    374374  //
    375375  Index = 0;
     
    560560
    561561  //
    562   // Calculate total number of Register HotKeys. 
     562  // Calculate total number of Register HotKeys.
    563563  //
    564564  Index = 0;
     
    583583
    584584    //
    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.
    586586    //
    587587    BakChar = L'\0';
     
    608608    Index ++;
    609609  }
    610  
     610
    611611  if (SetState) {
    612612    //
     
    627627    }
    628628  }
    629  
     629
    630630  return;
    631631}
     
    633633/**
    634634  Get step info from numeric opcode.
    635  
     635
    636636  @param[in] OpCode     The input numeric op code.
    637637
     
    647647
    648648  NumericOp = (EFI_IFR_NUMERIC *) OpCode;
    649  
     649
    650650  switch (NumericOp->Flags & EFI_IFR_NUMERIC_SIZE) {
    651651  case EFI_IFR_NUMERIC_SIZE_1:
    652652    Step    = NumericOp->data.u8.Step;
    653653    break;
    654  
     654
    655655  case EFI_IFR_NUMERIC_SIZE_2:
    656656    Step    = NumericOp->data.u16.Step;
    657657    break;
    658  
     658
    659659  case EFI_IFR_NUMERIC_SIZE_4:
    660660    Step    = NumericOp->data.u32.Step;
    661661    break;
    662  
     662
    663663  case EFI_IFR_NUMERIC_SIZE_8:
    664664    Step    = NumericOp->data.u64.Step;
    665665    break;
    666  
     666
    667667  default:
    668668    Step = 0;
     
    705705  gNvUpdateMessage      = LibGetToken (STRING_TOKEN (NV_UPDATE_MESSAGE), mCDLStringPackHandle);
    706706  gInputErrorMessage    = LibGetToken (STRING_TOKEN (INPUT_ERROR_MESSAGE), mCDLStringPackHandle);
    707  
     707
    708708  //
    709709  // SpaceBuffer;
     
    746746  FreePool (gNvUpdateMessage);
    747747  FreePool (gInputErrorMessage);
    748  
     748
    749749  FreePool (mSpaceBuffer);
    750750}
     
    775775      continue;
    776776    }
    777    
     777
    778778    gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
    779779  }
     
    821821UINTN
    822822PrintInternal (
    823   IN UINTN                            Width, 
     823  IN UINTN                            Width,
    824824  IN UINTN                            Column,
    825825  IN UINTN                            Row,
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h

    r58464 r58466  
    44
    55Copyright (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. 
     6This program and the accompanying materials are licensed and made available under
     7the terms and conditions of the BSD License that accompanies this distribution.
    88The 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,                     
     9http://opensource.org/licenses/bsd-license.php.
     10
     11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1212WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1313
     
    122122
    123123  @param[in]  FormData             Form Data to be shown in Page
    124  
    125 **/
    126 VOID
    127 PrintBannerInfo ( 
     124
     125**/
     126VOID
     127PrintBannerInfo (
    128128  IN FORM_DISPLAY_ENGINE_FORM       *FormData
    129129  );
     
    148148
    149149**/
    150 EFI_STATUS 
     150EFI_STATUS
    151151ScreenDiemensionInfoValidate (
    152152  IN FORM_DISPLAY_ENGINE_FORM       *FormData
     
    202202  IN BOOLEAN                       SetState
    203203  );
    204  
     204
    205205/**
    206206  Get step info from numeric opcode.
    207  
     207
    208208  @param[in] OpCode     The input numeric op code.
    209209
     
    286286/**
    287287  Process some op codes which is out side of current form.
    288  
     288
    289289  @param FormData                Pointer to the form data.
    290290
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.c

    r48674 r58466  
    1616
    1717/**
    18   The firmware checks whether the capsule image is supported 
     18  The firmware checks whether the capsule image is supported
    1919  by the CapsuleGuid in CapsuleHeader or other specific information in capsule image.
    20  
     20
    2121  @param  CapsuleHeader    Point to the UEFI capsule image to be checked.
    22  
     22
    2323  @retval EFI_UNSUPPORTED  Input capsule is not supported by the firmware.
    2424**/
     
    3535  The firmware specific implementation processes the capsule image
    3636  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
    4040  @retval EFI_UNSUPPORTED  Capsule image is not supported by the firmware.
    4141**/
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf

    r58459 r58466  
    33# The implementation borrows the DxeCore Memory Allocation services as the primitive
    44# 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.
    66#
    77# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
     
    2525  VERSION_STRING                 = 1.0
    2626  LIBRARY_CLASS                  = MemoryAllocationLib|DXE_CORE
    27  
     27
    2828#
    2929# 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  
    33
    44  This header file borrows the DxeCore Memory Allocation services as the primitive
    5   for memory allocation. 
     5  for memory allocation.
    66
    77  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
    1212
    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.
    1515
    1616**/
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c

    r58459 r58466  
    11/** @file
    2   Support routines for memory allocation routines based 
     2  Support routines for memory allocation routines based
    33  on boot services for Dxe phase drivers.
    44
    55  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.
    1313
    1414**/
     
    3838VOID *
    3939InternalAllocatePages (
    40   IN EFI_MEMORY_TYPE  MemoryType, 
     40  IN EFI_MEMORY_TYPE  MemoryType,
    4141  IN UINTN            Pages
    4242  )
    4343{
    4444  EFI_STATUS            Status;
    45   EFI_PHYSICAL_ADDRESS  Memory; 
     45  EFI_PHYSICAL_ADDRESS  Memory;
    4646
    4747  if (Pages == 0) {
     
    130130  Allocation Library.  If it is not possible to free allocated pages, then this function will
    131131  perform no actions.
    132  
     132
    133133  If Buffer was not allocated with a page allocation function in the Memory Allocation Library,
    134134  then ASSERT().
    135135  If Pages is zero, then ASSERT().
    136  
     136
    137137  @param  Buffer                Pointer to the buffer of pages to free.
    138138  @param  Pages                 The number of 4 KB pages to free.
     
    173173VOID *
    174174InternalAllocateAlignedPages (
    175   IN EFI_MEMORY_TYPE  MemoryType, 
     175  IN EFI_MEMORY_TYPE  MemoryType,
    176176  IN UINTN            Pages,
    177177  IN UINTN            Alignment
     
    189189  //
    190190  ASSERT ((Alignment & (Alignment - 1)) == 0);
    191  
     191
    192192  if (Pages == 0) {
    193193    return NULL;
     
    203203    //
    204204    ASSERT (RealPages > Pages);
    205  
     205
    206206    Status         = CoreAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);
    207207    if (EFI_ERROR (Status)) {
     
    246246  returned.  If there is not enough memory at the specified alignment remaining to satisfy the
    247247  request, then NULL is returned.
    248  
     248
    249249  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    250250  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
     
    274274  returned.  If there is not enough memory at the specified alignment remaining to satisfy the
    275275  request, then NULL is returned.
    276  
     276
    277277  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    278278  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
     
    302302  returned.  If there is not enough memory at the specified alignment remaining to satisfy the
    303303  request, then NULL is returned.
    304  
     304
    305305  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    306306  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
     
    329329  Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer.  Buffer
    330330  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
    332332  perform no actions.
    333  
     333
    334334  If Buffer was not allocated with an aligned page allocation function in the Memory Allocation
    335335  Library, then ASSERT().
    336336  If Pages is zero, then ASSERT().
    337  
     337
    338338  @param  Buffer                Pointer to the buffer of pages to free.
    339339  @param  Pages                 The number of 4 KB pages to free.
     
    369369VOID *
    370370InternalAllocatePool (
    371   IN EFI_MEMORY_TYPE  MemoryType, 
     371  IN EFI_MEMORY_TYPE  MemoryType,
    372372  IN UINTN            AllocationSize
    373373  )
     
    464464VOID *
    465465InternalAllocateZeroPool (
    466   IN EFI_MEMORY_TYPE  PoolType, 
     466  IN EFI_MEMORY_TYPE  PoolType,
    467467  IN UINTN            AllocationSize
    468   ) 
     468  )
    469469{
    470470  VOID  *Memory;
     
    551551  is not enough memory remaining to satisfy the request, then NULL is returned.
    552552  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().
    554554
    555555  @param  PoolType              The type of pool to allocate.
     
    562562VOID *
    563563InternalAllocateCopyPool (
    564   IN EFI_MEMORY_TYPE  PoolType, 
     564  IN EFI_MEMORY_TYPE  PoolType,
    565565  IN UINTN            AllocationSize,
    566566  IN CONST VOID       *Buffer
    567   ) 
     567  )
    568568{
    569569  VOID  *Memory;
     
    577577  }
    578578  return Memory;
    579 } 
     579}
    580580
    581581/**
     
    586586  allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there
    587587  is not enough memory remaining to satisfy the request, then NULL is returned.
    588  
     588
    589589  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().
    591591
    592592  @param  AllocationSize        The number of bytes to allocate and zero.
     
    613613  allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there
    614614  is not enough memory remaining to satisfy the request, then NULL is returned.
    615  
     615
    616616  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().
    618618
    619619  @param  AllocationSize        The number of bytes to allocate and zero.
     
    640640  allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there
    641641  is not enough memory remaining to satisfy the request, then NULL is returned.
    642  
     642
    643643  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().
    645645
    646646  @param  AllocationSize        The number of bytes to allocate and zero.
     
    664664
    665665  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
    670670  enough memory remaining to satisfy the request, then NULL is returned.
    671  
     671
    672672  If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
    673673  is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
     
    676676  @param  OldSize        The size, in bytes, of OldBuffer.
    677677  @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
    679679                         parameter that may be NULL.
    680680
     
    684684VOID *
    685685InternalReallocatePool (
    686   IN EFI_MEMORY_TYPE  PoolType, 
     686  IN EFI_MEMORY_TYPE  PoolType,
    687687  IN UINTN            OldSize,
    688688  IN UINTN            NewSize,
     
    704704
    705705  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
    710710  enough memory remaining to satisfy the request, then NULL is returned.
    711  
     711
    712712  If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
    713713  is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
     
    715715  @param  OldSize        The size, in bytes, of OldBuffer.
    716716  @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
    718718                         parameter that may be NULL.
    719719
     
    736736
    737737  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
    742742  enough memory remaining to satisfy the request, then NULL is returned.
    743743
     
    747747  @param  OldSize        The size, in bytes, of OldBuffer.
    748748  @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
    750750                         parameter that may be NULL.
    751751
     
    768768
    769769  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
    774774  enough memory remaining to satisfy the request, then NULL is returned.
    775775
     
    779779  @param  OldSize        The size, in bytes, of OldBuffer.
    780780  @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
    782782                         parameter that may be NULL.
    783783
     
    803803  pool allocation services of the Memory Allocation Library.  If it is not possible to free pool
    804804  resources, then this function will perform no actions.
    805  
     805
    806806  If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
    807807  then ASSERT().
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c

    r58459 r58466  
    44  This library provides the performance measurement interfaces and initializes performance
    55  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.
    77  It initializes DXE phase performance logging by publishing the Performance and PerformanceEx Protocol,
    88  which are consumed by DxePerformanceLib to logging performance data in DXE phase.
     
    3232
    3333//
    34 // The current maximum number of logging entries. If current number of 
     34// The current maximum number of logging entries. If current number of
    3535// entries exceeds this value, it will re-allocate a larger array and
    3636// migration the old data to the larger array.
     
    654654EFIAPI
    655655GetPerformanceMeasurementEx (
    656   IN  UINTN       LogEntryKey, 
     656  IN  UINTN       LogEntryKey,
    657657  OUT CONST VOID  **Handle,
    658658  OUT CONST CHAR8 **Token,
     
    667667
    668668  GaugeData = NULL;
    669  
     669
    670670  ASSERT (Handle != NULL);
    671671  ASSERT (Token != NULL);
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf

    r58459 r58466  
    11## @file
    22#  Performance library instance mainly for DxeCore usage.
    3 # 
     3#
    44#  This library provides the performance measurement interfaces and initializes performance
    55#  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.
    77#  It initializes DXE phase performance logging by publishing the Performance and PerformanceEx Protocol,
    88#  which is consumed by DxePerformanceLib to logging performance data in DXE phase.
    99#  This library is mainly used by DxeCore to start performance logging to ensure that
    1010#  Performance and PerformanceEx Protocol are installed at the very beginning of DXE phase.
    11 # 
     11#
    1212#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    1313#  This program and the accompanying materials
     
    1515#  which accompanies this distribution.  The full text of the license may be found at
    1616#  http://opensource.org/licenses/bsd-license.php
    17 # 
     17#
    1818#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1919#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    20 # 
     20#
    2121##
    2222
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h

    r48674 r58466  
    1515
    1616**/
    17  
     17
    1818#ifndef _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_
    1919#define _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c

    r48674 r58466  
    11/** @file
    22
    3   This library registers CRC32 guided section handler 
     3  This library registers CRC32 guided section handler
    44  to parse CRC32 encapsulation section and extract raw data.
    55  It uses UEFI boot service CalculateCrc32 to authenticate 32 bit CRC value.
    66
    77Copyright (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.             
     8This program and the accompanying materials
     9are licensed and made available under the terms and conditions of the BSD License
     10which accompanies this distribution.  The full text of the license may be found at
     11http://opensource.org/licenses/bsd-license.php
     12
     13THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     14WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1515
    1616**/
     
    4040
    4141  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.
    4343  If not, EFI_INVALID_PARAMETER will return.
    4444
     
    4848  @param SectionAttribute   The attribute of the input guided section.
    4949
    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
    5151                                 the attribute of the input section are successull retrieved.
    5252  @retval EFI_INVALID_PARAMETER  The GUID in InputSection does not match this instance guid.
     
    101101  Extraction handler tries to extract raw data from the input guided section.
    102102  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.
    104104  If not, EFI_INVALID_PARAMETER will return.
    105105
     
    138138      return EFI_INVALID_PARAMETER;
    139139    }
    140  
     140
    141141    //
    142142    // Get section Crc32 checksum.
     
    160160      return EFI_INVALID_PARAMETER;
    161161    }
    162  
     162
    163163    //
    164164    // Get section Crc32 checksum.
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf

    r58459 r58466  
    22#  Dxe Crc32 Guided Section Extract library.
    33#
    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
    55#  ExtractGuidedSectionLib service to register CRC32 guided section handler
    66#  that parses CRC32 encapsulation section and extracts raw data.
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c

    r48674 r58466  
    11/** @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
    33  "err" shell command.  This includes support for the Debug Mask Protocol
    44  supports for global debug print error level mask stored in an EFI Variable.
     
    3333
    3434  @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
    3636                            is returned.
    3737
     
    4646EFIAPI
    4747GetDebugMask (
    48   IN EFI_DEBUG_MASK_PROTOCOL  *This,             
    49   IN OUT UINTN                *CurrentDebugMask 
     48  IN EFI_DEBUG_MASK_PROTOCOL  *This,
     49  IN OUT UINTN                *CurrentDebugMask
    5050  );
    5151
     
    8080
    8181///
    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
    8383/// retrieve the global error level mask through the EFI Varibale Services.
    8484/// This variable prevents the EFI Variable Services from being called fort
     
    9292/// set to the PcdDebugPrintErrorLevel value.  If the EFI Variable exists that
    9393/// 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
    9595/// 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
    9797/// the PcdDebugPrintErrorLevel and the EFI Variable setting.
    9898///
     
    108108
    109109/**
    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
    111111  Set Virtual Address Map event to convert physical address to virtual addresses.
    112  
     112
    113113  @param  ImageHandle   The firmware allocated handle for the EFI image.
    114114  @param  SystemTable   A pointer to the EFI System Table.
    115  
     115
    116116  @retval EFI_SUCCESS   The constructor completed successfully.
    117117  @retval Other value   The constructor did not complete successfully.
     
    126126{
    127127  EFI_STATUS                  Status;
    128  
     128
    129129  //
    130130  // Initialize the error level mask from PCD setting.
    131131  //
    132132  mDebugPrintErrorLevel = PcdGet32 (PcdDebugPrintErrorLevel);
    133    
     133
    134134  //
    135135  // Install Debug Mask Protocol onto ImageHandle
    136   // 
     136  //
    137137  mSystemTable = SystemTable;
    138138  Status = SystemTable->BootServices->InstallMultipleProtocolInterfaces (
     
    145145  // Attempt to retrieve the global debug print error level mask from the EFI Variable
    146146  // 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
    148148  // was found then the EFI Variable access will be reattempted on every DEBUG() print
    149149  // from this module until the EFI Variable services are available.
    150150  //
    151151  GetDebugPrintErrorLevel ();
    152  
     152
    153153  return Status;
    154154}
    155155
    156156/**
    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
    158158  Address Map event.
    159  
     159
    160160  @param  ImageHandle   The firmware allocated handle for the EFI image.
    161161  @param  SystemTable   A pointer to the EFI System Table.
    162  
     162
    163163  @retval EFI_SUCCESS   The destructor completed successfully.
    164164  @retval Other value   The destructor did not complete successfully.
     
    174174  //
    175175  // Uninstall the Debug Mask Protocol from ImageHandle
    176   // 
     176  //
    177177  return SystemTable->BootServices->UninstallMultipleProtocolInterfaces (
    178178                                      ImageHandle,
     
    208208    return PcdGet32 (PcdDebugPrintErrorLevel);
    209209  }
    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
    213213  // error level mask.  Since this library instance stores the global debug print
    214214  // error level mask in an EFI Variable, the EFI Variable should only be accessed
    215215  // once to reduce the overhead of reading the EFI Variable on every debug print
    216   // 
     216  //
    217217  if (!mGlobalErrorLevelInitialized) {
    218218    //
     
    223223    if (CurrentTpl <= TPL_CALLBACK) {
    224224      //
    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
    226226      // EFI Variable
    227227      //
    228228      Size = sizeof (GlobalErrorLevel);
    229229      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,
    234234                                       &GlobalErrorLevel
    235235                                       );
     
    271271/**
    272272  Sets the global debug print error level mask fpr the entire platform.
    273  
     273
    274274  @param   ErrorLevel     Global debug print error level
    275  
     275
    276276  @retval  TRUE           The debug print error level mask was sucessfully set.
    277277  @retval  FALSE          The debug print error level mask could not be set.
     
    305305      Size = sizeof (GlobalErrorLevel);
    306306      Status = mSystemTable->RuntimeServices->SetVariable (
    307                                        DEBUG_MASK_VARIABLE_NAME, 
    308                                        &gEfiGenericVariableGuid, 
     307                                       DEBUG_MASK_VARIABLE_NAME,
     308                                       &gEfiGenericVariableGuid,
    309309                                       (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS),
    310310                                       Size,
     
    313313      if (!EFI_ERROR (Status)) {
    314314        //
    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
    316316        // module and return TRUE.
    317317        //
    318         mGlobalErrorLevelInitialized = TRUE;   
     318        mGlobalErrorLevelInitialized = TRUE;
    319319        mDebugPrintErrorLevel = ErrorLevel;
    320320        return TRUE;
     
    333333
    334334  @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
    336336                            is returned.
    337337
     
    346346EFIAPI
    347347GetDebugMask (
    348   IN EFI_DEBUG_MASK_PROTOCOL  *This,             
    349   IN OUT UINTN                *CurrentDebugMask 
     348  IN EFI_DEBUG_MASK_PROTOCOL  *This,
     349  IN OUT UINTN                *CurrentDebugMask
    350350  )
    351351{
     
    353353    return EFI_INVALID_PARAMETER;
    354354  }
    355  
     355
    356356  //
    357357  // Retrieve the current debug mask from mDebugPrintErrorLevel
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.inf

    r58459 r58466  
    2323  MODULE_TYPE                    = DXE_DRIVER
    2424  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
    2626  CONSTRUCTOR                    = DxeDebugPrintErrorLevelLibConstructor
    2727  DESTRUCTOR                     = DxeDebugPrintErrorLevelLibDestructor
     
    4141  PcdLib
    4242  HobLib
    43  
     43
    4444[Protocols]
    4545  gEfiDebugMaskProtocolGuid     ## PRODUCES
    46  
     46
    4747[Guids]
    4848  ## SOMETIMES_PRODUCES   ## Variable:L"EFIDebug"
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeDpcLib/DpcLib.c

    r48674 r58466  
    11/** @file
    22  Help functions to access UDP service.
    3  
     3
    44Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c

    r48674 r58466  
    7878  {FALSE, TRUE}, // ICMP6_ERR_UNREACH_HOST
    7979  {TRUE,  TRUE}, // ICMP6_ERR_UNREACH_PROTOCOL
    80   {TRUE,  TRUE}, // ICMP6_ERR_UNREACH_PORT   
     80  {TRUE,  TRUE}, // ICMP6_ERR_UNREACH_PORT
    8181  {TRUE,  TRUE}, // ICMP6_ERR_PACKAGE_TOOBIG
    8282  {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_HOPLIMIT
    8383  {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_REASS
    84   {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_HEADER   
     84  {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_HEADER
    8585  {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_NEXHEADER
    8686  {FALSE, TRUE}  // ICMP6_ERR_PARAMPROB_IPV6OPTION
     
    255255
    256256/**
    257   This function handles ICMPv4 packets. It is the worker function of 
     257  This function handles ICMPv4 packets. It is the worker function of
    258258  IpIoIcmpHandler.
    259259
     
    380380  IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, IpIo->RcvdContext);
    381381
    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
    387387  IpIoIcmpHandler.
    388388
     
    428428  //
    429429  // Analyze the ICMPv6 Error in this ICMPv6 packet
    430   // 
     430  //
    431431  switch (Type) {
    432432  case ICMP_V6_DEST_UNREACHABLE:
     
    487487
    488488     return EFI_ABORTED;
    489    } 
     489   }
    490490
    491491  //
     
    498498  PayLoadHdr = (UINT8 *) ((UINT8 *) IcmpHdr + sizeof (IP6_ICMP_ERROR_HEAD));
    499499  Flag       = TRUE;
    500  
     500
    501501  do {
    502502    switch (NextHeader) {
     
    536536
    537537  TrimBytes = (UINT32) (PayLoadHdr - (UINT8 *) IcmpHdr);
    538  
     538
    539539  NetbufTrim (Pkt, TrimBytes, TRUE);
    540540
     
    625625{
    626626  IP_IO_SEND_ENTRY          *SndEntry;
    627   EFI_EVENT                 Event; 
     627  EFI_EVENT                 Event;
    628628  EFI_STATUS                Status;
    629629  NET_FRAGMENT              *ExtFragment;
     
    675675
    676676  //
    677   // Build a fragment table to contain the fragments in the packet. 
     677  // Build a fragment table to contain the fragments in the packet.
    678678  //
    679679  if (IpIo->IpVersion == IP_VERSION_4) {
     
    732732    Ip6TxData->ExtHdrsLength = 0;
    733733    Ip6TxData->ExtHdrs       = NULL;
    734    
     734
    735735    //
    736736    // Set the fields of SndToken
     
    779779/**
    780780  Destroy the SndEntry.
    781  
     781
    782782  This function pairs with IpIoCreateSndEntry().
    783783
     
    10641064      goto CleanUp;
    10651065    }
    1066    
     1066
    10671067    //
    10681068    // Create a netbuffer representing IPv6 packet
     
    10841084    //
    10851085    CopyMem (
    1086       &Session.Source, 
     1086      &Session.Source,
    10871087      &RxData->Ip6RxData.Header->SourceAddress,
    10881088      sizeof(EFI_IPv6_ADDRESS)
    10891089      );
    10901090    CopyMem (
    1091       &Session.Dest, 
    1092       &RxData->Ip6RxData.Header->DestinationAddress, 
     1091      &Session.Dest,
     1092      &RxData->Ip6RxData.Header->DestinationAddress,
    10931093      sizeof(EFI_IPv6_ADDRESS)
    10941094      );
     
    10961096    Session.IpHdrLen     = RxData->Ip6RxData.HeaderLength;
    10971097    Session.IpVersion    = IP_VERSION_6;
    1098   } 
     1098  }
    10991099
    11001100  if (EFI_SUCCESS == Status) {
     
    11181118    gBS->SignalEvent (RxData->Ip4RxData.RecycleSignal);
    11191119  } else {
    1120     gBS->SignalEvent (RxData->Ip6RxData.RecycleSignal); 
     1120    gBS->SignalEvent (RxData->Ip6RxData.RecycleSignal);
    11211121  }
    11221122
     
    11531153/**
    11541154  Create a new IP_IO instance.
    1155  
     1155
    11561156  This function uses IP4/IP6 service binding protocol in Controller to create
    11571157  an IP4/IP6 child (aka IP4/IP6 instance).
     
    11621162                                binding protocol installed.
    11631163  @param[in]  IpVersion         The version of the IP protocol to use, either
    1164                                 IPv4 or IPv6.                           
     1164                                IPv4 or IPv6.
    11651165
    11661166  @return Pointer to a newly created IP_IO instance, or NULL if failed.
     
    12171217             Image,
    12181218             &IpIo->ChildHandle,
    1219              IpVersion,             
     1219             IpVersion,
    12201220             (VOID **)&(IpIo->Ip)
    12211221             );
     
    12401240/**
    12411241  Open an IP_IO instance for use.
    1242  
     1242
    12431243  This function is called after IpIoCreate(). It is used for configuring the IP
    12441244  instance and register the callbacks and their context data for sending and
     
    12521252  @retval          EFI_SUCCESS        The IP_IO instance opened with OpenData
    12531253                                      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
    12551255                                      reopen it.
    12561256  @retval          Others             Error condition occurred.
     
    12861286
    12871287    Status = IpIo->Ip.Ip6->Configure (
    1288                              IpIo->Ip.Ip6, 
     1288                             IpIo->Ip.Ip6,
    12891289                             &OpenData->IpConfigData.Ip6CfgData
    12901290                             );
     
    13591359/**
    13601360  Stop an IP_IO instance.
    1361  
     1361
    13621362  This function is paired with IpIoOpen(). The IP_IO will be unconfigured and all
    13631363  the pending send/receive tokens will be canceled.
     
    14361436/**
    14371437  Destroy an IP_IO instance.
    1438  
     1438
    14391439  This function is paired with IpIoCreate(). The IP_IO will be closed first.
    14401440  Resource will be freed afterwards. See IpIoCloseProtocolDestroyIpChild().
     
    14761476/**
    14771477  Send out an IP packet.
    1478  
     1478
    14791479  This function is called after IpIoOpen(). The data to be sent are wrapped in
    14801480  Pkt. The IP instance wrapped in IpIo is used for sending by default but can be
     
    16011601/**
    16021602  Add a new IP instance for sending data.
    1603  
     1603
    16041604  The function is used to add the IP_IO to the IP_IO sending list. The caller
    16051605  can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send
     
    17601760      if (((EFI_IP4_CONFIG_DATA *) IpConfigData)->UseDefaultAddress) {
    17611761        Ip.Ip4->GetModeData (
    1762                   Ip.Ip4, 
    1763                   &Ip4ModeData, 
    1764                   NULL, 
     1762                  Ip.Ip4,
     1763                  &Ip4ModeData,
     1764                  NULL,
    17651765                  NULL
    17661766                  );
     
    17711771
    17721772      CopyMem (
    1773         &IpInfo->Addr.Addr, 
    1774         &((EFI_IP4_CONFIG_DATA *) IpConfigData)->StationAddress, 
     1773        &IpInfo->Addr.Addr,
     1774        &((EFI_IP4_CONFIG_DATA *) IpConfigData)->StationAddress,
    17751775        sizeof (IP4_ADDR)
    17761776        );
    17771777      CopyMem (
    1778         &IpInfo->PreMask.SubnetMask, 
     1778        &IpInfo->PreMask.SubnetMask,
    17791779        &((EFI_IP4_CONFIG_DATA *) IpConfigData)->SubnetMask,
    17801780        sizeof (IP4_ADDR)
     
    18301830        Status = EFI_NO_MAPPING;
    18311831        goto OnExit;
    1832       } 
     1832      }
    18331833
    18341834      CopyMem (
    1835         &IpInfo->Addr, 
    1836         &Ip6ModeData.ConfigData.StationAddress, 
     1835        &IpInfo->Addr,
     1836        &Ip6ModeData.ConfigData.StationAddress,
    18371837        sizeof (EFI_IPv6_ADDRESS)
    18381838        );
     
    18451845        Ip.Ip6->Configure (Ip.Ip6, NULL);
    18461846      }
    1847     } 
     1847    }
    18481848  } else {
    18491849    //
     
    18631863  Destroy an IP instance maintained in IpIo->IpList for
    18641864  sending purpose.
    1865  
     1865
    18661866  This function pairs with IpIoAddIp(). The IpInfo is previously created by
    18671867  IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance
     
    19351935  Find the first IP protocol maintained in IpIo whose local
    19361936  address is the same as Src.
    1937  
     1937
    19381938  This function is called when the caller needs the IpIo to send data to the
    19391939  specified Src. The IpIo was added previously by IpIoAddIp().
     
    19611961  IP_IO_IP_INFO   *IpInfo;
    19621962
    1963   ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6)); 
     1963  ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6));
    19641964
    19651965  NET_LIST_FOR_EACH (IpIoEntry, &mActiveIpIoList) {
     
    19831983        if (EFI_IP6_EQUAL (&IpInfo->Addr.v6, &Src->v6)) {
    19841984          *IpIo = IpIoPtr;
    1985           return IpInfo;       
     1985          return IpInfo;
    19861986        }
    1987       }     
     1987      }
    19881988
    19891989    }
     
    19991999/**
    20002000  Get the ICMP error map information.
    2001  
     2001
    20022002  The ErrorStatus will be returned. The IsHard and Notify are optional. If they
    20032003  are not NULL, this routine will fill them.
     
    20052005  @param[in]   IcmpError             IcmpError Type.
    20062006  @param[in]   IpVersion             The version of the IP protocol to use,
    2007                                      either IPv4 or IPv6. 
     2007                                     either IPv4 or IPv6.
    20082008  @param[out]  IsHard                If TRUE, indicates that it is a hard error.
    20092009  @param[out]  Notify                If TRUE, SockError needs to be notified.
     
    20762076    case ICMP6_ERR_UNREACH_HOST:
    20772077    case ICMP6_ERR_TIMXCEED_HOPLIMIT:
    2078     case ICMP6_ERR_TIMXCEED_REASS:       
     2078    case ICMP6_ERR_TIMXCEED_REASS:
    20792079      return EFI_HOST_UNREACHABLE;
    20802080
    20812081    case ICMP6_ERR_UNREACH_PROTOCOL:
    20822082      return EFI_PROTOCOL_UNREACHABLE;
    2083      
     2083
    20842084    case ICMP6_ERR_UNREACH_PORT:
    20852085      return EFI_PORT_UNREACHABLE;
     
    21102110
    21112111  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.
    21152115
    21162116  @param[in]   IpIo                  Pointer to an IP_IO instance
    21172117  @param[in]   Neighbor              The IP address of the neighbor
    21182118  @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
    21222122                                     dynamic and will be deleted after Timeout.
    21232123
     
    21252125  @retval      EFI_NOT_STARTED       The IpIo is not configured.
    21262126  @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.
    21292129  @retval      EFI_OUT_OF_RESOURCES  Failed due to resource limit.
    21302130
     
    21342134  IN IP_IO           *IpIo,
    21352135  IN EFI_IP_ADDRESS  *Neighbor,
    2136   IN UINT32          Timeout 
     2136  IN UINT32          Timeout
    21372137  )
    21382138{
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c

    r58459 r58466  
    10761076  If it hasn't been removed, then continue with the next node directly.
    10771077  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.
    10791079
    10801080  @param[in]    List             The head of the list.
     
    11631163{
    11641164  UINTN     Index;
    1165  
     1165
    11661166  if (NumberOfChildren == 0 || ChildHandleBuffer == NULL) {
    11671167    return FALSE;
     
    18241824      continue;
    18251825    }
    1826    
     1826
    18271827    //
    18281828    // Disconnect the driver specified by ImageHandle from all
     
    18361836                      );
    18371837    }
    1838    
     1838
    18391839    //
    18401840    // Uninstall all the protocols installed in the driver entry point
    1841     //   
     1841    //
    18421842    gBS->UninstallProtocolInterface (
    18431843          DriverBinding->DriverBindingHandle,
     
    18451845          DriverBinding
    18461846          );
    1847    
     1847
    18481848    Status = gBS->HandleProtocol (
    18491849                    DeviceHandleBuffer[Index],
     
    29852985    if (*Ip6Str == ':') {
    29862986      if (*(Ip6Str + 1) == ':') {
    2987         if ((NodeCnt > 6) || 
     2987        if ((NodeCnt > 6) ||
    29882988            ((*(Ip6Str + 2) != '\0') && (AsciiStrHexToUintn (Ip6Str + 2) == 0))) {
    29892989          //
     
    29922992          return EFI_INVALID_PARAMETER;
    29932993        }
    2994         if ((NodeCnt == 6) && (*(Ip6Str + 2) != '\0') && 
     2994        if ((NodeCnt == 6) && (*(Ip6Str + 2) != '\0') &&
    29952995            (AsciiStrHexToUintn (Ip6Str + 2) != 0)) {
    29962996          return EFI_INVALID_PARAMETER;
     
    30503050    }
    30513051    if (NodeVal != 0) {
    3052       if ((*TempStr  == '0') && 
    3053           ((*(TempStr + 2) == ':') || (*(TempStr + 3) == ':') || 
     3052      if ((*TempStr  == '0') &&
     3053          ((*(TempStr + 2) == ':') || (*(TempStr + 3) == ':') ||
    30543054          (*(TempStr + 2) == '\0') || (*(TempStr + 3) == '\0'))) {
    30553055        return EFI_INVALID_PARAMETER;
    30563056      }
    3057       if ((*TempStr  == '0') && (*(TempStr + 4) != '\0') && 
    3058           (*(TempStr + 4) != ':')) { 
     3057      if ((*TempStr  == '0') && (*(TempStr + 4) != '\0') &&
     3058          (*(TempStr + 4) != ':')) {
    30593059        return EFI_INVALID_PARAMETER;
    30603060      }
    30613061    } else {
    3062       if (((*TempStr  == '0') && (*(TempStr + 1) == '0') && 
     3062      if (((*TempStr  == '0') && (*(TempStr + 1) == '0') &&
    30633063          ((*(TempStr + 2) == ':') || (*(TempStr + 2) == '\0'))) ||
    3064           ((*TempStr  == '0') && (*(TempStr + 1) == '0') && (*(TempStr + 2) == '0') && 
     3064          ((*TempStr  == '0') && (*(TempStr + 1) == '0') && (*(TempStr + 2) == '0') &&
    30653065          ((*(TempStr + 3) == ':') || (*(TempStr + 3) == '\0')))) {
    30663066        return EFI_INVALID_PARAMETER;
     
    30703070    Cnt = 0;
    30713071    while ((TempStr[Cnt] != ':') && (TempStr[Cnt] != '\0')) {
    3072       Cnt++; 
     3072      Cnt++;
    30733073    }
    30743074    if (LeadZeroCnt == 0) {
     
    30883088        return EFI_INVALID_PARAMETER;
    30893089      }
    3090     } 
     3090    }
    30913091
    30923092    Ip6Address->Addr[Index] = (UINT8) (NodeVal >> 8);
     
    32923292  Convert one EFI_IPv6_ADDRESS to Null-terminated Unicode string.
    32933293  The text representation of address is defined in RFC 4291.
    3294  
     3294
    32953295  @param[in]       Ip6Address     The pointer to the IPv6 address.
    32963296  @param[out]      String         The buffer to return the converted string.
    32973297  @param[in]       StringSize     The length in bytes of the input String.
    3298                                  
     3298
    32993299  @retval EFI_SUCCESS             Convert to string successfully.
    33003300  @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
    33023302                                  updated with the size needed to complete the request.
    33033303**/
     
    33253325  //
    33263326  // Convert the UINT8 array to an UINT16 array for easy handling.
    3327   // 
     3327  //
    33283328  ZeroMem (Ip6Addr, sizeof (Ip6Addr));
    33293329  for (Index = 0; Index < 16; Index++) {
     
    33573357    }
    33583358  }
    3359  
     3359
    33603360  if (CurrentZerosStart != DEFAULT_ZERO_START && CurrentZerosLength > 2) {
    33613361    if (LongestZerosStart == DEFAULT_ZERO_START || LongestZerosLength < CurrentZerosLength) {
     
    33783378    Ptr += UnicodeSPrint(Ptr, 10, L"%x", Ip6Addr[Index]);
    33793379  }
    3380  
     3380
    33813381  if (LongestZerosStart != DEFAULT_ZERO_START && LongestZerosStart + LongestZerosLength == 8) {
    33823382    *Ptr++ = L':';
     
    34323432        return EFI_NOT_FOUND;
    34333433      }
    3434      
     3434
    34353435      //
    34363436      // SMBIOS tables are byte packed so we need to do a byte copy to
     
    34463446    // to skip one SMBIOS structure.
    34473447    //
    3448    
     3448
    34493449    //
    34503450    // Step 1: Skip over formatted section.
    34513451    //
    34523452    String = (CHAR8 *) (Smbios.Raw + Smbios.Hdr->Length);
    3453  
     3453
    34543454    //
    34553455    // Step 2: Skip over unformated string section.
     
    34693469        Smbios.Raw = (UINT8 *)++String;
    34703470        break;
    3471       }   
     3471      }
    34723472    } while (TRUE);
    34733473  } while (Smbios.Raw < SmbiosEnd.Raw);
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf

    r58459 r58466  
    5353[Guids]
    5454  ## SOMETIMES_PRODUCES ## UNDEFINED # HiiConstructConfigHdr EFI_NIC_IP4_CONFIG_VARIABLE
    55   ## UNDEFINED # Device Path Node 
    56   gEfiNicIp4ConfigVariableGuid                 
     55  ## UNDEFINED # Device Path Node
     56  gEfiNicIp4ConfigVariableGuid
    5757  gEfiSmbiosTableGuid                           ## SOMETIMES_CONSUMES  ## SystemTable
    5858
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeNetLib/NetBuffer.c

    r48674 r58466  
    18441844
    18451845/**
    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
    18511851  buffer for the ESP, so there needs a function to free the old net buffer.
    18521852
     
    18651865
    18661866  if (Nbuf->RefCnt == 0) {
    1867    
     1867
    18681868    //
    18691869    // Update Vector only when NBuf is to be released. That is,
     
    18801880
    18811881    //
    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
    18831883    // allocated by us
    18841884    //
     
    18871887    }
    18881888    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  
    225225EFIAPI
    226226GetPerformanceMeasurementEx (
    227   IN  UINTN       LogEntryKey, 
     227  IN  UINTN       LogEntryKey,
    228228  OUT CONST VOID  **Handle,
    229229  OUT CONST CHAR8 **Token,
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf

    r58459 r58466  
    11## @file
    22#  Performance library instance used in DXE phase.
    3 # 
     3#
    44#  This library instance provides infrastructure for DXE phase drivers to log performance
    55#  data. It consumes PerformanceEx or Performance Protocol published by DxeCorePerformanceLib
    66#  to log performance data. If both PerformanceEx and Performance Protocol are not available,
    77#  it does not log any performance information.
    8 # 
     8#
    99#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    1010#  This program and the accompanying materials
     
    1212#  which accompanies this distribution.  The full text of the license may be found at
    1313#  http://opensource.org/licenses/bsd-license.php
    14 # 
     14#
    1515#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1616#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    17 # 
     17#
    1818##
    1919
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c

    r58459 r58466  
    22  Instance of Print Library based on gEfiPrint2ProtocolGuid.
    33
    4   Implement the print library instance by wrap the interface 
     4  Implement the print library instance by wrap the interface
    55  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
    77  library instance is only for this code base.
    88
     
    3131/**
    3232  The constructor function caches the pointer to Print2 protocol.
    33  
     33
    3434  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.
    3636
    3737  @param  ImageHandle   The firmware allocated handle for the EFI image.
    3838  @param  SystemTable   A pointer to the EFI System Table.
    39  
     39
    4040  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.
    4141
     
    6363
    6464/**
    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
    6666  format string.
    6767
     
    130130
    131131        switch (FormatCharacter) {
    132         case '.': 
    133         case '-': 
    134         case '+': 
    135         case ' ': 
    136         case ',': 
     132        case '.':
     133        case '-':
     134        case '+':
     135        case ' ':
     136        case ',':
    137137        case '0':
    138138        case '1':
     
    147147          break;
    148148        case 'L':
    149         case 'l': 
     149        case 'l':
    150150          Long = TRUE;
    151151          break;
     
    156156          //
    157157          // 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.
    159159          //
    160160          Format -= BytesPerFormatCharacter;
     
    166166          break;
    167167        }
    168       } 
    169        
     168      }
     169
    170170      //
    171171      // Handle each argument type
     
    222222
    223223/**
    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
    225225  a Null-terminated Unicode format string and a VA_LIST argument list
    226  
     226
    227227  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.
    232232  The number of Unicode characters in the produced output buffer is returned not including
    233233  the Null-terminator.
     
    238238  If BufferSize > 1 and FormatString is NULL, then ASSERT().
    239239  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
    241241  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
    242242  ASSERT().
     
    245245  Null-terminator, then ASSERT().
    246246
    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
    248248                          Unicode string.
    249249  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    250250  @param  FormatString    Null-terminated Unicode format string.
    251251  @param  Marker          VA_LIST marker for the variable argument list.
    252  
     252
    253253  @return The number of Unicode characters in the produced output buffer not including the
    254254          Null-terminator.
     
    267267
    268268  DxePrintLibPrint2ProtocolVaListToBaseList (
    269     FALSE, 
    270     (CHAR8 *)FormatString, 
    271     Marker, 
    272     (BASE_LIST)BaseListMarker, 
     269    FALSE,
     270    (CHAR8 *)FormatString,
     271    Marker,
     272    (BASE_LIST)BaseListMarker,
    273273    sizeof (BaseListMarker) - 8
    274274    );
     
    278278
    279279/**
    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
    281281  a Null-terminated Unicode format string and a BASE_LIST argument list
    282  
     282
    283283  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.
    288288  The number of Unicode characters in the produced output buffer is returned not including
    289289  the Null-terminator.
     
    294294  If BufferSize > 1 and FormatString is NULL, then ASSERT().
    295295  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
    297297  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
    298298  ASSERT().
     
    301301  Null-terminator, then ASSERT().
    302302
    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
    304304                          Unicode string.
    305305  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    306306  @param  FormatString    Null-terminated Unicode format string.
    307307  @param  Marker          BASE_LIST marker for the variable argument list.
    308  
     308
    309309  @return The number of Unicode characters in the produced output buffer not including the
    310310          Null-terminator.
     
    324324
    325325/**
    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
    327327  Unicode format string and variable argument list.
    328  
     328
    329329  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
    330330  and BufferSize.
     
    339339  If BufferSize > 1 and FormatString is NULL, then ASSERT().
    340340  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
    342342  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
    343343  ASSERT().
     
    346346  Null-terminator, then ASSERT().
    347347
    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
    349349                          Unicode string.
    350350  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    351351  @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
    353353                          format string specified by FormatString.
    354354
     
    378378  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
    379379  ASCII format string and a VA_LIST argument list
    380  
     380
    381381  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
    382382  and BufferSize.
    383383  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
    385385  contents of the format string.
    386386  The number of Unicode characters in the produced output buffer is returned not including
     
    398398  Null-terminator, then ASSERT().
    399399
    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
    401401                          Unicode string.
    402402  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    403403  @param  FormatString    Null-terminated Unicode format string.
    404404  @param  Marker          VA_LIST marker for the variable argument list.
    405  
     405
    406406  @return The number of Unicode characters in the produced output buffer not including the
    407407          Null-terminator.
     
    420420
    421421  DxePrintLibPrint2ProtocolVaListToBaseList (
    422     TRUE, 
    423     FormatString, 
    424     Marker, 
    425     (BASE_LIST)BaseListMarker, 
     422    TRUE,
     423    FormatString,
     424    Marker,
     425    (BASE_LIST)BaseListMarker,
    426426    sizeof (BaseListMarker) - 8
    427427    );
     
    433433  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
    434434  ASCII format string and a BASE_LIST argument list
    435  
     435
    436436  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
    437437  and BufferSize.
    438438  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
    440440  contents of the format string.
    441441  The number of Unicode characters in the produced output buffer is returned not including
     
    453453  Null-terminator, then ASSERT().
    454454
    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
    456456                          Unicode string.
    457457  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    458458  @param  FormatString    Null-terminated Unicode format string.
    459459  @param  Marker          BASE_LIST marker for the variable argument list.
    460  
     460
    461461  @return The number of Unicode characters in the produced output buffer not including the
    462462          Null-terminator.
     
    476476
    477477/**
    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
    479479  ASCII format string and  variable argument list.
    480  
     480
    481481  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
    482482  and BufferSize.
    483483  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
    485485  format string.
    486486  The number of Unicode characters in the produced output buffer is returned not including
     
    498498  Null-terminator, then ASSERT().
    499499
    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
    501501                          Unicode string.
    502502  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    503503  @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
    505505                          format string specified by FormatString.
    506  
     506
    507507  @return The number of Unicode characters in the produced output buffer not including the
    508508          Null-terminator.
     
    529529/**
    530530  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
    534534  is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
    535535  The number of Unicode characters in Buffer is returned not including the Null-terminator.
    536536  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
    538538  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
    541541  The Flags bit LEFT_JUSTIFY is always ignored.
    542542  All conversions are left justified in Buffer.
     
    544544  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
    545545  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
    547547  formatted in hexadecimal format.
    548548  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 '-'
    551551  sign character, '0' characters, digit characters for Value, and the Null-terminator
    552552  add up to Width characters.
     
    564564  @param  Width   The maximum number of Unicode characters to place in Buffer, not including
    565565                  the Null-terminator.
    566  
     566
    567567  @return The number of Unicode characters in Buffer not including the Null-terminator.
    568568
     
    583583  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
    584584  ASCII format string and a VA_LIST argument list.
    585  
     585
    586586  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
    587587  and BufferSize.
    588588  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
    590590  the contents of the format string.
    591591  The number of ASCII characters in the produced output buffer is returned not including
     
    602602  Null-terminator, then ASSERT().
    603603
    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
    605605                          ASCII string.
    606606  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    607607  @param  FormatString    Null-terminated Unicode format string.
    608608  @param  Marker          VA_LIST marker for the variable argument list.
    609  
     609
    610610  @return The number of ASCII characters in the produced output buffer not including the
    611611          Null-terminator.
     
    624624
    625625  DxePrintLibPrint2ProtocolVaListToBaseList (
    626     TRUE, 
    627     FormatString, 
    628     Marker, 
    629     (BASE_LIST)BaseListMarker, 
     626    TRUE,
     627    FormatString,
     628    Marker,
     629    (BASE_LIST)BaseListMarker,
    630630    sizeof (BaseListMarker) - 8
    631631    );
     
    637637  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
    638638  ASCII format string and a BASE_LIST argument list.
    639  
     639
    640640  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
    641641  and BufferSize.
    642642  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
    644644  the contents of the format string.
    645645  The number of ASCII characters in the produced output buffer is returned not including
     
    656656  Null-terminator, then ASSERT().
    657657
    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
    659659                          ASCII string.
    660660  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    661661  @param  FormatString    Null-terminated Unicode format string.
    662662  @param  Marker          BASE_LIST marker for the variable argument list.
    663  
     663
    664664  @return The number of ASCII characters in the produced output buffer not including the
    665665          Null-terminator.
     
    681681  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
    682682  ASCII format string and  variable argument list.
    683  
     683
    684684  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
    685685  and BufferSize.
    686686  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
    688688  format string.
    689689  The number of ASCII characters in the produced output buffer is returned not including
     
    700700  Null-terminator, then ASSERT().
    701701
    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
    703703                          ASCII string.
    704704  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    705705  @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
    707707                          format string specified by FormatString.
    708708
     
    732732  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
    733733  ASCII format string and a VA_LIST argument list.
    734  
     734
    735735  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
    736736  and BufferSize.
    737737  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
    739739  the contents of the format string.
    740740  The number of ASCII characters in the produced output buffer is returned not including
     
    752752  Null-terminator, then ASSERT().
    753753
    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
    755755                          ASCII string.
    756756  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    757757  @param  FormatString    Null-terminated Unicode format string.
    758758  @param  Marker          VA_LIST marker for the variable argument list.
    759  
     759
    760760  @return The number of ASCII characters in the produced output buffer not including the
    761761          Null-terminator.
     
    774774
    775775  DxePrintLibPrint2ProtocolVaListToBaseList (
    776     FALSE, 
    777     (CHAR8 *)FormatString, 
    778     Marker, 
    779     (BASE_LIST)BaseListMarker, 
     776    FALSE,
     777    (CHAR8 *)FormatString,
     778    Marker,
     779    (BASE_LIST)BaseListMarker,
    780780    sizeof (BaseListMarker) - 8
    781781    );
     
    787787  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
    788788  ASCII format string and a BASE_LIST argument list.
    789  
     789
    790790  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
    791791  and BufferSize.
    792792  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
    794794  the contents of the format string.
    795795  The number of ASCII characters in the produced output buffer is returned not including
     
    807807  Null-terminator, then ASSERT().
    808808
    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
    810810                          ASCII string.
    811811  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    812812  @param  FormatString    Null-terminated Unicode format string.
    813813  @param  Marker          BASE_LIST marker for the variable argument list.
    814  
     814
    815815  @return The number of ASCII characters in the produced output buffer not including the
    816816          Null-terminator.
     
    832832  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
    833833  ASCII format string and  variable argument list.
    834  
     834
    835835  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
    836836  and BufferSize.
    837837  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
    839839  format string.
    840840  The number of ASCII characters in the produced output buffer is returned not including
     
    852852  Null-terminator, then ASSERT().
    853853
    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
    855855                          ASCII string.
    856856  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.
    857857  @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
    859859                          format string specified by FormatString.
    860860
     
    884884/**
    885885  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
    889889  is ever performed.
    890890  If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.
     
    893893  characters are returned, and the total number of characters required to perform
    894894  the conversion is returned.
    895   Additional conversion parameters are specified in Flags. 
     895  Additional conversion parameters are specified in Flags.
    896896  The Flags bit LEFT_JUSTIFY is always ignored.
    897897  All conversions are left justified in Buffer.
     
    899899  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
    900900  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
    902902  formatted in hexadecimal format.
    903903  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 '-'
    906906  sign character, '0' characters, digit characters for Value, and the Null-terminator
    907907  add up to Width characters.
    908  
     908
    909909  If Buffer is NULL, then ASSERT().
    910910  If unsupported bits are set in Flags, then ASSERT().
     
    918918  @param  Width   The maximum number of ASCII characters to place in Buffer, not including
    919919                  the Null-terminator.
    920  
     920
    921921  @return The number of ASCII characters in Buffer not including the Null-terminator.
    922922
     
    978978CHAR8 *
    979979InternalPrintLibValueToString (
    980   IN OUT CHAR8  *Buffer, 
    981   IN INT64      Value, 
     980  IN OUT CHAR8  *Buffer,
     981  IN INT64      Value,
    982982  IN UINTN      Radix
    983983  )
     
    10011001
    10021002/**
    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
    10041004  based on a Null-terminated format string and a VA_LIST argument list.
    10051005
    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
    10081008  this is the main print working routine.
    10091009
    10101010  If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all.
    10111011
    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
    10131013                              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
    10151015                              buffer.
    10161016  @param[in]  Flags           Initial flags value.
    1017                               Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 
     1017                              Can only have FORMAT_UNICODE, OUTPUT_UNICODE,
    10181018                              and COUNT_ONLY_NO_PRINT set.
    10191019  @param[in]  Format          A Null-terminated format string.
     
    10391039
    10401040/**
    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
    10421042  based on a Null-terminated format string and variable argument list.
    10431043
    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
    10461046  this is the main print working routine
    10471047
     
    11291129  @param  Buffer      The buffer to place the Unicode or ASCII string.
    11301130  @param  EndBuffer   The end of the input Buffer. No characters will be
    1131                       placed after that. 
     1131                      placed after that.
    11321132  @param  Length      The count of character to be placed into Buffer.
    11331133                      (Negative value indicates no buffer fill.)
     
    11481148{
    11491149  INTN  Index;
    1150  
     1150
    11511151  for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
    11521152    *Buffer = (CHAR8) Character;
     
    11611161
    11621162/**
    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
    11641164  based on a Null-terminated format string and a VA_LIST argument list.
    11651165
    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
    11681168  this is the main print working routine.
    11691169
    11701170  If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all.
    11711171
    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
    11731173                              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
    11751175                              buffer.
    11761176  @param[in]  Flags           Initial flags value.
    1177                               Can only have FORMAT_UNICODE, OUTPUT_UNICODE, 
     1177                              Can only have FORMAT_UNICODE, OUTPUT_UNICODE,
    11781178                              and COUNT_ONLY_NO_PRINT set.
    11791179  @param[in]  Format          A Null-terminated format string.
     
    12311231  //
    12321232  // 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
    12341234  // DxePrintLibPrint2Protocol (both PrintLib instances).
    12351235  //
     
    12751275    //
    12761276    // 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.
    12781278    //
    12791279    ASSERT (StrSize ((CHAR16 *) Format) != 0);
     
    12831283    //
    12841284    // 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.
    12861286    //
    12871287    ASSERT (AsciiStrSize (Format) != 0);
     
    13271327        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
    13281328        switch (FormatCharacter) {
    1329         case '.': 
    1330           Flags |= PRECISION; 
     1329        case '.':
     1330          Flags |= PRECISION;
    13311331          break;
    1332         case '-': 
    1333           Flags |= LEFT_JUSTIFY; 
     1332        case '-':
     1333          Flags |= LEFT_JUSTIFY;
    13341334          break;
    1335         case '+': 
    1336           Flags |= PREFIX_SIGN; 
     1335        case '+':
     1336          Flags |= PREFIX_SIGN;
    13371337          break;
    1338         case ' ': 
    1339           Flags |= PREFIX_BLANK; 
     1338        case ' ':
     1339          Flags |= PREFIX_BLANK;
    13401340          break;
    1341         case ',': 
    1342           Flags |= COMMA_TYPE; 
     1341        case ',':
     1342          Flags |= COMMA_TYPE;
    13431343          break;
    13441344        case 'L':
    1345         case 'l': 
    1346           Flags |= LONG_TYPE;   
     1345        case 'l':
     1346          Flags |= LONG_TYPE;
    13471347          break;
    13481348        case '*':
     
    13881388          }
    13891389          break;
    1390        
     1390
    13911391        case '\0':
    13921392          //
    13931393          // 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.
    13951395          //
    13961396          Format   -= BytesPerFormatCharacter;
     
    14031403          break;
    14041404        }
    1405       } 
     1405      }
    14061406
    14071407      //
     
    14351435          // 'd','x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int".
    14361436          // 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
    14401440          // architectures.  This is why the type "int" is used in this one case.
    14411441          //
     
    14791479            // 'd','x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int".
    14801480            // 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
    14841484            // architectures.  This is why the type "unsigned int" is used in this one case.
    14851485            //
     
    14951495        }
    14961496        ArgumentString = (CHAR8 *)ValueBuffer + Count;
    1497        
     1497
    14981498        Digits = Count % 3;
    14991499        if (Digits != 0) {
     
    15681568          InternalPrintLibSPrint (
    15691569            ValueBuffer,
    1570             MAXIMUM_VALUE_CHARACTERS, 
     1570            MAXIMUM_VALUE_CHARACTERS,
    15711571            0,
    15721572            "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
     
    15891589      case 't':
    15901590        if (BaseListMarker == NULL) {
    1591           TmpTime = VA_ARG (VaListMarker, TIME *); 
     1591          TmpTime = VA_ARG (VaListMarker, TIME *);
    15921592        } else {
    1593           TmpTime = BASE_ARG (BaseListMarker, TIME *); 
     1593          TmpTime = BASE_ARG (BaseListMarker, TIME *);
    15941594        }
    15951595        if (TmpTime == NULL) {
     
    16761676      }
    16771677      break;
    1678  
     1678
    16791679    case '\r':
    16801680      Format += BytesPerFormatCharacter;
     
    18421842  //
    18431843  // 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.
    18451845  //
    18461846  ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0));
    18471847  //
    18481848  // 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.
    18501850  //
    18511851  ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0));
     
    18551855
    18561856/**
    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
    18581858  output were produced not including the Null-terminator.
    18591859
     
    18641864  @param[in]  Marker          VA_LIST marker for the variable argument list.
    18651865
    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
    18671867          Null-terminator.
    18681868**/
     
    18791879
    18801880/**
    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
    18821882  output were produced not including the Null-terminator.
    18831883
     
    18871887  @param[in]  Marker          VA_LIST marker for the variable argument list.
    18881888
    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
    18901890          Null-terminator.
    18911891**/
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c

    r48674 r58466  
    110110    return mReportStatusCodeLibStatusCodeProtocol->ReportStatusCode (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
    111111  }
    112  
     112
    113113  return EFI_UNSUPPORTED;
    114114}
     
    506506  Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
    507507  gBS->RestoreTPL (Tpl);
    508  
     508
    509509  StatusCodeData = NULL;
    510510  if (Tpl <= TPL_NOTIFY) {
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c

    r58459 r58466  
    6565  //
    6666  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),
    6969                     mSecurityTable
    7070                     );
     
    8585
    8686/**
    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,
    8888 which must make sure that the measure image operation is the last one.
    8989
     
    9999  IN  UINT32    CheckAuthOperation
    100100  )
    101 { 
     101{
    102102  //
    103103  // Make sure new auth operation can be recognized.
    104104  //
    105105  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,
    109109  // only another measure image operation or none operation will be allowed.
    110110  //
     
    117117    }
    118118  }
    119  
    120   //
    121   // When current operation doesn't include measure image operation, 
     119
     120  //
     121  // When current operation doesn't include measure image operation,
    122122  // any new operation will be allowed.
    123123  //
     
    181181  If none of the handlers return an error, then EFI_SUCCESS is returned.
    182182
    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
    184184  requires the image file. And return the image buffer to each handler when exectue handler.
    185185
    186186  The handlers are executed in same order to their registered order.
    187187
    188   @param[in]  AuthenticationStatus 
     188  @param[in]  AuthenticationStatus
    189189                           This is the authentication type returned from the Section
    190190                           Extraction protocol. See the Section Extraction Protocol
     
    194194
    195195  @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
    199199                                 dictates that the DXE Core may use File.
    200200  @retval EFI_INVALID_PARAMETER  File is NULL.
     
    220220  VOID          *FileBuffer;
    221221  UINTN         FileSize;
    222  
     222
    223223  if (FilePath == NULL) {
    224224    return EFI_INVALID_PARAMETER;
     
    231231    return EFI_SUCCESS;
    232232  }
    233  
     233
    234234  Status                      = EFI_SUCCESS;
    235235  FileBuffer                  = NULL;
     
    290290  //
    291291  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),
    294294                     mSecurity2Table
    295295                     );
     
    310310
    311311/**
    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,
    313313  which must make sure that the measure image operation is the last one.
    314  
     314
    315315  If AuthenticationOperation is not recongnized, return FALSE.
    316316  If AuthenticationOperation is EFI_AUTH_OPERATION_NONE, return FALSE.
    317317  If AuthenticationOperation includes security operation and authentication operation, return FALSE.
    318318  If the previous register handler can't be executed before the later register handler, return FALSE.
    319  
     319
    320320  @param CurrentAuthOperation  Current operation.
    321321  @param CheckAuthOperation    Operation to be checked.
    322  
     322
    323323  @retval  TRUE   Operation is valid for current operation.
    324324  @retval  FALSE  Operation is invalid for current operation.
     
    329329  IN  UINT32    CheckAuthOperation
    330330  )
    331 { 
     331{
    332332  //
    333333  // Make sure new auth operation can be recognized.
     
    336336    return FALSE;
    337337  }
    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 |
    340340                              EFI_AUTH_OPERATION_IMAGE_REQUIRED)) != 0) {
    341341    return FALSE;
     
    343343
    344344  //
    345   // When current operation includes measure image operation, 
     345  // When current operation includes measure image operation,
    346346  // only another measure image or none image operation will be allowed.
    347347  //
     
    354354    }
    355355  }
    356  
     356
    357357  //
    358358  // Any other operation will be allowed.
     
    415415
    416416/**
    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
    420420  If none of the handlers return an error, then EFI_SUCCESS is returned.
    421421  The handlers those satisfy AuthenticationOperation will only be executed.
    422422  The handlers are executed in same order to their registered order.
    423423
    424   @param[in]  AuthenticationOperation   
     424  @param[in]  AuthenticationOperation
    425425                           The operation type specifies which handlers will be executed.
    426   @param[in]  AuthenticationStatus 
     426  @param[in]  AuthenticationStatus
    427427                           The authentication status for the input file.
    428428  @param[in]  File         This is a pointer to the device path of the file that is
     
    442442                                  UEFI device drivers on the device path specified by DevicePath.
    443443  @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
    445445                                  the file should be placed in the untrusted state.
    446446  @retval EFI_SECURITY_VIOLATION  FileBuffer FileBuffer is NULL and the user has no
     
    453453                                  the platform policy dictates that the DXE
    454454                                  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.
    456456**/
    457457EFI_STATUS
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf

    r58459 r58466  
    2323  MODULE_TYPE                    = DXE_DRIVER
    2424  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
    2626
    2727#
     
    4242  DebugLib
    4343  DxeServicesLib
    44  
     44
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c

    r58459 r58466  
    243243
    244244  //
    245   // Initialize communicate buffer 
     245  // Initialize communicate buffer
    246246  //
    247247  SmmCommBufferHeader = (EFI_SMM_COMMUNICATE_HEADER *)mSmmPerformanceBuffer;
    248248  SmmPerfCommData = (SMM_PERF_COMMUNICATE *)SmmCommBufferHeader->Data;
    249249  ZeroMem((UINT8*)SmmPerfCommData, sizeof(SMM_PERF_COMMUNICATE));
    250    
     250
    251251  CopyGuid (&SmmCommBufferHeader->HeaderGuid, &gSmmPerformanceProtocolGuid);
    252252  SmmCommBufferHeader->MessageLength = sizeof(SMM_PERF_COMMUNICATE);
     
    263263
    264264  mGaugeNumberOfEntries = SmmPerfCommData->NumberOfEntries;
    265  
     265
    266266  DataSize = mGaugeNumberOfEntries * sizeof(GAUGE_DATA_ENTRY);
    267267  mGaugeData = AllocateZeroPool(DataSize);
    268268  ASSERT (mGaugeData != NULL);
    269  
     269
    270270  //
    271271  // Get all SMM gauge data
    272   // 
     272  //
    273273  SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_DATA;
    274274  SmmPerfCommData->LogEntryKey = 0;
     
    313313
    314314  //
    315   // Initialize communicate buffer 
     315  // Initialize communicate buffer
    316316  //
    317317  SmmCommBufferHeader = (EFI_SMM_COMMUNICATE_HEADER *)mSmmPerformanceBuffer;
    318318  SmmPerfCommData = (SMM_PERF_COMMUNICATE_EX *)SmmCommBufferHeader->Data;
    319319  ZeroMem((UINT8*)SmmPerfCommData, sizeof(SMM_PERF_COMMUNICATE_EX));
    320    
     320
    321321  CopyGuid (&SmmCommBufferHeader->HeaderGuid, &gSmmPerformanceExProtocolGuid);
    322322  SmmCommBufferHeader->MessageLength = sizeof(SMM_PERF_COMMUNICATE_EX);
     
    333333
    334334  mGaugeNumberOfEntriesEx = SmmPerfCommData->NumberOfEntries;
    335  
     335
    336336  DataSize = mGaugeNumberOfEntriesEx * sizeof(GAUGE_DATA_ENTRY_EX);
    337337  mGaugeDataEx = AllocateZeroPool(DataSize);
    338338  ASSERT (mGaugeDataEx != NULL);
    339  
     339
    340340  //
    341341  // Get all SMM gauge data
    342   // 
     342  //
    343343  SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_DATA;
    344344  SmmPerfCommData->LogEntryKey = 0;
     
    351351    mGaugeNumberOfEntriesEx = 0;
    352352  }
    353  
     353
    354354  return mGaugeDataEx;
    355355}
     
    399399EFIAPI
    400400GetPerformanceMeasurementEx (
    401   IN  UINTN       LogEntryKey, 
     401  IN  UINTN       LogEntryKey,
    402402  OUT CONST VOID  **Handle,
    403403  OUT CONST CHAR8 **Token,
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf

    r58459 r58466  
    11## @file
    22#  Performance library instance used in DXE phase to dump SMM performance data.
    3 # 
     3#
    44#  This library instance allows a DXE driver or UEFI application to dump the SMM performance data.
    55#  StartPerformanceMeasurement(), EndPerformanceMeasurement(), StartPerformanceMeasurementEx()
    66#  and EndPerformanceMeasurementEx() are not implemented.
    7 # 
     7#
    88#  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
    99#  This program and the accompanying materials
     
    1111#  which accompanies this distribution.  The full text of the license may be found at
    1212#  http://opensource.org/licenses/bsd-license.php
    13 # 
     13#
    1414#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1515#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    16 # 
     16#
    1717##
    1818
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c

    r48674 r58466  
    2424
    2525/**
    26   The common notify function associated with various TcpIo events. 
     26  The common notify function associated with various TcpIo events.
    2727
    2828  @param[in]  Event   The event signaled.
     
    112112
    113113/**
    114   Create a TCP socket with the specified configuration data. 
     114  Create a TCP socket with the specified configuration data.
    115115
    116116  @param[in]  Image      The handle of the driver image.
     
    119119  @param[in]  ConfigData The Tcp configuration data.
    120120  @param[out] TcpIo      The TcpIo.
    121  
     121
    122122  @retval EFI_SUCCESS            The TCP socket is created and configured.
    123123  @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.
     
    177177  //
    178178  // Create the TCP child instance and get the TCP protocol.
    179   // 
     179  //
    180180  Status = NetLibCreateServiceChild (
    181181             Controller,
     
    396396  return Status;
    397397}
    398  
     398
    399399/**
    400   Destroy the socket. 
     400  Destroy the socket.
    401401
    402402  @param[in]  TcpIo The TcpIo which wraps the socket to be destroyed.
     
    532532  @param[in, out]  TcpIo     The TcpIo wrapping the TCP socket.
    533533  @param[in]       Timeout   The time to wait for connection done.
    534  
     534
    535535  @retval EFI_SUCCESS            Connect to the other endpoint of the TCP socket
    536536                                 successfully.
     
    600600  @param[in]       Timeout   The time to wait for connection done.
    601601
    602  
     602
    603603  @retval EFI_SUCCESS            Connect to the other endpoint of the TCP socket
    604604                                 successfully.
     
    608608
    609609  @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.
    611611  @retval Others                 Other errors as indicated.
    612612
     
    662662
    663663  //
    664   // The new TCP instance handle created for the established connection is 
     664  // The new TCP instance handle created for the established connection is
    665665  // in ListenToken.
    666666  //
     
    671671      ProtocolGuid = &gEfiTcp6ProtocolGuid;
    672672    }
    673    
     673
    674674    Status = gBS->OpenProtocol (
    675675                    TcpIo->ListenToken.Tcp4Token.NewChildHandle,
     
    710710  Tcp6               = NULL;
    711711
    712   if (TcpIo->TcpVersion == TCP_VERSION_4) { 
     712  if (TcpIo->TcpVersion == TCP_VERSION_4) {
    713713    TcpIo->CloseToken.Tcp4Token.AbortOnClose = TRUE;
    714714    Tcp4 = TcpIo->Tcp.Tcp4;
     
    735735}
    736736
    737  
     737
    738738/**
    739739  Transmit the Packet to the other endpoint of the socket.
     
    741741  @param[in]   TcpIo           The TcpIo wrapping the TCP socket.
    742742  @param[in]   Packet          The packet to transmit.
    743  
     743
    744744  @retval EFI_SUCCESS            The packet is trasmitted.
    745745  @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.
     
    770770  if (TcpIo->TcpVersion == TCP_VERSION_4) {
    771771
    772     Size = sizeof (EFI_TCP4_TRANSMIT_DATA) + 
     772    Size = sizeof (EFI_TCP4_TRANSMIT_DATA) +
    773773           (Packet->BlockOpNum - 1) * sizeof (EFI_TCP4_FRAGMENT_DATA);
    774774  } else if (TcpIo->TcpVersion == TCP_VERSION_6) {
     
    816816      goto ON_EXIT;
    817817    }
    818    
     818
    819819    Status  = Tcp4->Transmit (Tcp4, &TcpIo->TxToken.Tcp4Token);
    820820  } else {
     
    920920
    921921    if (Tcp6 == NULL) {
    922       return EFI_DEVICE_ERROR; 
     922      return EFI_DEVICE_ERROR;
    923923    }
    924924
     
    952952      Status = Tcp6->Receive (Tcp6, &TcpIo->RxToken.Tcp6Token);
    953953    }
    954    
     954
    955955    if (EFI_ERROR (Status)) {
    956956      goto ON_EXIT;
    957957    }
    958    
     958
    959959    while (!TcpIo->IsRxDone && ((Timeout == NULL) || EFI_ERROR (gBS->CheckEvent (Timeout)))) {
    960960      //
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf

    r58459 r58466  
    11## @file
    22#  This library instance provides TCP services by EFI TCPv4/TCPv6 Protocols.
    3 # 
     3#
    44#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf

    r58459 r58466  
    11## @file
    22#  This library instance provides UDP services by consuming EFI UDPv4/UDPv6 Protocols.
    3 # 
     3#
    44#  Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.c

    r48674 r58466  
    104104  @retval RETURN_SUCCESS            the information is restored successfully.
    105105  @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
    107107                                    LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.
    108108  @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  
    2828# The following information is for reference only and not required by the build tools.
    2929#
    30 #  VALID_ARCHITECTURES           = IA32 X64 
     30#  VALID_ARCHITECTURES           = IA32 X64
    3131#
    3232
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c

    r58464 r58466  
    11/** @file
    2   LZMA Decompress GUIDed Section Extraction Library, which produces LZMA custom 
     2  LZMA Decompress GUIDed Section Extraction Library, which produces LZMA custom
    33  decompression algorithm with the converter for the different arch code.
    44  It wraps Lzma decompress interfaces to GUIDed Section Extraction interfaces
     
    2323  size of an scratch buffer required to actually decode the data in a GUIDed section.
    2424
    25   Examines a GUIDed section specified by InputSection. 
     25  Examines a GUIDed section specified by InputSection.
    2626  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.
    2828  If the required information can not be retrieved from InputSection,
    2929  then RETURN_INVALID_PARAMETER is returned.
     
    3232  the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field
    3333  from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute.
    34  
     34
    3535  If InputSection is NULL, then ASSERT().
    3636  If OutputBufferSize is NULL, then ASSERT().
     
    101101/**
    102102  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.
    106106  If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned.
    107107  If the GUID of InputSection does match the GUID that this handler supports, then InputSection
     
    110110  data in InputSection, then OutputBuffer is set to point at the data in InputSection.  Otherwise,
    111111  the decoded data will be placed in caller allocated buffer specified by OutputBuffer.
    112  
     112
    113113  If InputSection is NULL, then ASSERT().
    114114  If OutputBuffer is NULL, then ASSERT().
     
    118118
    119119  @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.
    121121  @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
    124124                            A pointer to the authentication status of the decoded output buffer.
    125125                            See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
     
    148148  UINT32            OutputBufferSize;
    149149  UINT32            ScratchBufferSize;
    150  
     150
    151151  ASSERT (OutputBuffer != NULL);
    152152  ASSERT (InputSection != NULL);
     
    179179
    180180  //
    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.
    182182  //
    183183  if (!EFI_ERROR (Status)) {
     
    188188             &ScratchBufferSize
    189189             );
    190    
     190
    191191    if (!EFI_ERROR (Status)) {
    192192      x86_Convert_Init(X86State);
     
    194194    }
    195195  }
    196  
     196
    197197  return Status;
    198198}
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c

    r58464 r58466  
    2121  size of an scratch buffer required to actually decode the data in a GUIDed section.
    2222
    23   Examines a GUIDed section specified by InputSection. 
     23  Examines a GUIDed section specified by InputSection.
    2424  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.
    2626  If the required information can not be retrieved from InputSection,
    2727  then RETURN_INVALID_PARAMETER is returned.
     
    3030  the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field
    3131  from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute.
    32  
     32
    3333  If InputSection is NULL, then ASSERT().
    3434  If OutputBufferSize is NULL, then ASSERT().
     
    9999/**
    100100  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.
    104104  If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned.
    105105  If the GUID of InputSection does match the GUID that this handler supports, then InputSection
     
    108108  data in InputSection, then OutputBuffer is set to point at the data in InputSection.  Otherwise,
    109109  the decoded data will be placed in caller allocated buffer specified by OutputBuffer.
    110  
     110
    111111  If InputSection is NULL, then ASSERT().
    112112  If OutputBuffer is NULL, then ASSERT().
     
    116116
    117117  @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.
    119119  @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
    122122                            A pointer to the authentication status of the decoded output buffer.
    123123                            See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
     
    197197          LzmaGuidedSectionGetInfo,
    198198          LzmaGuidedSectionExtraction
    199           );     
     199          );
    200200}
    201201
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaArchCustomDecompressLib.inf

    r58464 r58466  
    4444  Sdk/C/LzHash.h
    4545  Sdk/C/LzmaDec.h
    46   Sdk/C/Types.h 
     46  Sdk/C/Types.h
    4747  UefiLzma.h
    4848  LzmaDecompressLibInternal.h
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf

    r58464 r58466  
    4343  Sdk/C/LzHash.h
    4444  Sdk/C/LzmaDec.h
    45   Sdk/C/Types.h 
     45  Sdk/C/Types.h
    4646  GuidedSectionExtraction.c
    4747  UefiLzma.h
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c

    r58464 r58466  
    106106
    107107/**
    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
    110110  to decompress the compressed source buffer.
    111111
    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
    113113  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,
    115115  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
    117117  checking of the validity of the source data. It just retrieves the "Original Size"
    118118  field from the LZMA_HEADER_SIZE beginning bytes of the source data and output it as DestinationSize.
     
    127127                          by Source and SourceSize is decompressed.
    128128  @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
    130130                          by Source and SourceSize.
    131131
    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
    134134                          buffer was returned in ScratchSize.
    135135
     
    159159
    160160  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
    163163  specified by Source is not in a valid compressed data format,
    164164  then RETURN_INVALID_PARAMETER is returned.
     
    168168  @param  Destination The destination buffer to store the decompressed data
    169169  @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
    171171                      required scratch buffer size is 0.
    172                      
    173   @retval  RETURN_SUCCESS Decompression completed successfully, and 
     172
     173  @retval  RETURN_SUCCESS Decompression completed successfully, and
    174174                          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
    177177                          (not in a valid compressed format).
    178178**/
     
    196196  AllocFuncs.Buffer           = Scratch;
    197197  AllocFuncs.BufferSize       = SCRATCH_BUFFER_REQUEST_SIZE;
    198  
     198
    199199  DecodedBufSize = (SizeT)GetDecodedSizeOfBuf((UINT8*)Source);
    200200  EncodedDataSize = (SizeT) (SourceSize - LZMA_HEADER_SIZE);
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompressLibInternal.h

    r58464 r58466  
    2424
    2525/**
    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
    2828  to decompress the compressed source buffer.
    2929
    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
    3131  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,
    3333  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
    3535  checking of the validity of the source data. It just retrieves the "Original Size"
    3636  field from the LZMA_HEADER_SIZE beginning bytes of the source data and output it as DestinationSize.
     
    4545                          by Source and SourceSize is decompressed.
    4646  @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
    4848                          by Source and SourceSize.
    4949
    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
    5252                          buffer was returned in ScratchSize.
    5353
     
    6666
    6767  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
    7070  specified by Source is not in a valid compressed data format,
    7171  then RETURN_INVALID_PARAMETER is returned.
     
    7575  @param  Destination The destination buffer to store the decompressed data
    7676  @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
    7878                      required scratch buffer size is 0.
    79                      
    80   @retval  RETURN_SUCCESS Decompression completed successfully, and 
     79
     80  @retval  RETURN_SUCCESS Decompression completed successfully, and
    8181                          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
    8484                          (not in a valid compressed format).
    8585**/
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/Bra.h

    r58464 r58466  
    1010These functions convert relative addresses to absolute addresses
    1111in CALL instructions to increase the compression ratio.
    12  
     12
    1313  In:
    1414    data     - data buffer
     
    1717    state    - state variable for x86 converter
    1818    encoding - 0 (for decoding), 1 (for encoding)
    19  
     19
    2020  Out:
    2121    state    - state variable for x86 converter
     
    2424    The number of processed bytes. If you call these functions with multiple calls,
    2525    you must start next call with first byte after block of processed bytes.
    26  
     26
    2727  Type   Endian  Alignment  LookAhead
    28  
     28
    2929  x86    little      1          4
    3030  ARMT   little      2          2
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzFind.c

    r58464 r58466  
    522522  delta2 = p->pos - p->hash[hash2Value];
    523523  curMatch = p->hash[kFix3HashSize + hashValue];
    524  
     524
    525525  p->hash[hash2Value] =
    526526  p->hash[kFix3HashSize + hashValue] = p->pos;
     
    556556  delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
    557557  curMatch = p->hash[kFix4HashSize + hashValue];
    558  
     558
    559559  p->hash[                hash2Value] =
    560560  p->hash[kFix3HashSize + hash3Value] =
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c

    r58464 r58466  
    167167  SizeT dicBufSize = p->dicBufSize;
    168168  SizeT dicPos = p->dicPos;
    169  
     169
    170170  UInt32 processedPos = p->processedPos;
    171171  UInt32 checkDicSize = p->checkDicSize;
     
    351351              NORMALIZE
    352352              range >>= 1;
    353              
     353
    354354              {
    355355                UInt32 t;
     
    749749  (*srcLen) = 0;
    750750  LzmaDec_WriteRem(p, dicLimit);
    751  
     751
    752752  *status = LZMA_STATUS_NOT_SPECIFIED;
    753753
     
    795795      if (p->needInitState)
    796796        LzmaDec_InitStateReal(p);
    797  
     797
    798798      if (p->tempBufSize == 0)
    799799      {
     
    926926  UInt32 dicSize;
    927927  Byte d;
    928  
     928
    929929  if (size < LZMA_PROPS_SIZE)
    930930    return SZ_ERROR_UNSUPPORTED;
    931931  else
    932932    dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
    933  
     933
    934934  if (dicSize < LZMA_DIC_MIN)
    935935    dicSize = LZMA_DIC_MIN;
     
    10131013
    10141014  LzmaDec_Init(&p);
    1015  
     1015
    10161016  *srcLen = inSize;
    10171017  res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.h

    r58464 r58466  
    127127  SZ_ERROR_UNSUPPORTED - Unsupported properties
    128128*/
    129    
     129
    130130SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
    131131void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
     
    156156
    157157/* LzmaDec_DecodeToDic
    158    
     158
    159159   The decoding to internal dictionary buffer (CLzmaDec::dic).
    160160   You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c

    r48674 r58466  
    3131/**
    3232  Report status code to OEM device.
    33  
     33
    3434  @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,
    4242                        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.
    4545  @param  Data          This optional parameter may be used to pass additional data
    46  
     46
    4747  @retval EFI_SUCCESS   Always return EFI_SUCCESS.
    4848
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf

    r58459 r58466  
    2121  MODULE_TYPE                    = DXE_DRIVER
    2222  VERSION_STRING                 = 1.0
    23   LIBRARY_CLASS                  = OemHookStatusCodeLib 
     23  LIBRARY_CLASS                  = OemHookStatusCodeLib
    2424
    2525#
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.c

    r58464 r58466  
    11/** @file
    22
    3   This library registers CRC32 guided section handler 
     3  This library registers CRC32 guided section handler
    44  to parse CRC32 encapsulation section and extract raw data.
    55
    66Copyright (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.             
     7This program and the accompanying materials
     8are licensed and made available under the terms and conditions of the BSD License
     9which accompanies this distribution.  The full text of the license may be found at
     10http://opensource.org/licenses/bsd-license.php
     11
     12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1414
    1515**/
     
    9090    return EFI_INVALID_PARAMETER;
    9191  }
    92  
     92
    9393  //
    9494  // Initialize CRC32 table.
     
    121121
    122122  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.
    124124  If not, EFI_INVALID_PARAMETER will return.
    125125
     
    129129  @param SectionAttribute   The attribute of the input guided section.
    130130
    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
    132132                                 the attribute of the input section are successull retrieved.
    133133  @retval EFI_INVALID_PARAMETER  The GUID in InputSection does not match this instance guid.
     
    182182  Extraction handler tries to extract raw data from the input guided section.
    183183  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.
    185185  If not, EFI_INVALID_PARAMETER will return.
    186186
     
    218218      return EFI_INVALID_PARAMETER;
    219219    }
    220  
     220
    221221    //
    222222    // Get section Crc32 checksum.
     
    240240      return EFI_INVALID_PARAMETER;
    241241    }
    242  
     242
    243243    //
    244244    // Get section Crc32 checksum.
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.inf

    r58464 r58466  
    22#  Pei Crc32 Guided Section Extract library.
    33#
    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
    55#  ExtractGuidedSectionLib service to register CRC32 guided section handler
    66#  that parses CRC32 encapsulation section and extracts raw data.
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.c

    r48674 r58466  
    2626/**
    2727  The constructor reads variable and sets HOB
    28  
     28
    2929  @param  FileHandle   The handle of FFS header the loaded driver.
    3030  @param  PeiServices  The pointer to the PEI services.
     
    4545  UINT64                          GlobalErrorLevel;
    4646  UINT32                          HobErrorLevel;
    47  
     47
    4848  Status = PeiServicesLocatePpi (
    4949             &gEfiPeiReadOnlyVariable2PpiGuid,
     
    5454  if (!EFI_ERROR (Status)) {
    5555    Size = sizeof (GlobalErrorLevel);
    56     Status = Variable->GetVariable ( 
    57                          Variable, 
     56    Status = Variable->GetVariable (
     57                         Variable,
    5858                         DEBUG_MASK_VARIABLE_NAME,
    5959                         &gEfiGenericVariableGuid,
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c

    r58464 r58466  
    3131  Prints a debug message to the debug output device if the specified error level is enabled.
    3232
    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
    3535  associated variable argument list to the debug output device.
    3636
     
    4242  @param  ErrorLevel  The error level of the debug message.
    4343  @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
    4545                      based on the format string specified by Format.
    4646
     
    7676  //
    7777  // 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
    7979  // the following layout:
    8080  //
     
    166166        //
    167167        // 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.
    169169        //
    170170        Format--;
     
    176176      break;
    177177    }
    178    
     178
    179179    //
    180180    // Pack variable arguments into the storage area following EFI_DEBUG_INFO.
     
    199199    //
    200200    // 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
    202202    // the EFI_DEBUG_INFO record
    203203    //
     
    229229
    230230/**
    231   Prints an assert message containing a filename, line number, and description. 
     231  Prints an assert message containing a filename, line number, and description.
    232232  This may be followed by a breakpoint or a dead loop.
    233233
    234234  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
    239239  returns immediately after the message is printed to the debug output device.
    240240  DebugAssert() must actively prevent recursion.  If DebugAssert() is called while
     
    277277  if (HeaderSize + FileNameSize + DescriptionSize > sizeof (Buffer)) {
    278278    //
    279     // FileName + Description is too long to be filled into buffer. 
     279    // FileName + Description is too long to be filled into buffer.
    280280    //
    281281    if (HeaderSize + FileNameSize < sizeof (Buffer)) {
    282282      //
    283       // Description has enough buffer to be truncated. 
     283      // Description has enough buffer to be truncated.
    284284      //
    285285      DescriptionSize = sizeof (Buffer) - HeaderSize - FileNameSize;
     
    293293    }
    294294  }
    295  
     295
    296296  //
    297297  // Fill in EFI_DEBUG_ASSERT_DATA
     
    339339  Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
    340340
    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
    342342  PcdDebugClearMemoryValue, and returns Buffer.
    343343
    344344  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().
    346346
    347347  @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.
    349349
    350350  @return  Buffer  Pointer to the target buffer filled with PcdDebugClearMemoryValue.
     
    367367  Returns TRUE if ASSERT() macros are enabled.
    368368
    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
    370370  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
    371371
     
    384384
    385385
    386 /** 
     386/**
    387387  Returns TRUE if DEBUG() macros are enabled.
    388388
    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
    390390  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
    391391
     
    404404
    405405
    406 /** 
     406/**
    407407  Returns TRUE if DEBUG_CODE() macros are enabled.
    408408
    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
    410410  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
    411411
     
    424424
    425425
    426 /** 
     426/**
    427427  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
    428428
    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
    430430  PcdDebugProperyMask is set.  Otherwise FALSE is returned.
    431431
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf

    r58464 r58466  
    3737  MdePkg/MdePkg.dec
    3838  MdeModulePkg/MdeModulePkg.dec
    39  
     39
    4040[LibraryClasses]
    4141  PcdLib
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c

    r58459 r58466  
    55  performance logging GUIDed HOB on the first performance logging and then logs the
    66  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.
    88
    99Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
     
    8989  otherwise, the the number of log entries in the array is returned.
    9090
    91   @param  PeiPerformanceLog       Pointer to the data structure containing PEI 
     91  @param  PeiPerformanceLog       Pointer to the data structure containing PEI
    9292                                  performance data.
    9393  @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
    22#  Performance library instance used in PEI phase.
    3 # 
     3#
    44#  This library provides the performance measurement interfaces in PEI phase, it creates
    55#  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#
    88#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    99#  This program and the accompanying materials
     
    1111#  which accompanies this distribution.  The full text of the license may be found at
    1212#  http://opensource.org/licenses/bsd-license.php
    13 # 
     13#
    1414#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1515#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    16 # 
     16#
    1717##
    1818
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.c

    r48674 r58466  
    44  This library instance is no longer used and module using this library
    55  class should update to directly locate EFI_PEI_RECOVERY_MODULE_PPI defined
    6   in PI 1.2 specification. 
     6  in PI 1.2 specification.
    77
    88Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
     
    2121/**
    2222  Calling this function causes the system do recovery boot path.
    23  
     23
    2424  @retval EFI_UNSUPPORTED       Recovery is not supported.
    2525**/
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf

    r58459 r58466  
    1 ## @file 
     1## @file
    22#  Null Recovery library instance for PEIM module
    33#  This library instance is no longer used and module using this library
    44#  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#
    77#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    88#  This program and the accompanying materials
     
    1010#  which accompanies this distribution.  The full text of the license may be found at
    1111#  http://opensource.org/licenses/bsd-license.php
    12 # 
     12#
    1313#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1414#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    15 # 
     15#
    1616##
    1717
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf

    r58459 r58466  
    2626  VERSION_STRING                 = 1.0
    2727  LIBRARY_CLASS                  = ReportStatusCodeLib|SEC PEIM PEI_CORE
    28  
     28
    2929#
    3030# 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  
    44  This library instance is no longer used and module using this library
    55  class should update to directly locate EFI_PEI_S3_RESUME_PPI defined
    6   in PI 1.2 specification. 
     6  in PI 1.2 specification.
    77
    88Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
     
    2121/**
    2222  This function is responsible for calling the S3 resume vector in the ACPI Tables.
    23  
     23
    2424  @retval EFI_SUCESS   Success to restore config from S3.
    2525  @retval Others       Fail to restore config from S3.
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf

    r58459 r58466  
    33#  This library instance is no longer used and module using this library
    44#  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#
    77#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    88#
     
    1111#  which accompanies this distribution.  The full text of the license may be found at
    1212#  http://opensource.org/licenses/bsd-license.php
    13 # 
     13#
    1414#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1515#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c

    r58459 r58466  
    11/** @file
    2   Interpret and execute the S3 data in S3 boot script. 
     2  Interpret and execute the S3 data in S3 boot script.
    33
    44  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
     
    2424  slave devices accept this transaction or that this function returns with error.
    2525
    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,
    2727                                  and PEC.
    2828  @param  Operation               Signifies which particular SMBus hardware protocol instance that
     
    121121  }
    122122
    123   return Status; 
     123  return Status;
    124124}
    125125
     
    131131  @param Address        Address of the operation.
    132132  @param AddressStride  Instride for stepping input buffer.
    133   @param BufferStride   Outstride for stepping output buffer. 
     133  @param BufferStride   Outstride for stepping output buffer.
    134134
    135135  @retval EFI_SUCCESS  Successful translation.
     
    171171/**
    172172  Perform IO read operation
    173  
     173
    174174  @param[in]  Width   Width of the operation.
    175175  @param[in]  Address Address of the operation.
    176176  @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.
    178178
    179179  @retval EFI_SUCCESS The data was written to the EFI System.
     
    181181                                Buffer is NULL.
    182182                                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
    185185**/
    186186EFI_STATUS
     
    275275/**
    276276  Perform IO write operation
    277  
     277
    278278  @param[in]  Width Width of the operation.
    279279  @param[in]  Address Address of the operation.
    280280  @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.
    282282
    283283  @retval EFI_SUCCESS The data was written to the EFI System.
     
    285285                                Buffer is NULL.
    286286                                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
    289289**/
    290290EFI_STATUS
     
    323323        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));
    324324        IoWrite8 ((UINTN) Address, *In.Uint8);
    325         break;     
     325        break;
    326326      case S3BootScriptWidthFifoUint8:
    327327        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8));
    328328        IoWrite8 ((UINTN) OriginalAddress, *In.Uint8);
    329         break;       
     329        break;
    330330      case S3BootScriptWidthFillUint8:
    331331        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));
     
    335335        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));
    336336        IoWrite16 ((UINTN) Address, *In.Uint16);
    337         break;     
     337        break;
    338338      case S3BootScriptWidthFifoUint16:
    339339        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16));
    340340        IoWrite16 ((UINTN) OriginalAddress, *In.Uint16);
    341         break;     
     341        break;
    342342      case S3BootScriptWidthFillUint16:
    343343        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));
     
    347347        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));
    348348        IoWrite32 ((UINTN) Address, *In.Uint32);
    349         break;     
     349        break;
    350350      case S3BootScriptWidthFifoUint32:
    351351        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32));
     
    359359        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));
    360360        IoWrite64 ((UINTN) Address, *In.Uint64);
    361         break;     
     361        break;
    362362      case S3BootScriptWidthFifoUint64:
    363363        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64));
    364364        IoWrite64 ((UINTN) OriginalAddress, *In.Uint64);
    365         break;     
     365        break;
    366366      case S3BootScriptWidthFillUint64:
    367367        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));
     
    372372    }
    373373  }
    374  
     374
    375375
    376376  return EFI_SUCCESS;
     
    378378/**
    379379  Interprete the boot script node with EFI_BOOT_SCRIPT_IO_WRITE OP code.
    380  
     380
    381381  @param Script       Pointer to the node which is to be interpreted.
    382382
     
    385385                                Buffer is NULL.
    386386                                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
    389389**/
    390390EFI_STATUS
    391391BootScriptExecuteIoWrite (
    392   IN UINT8                    *Script   
     392  IN UINT8                    *Script
    393393  )
    394394{
     
    398398  VOID                      *Buffer;
    399399  EFI_BOOT_SCRIPT_IO_WRITE   IoWrite;
    400  
     400
    401401  CopyMem ((VOID*)&IoWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_WRITE));
    402402  Width = (S3_BOOT_SCRIPT_LIB_WIDTH) IoWrite.Width;
     
    410410/**
    411411  Perform memory read operation
    412  
     412
    413413  @param  Width Width of the operation.
    414414  @param  Address Address of the operation.
    415415  @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.
    417417
    418418  @retval EFI_SUCCESS The data was written to the EFI System.
     
    420420                                Buffer is NULL.
    421421                                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
    425425**/
    426426EFI_STATUS
     
    509509/**
    510510  Perform memory write operation
    511  
     511
    512512  @param   Width   Width of the operation.
    513513  @param   Address Address of the operation.
    514514  @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.
    516516
    517517  @retval EFI_SUCCESS The data was written to the EFI System.
     
    519519                                Buffer is NULL.
    520520                                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
    524524**/
    525525EFI_STATUS
     
    533533  EFI_STATUS  Status;
    534534  UINTN       AddressStride;
    535   UINT64      OriginalAddress; 
     535  UINT64      OriginalAddress;
    536536  UINTN       BufferStride;
    537537  PTR         In;
     
    548548  //
    549549  OriginalAddress = Address;
    550   OriginalIn.Buf = In.Buf; 
     550  OriginalIn.Buf = In.Buf;
    551551  for (; Count > 0; Count--, Address += AddressStride, In.Buf += BufferStride) {
    552552    switch (Width) {
     
    554554        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));
    555555        MmioWrite8 ((UINTN) Address, *In.Uint8);
    556         break;     
     556        break;
    557557      case S3BootScriptWidthFifoUint8:
    558558        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8));
    559559        MmioWrite8 ((UINTN) OriginalAddress, *In.Uint8);
    560         break;     
     560        break;
    561561      case S3BootScriptWidthFillUint8:
    562562        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));
     
    566566        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));
    567567        MmioWrite16 ((UINTN) Address, *In.Uint16);
    568         break;     
     568        break;
    569569      case S3BootScriptWidthFifoUint16:
    570570        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16));
    571571        MmioWrite16 ((UINTN) OriginalAddress, *In.Uint16);
    572         break;     
     572        break;
    573573      case S3BootScriptWidthFillUint16:
    574574        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));
     
    578578        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));
    579579        MmioWrite32 ((UINTN) Address, *In.Uint32);
    580         break;     
     580        break;
    581581      case S3BootScriptWidthFifoUint32:
    582582        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32));
    583583        MmioWrite32 ((UINTN) OriginalAddress, *In.Uint32);
    584         break;     
     584        break;
    585585      case S3BootScriptWidthFillUint32:
    586586        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint32));
     
    590590        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));
    591591        MmioWrite64 ((UINTN) Address, *In.Uint64);
    592         break;     
     592        break;
    593593      case S3BootScriptWidthFifoUint64:
    594594        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64));
    595595        MmioWrite64 ((UINTN) OriginalAddress, *In.Uint64);
    596         break;     
     596        break;
    597597      case S3BootScriptWidthFillUint64:
    598598        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));
     
    609609
    610610  @param[in]  Script Pointer to the node which is to be interpreted.
    611  
     611
    612612  @retval EFI_SUCCESS The data was written to the EFI System.
    613613  @retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.
    614614                                Buffer is NULL.
    615615                                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
    619619**/
    620620EFI_STATUS
     
    628628  UINTN            Count;
    629629  EFI_BOOT_SCRIPT_MEM_WRITE  MemWrite;
    630  
     630
    631631  CopyMem((VOID*)&MemWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_WRITE));
    632632  Width   = (S3_BOOT_SCRIPT_LIB_WIDTH)MemWrite.Width;
     
    637637  DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryWrite - 0x%08x, 0x%08x, 0x%08x\n", (UINTN)Address, Count, (UINTN)Width));
    638638  return ScriptMemoryWrite (Width,Address, Count,  Buffer);
    639  
    640 } 
     639
     640}
    641641/**
    642642  Performance PCI configuration read operation
     
    646646  @param  Count   Count of the number of accesses to perform.
    647647  @param  Buffer  Pointer to the buffer read from PCI config space
    648  
     648
    649649  @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
    651651  @note  A known Limitations in the implementation which is 64bits operations are not supported.
    652652
     
    732732  @param  Count   Count of the number of accesses to perform.
    733733  @param  Buffer  Pointer to the buffer write to PCI config space
    734  
     734
    735735  @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
    737737  @note  A known Limitations in the implementation which is 64bits operations are not supported.
    738738
     
    772772        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", PciAddress, (UINTN)*In.Uint8));
    773773        PciWrite8 (PciAddress, *In.Uint8);
    774         break;     
     774        break;
    775775      case S3BootScriptWidthFifoUint8:
    776776        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", OriginalPciAddress, (UINTN)*In.Uint8));
    777777        PciWrite8 (OriginalPciAddress, *In.Uint8);
    778         break;     
     778        break;
    779779      case S3BootScriptWidthFillUint8:
    780780        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", PciAddress, (UINTN)*OriginalIn.Uint8));
     
    784784        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", PciAddress, (UINTN)*In.Uint16));
    785785        PciWrite16 (PciAddress, *In.Uint16);
    786         break;     
     786        break;
    787787      case S3BootScriptWidthFifoUint16:
    788788        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", OriginalPciAddress, (UINTN)*In.Uint16));
    789789        PciWrite16 (OriginalPciAddress, *In.Uint16);
    790         break;     
     790        break;
    791791      case S3BootScriptWidthFillUint16:
    792792        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", PciAddress, (UINTN)*OriginalIn.Uint16));
     
    796796        DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", PciAddress, (UINTN)*In.Uint32));
    797797        PciWrite32 (PciAddress, *In.Uint32);
    798         break;     
     798        break;
    799799      case S3BootScriptWidthFifoUint32:
    800800        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", OriginalPciAddress, (UINTN)*In.Uint32));
    801801        PciWrite32 (OriginalPciAddress, *In.Uint32);
    802         break;     
     802        break;
    803803      case S3BootScriptWidthFillUint32:
    804804        DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)PciAddress, (UINTN)*OriginalIn.Uint32));
     
    813813/**
    814814  Performance PCI configuration 2 read operation
    815  
     815
    816816  @param     Width                      Width of the operation.
    817817  @param     Segment                    Pci segment number
     
    825825                                        The Buffer is not aligned for the given Width.
    826826                                        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
    828828         Zero, or else, assert.
    829829**/
     
    831831ScriptPciCfg2Read (
    832832  IN  S3_BOOT_SCRIPT_LIB_WIDTH    Width,
    833   IN  UINT16                   Segment, 
     833  IN  UINT16                   Segment,
    834834  IN  UINT64                   Address,
    835835  IN  UINTN                    Count,
     
    838838{
    839839  ASSERT (Segment==0);
    840  
     840
    841841  return ScriptPciCfgRead (Width, Address, Count, Buffer);
    842842}
    843843/**
    844844  Performance PCI configuration 2 write operation
    845  
     845
    846846  @param     Width                      Width of the operation.
    847847  @param     Segment                    Pci segment number
     
    855855                                        The Buffer is not aligned for the given Width.
    856856                                        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
    858858         Zero, or else, assert.
    859                                
     859
    860860**/
    861861EFI_STATUS
     
    863863ScriptPciCfg2Write (
    864864  IN  S3_BOOT_SCRIPT_LIB_WIDTH    Width,
    865   IN  UINT16                   Segment, 
     865  IN  UINT16                   Segment,
    866866  IN  UINT64                   Address,
    867867  IN  UINTN                    Count,
     
    874874/**
    875875  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
    879879  @retval EFI_SUCCESS  The operation was executed successfully
    880880**/
     
    903903  Interprete the boot script node with EFI_BOOT_SCRIPT_IO_READ_WRITE OP code.
    904904
    905   @param Script   The pointer of typed node in boot script table 
     905  @param Script   The pointer of typed node in boot script table
    906906  @param AndMask  Mask value for 'and' operation
    907907  @param OrMask   Mask value for 'or' operation
     
    920920  UINT64      Data;
    921921  EFI_BOOT_SCRIPT_IO_READ_WRITE IoReadWrite;
    922  
     922
    923923  Data = 0;
    924  
     924
    925925  CopyMem((VOID*)&IoReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_READ_WRITE));
    926926
     
    947947  Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_READ_WRITE OP code.
    948948
    949   @param Script    The pointer of typed node in boot script table 
     949  @param Script    The pointer of typed node in boot script table
    950950  @param AndMask   Mask value for 'and' operation
    951951  @param OrMask    Mask value for 'or' operation
     
    964964  UINT64      Data;
    965965  EFI_BOOT_SCRIPT_MEM_READ_WRITE  MemReadWrite;
    966  
     966
    967967  Data = 0;
    968  
     968
    969969  CopyMem((VOID*)&MemReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_READ_WRITE));
    970970
    971971  DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)MemReadWrite.Address, AndMask, OrMask));
    972  
     972
    973973  Status = ScriptMemoryRead (
    974974             (S3_BOOT_SCRIPT_LIB_WIDTH) MemReadWrite.Width,
     
    991991  Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CFG_READ_WRITE OP code.
    992992
    993   @param Script   The pointer of typed node in boot script table 
     993  @param Script   The pointer of typed node in boot script table
    994994  @param AndMask  Mask value for 'and' operation
    995995  @param OrMask   Mask value for 'or' operation
     
    10141014
    10151015  DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfgReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfgReadWrite.Address), AndMask, OrMask));
    1016  
     1016
    10171017  Status = ScriptPciCfgRead (
    10181018             (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfgReadWrite.Width,
     
    10391039  Interprete the boot script node with EFI_BOOT_SCRIPT_SMBUS_EXECUTE OP code.
    10401040
    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
    10431043  @retval EFI_SUCCESS      The operation was executed successfully
    10441044  @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
    10461046**/
    10471047EFI_STATUS
     
    10531053  UINTN                    DataSize;
    10541054  EFI_BOOT_SCRIPT_SMBUS_EXECUTE SmbusExecuteEntry;
    1055  
     1055
    10561056  CopyMem ((VOID*)&SmbusExecuteEntry, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_SMBUS_EXECUTE ));
    10571057
     
    10701070  Interprete the boot script node with EFI_BOOT_SCRIPT_STALL OP code.
    10711071
    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
    10741074  @retval EFI_SUCCESS The operation was executed successfully
    10751075**/
     
    10801080{
    10811081  EFI_BOOT_SCRIPT_STALL    Stall;
    1082  
     1082
    10831083  CopyMem ((VOID*)&Stall, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_STALL));
    10841084
     
    10901090/**
    10911091  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
    10941094  @retval EFI_SUCCESS  The operation was executed successfully
    10951095**/
     
    11021102  DISPATCH_ENTRYPOINT_FUNC  EntryFunc;
    11031103  EFI_BOOT_SCRIPT_DISPATCH  ScriptDispatch;
    1104  
     1104
    11051105  CopyMem ((VOID*)&ScriptDispatch, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_DISPATCH));
    11061106  EntryFunc = (DISPATCH_ENTRYPOINT_FUNC) (UINTN) (ScriptDispatch.EntryPoint);
     
    11151115  Interprete the boot script node with EFI_BOOT_SCRIPT_DISPATCH_2 OP code.
    11161116
    1117   @param  Script       The pointer of typed node in boot script table 
     1117  @param  Script       The pointer of typed node in boot script table
    11181118  @retval EFI_SUCCESS  The operation was executed successfully
    11191119**/
     
    11261126  DISPATCH_ENTRYPOINT_FUNC  EntryFunc;
    11271127  EFI_BOOT_SCRIPT_DISPATCH_2  ScriptDispatch2;
    1128  
     1128
    11291129  CopyMem ((VOID*)&ScriptDispatch2, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_DISPATCH_2));
    11301130
    11311131  DEBUG ((EFI_D_INFO, "BootScriptExecuteDispatch2 - 0x%08x(0x%08x)\n", (UINTN)ScriptDispatch2.EntryPoint, (UINTN)ScriptDispatch2.Context));
    1132  
     1132
    11331133  EntryFunc = (DISPATCH_ENTRYPOINT_FUNC) (UINTN) (ScriptDispatch2.EntryPoint);
    11341134
     
    11401140  Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_POLL OP code.
    11411141
    1142   @param  Script  The pointer of typed node in boot script table 
     1142  @param  Script  The pointer of typed node in boot script table
    11431143  @param  AndMask  Mask value for 'and' operation
    11441144  @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
    11471147                           the epecting data within the Loop Times.
    11481148  @retval EFI_SUCCESS      The operation was executed successfully
     
    11521152  IN UINT8                        *Script,
    11531153  IN UINT64                        AndMask,
    1154   IN UINT64                        OrMask 
    1155   )
    1156 {
    1157  
     1154  IN UINT64                        OrMask
     1155  )
     1156{
     1157
    11581158  UINT64        Data;
    11591159  UINT64        LoopTimes;
    11601160  EFI_STATUS    Status;
    11611161  EFI_BOOT_SCRIPT_MEM_POLL       MemPoll;
    1162  
     1162
    11631163  CopyMem ((VOID*)&MemPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_POLL));
    11641164
     
    12011201  This opcode is a no-op on dispatch and is only used for debugging script issues.
    12021202
    1203   @param Script       The pointer of node in boot script table 
    1204  
     1203  @param Script       The pointer of node in boot script table
     1204
    12051205**/
    12061206VOID
     
    12271227
    12281228/**
    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
    12331233**/
    12341234VOID
     
    12561256/**
    12571257  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
    12591259  @param AndMask  The Mask value for 'and' operation
    12601260  @param OrMask   The Mask value for 'or' operation
     
    12881288    Size = sizeof (EFI_BOOT_SCRIPT_MEM_POLL);
    12891289    break;
    1290  
     1290
    12911291  case EFI_BOOT_SCRIPT_IO_POLL_OPCODE:
    12921292    Size = sizeof (EFI_BOOT_SCRIPT_IO_POLL);
    1293     break;   
    1294  
     1293    break;
     1294
    12951295  case EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE:
    12961296    Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE);
    12971297    break;
    1298  
     1298
    12991299  case EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE:
    13001300    Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL);
    13011301    break;
    1302  
     1302
    13031303  case EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE:
    13041304    Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL);
    13051305    break;
    1306  
     1306
    13071307  default:
    13081308    return;
    13091309  }
    1310  
     1310
    13111311  DataPtr = Script + Size;
    13121312
     
    13411341  Interprete the boot script node with EFI_BOOT_SCRIPT_IO_POLL OP code.
    13421342
    1343   @param  Script  The pointer of typed node in boot script table 
     1343  @param  Script  The pointer of typed node in boot script table
    13441344  @param  AndMask  Mask value for 'and' operation
    13451345  @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
    13481348                           the epecting data within the Loop Times.
    13491349  @retval EFI_SUCCESS      The operation was executed successfully
     
    13601360  UINT64        LoopTimes;
    13611361  EFI_BOOT_SCRIPT_IO_POLL       IoPoll;
    1362  
     1362
    13631363  CopyMem ((VOID*)&IoPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_POLL));
    13641364
     
    13861386    if ((!EFI_ERROR (Status)) &&(Data & AndMask) == OrMask) {
    13871387      return EFI_SUCCESS;
    1388     } 
     1388    }
    13891389  }
    13901390
     
    14141414  UINTN                             Count;
    14151415  EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE PciCfg2Write;
    1416  
     1416
    14171417  CopyMem ((VOID*)&PciCfg2Write, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE));
    14181418
     
    14301430/**
    14311431  Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE OP code.
    1432  
     1432
    14331433  @param     Script                     The pointer of S3 boot script
    14341434  @param     AndMask                    Mask value for 'and' operation
     
    14541454
    14551455  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
    14571457  Status = ScriptPciCfg2Read (
    14581458             (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2ReadWrite.Width,
     
    14781478/**
    14791479  Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG_POLL OP code.
    1480  
     1480
    14811481  @param     Script                     The pointer of S3 boot script
    14821482  @param     AndMask                    Mask value for 'and' operation
     
    14841484
    14851485  @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
    14871487                                        epecting data within the Loop Times.
    14881488**/
     
    14911491  IN UINT8                         *Script,
    14921492  IN UINT64                        AndMask,
    1493   IN UINT64                        OrMask 
     1493  IN UINT64                        OrMask
    14941494  )
    14951495{
     
    15011501
    15021502  DEBUG ((EFI_D_INFO, "BootScriptPciCfgPoll - 0x%08x, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfgPoll.Address), AndMask, OrMask));
    1503  
     1503
    15041504  Data = 0;
    15051505  Status = ScriptPciCfgRead (
     
    15371537/**
    15381538  Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL OP code.
    1539  
     1539
    15401540  @param     Script                     The pointer of S3 Boot Script
    15411541  @param     AndMask                    Mask value for 'and' operation
     
    15431543
    15441544  @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
    15461546                                        epecting data within the Loop Times.
    15471547
     
    15511551  IN UINT8                        *Script,
    15521552  IN UINT64                        AndMask,
    1553   IN UINT64                        OrMask 
     1553  IN UINT64                        OrMask
    15541554  )
    15551555{
     
    15631563
    15641564  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
    15661566  Status = ScriptPciCfg2Read (
    15671567             (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2Poll.Width,
     
    15811581    Status = ScriptPciCfg2Read (
    15821582               (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2Poll.Width,
    1583                PciCfg2Poll.Segment,               
     1583               PciCfg2Poll.Segment,
    15841584               PciCfg2Poll.Address,
    15851585               1,
     
    15961596    return EFI_DEVICE_ERROR;
    15971597  }
    1598  
     1598
    15991599}
    16001600
    16011601/**
    16021602  Executes the S3 boot script table.
    1603  
     1603
    16041604  @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
    16071607  @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
    16091609         Zero, or else, assert.
    16101610**/
     
    16241624  EFI_BOOT_SCRIPT_TABLE_HEADER   TableHeader;
    16251625  Script = mS3BootScriptTablePtr->TableBase;
    1626   if (Script != 0) {   
     1626  if (Script != 0) {
    16271627    CopyMem ((VOID*)&TableHeader, Script, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER));
    16281628  } else {
     
    16361636
    16371637  DEBUG ((EFI_D_INFO, "TableHeader - 0x%08x\n", Script));
    1638  
     1638
    16391639  StartAddress  = (UINTN) Script;
    16401640  TableLength   = TableHeader.TableLength;
     
    16481648  while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) {
    16491649    DEBUG ((EFI_D_INFO, "ExecuteBootScript - %08x\n", (UINTN)Script));
    1650    
     1650
    16511651    CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));
    16521652    switch (ScriptHeader.OpCode) {
     
    17131713      DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_INFORMATION_OPCODE\n"));
    17141714      BootScriptExecuteInformation (Script);
    1715       break;   
     1715      break;
    17161716
    17171717    case S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE:
     
    17441744      CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script);
    17451745      Status = BootScriptExecuteMemPoll (Script, AndMask, OrMask);
    1746      
    1747       break;
    1748    
     1746
     1747      break;
     1748
    17491749    case EFI_BOOT_SCRIPT_IO_POLL_OPCODE:
    17501750      DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_IO_POLL_OPCODE\n"));
     
    17521752      Status = BootScriptExecuteIoPoll (Script, AndMask, OrMask);
    17531753      break;
    1754      
     1754
    17551755    case EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE:
    17561756      DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE\n"));
     
    17581758      Status = BootScriptPciCfgPoll (Script, AndMask, OrMask);
    17591759      break;
    1760      
     1760
    17611761    case EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE:
    17621762     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  
    170170  UINT32  Width;
    171171  UINT64  Address;
    172   UINT16  Segment; 
     172  UINT16  Segment;
    173173  UINT64  Delay;
    174174} EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL;
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c

    r58459 r58466  
    11/** @file
    2   Save the S3 data to S3 boot script. 
    3  
     2  Save the S3 data to S3 boot script.
     3
    44  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    55
     
    6060
    6161/**
    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.
    6666 **/
    6767UINT8*
     
    7474  EFI_BOOT_SCRIPT_TABLE_HEADER   *ScriptTableInfo;
    7575  S3TableBase = mS3BootScriptTablePtr->TableBase;
    76  
     76
    7777  if (S3TableBase == NULL) {
    7878    //
     
    9292  ScriptTableInfo                = (EFI_BOOT_SCRIPT_TABLE_HEADER*)(mS3BootScriptTablePtr->TableBase);
    9393  ScriptTableInfo->TableLength = mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE);
    94  
    95  
    96  
     94
     95
     96
    9797  return S3TableBase;
    9898  //
    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
    101101  // maybe in runtime, we still need add entries into the table, and the runtime entry should be
    102102  // added start before this TERMINATE node.
    103103  //
    104 } 
     104}
    105105
    106106/**
     
    162162  This is the Event call back function to notify the Library the system is entering
    163163  run time phase.
    164  
     164
    165165  @param  Event   Pointer to this event
    166   @param  Context Event handler private data 
     166  @param  Context Event handler private data
    167167 **/
    168168VOID
     
    190190
    191191  //
    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
    193193  // the memory page number occupied by the table should not grow anymore.
    194194  //
     
    207207    SaveBootScriptDataToLockBox ();
    208208  }
    209 } 
     209}
    210210/**
    211211  This is the Event call back function is triggered in SMM to notify the Library the system is entering
    212212  run time phase and set InSmm flag.
    213  
     213
    214214  @param  Protocol   Points to the protocol's unique identifier
    215215  @param  Interface  Points to the interface instance
     
    265265/**
    266266  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
    269269
    270270  @param  ImageHandle   The firmware allocated handle for the EFI image.
     
    307307    S3TablePtr = (VOID *) (UINTN) Buffer;
    308308
    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));
    311311    //
    312312    // create event to notify the library system enter the runtime phase
     
    320320                          );
    321321    ASSERT (mEnterRuntimeEvent != NULL);
    322   } 
     322  }
    323323  mS3BootScriptTablePtr = S3TablePtr;
    324324
     
    380380  To get the start address from which a new boot time s3 boot script entry will write into.
    381381  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
    383383  invoke reallocate to enlarge buffer.
    384  
     384
    385385  @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
    388388 **/
    389389UINT8*
     
    399399   EFI_STATUS                        Status;
    400400   EFI_BOOT_SCRIPT_TABLE_HEADER      *ScriptTableInfo;
    401    
     401
    402402   S3TableBase = (EFI_PHYSICAL_ADDRESS)(UINTN)(mS3BootScriptTablePtr->TableBase);
    403403   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.
    405405     // Allocate ACPI script table space under 4G memory. We need it to save
    406406     // some settings done by CSM, which runs after normal script table closed
     
    413413                  (EFI_PHYSICAL_ADDRESS*)&S3TableBase
    414414                  );
    415      
     415
    416416     if (EFI_ERROR(Status)) {
    417417       ASSERT_EFI_ERROR (Status);
     
    429429     mS3BootScriptTablePtr->TableMemoryPageNumber = (UINT16)(2 + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber));
    430430   }
    431      
     431
    432432   // 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));
    434434   TableLength =  mS3BootScriptTablePtr->TableLength;
    435435   if ((UINT32)(PageNumber * EFI_PAGE_SIZE) < (TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE))) {
    436      // 
     436     //
    437437     // The buffer is too small to hold the table, Reallocate the buffer
    438438     //
     
    444444                  (EFI_PHYSICAL_ADDRESS*)&NewS3TableBase
    445445                  );
    446    
     446
    447447     if (EFI_ERROR(Status)) {
    448448       ASSERT_EFI_ERROR (Status);
    449449       return 0;
    450450     }
    451      
     451
    452452     CopyMem ((VOID*)(UINTN)NewS3TableBase, (VOID*)(UINTN)S3TableBase, TableLength);
    453453     gBS->FreePages (S3TableBase, mS3BootScriptTablePtr->TableMemoryPageNumber);
    454          
     454
    455455     mS3BootScriptTablePtr->TableBase = (UINT8*)(UINTN)NewS3TableBase;
    456      mS3BootScriptTablePtr->TableMemoryPageNumber =  (UINT16) (2 + PageNumber + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber)); 
     456     mS3BootScriptTablePtr->TableMemoryPageNumber =  (UINT16) (2 + PageNumber + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber));
    457457   }
    458458   //
    459    // calculate the the start address for the new entry. 
     459   // calculate the the start address for the new entry.
    460460   //
    461461   NewEntryPtr = mS3BootScriptTablePtr->TableBase + TableLength;
    462    
     462
    463463   //
    464464   // update the table lenghth
    465465   //
    466466   mS3BootScriptTablePtr->TableLength =  TableLength + EntryLength;
    467    
     467
    468468   //
    469469   // 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.
    472472   //
    473473   //
    474  
    475    return NewEntryPtr;   
     474
     475   return NewEntryPtr;
    476476}
    477477/**
    478478  To get the start address from which a new runtime s3 boot script entry will write into.
    479479  In this case, it should be ensured that there is enough buffer to hold the entry.
    480  
     480
    481481  @param EntryLength      the new entry length.
    482  
     482
    483483  @retval the address from which the a new s3 runtime script entry will write into
    484484 **/
     
    489489{
    490490   UINT8     *NewEntryPtr;
    491    
    492    NewEntryPtr = NULL;   
     491
     492   NewEntryPtr = NULL;
    493493   //
    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.
    495495   //
    496496   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;
    498498     mS3BootScriptTablePtr->TableLength = mS3BootScriptTablePtr->TableLength + EntryLength;
    499499     //
     
    502502     S3BootScriptInternalCloseTable ();
    503503   }
    504    return (UINT8*)NewEntryPtr;   
     504   return (UINT8*)NewEntryPtr;
    505505}
    506506/**
    507507  To get the start address from which a new s3 boot script entry will write into.
    508  
     508
    509509  @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 **/
     513UINT8*
    514514S3BootScriptGetEntryAddAddress (
    515515  UINT8  EntryLength
     
    588588      ASSERT_EFI_ERROR (Status);
    589589    }
    590   } else {   
     590  } else {
    591591    NewEntryPtr  = S3BootScriptGetBootTimeEntryAddAddress (EntryLength);
    592   } 
     592  }
    593593  return NewEntryPtr;
    594  
    595 } 
     594
     595}
    596596
    597597/**
     
    631631}
    632632
    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
    636636  EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable(), this function will fulfill following things:
    637637  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
    640640     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
    642642     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
    644644     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
    648648  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
    652652  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.
    655655  @note this function could only called in boot time phase
    656656
     
    667667  EFI_STATUS                      Status;
    668668  EFI_BOOT_SCRIPT_TABLE_HEADER      *ScriptTableInfo;
    669  
    670   S3TableBase =    mS3BootScriptTablePtr->TableBase;   
     669
     670  S3TableBase =    mS3BootScriptTablePtr->TableBase;
    671671  if (S3TableBase == 0) {
    672     return 0; 
     672    return 0;
    673673  }
    674674  //
     
    678678  TableLength = mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE);
    679679  //
    680   // Allocate the buffer and copy the boot script to the buffer. 
     680  // Allocate the buffer and copy the boot script to the buffer.
    681681  //
    682682  Status = gBS->AllocatePool (
     
    686686                  );
    687687  if (EFI_ERROR (Status)) {
    688         return 0; 
     688        return 0;
    689689  }
    690690  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
    694694  // will write the record to the first entry of the table.
    695695  //
     
    699699  ScriptTableInfo->Length      = (UINT8) sizeof (EFI_BOOT_SCRIPT_TABLE_HEADER);
    700700  ScriptTableInfo->TableLength = 0;   // will be calculate at close the table
    701  
     701
    702702  mS3BootScriptTablePtr->TableLength = sizeof (EFI_BOOT_SCRIPT_TABLE_HEADER);
    703703  return Buffer;
    704704}
    705705/**
    706   Save I/O write to boot script 
     706  Save I/O write to boot script
    707707
    708708  @param Width   The width of the I/O operations.Enumerated in S3_BOOT_SCRIPT_LIB_WIDTH.
     
    731731  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    732732  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_IO_WRITE) + (WidthInByte * Count));
    733  
     733
    734734  Script = S3BootScriptGetEntryAddAddress (Length);
    735735  if (Script == NULL) {
     
    779779  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    780780  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE) + (WidthInByte * 2));
    781  
     781
    782782  Script = S3BootScriptGetEntryAddAddress (Length);
    783783  if (Script == NULL) {
     
    791791  ScriptIoReadWrite.Width   = Width;
    792792  ScriptIoReadWrite.Address = Address;
    793  
     793
    794794  CopyMem ((VOID*)Script, (VOID*)&ScriptIoReadWrite, sizeof(EFI_BOOT_SCRIPT_IO_READ_WRITE));
    795795  CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE)), Data, WidthInByte);
     
    824824  UINT8                 WidthInByte;
    825825  EFI_BOOT_SCRIPT_MEM_WRITE  ScriptMemWrite;
    826  
     826
    827827  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    828828  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_MEM_WRITE) + (WidthInByte * Count));
    829  
     829
    830830  Script = S3BootScriptGetEntryAddAddress (Length);
    831831  if (Script == NULL) {
    832832    return RETURN_OUT_OF_RESOURCES;
    833   } 
     833  }
    834834  //
    835835  // Build script data
     
    840840  ScriptMemWrite.Address  = Address;
    841841  ScriptMemWrite.Count    = (UINT32) Count;
    842  
     842
    843843  CopyMem ((VOID*)Script, (VOID*)&ScriptMemWrite, sizeof(EFI_BOOT_SCRIPT_MEM_WRITE));
    844844  CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_WRITE)), Buffer, WidthInByte * Count);
    845  
     845
    846846  SyncBootScript (Script);
    847847
     
    872872  UINT8                 WidthInByte;
    873873  EFI_BOOT_SCRIPT_MEM_READ_WRITE  ScriptMemReadWrite;
    874  
     874
    875875  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    876876  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE) + (WidthInByte * 2));
    877  
     877
    878878  Script = S3BootScriptGetEntryAddAddress (Length);
    879879  if (Script == NULL) {
    880880    return RETURN_OUT_OF_RESOURCES;
    881   } 
     881  }
    882882  //
    883883  // Build script data
    884   //   
     884  //
    885885  ScriptMemReadWrite.OpCode   = EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE;
    886886  ScriptMemReadWrite.Length   = Length;
    887887  ScriptMemReadWrite.Width    = Width;
    888888  ScriptMemReadWrite.Address  = Address;
    889  
     889
    890890  CopyMem ((VOID*)Script, (VOID*)&ScriptMemReadWrite , sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE));
    891891  CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE)), Data, WidthInByte);
     
    931931  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    932932  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE) + (WidthInByte * Count));
    933  
     933
    934934  Script = S3BootScriptGetEntryAddAddress (Length);
    935935  if (Script == NULL) {
    936936    return RETURN_OUT_OF_RESOURCES;
    937   } 
     937  }
    938938  //
    939939  // Build script data
     
    944944  ScriptPciWrite.Address  = Address;
    945945  ScriptPciWrite.Count    = (UINT32) Count;
    946  
     946
    947947  CopyMem ((VOID*)Script, (VOID*)&ScriptPciWrite,  sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE));
    948948  CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE)), Buffer, WidthInByte * Count);
    949  
     949
    950950  SyncBootScript (Script);
    951951
     
    987987  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    988988  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE) + (WidthInByte * 2));
    989  
     989
    990990  Script = S3BootScriptGetEntryAddAddress (Length);
    991991  if (Script == NULL) {
    992992    return RETURN_OUT_OF_RESOURCES;
    993   } 
     993  }
    994994  //
    995995  // Build script data
    996   // 
     996  //
    997997  ScriptPciReadWrite.OpCode   = EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE;
    998998  ScriptPciReadWrite.Length   = Length;
    999999  ScriptPciReadWrite.Width    = Width;
    10001000  ScriptPciReadWrite.Address  = Address;
    1001  
     1001
    10021002  CopyMem ((VOID*)Script, (VOID*)&ScriptPciReadWrite, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE));
    10031003  CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE)), Data, WidthInByte);
     
    10501050  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    10511051  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE) + (WidthInByte * Count));
    1052  
     1052
    10531053  Script = S3BootScriptGetEntryAddAddress (Length);
    10541054  if (Script == NULL) {
    10551055    return RETURN_OUT_OF_RESOURCES;
    1056   } 
     1056  }
    10571057  //
    10581058  // Build script data
     
    10641064  ScriptPciWrite2.Segment  = Segment;
    10651065  ScriptPciWrite2.Count    = (UINT32)Count;
    1066  
     1066
    10671067  CopyMem ((VOID*)Script, (VOID*)&ScriptPciWrite2, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE));
    10681068  CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE)), Buffer, WidthInByte * Count);
     
    11071107    return EFI_INVALID_PARAMETER;
    11081108  }
    1109  
     1109
    11101110  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    11111111  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE) + (WidthInByte * 2));
    1112  
     1112
    11131113  Script = S3BootScriptGetEntryAddAddress (Length);
    11141114  if (Script == NULL) {
    11151115    return RETURN_OUT_OF_RESOURCES;
    1116   } 
     1116  }
    11171117  //
    11181118  // Build script data
     
    11231123  ScriptPciReadWrite2.Segment  = Segment;
    11241124  ScriptPciReadWrite2.Address  = Address;
    1125  
     1125
    11261126  CopyMem ((VOID*)Script, (VOID*)&ScriptPciReadWrite2, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE));
    11271127  CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE)), Data, WidthInByte);
     
    11311131    WidthInByte
    11321132    );
    1133  
     1133
    11341134  SyncBootScript (Script);
    11351135
     
    11441144  error code based on the input SMBus bus protocol.
    11451145
    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,
    11471147                                  and PEC.
    11481148  @param  Operation               Signifies which particular SMBus hardware protocol instance that
     
    11601160
    11611161  @retval EFI_SUCCESS             All the parameters are valid for the corresponding SMBus bus
    1162                                   protocol. 
     1162                                  protocol.
    11631163  @retval EFI_INVALID_PARAMETER   Operation is not defined in EFI_SMBUS_OPERATION.
    11641164  @retval EFI_INVALID_PARAMETER   Length/Buffer is NULL for operations except for EfiSmbusQuickRead
     
    11811181  EFI_SMBUS_DEVICE_COMMAND Command;
    11821182  BOOLEAN                  PecCheck;
    1183  
     1183
    11841184  Command      = SMBUS_LIB_COMMAND (SmBusAddress);
    11851185  PecCheck     = SMBUS_LIB_PEC (SmBusAddress);
    11861186  //
    11871187  // Set default value to be 2:
    1188   // for SmbusReadWord, SmbusWriteWord and SmbusProcessCall. 
     1188  // for SmbusReadWord, SmbusWriteWord and SmbusProcessCall.
    11891189  //
    11901190  RequiredLen = 2;
     
    12241224    case EfiSmbusWriteBlock:
    12251225    case EfiSmbusBWBRProcessCall:
    1226       if ((Buffer == NULL) || 
    1227           (Length == NULL) || 
     1226      if ((Buffer == NULL) ||
     1227          (Length == NULL) ||
    12281228          (*Length < MIN_SMBUS_BLOCK_LEN) ||
    12291229          (*Length > MAX_SMBUS_BLOCK_LEN)) {
     
    12451245  @param Length         A pointer to signify the number of bytes that this operation will do.
    12461246  @param Buffer         Contains the value of data to execute to the SMBUS slave device.
    1247  
     1247
    12481248  @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.
    12491249  @retval RETURN_SUCCESS           Opcode is added.
     
    12521252EFIAPI
    12531253S3BootScriptSaveSmbusExecute (
    1254   IN  UINTN                             SmBusAddress, 
     1254  IN  UINTN                             SmBusAddress,
    12551255  IN  EFI_SMBUS_OPERATION               Operation,
    12561256  IN  UINTN                             *Length,
     
    12761276
    12771277  DataSize = (UINT8)(sizeof (EFI_BOOT_SCRIPT_SMBUS_EXECUTE) + BufferLength);
    1278  
     1278
    12791279  Script = S3BootScriptGetEntryAddAddress (DataSize);
    12801280  if (Script == NULL) {
     
    13051305
    13061306  @param Duration   Duration in microseconds of the stall
    1307  
     1307
    13081308  @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.
    13091309  @retval RETURN_SUCCESS           Opcode is added.
     
    13201320
    13211321  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_STALL));
    1322  
     1322
    13231323  Script = S3BootScriptGetEntryAddAddress (Length);
    13241324  if (Script == NULL) {
    13251325    return RETURN_OUT_OF_RESOURCES;
    1326   } 
     1326  }
    13271327  //
    13281328  // Build script data
     
    13311331  ScriptStall.Length    = Length;
    13321332  ScriptStall.Duration  = Duration;
    1333  
     1333
    13341334  CopyMem ((VOID*)Script, (VOID*)&ScriptStall, sizeof (EFI_BOOT_SCRIPT_STALL));
    1335  
     1335
    13361336  SyncBootScript (Script);
    13371337
     
    13431343  @param EntryPoint   Entry point of the code to be dispatched.
    13441344  @param Context      Argument to be passed into the EntryPoint of the code to be dispatched.
    1345  
     1345
    13461346  @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.
    13471347  @retval RETURN_SUCCESS           Opcode is added.
     
    13581358  EFI_BOOT_SCRIPT_DISPATCH_2  ScriptDispatch2;
    13591359  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_DISPATCH_2));
    1360  
     1360
    13611361  Script = S3BootScriptGetEntryAddAddress (Length);
    13621362  if (Script == NULL) {
    13631363    return RETURN_OUT_OF_RESOURCES;
    1364   } 
     1364  }
    13651365  //
    13661366  // Build script data
     
    13701370  ScriptDispatch2.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;
    13711371  ScriptDispatch2.Context =   (EFI_PHYSICAL_ADDRESS)(UINTN)Context;
    1372  
     1372
    13731373  CopyMem ((VOID*)Script, (VOID*)&ScriptDispatch2, sizeof (EFI_BOOT_SCRIPT_DISPATCH_2));
    1374  
     1374
    13751375  SyncBootScript (Script);
    13761376
     
    14111411  UINT8                 Length;
    14121412  UINT8                *Script;
    1413   UINT8                 WidthInByte; 
    1414   EFI_BOOT_SCRIPT_MEM_POLL      ScriptMemPoll; 
     1413  UINT8                 WidthInByte;
     1414  EFI_BOOT_SCRIPT_MEM_POLL      ScriptMemPoll;
    14151415
    14161416  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    1417  
     1417
    14181418  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_MEM_POLL) + (WidthInByte * 2));
    1419  
     1419
    14201420  Script = S3BootScriptGetEntryAddAddress (Length);
    14211421  if (Script == NULL) {
     
    14271427  ScriptMemPoll.OpCode   = EFI_BOOT_SCRIPT_MEM_POLL_OPCODE;
    14281428  ScriptMemPoll.Length   = Length;
    1429   ScriptMemPoll.Width    = Width; 
     1429  ScriptMemPoll.Width    = Width;
    14301430  ScriptMemPoll.Address  = Address;
    14311431  ScriptMemPoll.Duration = Duration;
     
    14341434  CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_MEM_POLL)), BitValue, WidthInByte);
    14351435  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));
    14371437
    14381438  SyncBootScript (Script);
     
    14431443  Store arbitrary information in the boot script table. This opcode is a no-op on dispatch and is only
    14441444  used for debugging script issues.
    1445  
     1445
    14461446  @param InformationLength   Length of the data in bytes
    14471447  @param Information       Information to be logged in the boot scrpit
    1448  
     1448
    14491449  @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.
    14501450  @retval RETURN_SUCCESS           Opcode is added.
     
    14541454EFIAPI
    14551455S3BootScriptSaveInformation (
    1456   IN  UINT32                                InformationLength, 
     1456  IN  UINT32                                InformationLength,
    14571457  IN  VOID                                 *Information
    14581458  )
     
    14751475
    14761476
    1477   ScriptInformation.InformationLength = InformationLength; 
     1477  ScriptInformation.InformationLength = InformationLength;
    14781478
    14791479  CopyMem ((VOID*)Script, (VOID*)&ScriptInformation, sizeof (EFI_BOOT_SCRIPT_INFORMATION));
     
    14881488  Store a string in the boot script table. This opcode is a no-op on dispatch and is only
    14891489  used for debugging script issues.
    1490  
     1490
    14911491  @param String            The string to save to boot script table
    1492  
     1492
    14931493  @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.
    14941494  @retval RETURN_SUCCESS           Opcode is added.
     
    15011501  )
    15021502{
    1503   return S3BootScriptSaveInformation (     
    1504            (UINT32) AsciiStrLen (String) + 1, 
     1503  return S3BootScriptSaveInformation (
     1504           (UINT32) AsciiStrLen (String) + 1,
    15051505           (VOID*) String
    15061506           );
     
    15101510
    15111511  @param EntryPoint   Entry point of the code to be dispatched.
    1512  
     1512
    15131513  @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.
    15141514  @retval RETURN_SUCCESS           Opcode is added.
     
    15231523  UINT8                *Script;
    15241524  EFI_BOOT_SCRIPT_DISPATCH  ScriptDispatch;
    1525  
     1525
    15261526  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_DISPATCH));
    1527  
     1527
    15281528  Script = S3BootScriptGetEntryAddAddress (Length);
    15291529  if (Script == NULL) {
    15301530    return RETURN_OUT_OF_RESOURCES;
    1531   } 
     1531  }
    15321532  //
    15331533  // Build script data
     
    15361536  ScriptDispatch.Length     = Length;
    15371537  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
    15411541  SyncBootScript (Script);
    15421542
     
    15471547  Adds a record for I/O reads the I/O location and continues when the exit criteria is satisfied or after a
    15481548  defined duration.
    1549  
    1550   @param  Width                 The width of the I/O operations. 
     1549
     1550  @param  Width                 The width of the I/O operations.
    15511551  @param  Address               The base address of the I/O operations.
    15521552  @param  Data                  The comparison value used for the polling exit criteria.
     
    15661566  IN UINT64                     Address,
    15671567  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;
    15731573  UINT8                *Script;
    15741574  UINT8                 Length;
    15751575  EFI_BOOT_SCRIPT_IO_POLL  ScriptIoPoll;
    1576  
    1577 
    1578   WidthInByte = (UINT8) (0x01 << (Width & 0x03)); 
     1576
     1577
     1578  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    15791579  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_IO_POLL) + (WidthInByte * 2));
    1580  
     1580
    15811581  Script = S3BootScriptGetEntryAddAddress (Length);
    15821582  if (Script == NULL) {
    15831583    return RETURN_OUT_OF_RESOURCES;
    1584   } 
     1584  }
    15851585  //
    15861586  // Build script data
     
    15881588  ScriptIoPoll.OpCode   = EFI_BOOT_SCRIPT_IO_POLL_OPCODE;
    15891589  ScriptIoPoll.Length   = (UINT8) (sizeof (EFI_BOOT_SCRIPT_IO_POLL) + (WidthInByte * 2));
    1590   ScriptIoPoll.Width    = Width; 
     1590  ScriptIoPoll.Width    = Width;
    15911591  ScriptIoPoll.Address  = Address;
    15921592  ScriptIoPoll.Delay    = Delay;
    15931593
    1594   CopyMem ((VOID*)Script, (VOID*)&ScriptIoPoll, sizeof (EFI_BOOT_SCRIPT_IO_POLL)); 
     1594  CopyMem ((VOID*)Script, (VOID*)&ScriptIoPoll, sizeof (EFI_BOOT_SCRIPT_IO_POLL));
    15951595  CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_IO_POLL)), Data, WidthInByte);
    15961596  CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_IO_POLL) + WidthInByte), DataMask, WidthInByte);
    1597  
     1597
    15981598  SyncBootScript (Script);
    15991599
     
    16051605  after a defined duration.
    16061606
    1607   @param  Width                 The width of the I/O operations. 
     1607  @param  Width                 The width of the I/O operations.
    16081608  @param  Address               The address within the PCI configuration space.
    16091609  @param  Data                  The comparison value used for the polling exit criteria.
     
    16291629{
    16301630  UINT8                   *Script;
    1631   UINT8                    WidthInByte; 
     1631  UINT8                    WidthInByte;
    16321632  UINT8                    Length;
    16331633  EFI_BOOT_SCRIPT_PCI_CONFIG_POLL  ScriptPciPoll;
     
    16411641  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    16421642  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + (WidthInByte * 2));
    1643  
     1643
    16441644  Script = S3BootScriptGetEntryAddAddress (Length);
    16451645  if (Script == NULL) {
     
    16511651  ScriptPciPoll.OpCode   = EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE;
    16521652  ScriptPciPoll.Length   = (UINT8) (sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + (WidthInByte * 2));
    1653   ScriptPciPoll.Width    = Width; 
     1653  ScriptPciPoll.Width    = Width;
    16541654  ScriptPciPoll.Address  = Address;
    16551655  ScriptPciPoll.Delay    = Delay;
     
    16581658  CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL)), Data, WidthInByte);
    16591659  CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + WidthInByte), DataMask, WidthInByte);
    1660  
     1660
    16611661  SyncBootScript (Script);
    16621662
     
    16671667  after a defined duration.
    16681668
    1669   @param  Width                 The width of the I/O operations. 
     1669  @param  Width                 The width of the I/O operations.
    16701670  @param  Segment               The PCI segment number for Address.
    16711671  @param  Address               The address within the PCI configuration space.
     
    16921692)
    16931693{
    1694   UINT8                    WidthInByte; 
     1694  UINT8                    WidthInByte;
    16951695  UINT8                   *Script;
    16961696  UINT8                    Length;
     
    17061706  WidthInByte = (UINT8) (0x01 << (Width & 0x03));
    17071707  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + (WidthInByte * 2));
    1708  
     1708
    17091709  Script = S3BootScriptGetEntryAddAddress (Length);
    17101710  if (Script == NULL) {
    17111711    return RETURN_OUT_OF_RESOURCES;
    1712   } 
     1712  }
    17131713  //
    17141714  // Build script data
     
    17161716  ScriptPci2Poll.OpCode   = EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE;
    17171717  ScriptPci2Poll.Length   = (UINT8) (sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + (WidthInByte * 2));
    1718   ScriptPci2Poll.Width    = Width; 
     1718  ScriptPci2Poll.Width    = Width;
    17191719  ScriptPci2Poll.Segment  = Segment;
    17201720  ScriptPci2Poll.Address  = Address;
     
    17241724  CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL)), Data, WidthInByte);
    17251725  CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + WidthInByte), DataMask, WidthInByte);
    1726  
     1726
    17271727  SyncBootScript (Script);
    17281728
     
    17311731/**
    17321732  Do the calculation of start address from which a new s3 boot script entry will write into.
    1733  
     1733
    17341734  @param EntryLength      The new entry length.
    17351735  @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.
    17371737  @param BeforeOrAfter    The flag to indicate to insert the nod before or after the position.
    17381738                          This parameter is effective when InsertFlag is TRUE
     
    17441744  IN  VOID     *Position OPTIONAL,
    17451745  IN  BOOLEAN   BeforeOrAfter OPTIONAL,
    1746   OUT UINT8   **Script   
     1746  OUT UINT8   **Script
    17471747  )
    17481748{
    17491749   UINTN                            TableLength;
    17501750   UINT8                            *S3TableBase;
    1751    UINTN                            PositionOffset; 
     1751   UINTN                            PositionOffset;
    17521752   EFI_BOOT_SCRIPT_COMMON_HEADER     ScriptHeader;
    17531753   //
     
    17561756   TableLength =  mS3BootScriptTablePtr->TableLength - EntryLength;
    17571757   S3TableBase = mS3BootScriptTablePtr->TableBase ;
    1758    // 
     1758   //
    17591759   // calculate the Position offset
    17601760   //
    17611761   if (Position != NULL) {
    17621762     PositionOffset = (UINTN) ((UINT8 *)Position - S3TableBase);
    1763    
     1763
    17641764     //
    17651765     // If the BeforeOrAfter is FALSE, that means to insert the node right after the node.
    17661766     //
    17671767     if (!BeforeOrAfter) {
    1768         CopyMem ((VOID*)&ScriptHeader, Position, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); 
     1768        CopyMem ((VOID*)&ScriptHeader, Position, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));
    17691769        PositionOffset += (ScriptHeader.Length);
    17701770     }
    1771      //     
     1771     //
    17721772     // Insert the node before the adjusted Position
    17731773     //
    1774      CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset); 
     1774     CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset);
    17751775     //
    1776      // calculate the the start address for the new entry. 
     1776     // calculate the the start address for the new entry.
    17771777     //
    17781778     *Script = S3TableBase + PositionOffset;
    1779        
     1779
    17801780   } else {
    17811781     if (!BeforeOrAfter) {
     
    17831783       //  Insert the node to the end of the table
    17841784       //
    1785        *Script = S3TableBase + TableLength; 
     1785       *Script = S3TableBase + TableLength;
    17861786     } else {
    1787        // 
     1787       //
    17881788       // Insert the node to the beginning of the table
    17891789       //
    17901790       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;
    17931793     }
    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
    17981798
    17991799  @param  BeforeOrAfter         Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position
     
    18171817{
    18181818  UINT8*                Script;
    1819   VOID                  *TempPosition; 
     1819  VOID                  *TempPosition;
    18201820  UINTN                 StartAddress;
    18211821  UINT32                TableLength;
     
    18241824  UINT8*                LastOpcode;
    18251825  UINT8                 TempBootScriptEntry[BOOT_SCRIPT_NODE_MAX_LENGTH];
    1826  
     1826
    18271827  ValidatePosition = FALSE;
    18281828  TempPosition = (Position == NULL) ? NULL:(*Position);
     
    18441844  // Find the last boot Script Entry which is not the terminate node
    18451845  //
    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));
    18481848    if (TempPosition != NULL && TempPosition == Script) {
    18491849      //
    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.
    18511851      //
    18521852      ValidatePosition = TRUE;
     
    18541854    if (ScriptHeader.OpCode != S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE) {
    18551855      LastOpcode = Script;
    1856     } 
     1856    }
    18571857    Script  = Script + ScriptHeader.Length;
    18581858  }
     
    18631863    return RETURN_INVALID_PARAMETER;
    18641864  }
    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);
    18691869  //
    18701870  // Find the right position to write the node in
     
    18741874    TempPosition,
    18751875    BeforeOrAfter,
    1876     &Script   
     1876    &Script
    18771877  );
    18781878  //
     
    18921892}
    18931893/**
    1894   Create a Label node in the boot script table. 
    1895  
     1894  Create a Label node in the boot script table.
     1895
    18961896  @param  BeforeOrAfter         Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position
    18971897                                in the boot script table specified by Position. If Position is NULL or points to
     
    19001900  @param  Position              On entry, specifies the position in the boot script table where the opcode will be
    19011901                                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.
    19031903  @param InformationLength      Length of the label in bytes
    19041904  @param Information            Label to be logged in the boot scrpit
    1905  
     1905
    19061906  @retval RETURN_INVALID_PARAMETER The Position is not a valid position in the boot script table.
    19071907  @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.
     
    19131913S3BootScriptLabelInternal (
    19141914  IN        BOOLEAN                        BeforeOrAfter,
    1915   IN OUT    VOID                         **Position OPTIONAL, 
    1916   IN        UINT32                         InformationLength, 
     1915  IN OUT    VOID                         **Position OPTIONAL,
     1916  IN        UINT32                         InformationLength,
    19171917  IN CONST  CHAR8                          *Information
    19181918  )
     
    19211921  UINT8                 *Script;
    19221922  EFI_BOOT_SCRIPT_INFORMATION  ScriptInformation;
    1923  
     1923
    19241924  Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_INFORMATION) + InformationLength);
    1925  
     1925
    19261926  Script = S3BootScriptGetEntryAddAddress (Length);
    19271927  if (Script == NULL) {
     
    19351935
    19361936
    1937   ScriptInformation.InformationLength = InformationLength; 
     1937  ScriptInformation.InformationLength = InformationLength;
    19381938
    19391939  CopyMem ((VOID*)Script, (VOID*)&ScriptInformation, sizeof (EFI_BOOT_SCRIPT_INFORMATION));
     
    19491949
    19501950  @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
    19521952                                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
    19541954                                does not exists (TRUE) or not (FALSE).
    19551955  @param  Position              On entry, specifies the position in the boot script table
     
    19621962                                specified script table.
    19631963  @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
    19651965                                Feature Flags.
    19661966  @retval EFI_OUT_OF_RESOURCES  There is insufficient memory to store the boot script.
     
    19681968**/
    19691969RETURN_STATUS
    1970 EFIAPI 
     1970EFIAPI
    19711971S3BootScriptLabel (
    19721972  IN       BOOLEAN                      BeforeOrAfter,
     
    19941994    return EFI_INVALID_PARAMETER;
    19951995  }
    1996  
     1996
    19971997  //
    19981998  // Check that the script is initialized and synced without adding an entry to the script.
     
    20042004    return RETURN_OUT_OF_RESOURCES;
    20052005  }
    2006  
     2006
    20072007  //
    20082008  // Check the header and search for existing label.
    2009   // 
     2009  //
    20102010  Script = mS3BootScriptTablePtr->TableBase;
    20112011  CopyMem ((VOID*)&TableHeader, Script, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER));
     
    20172017  Script    =     Script + TableHeader.Length;
    20182018  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));
    20212021    if (ScriptHeader.OpCode == S3_BOOT_SCRIPT_LIB_LABEL_OPCODE) {
    20222022      if (AsciiStrCmp ((CHAR8 *)(UINTN)(Script+sizeof(EFI_BOOT_SCRIPT_INFORMATION)), Label) == 0) {
    2023         (*Position) = Script; 
     2023        (*Position) = Script;
    20242024        return EFI_SUCCESS;
    20252025      }
    2026     } 
     2026    }
    20272027    Script  = Script + ScriptHeader.Length;
    20282028  }
    20292029  if (CreateIfNotFound) {
    20302030    LabelLength = (UINT32)AsciiStrSize(Label);
    2031     return S3BootScriptLabelInternal (BeforeOrAfter,Position, LabelLength, Label);     
     2031    return S3BootScriptLabelInternal (BeforeOrAfter,Position, LabelLength, Label);
    20322032  } else {
    20332033    return EFI_NOT_FOUND;
    2034   }   
     2034  }
    20352035}
    20362036
     
    20442044                                specified script table.
    20452045  @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
    20472047                                Feature Flags.
    20482048  @retval EFI_OUT_OF_RESOURCES  There is insufficient memory to store the boot script.
     
    20502050**/
    20512051RETURN_STATUS
    2052 EFIAPI 
     2052EFIAPI
    20532053S3BootScriptCompare (
    20542054  IN  UINT8                       *Position1,
     
    20582058{
    20592059  UINT8*                    Script;
    2060   UINT32                    TableLength; 
     2060  UINT32                    TableLength;
    20612061
    20622062  if (RelativePosition == NULL) {
     
    20842084  }
    20852085  *RelativePosition = (Position1 < Position2)?-1:((Position1 == Position2)?0:1);
    2086  
     2086
    20872087  return EFI_SUCCESS;
    20882088}
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf

    r58459 r58466  
    5353  SmbusLib
    5454  PciLib
    55   IoLib 
     55  IoLib
    5656  LockBoxLib
    5757
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h

    r48674 r58466  
    11/** @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
    33  data structure
    4  
     4
    55  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
    66
     
    4949        ((((UINTN)(A))& 0xff000000) >> 24), ((((UINTN)(A)) &0x00ff0000) >> 16), ((((UINTN)(A)) & 0xff00) >> 8), ((RShiftU64 ((A), 32) & 0xfff) | ((A)& 0xff)) \
    5050        )
    51        
     51
    5252
    5353
     
    7272typedef struct {
    7373  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
    7676  BOOLEAN         AtRuntime;                 // Record if current state is after SmmReadyToLock
    7777  BOOLEAN         InSmm;                     // Record if this library is in SMM.
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c

    r58459 r58466  
    33
    44  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.
    1212
    1313**/
     
    2727/**
    2828  This function gets and caches SMRAM ranges that are present in the system.
    29    
     29
    3030  It will ASSERT() if SMM Access2 Protocol doesn't exist.
    3131  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.
    3333
    3434**/
     
    4747  //
    4848  Status = gBS->LocateProtocol (
    49                   &gEfiSmmAccess2ProtocolGuid, 
    50                   NULL, 
     49                  &gEfiSmmAccess2ProtocolGuid,
     50                  NULL,
    5151                  (VOID **)&SmmAccess
    5252                  );
     
    9393
    9494  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) &&
    9696        ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer < (mSmramRanges[Index].CpuStart + mSmramRanges[Index].PhysicalSize))) {
    9797      return TRUE;
     
    117117VOID *
    118118InternalAllocatePages (
    119   IN EFI_MEMORY_TYPE  MemoryType, 
     119  IN EFI_MEMORY_TYPE  MemoryType,
    120120  IN UINTN            Pages
    121121  )
    122122{
    123123  EFI_STATUS            Status;
    124   EFI_PHYSICAL_ADDRESS  Memory; 
     124  EFI_PHYSICAL_ADDRESS  Memory;
    125125
    126126  if (Pages == 0) {
     
    209209  Allocation Library.  If it is not possible to free allocated pages, then this function will
    210210  perform no actions.
    211  
     211
    212212  If Buffer was not allocated with a page allocation function in the Memory Allocation Library,
    213213  then ASSERT().
    214214  If Pages is zero, then ASSERT().
    215  
     215
    216216  @param  Buffer                Pointer to the buffer of pages to free.
    217217  @param  Pages                 The number of 4 KB pages to free.
     
    264264VOID *
    265265InternalAllocateAlignedPages (
    266   IN EFI_MEMORY_TYPE  MemoryType, 
     266  IN EFI_MEMORY_TYPE  MemoryType,
    267267  IN UINTN            Pages,
    268268  IN UINTN            Alignment
     
    280280  //
    281281  ASSERT ((Alignment & (Alignment - 1)) == 0);
    282  
     282
    283283  if (Pages == 0) {
    284284    return NULL;
     
    294294    //
    295295    ASSERT (RealPages > Pages);
    296  
     296
    297297    Status         = SmmAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);
    298298    if (EFI_ERROR (Status)) {
     
    337337  returned.  If there is not enough memory at the specified alignment remaining to satisfy the
    338338  request, then NULL is returned.
    339  
     339
    340340  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    341341  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
     
    365365  returned.  If there is not enough memory at the specified alignment remaining to satisfy the
    366366  request, then NULL is returned.
    367  
     367
    368368  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    369369  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
     
    393393  returned.  If there is not enough memory at the specified alignment remaining to satisfy the
    394394  request, then NULL is returned.
    395  
     395
    396396  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    397397  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
     
    420420  Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer.  Buffer
    421421  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
    423423  perform no actions.
    424  
     424
    425425  If Buffer was not allocated with an aligned page allocation function in the Memory Allocation
    426426  Library, then ASSERT().
    427427  If Pages is zero, then ASSERT().
    428  
     428
    429429  @param  Buffer                Pointer to the buffer of pages to free.
    430430  @param  Pages                 The number of 4 KB pages to free.
     
    472472VOID *
    473473InternalAllocatePool (
    474   IN EFI_MEMORY_TYPE  MemoryType, 
     474  IN EFI_MEMORY_TYPE  MemoryType,
    475475  IN UINTN            AllocationSize
    476476  )
     
    567567VOID *
    568568InternalAllocateZeroPool (
    569   IN EFI_MEMORY_TYPE  PoolType, 
     569  IN EFI_MEMORY_TYPE  PoolType,
    570570  IN UINTN            AllocationSize
    571   ) 
     571  )
    572572{
    573573  VOID  *Memory;
     
    654654  is not enough memory remaining to satisfy the request, then NULL is returned.
    655655  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().
    657657
    658658  @param  PoolType              The type of pool to allocate.
     
    665665VOID *
    666666InternalAllocateCopyPool (
    667   IN EFI_MEMORY_TYPE  PoolType, 
     667  IN EFI_MEMORY_TYPE  PoolType,
    668668  IN UINTN            AllocationSize,
    669669  IN CONST VOID       *Buffer
    670   ) 
     670  )
    671671{
    672672  VOID  *Memory;
     
    680680  }
    681681  return Memory;
    682 } 
     682}
    683683
    684684/**
     
    689689  allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there
    690690  is not enough memory remaining to satisfy the request, then NULL is returned.
    691  
     691
    692692  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().
    694694
    695695  @param  AllocationSize        The number of bytes to allocate and zero.
     
    716716  allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there
    717717  is not enough memory remaining to satisfy the request, then NULL is returned.
    718  
     718
    719719  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().
    721721
    722722  @param  AllocationSize        The number of bytes to allocate and zero.
     
    743743  allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there
    744744  is not enough memory remaining to satisfy the request, then NULL is returned.
    745  
     745
    746746  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().
    748748
    749749  @param  AllocationSize        The number of bytes to allocate and zero.
     
    767767
    768768  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
    773773  enough memory remaining to satisfy the request, then NULL is returned.
    774  
     774
    775775  If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
    776776  is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
     
    779779  @param  OldSize        The size, in bytes, of OldBuffer.
    780780  @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
    782782                         parameter that may be NULL.
    783783
     
    787787VOID *
    788788InternalReallocatePool (
    789   IN EFI_MEMORY_TYPE  PoolType, 
     789  IN EFI_MEMORY_TYPE  PoolType,
    790790  IN UINTN            OldSize,
    791791  IN UINTN            NewSize,
     
    807807
    808808  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
    813813  enough memory remaining to satisfy the request, then NULL is returned.
    814  
     814
    815815  If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
    816816  is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
     
    818818  @param  OldSize        The size, in bytes, of OldBuffer.
    819819  @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
    821821                         parameter that may be NULL.
    822822
     
    839839
    840840  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
    845845  enough memory remaining to satisfy the request, then NULL is returned.
    846846
     
    850850  @param  OldSize        The size, in bytes, of OldBuffer.
    851851  @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
    853853                         parameter that may be NULL.
    854854
     
    871871
    872872  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
    877877  enough memory remaining to satisfy the request, then NULL is returned.
    878878
     
    882882  @param  OldSize        The size, in bytes, of OldBuffer.
    883883  @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
    885885                         parameter that may be NULL.
    886886
     
    906906  pool allocation services of the Memory Allocation Library.  If it is not possible to free pool
    907907  resources, then this function will perform no actions.
    908  
     908
    909909  If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
    910910  then ASSERT().
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf

    r58459 r58466  
    33# The implementation borrows the SMM Core Memory Allocation services as the primitive
    44# 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.
    66#
    77# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
     
    4646
    4747[Protocols]
    48   gEfiSmmAccess2ProtocolGuid    ## CONSUMES 
     48  gEfiSmmAccess2ProtocolGuid    ## CONSUMES
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationServices.h

    r58459 r58466  
    33
    44  This header file borrows the PiSmmCore Memory Allocation services as the primitive
    5   for memory allocation. 
     5  for memory allocation.
    66
    77  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
    1212
    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.
    1515
    1616**/
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c

    r58459 r58466  
    5555    return;
    5656  }
    57  
     57
    5858  if (mHaveExitedBootServices) {
    5959    return;
    6060  }
    61  
     61
    6262  //
    6363  // Check gBS just in case ReportStatusCode is called before gBS is initialized.
     
    107107  //
    108108  // Locate the report status code service before enter runtime.
    109   // 
     109  //
    110110  InternalGetReportStatusCode ();
    111  
     111
    112112  mHaveExitedBootServices = TRUE;
    113113}
     
    121121  @param  ImageHandle   The firmware allocated handle for the EFI image.
    122122  @param  SystemTable   A pointer to the EFI System Table.
    123  
     123
    124124  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.
    125125
     
    136136  //
    137137  // Cache the report status code service
    138   // 
     138  //
    139139  InternalGetReportStatusCode ();
    140140
    141141  //
    142142  // Register notify function for EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE
    143   // 
     143  //
    144144  Status = gBS->CreateEventEx (
    145145                  EVT_NOTIFY_SIGNAL,
     
    154154  //
    155155  // Register notify function for EVT_SIGNAL_EXIT_BOOT_SERVICES
    156   // 
     156  //
    157157  Status = gBS->CreateEventEx (
    158158                  EVT_NOTIFY_SIGNAL,
     
    170170/**
    171171  The destructor function of Runtime DXE Report Status Code Lib.
    172  
     172
    173173  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.
    175175
    176176  @param  ImageHandle   The firmware allocated handle for the EFI image.
    177177  @param  SystemTable   A pointer to the EFI System Table.
    178  
     178
    179179  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.
    180180
     
    247247    return mReportStatusCodeLibStatusCodeProtocol->ReportStatusCode (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
    248248  }
    249  
     249
    250250  return EFI_UNSUPPORTED;
    251251}
     
    642642      return EFI_UNSUPPORTED;
    643643    }
    644  
     644
    645645    //
    646646    // Allocate space for the Status Code Header and its buffer
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf

    r58459 r58466  
    3232[Sources]
    3333  ReportStatusCodeLib.c
    34  
     34
    3535[Packages]
    3636  MdePkg/MdePkg.dec
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c

    r58459 r58466  
    3737
    3838//
    39 // The current maximum number of logging entries. If current number of 
     39// The current maximum number of logging entries. If current number of
    4040// entries exceeds this value, it will re-allocate a larger array and
    4141// migration the old data to the larger array.
     
    452452
    453453  This SMI handler provides services for the performance wrapper driver.
    454  
     454
    455455   Caution: This function may receive untrusted input.
    456456   Communicate buffer and buffer size are external input, so this function will do basic validation.
     
    463463  @param[in, out] CommBufferSize The size of the CommBuffer.
    464464
    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
    466466                                              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
    468468                                              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
    470470                                              be called.
    471471  @retval EFI_INTERRUPT_PENDING               The interrupt could not be quiesced.
     
    508508    return EFI_SUCCESS;
    509509  }
    510  
     510
    511511  SmmPerfCommData = (SMM_PERF_COMMUNICATE_EX *)CommBuffer;
    512512
     
    552552
    553553  SmmPerfCommData->ReturnStatus = Status;
    554  
     554
    555555  return EFI_SUCCESS;
    556556}
     
    571571  @param[in, out] CommBufferSize The size of the CommBuffer.
    572572
    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
    574574                                              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
    576576                                              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
    578578                                              be called.
    579579  @retval EFI_INTERRUPT_PENDING               The interrupt could not be quiesced.
     
    664664
    665665  SmmPerfCommData->ReturnStatus = Status;
    666  
     666
    667667  return EFI_SUCCESS;
    668668}
    669669
    670670/**
    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
    673673
    674674  @param  Event    The event of notify protocol.
     
    695695  mGaugeData = AllocateZeroPool (sizeof (GAUGE_DATA_HEADER) + (sizeof (GAUGE_DATA_ENTRY_EX) * mMaxGaugeRecords));
    696696  ASSERT (mGaugeData != NULL);
    697  
     697
    698698  //
    699699  // Install the protocol interfaces.
     
    726726
    727727/**
    728   The constructor function initializes the Performance Measurement Enable flag and 
     728  The constructor function initializes the Performance Measurement Enable flag and
    729729  registers SmmBase2 protocol notify callback.
    730730  It will ASSERT() if one of these operations fails and it will always return EFI_SUCCESS.
     
    902902EFIAPI
    903903GetPerformanceMeasurementEx (
    904   IN  UINTN       LogEntryKey, 
     904  IN  UINTN       LogEntryKey,
    905905  OUT CONST VOID  **Handle,
    906906  OUT CONST CHAR8 **Token,
     
    915915
    916916  GaugeData = NULL;
    917  
     917
    918918  ASSERT (Handle != NULL);
    919919  ASSERT (Token != NULL);
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf

    r58459 r58466  
    11## @file
    22#  Performance library instance used by SMM Core.
    3 # 
     3#
    44#  This library provides the performance measurement interfaces and initializes performance
    55#  logging for the SMM phase.
     
    88#  This library is mainly used by SMM Core to start performance logging to ensure that
    99#  SMM Performance and PerformanceEx Protocol are installed at the very beginning of SMM phase.
    10 # 
     10#
    1111#  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
    1212#  This program and the accompanying materials
     
    1414#  which accompanies this distribution.  The full text of the license may be found at
    1515#  http://opensource.org/licenses/bsd-license.php
    16 # 
     16#
    1717#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1818#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    19 # 
     19#
    2020##
    2121
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLibInternal.h

    r58459 r58466  
    1515
    1616**/
    17  
     17
    1818#ifndef _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_
    1919#define _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_
     
    2929#include <Library/TimerLib.h>
    3030#include <Library/PcdLib.h>
    31 #include <Library/UefiLib.h>                   
     31#include <Library/UefiLib.h>
    3232#include <Library/UefiBootServicesTableLib.h>
    3333#include <Library/MemoryAllocationLib.h>
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.c

    r48674 r58466  
    1717/**
    1818  Performs platform specific tasks before invoking registered SMI handlers.
    19  
     19
    2020  This function performs platform specific tasks before invoking registered SMI handlers.
    21  
     21
    2222  @retval EFI_SUCCESS       The platform hook completes successfully.
    2323  @retval Other values      The paltform hook cannot complete due to some error.
     
    3636/**
    3737  Performs platform specific tasks after invoking registered SMI handlers.
    38  
     38
    3939  This function performs platform specific tasks after invoking registered SMI handlers.
    40  
     40
    4141  @retval EFI_SUCCESS       The platform hook completes successfully.
    4242  @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  
    297297  @retval RETURN_SUCCESS            the information is restored successfully.
    298298  @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
    300300                                    LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.
    301301  @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  
    2727# The following information is for reference only and not required by the build tools.
    2828#
    29 #  VALID_ARCHITECTURES           = IA32 X64 
     29#  VALID_ARCHITECTURES           = IA32 X64
    3030#
    3131
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c

    r48674 r58466  
    238238
    239239  @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
    241241                                    LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.
    242242  @retval RETURN_BUFFER_TOO_SMALL   the Length is too small to hold the confidential information.
     
    510510  @retval RETURN_SUCCESS            the information is restored successfully.
    511511  @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
    513513                                    LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.
    514514  @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  
    2727# The following information is for reference only and not required by the build tools.
    2828#
    29 #  VALID_ARCHITECTURES           = IA32 X64 
     29#  VALID_ARCHITECTURES           = IA32 X64
    3030#
    3131
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.c

    r58459 r58466  
    6969  @param[in] SystemTable  A Pointer to the EFI System Table.
    7070
    71   @retval EFI_SUCEESS     
     71  @retval EFI_SUCEESS
    7272  @return Others          Some error occurs.
    7373**/
     
    414414  @retval RETURN_SUCCESS            the information is restored successfully.
    415415  @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
    417417                                    LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.
    418418  @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  
    2828# The following information is for reference only and not required by the build tools.
    2929#
    30 #  VALID_ARCHITECTURES           = IA32 X64 
     30#  VALID_ARCHITECTURES           = IA32 X64
    3131#
    3232
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.c

    r58459 r58466  
    5050  )
    5151{
    52  
     52
    5353  mPerformanceMeasurementEnabled =  (BOOLEAN) ((PcdGet8(PcdPerformanceLibraryPropertyMask) & PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED) != 0);
    5454
     
    247247EFIAPI
    248248GetPerformanceMeasurementEx (
    249   IN  UINTN       LogEntryKey, 
     249  IN  UINTN       LogEntryKey,
    250250  OUT CONST VOID  **Handle,
    251251  OUT CONST CHAR8 **Token,
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf

    r58459 r58466  
    11## @file
    22#  Performance library instance used in SMM phase.
    3 # 
     3#
    44#  This library instance provides infrastructure for SMM drivers to log performance
    55#  data. It consumes SMM PerformanceEx or Performance Protocol published by SmmCorePerformanceLib
    66#  to log performance data. If both SMM PerformanceEx and Performance Protocol are not available,
    77#  it does not log any performance information.
    8 # 
     8#
    99#  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
    1010#  This program and the accompanying materials
     
    1212#  which accompanies this distribution.  The full text of the license may be found at
    1313#  http://opensource.org/licenses/bsd-license.php
    14 # 
     14#
    1515#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1616#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    17 # 
     17#
    1818##
    1919
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c

    r48674 r58466  
    9393      }
    9494    }
    95  
     95
    9696    //
    9797    // A status code service is present in system, so pass in all the parameters to the service.
     
    9999    return (*mReportStatusCode) (mStatusCodeProtocol, Type, Value, Instance, (EFI_GUID *)CallerId, Data);
    100100  }
    101  
     101
    102102  return EFI_UNSUPPORTED;
    103103}
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c

    r48674 r58466  
    1717
    1818/**
    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
    2121  string is allocated using AllocatePool().  The caller is responsible for freeing
    2222  the returned string using FreePool().  The format of the returned string follows
    2323  the language format assumed the HII Database.
    24  
     24
    2525  If HiiHandle is NULL, then ASSERT().
    2626
     
    2828
    2929  @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
    3131                 languages.
    3232  @retval NULL   The list of suported languages could not be retrieved.
     
    5454
    5555  //
    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()
    5858  // returns an error other than EFI_BUFFER_TOO_SMALL, then HiiHandle is not present
    5959  // in the HII Database
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiLib/HiiLib.c

    r58459 r58466  
    4545
    4646//
    47 // Template used to mark the end of a list of packages 
     47// Template used to mark the end of a list of packages
    4848//
    4949GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_HII_PACKAGE_HEADER  mEndOfPakageList = {
     
    8686  Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &BufferSize, HiiPackageList);
    8787  ASSERT (Status != EFI_NOT_FOUND);
    88  
     88
    8989  if (Status == EFI_BUFFER_TOO_SMALL) {
    9090    HiiPackageList = AllocatePool (BufferSize);
     
    116116  the list of package is 0, then NULL is returned.
    117117
    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
    119119  by UEFI VFR compiler and StringGather tool.
    120120
     
    125125  } EDKII_AUTOGEN_PACKAGES_HEADER;
    126126  #pragma pack (pop)
    127  
     127
    128128  @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
    130130                               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
    132132                               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
    134134                               to packages terminated by a NULL.
    135135
     
    169169
    170170  //
    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
    172172  // are empty, then return a NULL HII Handle
    173173  //
     
    177177
    178178  //
    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
    180180  //
    181181  Length += sizeof (EFI_HII_PACKAGE_LIST_HEADER) + sizeof (EFI_HII_PACKAGE_HEADER);
     
    223223  //
    224224  Status = gHiiDatabase->NewPackageList (
    225                            gHiiDatabase, 
    226                            PackageListHeader, 
    227                            DeviceHandle, 
     225                           gHiiDatabase,
     226                           PackageListHeader,
     227                           DeviceHandle,
    228228                           &HiiHandle
    229229                           );
     
    273273  The caller is responsible for freeing the array with FreePool().
    274274
    275   @param[in]  PackageListGuid  An optional parameter that is used to request 
     275  @param[in]  PackageListGuid  An optional parameter that is used to request
    276276                               HII Handles associated with a specific
    277277                               Package List GUID.  If this parameter is NULL,
    278278                               then all the HII Handles in the HII Database
    279279                               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
    281281                               PackageListGuid are returned.
    282282
     
    313313
    314314  //
    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
    318318  // handles in the HII database.
    319319  //
    320320  if (Status != EFI_BUFFER_TOO_SMALL) {
    321321    //
    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
    323323    // handles in the HII Database
    324324    //
     
    365365      ASSERT_EFI_ERROR (Status);
    366366      if (CompareGuid (&Guid, PackageListGuid)) {
    367         HiiHandleBuffer[Index2++] = HiiHandleBuffer[Index1];       
     367        HiiHandleBuffer[Index2++] = HiiHandleBuffer[Index1];
    368368      }
    369369    }
     
    379379
    380380/**
    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
    382382  hex digits that appear between a '=' and a '&' in a config string.
    383383
     
    417417
    418418/**
    419   Uses the BlockToConfig() service of the Config Routing Protocol to 
     419  Uses the BlockToConfig() service of the Config Routing Protocol to
    420420  convert <ConfigRequest> and a buffer to a <ConfigResp>
    421421
     
    464464
    465465/**
    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
    469469  the buffer using FreePool().
    470470
    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
    472472                              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
    474474                              is an optional parameter that may be NULL.
    475475  @param[in]  SetResultsData  If not NULL, then this parameter specified the buffer
     
    524524                              VariableName
    525525                              );
    526    
     526
    527527    if (!EFI_ERROR (Status)) {
    528528      //
     
    565565
    566566/**
    567   Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing 
     567  Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing
    568568  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
    570570  responsible for freeing the allocated string with FreePool().
    571  
     571
    572572  The format of a <ConfigHdr> is as follows:
    573573
     
    575575
    576576  @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
    579579                            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.
    585585  @param[in]  DriverHandle  The driver handle which supports a Device Path Protocol
    586586                            that is the routing information PATH.  Each byte of
     
    609609
    610610  //
    611   // Compute the length of Name in Unicode characters. 
     611  // Compute the length of Name in Unicode characters.
    612612  // If Name is NULL, then the length is 0.
    613613  //
     
    656656    }
    657657  }
    658  
     658
    659659  //
    660660  // Append L"&NAME="
     
    697697
    698698/**
    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
    700700  to binary buffer from <ConfigHdr>.
    701701
     
    730730    return EFI_INVALID_PARAMETER;
    731731  }
    732  
     732
    733733  DataBuffer = NULL;
    734734  StringPtr  = NULL;
     
    765765      }
    766766    }
    767    
     767
    768768    *Buffer = DataBuffer;
    769769    break;
     
    772772    //
    773773    // Convert Config String to Unicode String, e.g. "0041004200430044" => "ABCD"
    774     // 
     774    //
    775775
    776776    //
     
    808808  This function checks VarOffset and VarWidth is in the block range.
    809809
    810   @param  BlockArray         The block array is to be checked. 
     810  @param  BlockArray         The block array is to be checked.
    811811  @param  VarOffset          Offset of var to the structure
    812812  @param  VarWidth           Width of var.
    813  
     813
    814814  @retval TRUE   This Var is in the block range.
    815815  @retval FALSE  This Var is not in the block range.
     
    824824  LIST_ENTRY          *Link;
    825825  IFR_BLOCK_DATA      *BlockData;
    826  
     826
    827827  //
    828828  // No Request Block array, all vars are got.
     
    831831    return TRUE;
    832832  }
    833  
     833
    834834  //
    835835  // Check the input var is in the request block range.
     
    888888  }
    889889  Length = StringPtr - ValueString;
    890  
     890
    891891  //
    892892  // Allocate buffer to store the value
     
    896896    return EFI_OUT_OF_RESOURCES;
    897897  }
    898  
     898
    899899  //
    900900  // Convert character one by one to the value buffer
     
    910910    }
    911911  }
    912  
     912
    913913  //
    914914  // Set the converted value and string length.
     
    925925  @param VarName                 The variable name which need to get value.
    926926  @param VarValue                The return value.
    927  
     927
    928928  @retval EFI_SUCCESS            Get the value for the VarName
    929929  @retval EFI_OUT_OF_RESOURCES   The memory is not enough.
     
    983983  @param HiiHandle          The HiiHandle for this formset.
    984984  @param NameValueType      Whether current storage is name/value varstore or not.
    985  
     985
    986986  @retval EFI_SUCCESS            The current setting is valid.
    987987  @retval EFI_OUT_OF_RESOURCES   The memory is not enough.
     
    11211121
    11221122          //
    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
    11251125          // GetVariable function.
    11261126          //
     
    11691169
    11701170          //
    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.
    11721172          //
    11731173          if (VarStoreData.VarStoreId == 0) {
    11741174            return EFI_INVALID_PARAMETER;
    11751175          }
    1176           // 
     1176          //
    11771177          // Check whether this question is for the requested varstore.
    11781178          //
     
    12131213            }
    12141214            //
    1215             // Check this var question is in the var storage 
     1215            // Check this var question is in the var storage
    12161216            //
    12171217            if ((Offset + Width) > VarStoreData.Size) {
    12181218              //
    1219               // This question exceeds the var store size. 
     1219              // This question exceeds the var store size.
    12201220              //
    12211221              return EFI_INVALID_PARAMETER;
     
    12401240
    12411241          //
    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.
    12431243          //
    12441244          if (VarStoreData.VarStoreId == 0) {
     
    12631263              break;
    12641264            }
    1265            
     1265
    12661266            Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue);
    12671267            if (EFI_ERROR (Status)) {
     
    12841284            }
    12851285            //
    1286             // Check this var question is in the var storage 
     1286            // Check this var question is in the var storage
    12871287            //
    12881288            if ((Offset + Width) > VarStoreData.Size) {
    12891289              //
    1290               // This question exceeds the var store size. 
     1290              // This question exceeds the var store size.
    12911291              //
    12921292              return EFI_INVALID_PARAMETER;
     
    13411341
    13421342          //
    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.
    13441344          //
    13451345          if (VarStoreData.VarStoreId == 0) {
     
    13651365              break;
    13661366            }
    1367            
     1367
    13681368            Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue);
    13691369            if (EFI_ERROR (Status)) {
     
    13861386            }
    13871387            //
    1388             // Check this var question is in the var storage 
     1388            // Check this var question is in the var storage
    13891389            //
    13901390            if ((Offset + Width) > VarStoreData.Size) {
    13911391              //
    1392               // This question exceeds the var store size. 
     1392              // This question exceeds the var store size.
    13931393              //
    13941394              return EFI_INVALID_PARAMETER;
     
    14131413
    14141414          //
    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.
    14161416          //
    14171417          if (VarStoreData.VarStoreId == 0) {
     
    14441444            //
    14451445            // Skip the "=".
    1446             // 
     1446            //
    14471447            StringPtr += 1;
    1448            
     1448
    14491449            //
    14501450            // Check current string length is less than maxsize
     
    14681468            }
    14691469            //
    1470             // Check this var question is in the var storage 
     1470            // Check this var question is in the var storage
    14711471            //
    14721472            if ((Offset + Width) > VarStoreData.Size) {
    14731473              //
    1474               // This question exceeds the var store size. 
     1474              // This question exceeds the var store size.
    14751475              //
    14761476              return EFI_INVALID_PARAMETER;
     
    14871487        case EFI_IFR_ONE_OF_OPTION_OP:
    14881488          //
    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.
    14901490          //
    14911491          if (VarBlockData.Scope == 0) {
     
    15221522
    15231523          //
    1524           // OneOf value doesn't belong to one of option value. 
     1524          // OneOf value doesn't belong to one of option value.
    15251525          //
    15261526          if ((VarBlockData.Scope == 0) && (VarBlockData.OpCode == EFI_IFR_ONE_OF_OP)) {
     
    15631563  @param CurrentBlockArray     Current block array.
    15641564  @param VarBuffer             Data buffer for this varstore.
    1565  
     1565
    15661566  @retval EFI_SUCCESS            The current setting is valid.
    15671567  @retval EFI_OUT_OF_RESOURCES   The memory is not enough.
     
    15871587  IFR_BLOCK_DATA               *BlockArray;
    15881588  UINT8                        *DataBuffer;
    1589  
     1589
    15901590  //
    15911591  // Initialize the local variables.
     
    16231623    //
    16241624    // Skip the &OFFSET= string
    1625     // 
     1625    //
    16261626    StringPtr += StrLen (L"&OFFSET=");
    16271627
     
    17531753
    17541754    //
    1755     // If '\0', parsing is finished. 
     1755    // If '\0', parsing is finished.
    17561756    //
    17571757    if (*StringPtr == 0) {
     
    17591759    }
    17601760    //
    1761     // Go to next ConfigBlock 
     1761    // Go to next ConfigBlock
    17621762    //
    17631763  }
     
    17891789    FreePool (DataBuffer);
    17901790  }
    1791  
     1791
    17921792  if (BlockArray != NULL) {
    17931793    //
     
    18141814  @param VarName            Name of the buffer storage.
    18151815  @param HiiHandle          The HiiHandle for this package.
    1816  
     1816
    18171817  @retval EFI_SUCCESS            The current setting is valid.
    18181818  @retval EFI_OUT_OF_RESOURCES   The memory is not enough.
     
    18831883    FreePool (VarBuffer);
    18841884  }
    1885  
     1885
    18861886  if (CurrentBlockArray != NULL) {
    18871887    //
     
    19081908  @retval  TRUE              The input include config request elements.
    19091909  @retval  FALSE             The input string not includes.
    1910                                  
     1910
    19111911**/
    19121912BOOLEAN
     
    19311931  string for setting default value and validating current setting.
    19321932
    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
    19341934  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
    19361936  by parsing HII form IFR opcode.
    19371937
    19381938  NULL request string support depends on the ExportConfig interface of
    19391939  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
    19421942                    <MultiConfigRequest> format. It can be NULL.
    19431943                    If it is NULL, all current configuration for the
     
    19471947  @param DefaultId  Specifies the type of defaults to retrieve only for setting default action.
    19481948  @param ActionType Action supports setting defaults and validate current setting.
    1949  
     1949
    19501950  @retval TURE    Action runs successfully.
    19511951  @retval FALSE   Action is not valid or Action can't be executed successfully..
     
    19901990  HiiHandle        = NULL;
    19911991  HiiPackageList   = NULL;
    1992  
     1992
    19931993  //
    19941994  // Only support set default and validate setting action.
     
    20142014                                );
    20152015  }
    2016  
     2016
    20172017  if (EFI_ERROR (Status)) {
    20182018    return FALSE;
    20192019  }
    2020  
     2020
    20212021  StringPtr = ConfigAltResp;
    2022  
     2022
    20232023  while (StringPtr != L'\0') {
    20242024    //
     
    20552055      goto Done;
    20562056    }
    2057    
     2057
    20582058    //
    20592059    // Get Path value DevicePath
     
    20802080      goto Done;
    20812081    }
    2082    
     2082
    20832083    //
    20842084    // Find the matched Hii Handle for the found Driver handle
     
    21042104      // This request string has no its Hii package.
    21052105      // 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.
    21072107      //
    21082108      Status = EFI_SUCCESS;
     
    21162116    HiiPackageList     = NULL;
    21172117    Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, HiiHandle, &PackageListLength, HiiPackageList);
    2118  
     2118
    21192119    //
    21202120    // The return status should always be EFI_BUFFER_TOO_SMALL as input buffer's size is 0.
     
    21242124      goto Done;
    21252125    }
    2126  
     2126
    21272127    HiiPackageList = AllocatePool (PackageListLength);
    21282128    if (HiiPackageList == NULL) {
     
    21302130      goto Done;
    21312131    }
    2132  
     2132
    21332133    //
    21342134    // Get PackageList on HiiHandle
     
    21382138      goto Done;
    21392139    }
    2140    
     2140
    21412141    //
    21422142    // 3. Call ConfigRouting GetAltCfg(ConfigRoute, <ConfigResponse>, Guid, Name, DevicePath, AltCfgId, AltCfgResp)
     
    21522152                                  &ConfigResp
    21532153                                );
    2154    
     2154
    21552155    //
    21562156    // The required setting can't be found. So, it is not required to be validated and set.
     
    21662166      goto NextConfigAltResp;
    21672167    }
    2168    
     2168
    21692169    //
    21702170    // 4. Set the default configuration information or Validate current setting by parse IFR code.
     
    21952195      HiiPackageList = NULL;
    21962196    }
    2197    
     2197
    21982198    if (ConfigResp != NULL) {
    21992199      FreePool (ConfigResp);
     
    22062206    FreePool (VarGuid);
    22072207    VarGuid = NULL;
    2208  
     2208
    22092209    FreePool (VarName);
    22102210    VarName = NULL;
    2211  
     2211
    22122212    FreePool (DevicePath);
    22132213    DevicePath = NULL;
     
    22262226      break;
    22272227    }
    2228        
    2229     //
    2230     // Construct ConfigAltHdr string  "&<ConfigHdr>&ALTCFG=\0" 
     2228
     2229    //
     2230    // Construct ConfigAltHdr string  "&<ConfigHdr>&ALTCFG=\0"
    22312231    //                               | 1 | StrLen (ConfigHdr) | 8 | 1 |
    22322232    //
     
    22392239    StrnCat (ConfigAltHdr, StringHdr, StringPtr - StringHdr);
    22402240    StrCat (ConfigAltHdr, L"&ALTCFG=");
    2241    
     2241
    22422242    //
    22432243    // Skip all AltResp (AltConfigHdr ConfigBody) for the same ConfigHdr
     
    22492249      }
    22502250    }
    2251    
     2251
    22522252    //
    22532253    // Free the allocated ConfigAltHdr string
     
    22572257      break;
    22582258    }
    2259    
     2259
    22602260    //
    22612261    // Find &GUID as the next ConfigHdr
     
    22712271    StringPtr ++;
    22722272  }
    2273  
     2273
    22742274Done:
    22752275  if (VarGuid != NULL) {
     
    22922292    FreePool (ConfigAltResp);
    22932293  }
    2294  
     2294
    22952295  if (HiiPackageList != NULL) {
    22962296    FreePool (HiiPackageList);
    22972297  }
    2298  
     2298
    22992299  if (EFI_ERROR (Status)) {
    23002300    return FALSE;
     
    23092309  NULL request string support depends on the ExportConfig interface of
    23102310  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
    23132313                    <MultiConfigRequest> format. It can be NULL.
    23142314                    If it is NULL, all current configuration for the
    23152315                    entirety of the current HII database will be validated.
    2316  
     2316
    23172317  @retval TRUE    Current configuration is valid.
    23182318  @retval FALSE   Current configuration is invalid.
    23192319**/
    23202320BOOLEAN
    2321 EFIAPI                               
     2321EFIAPI
    23222322HiiValidateSettings (
    23232323  IN CONST EFI_STRING Request  OPTIONAL
     
    23292329/**
    23302330  Reset the default value specified by DefaultId to the driver
    2331   configuration got by Request string. 
     2331  configuration got by Request string.
    23322332
    23332333  NULL request string support depends on the ExportConfig interface of
    23342334  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
    23372337                    <MultiConfigRequest> format. It can be NULL.
    23382338                    If it is NULL, all configuration for the
    23392339                    entirety of the current HII database will be reset.
    23402340  @param DefaultId  Specifies the type of defaults to retrieve.
    2341  
     2341
    23422342  @retval TURE    The default value is set successfully.
    23432343  @retval FALSE   The default value can't be found and set.
     
    23562356  Determines if two values in config strings match.
    23572357
    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
    23602360  in SecondString.  If the two substrings match, then TRUE is returned.  If the
    23612361  two substrings do not match, then FALSE is returned.
     
    23682368  @param FirstString        Pointer to the first Null-terminated Unicode string.
    23692369  @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
    23712371                            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
    23732373                            marks the end of the value string to compare.
    23742374
    2375   @retval FALSE             StartSearchString is not present in FirstString. 
     2375  @retval FALSE             StartSearchString is not present in FirstString.
    23762376  @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.
    23782378  @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
    23802380                            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
    23822382                            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
    23842384                            string in SecondString.
    23852385
     
    24902490  buffer.
    24912491
    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
    24932493                            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
    24952495                            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.
    24972497  @param[out] Buffer        Buffer of data to be updated.
    24982498
     
    25312531  ConfigResp = AllocateZeroPool (Size);
    25322532  UnicodeSPrint (ConfigResp, Size, L"%s&%s", mConfigHdrTemplate, ResultsData);
    2533  
     2533
    25342534  //
    25352535  // Free the allocated buffer
     
    25762576                              buffer data will be send back to Browser. If NULL,
    25772577                              the whole buffer of data will be committed to
    2578                               Browser. 
     2578                              Browser.
    25792579                              <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*
    25802580
     
    26052605  if (RequestElement == NULL) {
    26062606    //
    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
    26082608    // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator
    26092609    //
     
    26132613  } else {
    26142614    //
    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
    26162616    // followed by <RequestElement> followed by a Null-terminator
    26172617    //
     
    26722672
    26732673/**
    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
    26752675  HiiFreeOpCodeHandle().
    26762676
     
    27302730/**
    27312731  Internal function gets the current position of opcode buffer.
    2732  
     2732
    27332733  @param[in]  OpCodeHandle   Handle to the buffer of opcodes.
    27342734
     
    27462746/**
    27472747  Internal function gets the start pointer of opcode buffer.
    2748  
     2748
    27492749  @param[in]  OpCodeHandle   Handle to the buffer of opcodes.
    27502750
     
    27632763  Internal function reserves the enough buffer for current opcode.
    27642764  When the buffer is not enough, Opcode buffer will be extended.
    2765  
     2765
    27662766  @param[in]  OpCodeHandle   Handle to the buffer of opcodes.
    27672767  @param[in]  Size           Size of current opcode.
     
    27842784  if (OpCodeBuffer->Position + Size > OpCodeBuffer->BufferSize) {
    27852785    Buffer = ReallocatePool (
    2786               OpCodeBuffer->BufferSize, 
     2786              OpCodeBuffer->BufferSize,
    27872787              OpCodeBuffer->BufferSize + (Size + HII_LIB_OPCODE_ALLOCATION_SIZE),
    27882788              OpCodeBuffer->Buffer
     
    27992799/**
    28002800  Internal function creates opcode based on the template opcode.
    2801  
     2801
    28022802  @param[in]  OpCodeHandle    Handle to the buffer of opcodes.
    28032803  @param[in]  OpCodeTemplate  Pointer to the template buffer of opcode.
     
    28362836/**
    28372837  Internal function creates opcode based on the template opcode for the normal opcode.
    2838  
     2838
    28392839  @param[in]  OpCodeHandle    Handle to the buffer of opcodes.
    28402840  @param[in]  OpCodeTemplate  Pointer to the template buffer of opcode.
     
    30213021  @param[in]  OpCodeHandle  Handle to the buffer of opcodes.
    30223022  @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
    30243024                            optional parameter that may be NULL.  If this
    3025                             parameter is NULL, then the GUID extension 
     3025                            parameter is NULL, then the GUID extension
    30263026                            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
    30293029                            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
    30313031                            must be >= sizeof(EFI_IFR_GUID).
    30323032
     
    30543054
    30553055  OpCodePointer = (EFI_IFR_GUID *)InternalHiiCreateOpCodeExtended (
    3056                                     OpCodeHandle, 
     3056                                    OpCodeHandle,
    30573057                                    &OpCode,
    30583058                                    EFI_IFR_GUID_OP,
     
    31483148
    31493149  return InternalHiiCreateOpCodeExtended (
    3150            OpCodeHandle, 
     3150           OpCodeHandle,
    31513151           &OpCode,
    3152            EFI_IFR_SUBTITLE_OP, 
    3153            sizeof (OpCode), 
    3154            0, 
     3152           EFI_IFR_SUBTITLE_OP,
     3153           sizeof (OpCode),
     3154           0,
    31553155           Scope
    31563156           );
     
    32023202  Create EFI_IFR_REF_OP, EFI_IFR_REF2_OP, EFI_IFR_REF3_OP and EFI_IFR_REF4_OP opcode.
    32033203
    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.
    32053205  When RefDevicePath is zero and RefFormSetId is not NULL, EFI_IFR_REF3 opcode will be created.
    32063206  When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is not zero, EFI_IFR_REF2 opcode will be created.
     
    32163216  @param[in]  QuestionFlags  The flags in Question Header
    32173217  @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.
    32193219                             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
    32213221                             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
    32233223                             the device path to which the form set containing the form specified by FormId.
    32243224                             If its value is zero, then the link refers to the current page.
     
    38143814  @param[in] FormId            The Form ID.
    38153815  @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
    38173817                               opcodes to be inserted or replaced in the form.
    38183818  @param[in] OpCodeBufferEnd   An OpCcode buffer that contains the IFR opcode
     
    38613861    BufferPos           += IfrOpHdr->Length;
    38623862    UpdatePackageLength += IfrOpHdr->Length;
    3863    
     3863
    38643864    //
    38653865    // Find the matched FormSet and Form
     
    38783878      }
    38793879    }
    3880    
     3880
    38813881    //
    38823882    // The matched Form is found, and Update data in this form
     
    39073907            IfrOpHdr       = (EFI_IFR_OP_HEADER *) ((UINT8 *) (IfrOpHdr) + IfrOpHdr->Length);
    39083908          }
    3909          
     3909
    39103910          if (Offset >= PackageHeader.Length) {
    39113911            //
     
    39543954    IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
    39553955  }
    3956  
     3956
    39573957  if (!Updated) {
    39583958    //
     
    39713971
    39723972/**
    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
    39743974  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
    39793979  specified by StartOpCodeHandle.  The following rules are used to determine if
    39803980  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.
    39833983  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
    39853985     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
    39883988     IFR opcode specified by EndOpCodeHandle.  If no match is found for the first
    39893989     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
    39913991     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
    39933993     the matching start IFR opcode.  If StartOpCcodeHandle only contains one
    39943994     IFR instruction, then the result of this operation will delete all of the IFR
     
    40034003                                 If it is NULL, all FormSet will be updated.
    40044004  @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
    40064006                                 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.
    40104010  @param[in]  EndOpCodeHandle    An OpCcode Handle that contains the IFR opcode
    40114011                                 that marks the end of a replace operation in
    40124012                                 the form.  This is an optional parameter that
    40134013                                 may be NULL.  If it is NULL, then an the IFR
    4014                                  opcodes specified by StartOpCodeHandle are 
     4014                                 opcodes specified by StartOpCodeHandle are
    40154015                                 inserted into the form.
    4016  
     4016
    40174017  @retval EFI_OUT_OF_RESOURCES   No enough memory resource is allocated.
    40184018  @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,
    40204020                                 and FormId could not be found in the HII Database.
    40214021                                 2) No IFR opcodes in the target form match the first
    40224022                                 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
    40254025                                 the first IFR opcode in EndOpCodeHandle.
    40264026  @retval EFI_SUCCESS            The matched form is updated by StartOpcode.
     
    40304030EFIAPI
    40314031HiiUpdateForm (
    4032   IN EFI_HII_HANDLE  HiiHandle,           
     4032  IN EFI_HII_HANDLE  HiiHandle,
    40334033  IN EFI_GUID        *FormSetGuid,        OPTIONAL
    40344034  IN EFI_FORM_ID     FormId,
     
    40394039  EFI_STATUS                   Status;
    40404040  EFI_HII_PACKAGE_LIST_HEADER  *HiiPackageList;
    4041   UINT32                       PackageListLength; 
     4041  UINT32                       PackageListLength;
    40424042  UINT32                       Offset;
    40434043  EFI_HII_PACKAGE_LIST_HEADER  *UpdatePackageList;
     
    40504050  HII_LIB_OPCODE_BUFFER        *OpCodeBufferStart;
    40514051  HII_LIB_OPCODE_BUFFER        *OpCodeBufferEnd;
    4052  
     4052
    40534053  //
    40544054  // Input update data can't be NULL.
     
    40594059  TempPacakge       = NULL;
    40604060  HiiPackageList    = NULL;
    4061  
     4061
    40624062  //
    40634063  // Retrieve buffer data from Opcode Handle
     
    40654065  OpCodeBufferStart = (HII_LIB_OPCODE_BUFFER *) StartOpCodeHandle;
    40664066  OpCodeBufferEnd   = (HII_LIB_OPCODE_BUFFER *) EndOpCodeHandle;
    4067  
     4067
    40684068  //
    40694069  // Get the original package list
     
    40994099    goto Finish;
    41004100  }
    4101  
     4101
    41024102  //
    41034103  // Allocate temp buffer to store the temp updated package buffer
     
    41164116  CopyMem (UpdateBufferPos, HiiPackageList, sizeof (EFI_HII_PACKAGE_LIST_HEADER));
    41174117  UpdateBufferPos += sizeof (EFI_HII_PACKAGE_LIST_HEADER);
    4118  
     4118
    41194119  //
    41204120  // Go through each package to find the matched package and update one by one
     
    41394139        //
    41404140        // Set Update Flag
    4141         //       
     4141        //
    41424142        Updated = TRUE;
    41434143        //
     
    41554155    UpdateBufferPos += PackageHeader.Length;
    41564156  }
    4157  
     4157
    41584158  if (Updated) {
    41594159    //
     
    41624162    BufferSize = UpdateBufferPos - (UINT8 *) UpdatePackageList;
    41634163    WriteUnaligned32 (&UpdatePackageList->PackageLength, (UINT32) BufferSize);
    4164    
     4164
    41654165    //
    41664166    // Update Package to show form
     
    41784178    FreePool (HiiPackageList);
    41794179  }
    4180  
     4180
    41814181  if (UpdatePackageList != NULL) {
    41824182    FreePool (UpdatePackageList);
    41834183  }
    4184  
     4184
    41854185  if (TempPacakge != NULL) {
    41864186    FreePool (TempPacakge);
    41874187  }
    41884188
    4189   return Status; 
    4190 }
     4189  return Status;
     4190}
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiLib/HiiString.c

    r58459 r58466  
    1717
    1818/**
    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
    2020  string in a String Package.  If StringId is 0, then a new string is added to
    2121  a String Package.  If StringId is not zero, then a string in String Package is
    2222  updated.  If SupportedLanguages is NULL, then the string is added or updated
    2323  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
    2525  specified by SupportedLanguages.
    26    
     26
    2727  If HiiHandle is NULL, then ASSERT().
    2828  If String is NULL, then ASSERT().
    2929
    30   @param[in]  HiiHandle           A handle that was previously registered in the 
     30  @param[in]  HiiHandle           A handle that was previously registered in the
    3131                                  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
    3936                                  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
    5050                                  format assumed the HII Database.
    5151
     
    139139
    140140/**
    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
    147147  is responsible for freeing the allocated buffer using FreePool().
    148  
     148
    149149  If PackageListGuid is NULL, then ASSERT().
    150150  If StringId is 0, then ASSERT.
    151151
    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
    153153                               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
    155155                               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
    159159                               follow the language format assumed the HII Database.
    160160
     
    191191/**
    192192  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
    198198  for freeing the allocated buffer using FreePool().
    199  
     199
    200200  If HiiHandle is NULL, then ASSERT().
    201201  If StringId is 0, then ASSET.
    202202
    203203  @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
    205205                         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
    209209                         the HII Database.
    210210
     
    234234  //
    235235  // Initialize all allocated buffers to NULL
    236   // 
     236  //
    237237  SupportedLanguages = NULL;
    238238  PlatformLanguage   = NULL;
     
    254254
    255255  //
    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
    257257  // skipped by GetBestLanguage()
    258258  //
     
    265265  //
    266266  BestLanguage = GetBestLanguage (
    267                    SupportedLanguages, 
     267                   SupportedLanguages,
    268268                   FALSE,                                             // RFC 4646 mode
    269                    Language,                                          // Highest priority 
     269                   Language,                                          // Highest priority
    270270                   PlatformLanguage != NULL ? PlatformLanguage : "",  // Next highest priority
    271                    SupportedLanguages,                                // Lowest priority 
     271                   SupportedLanguages,                                // Lowest priority
    272272                   NULL
    273273                   );
     
    290290                         );
    291291  //
    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()
    294294  // returns an error other than EFI_BUFFER_TOO_SMALL, then HiiHandle is not present
    295295  // in the HII Database
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiLib/InternalHiiLib.h

    r48674 r58466  
    33
    44  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
    99
    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.
    1212
    1313**/
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.c

    r48674 r58466  
    11/** @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.
    66
    77  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
     
    5555/**
    5656  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
    6161  UEFI HII Config Routing Protocol.  This function always return EFI_SUCCESS.
    6262  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
    6464  the platform does not support a graphical console.  As a result, the consumers
    6565  of this library much check the protocol pointers againt NULL before using them,
     
    8383
    8484  //
    85   // Retrieve the pointer to the UEFI HII String Protocol 
     85  // Retrieve the pointer to the UEFI HII String Protocol
    8686  //
    8787  Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &gHiiString);
     
    8989
    9090  //
    91   // Retrieve the pointer to the UEFI HII Database Protocol 
     91  // Retrieve the pointer to the UEFI HII Database Protocol
    9292  //
    9393  Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &gHiiDatabase);
     
    9595
    9696  //
    97   // Retrieve the pointer to the UEFI HII Config Routing Protocol 
     97  // Retrieve the pointer to the UEFI HII Config Routing Protocol
    9898  //
    9999  Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &gHiiConfigRouting);
     
    101101
    102102  //
    103   // Retrieve the pointer to the optional UEFI HII Font Protocol 
     103  // Retrieve the pointer to the optional UEFI HII Font Protocol
    104104  //
    105105  gBS->LocateProtocol (&gEfiHiiFontProtocolGuid, NULL, (VOID **) &gHiiFont);
    106106
    107107  //
    108   // Retrieve the pointer to the optional UEFI HII Image Protocol 
     108  // Retrieve the pointer to the optional UEFI HII Image Protocol
    109109  //
    110110  gBS->LocateProtocol (&gEfiHiiImageProtocolGuid, NULL, (VOID **) &gHiiImage);
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf

    r58459 r58466  
    11## @file
    22# UEFI HII Services Library implementation.
    3 # 
     3#
    44# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
    55#
     
    2121  MODULE_TYPE                    = UEFI_DRIVER
    2222  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
    2424
    2525  CONSTRUCTOR                    = UefiHiiServicesLibConstructor
     
    3939  UefiBootServicesTableLib
    4040  DebugLib
    41  
     41
    4242[Protocols]
    43   gEfiHiiFontProtocolGuid             ## SOMETIMES_CONSUMES 
     43  gEfiHiiFontProtocolGuid             ## SOMETIMES_CONSUMES
    4444  gEfiHiiStringProtocolGuid           ## CONSUMES
    4545  gEfiHiiImageProtocolGuid            ## SOMETIMES_CONSUMES
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette