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:
6 edited

Legend:

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

  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/CapsulePei/Capsule.h

    r58459 r58466  
    4040#include "Common/CommonHeader.h"
    4141
    42 #ifdef MDE_CPU_IA32 
     42#ifdef MDE_CPU_IA32
    4343
    4444#pragma pack(1)
     
    7979    UINT64  Accessed:1;               // 0 = Not accessed, 1 = Accessed (set by CPU)
    8080    UINT64  Dirty:1;                  // 0 = Not Dirty, 1 = written by processor on access to page
    81     UINT64  MustBe1:1;                // Must be 1 
     81    UINT64  MustBe1:1;                // Must be 1
    8282    UINT64  Global:1;                 // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
    8383    UINT64  Available:3;              // Available for use by system software
     
    103103    UINT64  Accessed:1;               // 0 = Not accessed, 1 = Accessed (set by CPU)
    104104    UINT64  Dirty:1;                  // 0 = Not Dirty, 1 = written by processor on access to page
    105     UINT64  MustBe1:1;                // Must be 1 
     105    UINT64  MustBe1:1;                // Must be 1
    106106    UINT64  Global:1;                 // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
    107107    UINT64  Available:3;              // Available for use by system software
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf

    r58459 r58466  
    3939  UefiCapsule.c
    4040  Capsule.h
    41   Common/CapsuleCoalesce.c 
     41  Common/CapsuleCoalesce.c
    4242
    4343[Packages]
     
    6969  gEfiPeiReadOnlyVariable2PpiGuid               ## CONSUMES
    7070  gPeiCapsulePpiGuid                            ## PRODUCES
    71  
    72 [Ppis.IA32] 
     71
     72[Ppis.IA32]
    7373  gEfiPeiLoadFilePpiGuid                        ## SOMETIMES_CONSUMES
    7474
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c

    r58459 r58466  
    4545  @param DataSize    How big a free block we want to find
    4646
    47   @return A pointer to a memory block of at least DataSize that lies somewhere 
     47  @return A pointer to a memory block of at least DataSize that lies somewhere
    4848          between MemBase and (MemBase + MemSize). The memory pointed to does not
    4949          contain any of the capsule block descriptors or capsule blocks pointed to
     
    8989
    9090  @retval NULL    could not relocate the descriptors
    91   @retval Pointer to the base of the successfully-relocated block descriptors. 
     91  @retval Pointer to the base of the successfully-relocated block descriptors.
    9292
    9393**/
     
    107107
    108108  @retval FALSE  Capsule is OK
    109   @retval TRUE   Capsule is corrupted 
     109  @retval TRUE   Capsule is corrupted
    110110
    111111**/
     
    167167  @param DataSize    How big a free block we want to find
    168168
    169   @return A pointer to a memory block of at least DataSize that lies somewhere 
     169  @return A pointer to a memory block of at least DataSize that lies somewhere
    170170          between MemBase and (MemBase + MemSize). The memory pointed to does not
    171171          contain any of the capsule block descriptors or capsule blocks pointed to
     
    411411
    412412  @retval NULL    could not relocate the descriptors
    413   @retval Pointer to the base of the successfully-relocated block descriptors. 
     413  @retval Pointer to the base of the successfully-relocated block descriptors.
    414414
    415415**/
     
    698698
    699699  @retval FALSE  Capsule is OK
    700   @retval TRUE   Capsule is corrupted 
     700  @retval TRUE   Capsule is corrupted
    701701
    702702**/
     
    730730  where capsule data corruption occurs.
    731731
    732   The test pattern mode fills in memory with a counting UINT32 value. 
     732  The test pattern mode fills in memory with a counting UINT32 value.
    733733  If the capsule is not divided up in a multiple of 4-byte blocks, then
    734734  things get messy doing the check. Therefore there are some cases
     
    824824BuildCapsuleDescriptors (
    825825  IN  EFI_PHYSICAL_ADDRESS            *BlockListBuffer,
    826   OUT EFI_CAPSULE_BLOCK_DESCRIPTOR    **BlockDescriptorList 
     826  OUT EFI_CAPSULE_BLOCK_DESCRIPTOR    **BlockDescriptorList
    827827  )
    828828{
     
    867867    Index ++;
    868868  }
    869  
     869
    870870  if (HeadBlock != NULL) {
    871871    *BlockDescriptorList = HeadBlock;
     
    889889                   | |  Capsule [0]          | |            |
    890890                   | ------------------------- |            |
    891                    |    Capsule Image          |            |   
     891                   |    Capsule Image          |            |
    892892CapsuleImageBase-->+---------------------------+
    893893                   | ------------------------- |            |
     
    962962  UINT8                          *RelocPtr;
    963963  UINT64                         *AddDataPtr;
    964   UINTN                          CapsuleTimes; 
    965   UINT64                         SizeLeft; 
    966   UINT64                         CapsuleImageSize; 
     964  UINTN                          CapsuleTimes;
     965  UINT64                         SizeLeft;
     966  UINT64                         CapsuleImageSize;
    967967  UINTN                          CapsuleSize;
    968968  UINTN                          CapsuleNumber;
     
    12241224        //Here is the end of the current capsule image.
    12251225        //
    1226         CapsuleBeginFlag = TRUE; 
     1226        CapsuleBeginFlag = TRUE;
    12271227      }
    12281228    } else {
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c

    r58459 r58466  
    4444/**
    4545  Calculate the total size of page table.
    46  
     46
    4747  @return The size of page table.
    48  
    49  
     48
     49
    5050**/
    5151UINTN
     
    129129  IN  EFI_PHYSICAL_ADDRESS  PageTablesAddress
    130130  )
    131 { 
     131{
    132132  UINT32                                        RegEax;
    133133  UINT32                                        RegEdx;
     
    193193
    194194  //
    195   // Pre-allocate big pages to avoid later allocations. 
     195  // Pre-allocate big pages to avoid later allocations.
    196196  //
    197197  BigPageAddress = (UINTN) PageTablesAddress;
     
    222222    if (Page1GSupport) {
    223223      PageDirectory1GEntry = (VOID *) PageDirectoryPointerEntry;
    224    
     224
    225225      for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectory1GEntry++, PageAddress += SIZE_1GB) {
    226226        //
     
    237237        // Each Directory Pointer entries points to a page of Page Directory entires.
    238238        // So allocate space for them and fill them in in the IndexOfPageDirectoryEntries loop.
    239         //       
     239        //
    240240        PageDirectoryEntry = (VOID *) BigPageAddress;
    241241        BigPageAddress += SIZE_4KB;
     
    291291  SWITCH_64_TO_32_CONTEXT  *ReturnContext
    292292  )
    293 { 
     293{
    294294  //
    295295  // Restore original GDT
    296296  //
    297297  AsmWriteGdtr (&ReturnContext->Gdtr);
    298  
     298
    299299  //
    300300  // return to original caller
    301301  //
    302302  LongJump ((BASE_LIBRARY_JUMP_BUFFER  *)(UINTN)EntrypointContext->JumpBuffer, 1);
    303  
     303
    304304  //
    305305  // never be here
    306   // 
     306  //
    307307  ASSERT (FALSE);
    308308}
     
    339339    //
    340340    CreateIdentityMappingPageTables (PageTableAddress);
    341    
     341
    342342    //
    343343    // Create 64-bit GDT
     
    365365      );
    366366  }
    367  
     367
    368368  //
    369369  // Convert to 32-bit Status and return
     
    373373    Status = ENCODE_ERROR ((UINTN) ReturnContext->ReturnStatus);
    374374  }
    375  
     375
    376376  return Status;
    377377}
     
    411411  ZeroMem (&Context, sizeof (SWITCH_32_TO_64_CONTEXT));
    412412  ZeroMem (&ReturnContext, sizeof (SWITCH_64_TO_32_CONTEXT));
    413  
     413
    414414  MemoryBase64  = (UINT64) (UINTN) *MemoryBase;
    415415  MemorySize64  = (UINT64) (UINTN) *MemorySize;
     
    417417
    418418  //
    419   // Merge memory range reserved for stack and page table 
     419  // Merge memory range reserved for stack and page table
    420420  //
    421421  if (LongModeBuffer->StackBaseAddress < LongModeBuffer->PageTableAddress) {
     
    426426    ReservedRangeEnd  = LongModeBuffer->StackBaseAddress + LongModeBuffer->StackSize;
    427427  }
    428  
     428
    429429  //
    430430  // Check if memory range reserved is overlap with MemoryBase ~ MemoryBase + MemorySize.
     
    445445      MemorySize64 = (UINT64)(UINTN)(ReservedRangeBase - MemoryBase64);
    446446    }
    447   } 
    448  
     447  }
     448
    449449  //
    450450  // Initialize context jumping to 64-bit enviroment
     
    467467  //
    468468  ReturnContext.ReturnStatus       = 0;
    469  
     469
    470470  //
    471471  // Save original GDT
    472472  //
    473473  AsmReadGdtr ((IA32_DESCRIPTOR *)&ReturnContext.Gdtr);
    474  
     474
    475475  Status = Thunk32To64 (LongModeBuffer->PageTableAddress, &Context, &ReturnContext);
    476  
     476
    477477  if (!EFI_ERROR (Status)) {
    478478    *MemoryBase = (VOID *) (UINTN) MemoryBase64;
     
    576576  ValidIndex        = 0;
    577577  CapsuleDataPtr64  = 0;
    578  
     578
    579579  Status = PeiServicesLocatePpi (
    580580              &gEfiPeiReadOnlyVariable2PpiGuid,
     
    627627          break;
    628628        }
    629        
     629
    630630        //
    631631        // If this BlockList has been linked before, skip this variable
     
    643643        }
    644644      }
    645      
     645
    646646      //
    647647      // Cache BlockList which has been processed
     
    651651    }
    652652  }
    653  
     653
    654654  return EFI_SUCCESS;
    655655}
     
    732732  CHAR16                               CapsuleVarName[30];
    733733  CHAR16                               *TempVarName;
    734   EFI_PHYSICAL_ADDRESS                 CapsuleDataPtr64; 
     734  EFI_PHYSICAL_ADDRESS                 CapsuleDataPtr64;
    735735  EFI_STATUS                           Status;
    736736  EFI_BOOT_MODE                        BootMode;
     
    755755  Status = PeiServicesGetBootMode (&BootMode);
    756756  if (EFI_ERROR (Status) || (BootMode != BOOT_ON_FLASH_UPDATE)) {
    757     DEBUG ((EFI_D_ERROR, "Boot mode is not correct for capsule update path.\n"));   
     757    DEBUG ((EFI_D_ERROR, "Boot mode is not correct for capsule update path.\n"));
    758758    Status = EFI_NOT_FOUND;
    759759    goto Done;
    760760  }
    761  
     761
    762762  //
    763763  // User may set the same ScatterGatherList with several different variables,
     
    798798    Index++;
    799799  }
    800  
     800
    801801  DEBUG ((EFI_D_INFO,"Capsule variable count = %d\n", VariableCount));
    802  
     802
    803803  //
    804804  // The last entry is the end flag.
     
    813813    goto Done;
    814814  }
    815  
     815
    816816  ZeroMem (VariableArrayAddress, (VariableCount + 1) * sizeof (EFI_PHYSICAL_ADDRESS));
    817  
     817
    818818  //
    819819  // Find out if we actually have a capsule.
     
    842842      goto Done;
    843843    }
    844    
     844
    845845    Status = FindCapsuleCoalesceImage (&CoalesceImageEntryPoint, &CoalesceImageMachineType);
    846846    if ((EFI_ERROR (Status)) || (CoalesceImageMachineType != EFI_IMAGE_MACHINE_X64)) {
     
    864864  Status = CapsuleDataCoalesce (PeiServices, (EFI_PHYSICAL_ADDRESS *)(UINTN)VariableArrayAddress, MemoryBase, MemorySize);
    865865#endif
    866  
     866
    867867  DEBUG ((EFI_D_INFO, "Capsule Coalesce Status = %r!\n", Status));
    868868
     
    870870    DEBUG ((EFI_D_ERROR, "There is not enough memory to process capsule!\n"));
    871871  }
    872  
     872
    873873  if (Status == EFI_NOT_FOUND) {
    874874    DEBUG ((EFI_D_ERROR, "Fail to parse capsule descriptor in memory!\n"));
     
    903903}
    904904/**
    905   This function will look at a capsule and determine if it's a test pattern. 
     905  This function will look at a capsule and determine if it's a test pattern.
    906906  If it is, then it will verify it and emit an error message if corruption is detected.
    907  
     907
    908908  @param PeiServices   Standard pei services pointer
    909909  @param CapsuleBase   Base address of coalesced capsule, which is preceeded
     
    994994  EFI_PHYSICAL_ADDRESS          BaseAddress;
    995995  UINT64                        Length;
    996  
     996
    997997  PrivateData    = (EFI_CAPSULE_PEIM_PRIVATE_DATA *) CapsuleBase;
    998998  if (PrivateData->Signature != EFI_CAPSULE_PEIM_PRIVATE_DATA_SIGNATURE) {
     
    10501050    BuildCvHob (BaseAddress, Length);
    10511051  }
    1052  
     1052
    10531053  return EFI_SUCCESS;
    10541054}
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c

    r58459 r58466  
    4646  // Save the IA32 IDT Descriptor
    4747  //
    48   AsmReadIdtr ((IA32_DESCRIPTOR *) &Ia32Idtr); 
     48  AsmReadIdtr ((IA32_DESCRIPTOR *) &Ia32Idtr);
    4949
    5050  //
     
    5454  X64Idtr.Base = (UINTN) IdtEntryTable;
    5555  X64Idtr.Limit = (UINT16) (sizeof (IA32_IDT_GATE_DESCRIPTOR) * EXCEPTION_VECTOR_NUMBER - 1);
    56   AsmWriteIdtr ((IA32_DESCRIPTOR *) &X64Idtr); 
     56  AsmWriteIdtr ((IA32_DESCRIPTOR *) &X64Idtr);
    5757
    5858  //
     
    6161  Status = InitializeCpuExceptionHandlers (NULL);
    6262  ASSERT_EFI_ERROR (Status);
    63  
     63
    6464  //
    6565  // Initialize Debug Agent to support source level debug
     
    7676             (UINTN *) (UINTN) EntrypointContext->MemorySize64Ptr
    7777             );
    78  
     78
    7979  ReturnContext->ReturnStatus = Status;
    8080
     
    8686  // Restore IA32 IDT table
    8787  //
    88   AsmWriteIdtr ((IA32_DESCRIPTOR *) &Ia32Idtr); 
    89  
     88  AsmWriteIdtr ((IA32_DESCRIPTOR *) &Ia32Idtr);
     89
    9090  //
    9191  // Finish to coalesce capsule, and return to 32-bit mode.
     
    9797    (UINT32) (UINTN) ReturnContext,
    9898    (UINT32) (EntrypointContext->StackBufferBase + EntrypointContext->StackBufferLength)
    99     ); 
    100  
     99    );
     100
    101101  //
    102102  // Should never be here.
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