Changeset 58459 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiHobLib
- Timestamp:
- Oct 28, 2015 8:17:18 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
-
Property svn:mergeinfo
set to (toggle deleted branches)
/vendor/edk2/current 103735-103757
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiHobLib/HobLib.c
r48674 r58459 2 2 Provide Hob Library functions for Pei phase. 3 3 4 Copyright (c) 2007 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 302 302 303 303 /** 304 Builds a HOB that describes a chunk of system memory with Owner GUID. 305 306 This function builds a HOB that describes a chunk of system memory. 307 It can only be invoked during PEI phase; 308 for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. 309 310 If there is no additional space for HOB creation, then ASSERT(). 311 312 @param ResourceType The type of resource described by this HOB. 313 @param ResourceAttribute The resource attributes of the memory described by this HOB. 314 @param PhysicalStart The 64 bit physical address of memory described by this HOB. 315 @param NumberOfBytes The length of the memory described by this HOB in bytes. 316 @param OwnerGUID GUID for the owner of this resource. 317 318 **/ 319 VOID 320 EFIAPI 321 BuildResourceDescriptorWithOwnerHob ( 322 IN EFI_RESOURCE_TYPE ResourceType, 323 IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, 324 IN EFI_PHYSICAL_ADDRESS PhysicalStart, 325 IN UINT64 NumberOfBytes, 326 IN EFI_GUID *OwnerGUID 327 ) 328 { 329 EFI_HOB_RESOURCE_DESCRIPTOR *Hob; 330 331 Hob = InternalPeiCreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, (UINT16) sizeof (EFI_HOB_RESOURCE_DESCRIPTOR)); 332 if (Hob == NULL) { 333 return; 334 } 335 336 Hob->ResourceType = ResourceType; 337 Hob->ResourceAttribute = ResourceAttribute; 338 Hob->PhysicalStart = PhysicalStart; 339 Hob->ResourceLength = NumberOfBytes; 340 341 CopyGuid (&Hob->Owner, OwnerGUID); 342 } 343 344 /** 304 345 Builds a HOB that describes a chunk of system memory. 305 346 … … 336 377 Hob->PhysicalStart = PhysicalStart; 337 378 Hob->ResourceLength = NumberOfBytes; 379 ZeroMem (&(Hob->Owner), sizeof (EFI_GUID)); 338 380 } 339 381 … … 350 392 If Guid is NULL, then ASSERT(). 351 393 If there is no additional space for HOB creation, then ASSERT(). 352 If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). 394 If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). 395 HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8. 353 396 354 397 @param Guid The GUID to tag the customized HOB. … … 376 419 // Make sure that data length is not too long. 377 420 // 378 ASSERT (DataLength <= (0x ffff- sizeof (EFI_HOB_GUID_TYPE)));421 ASSERT (DataLength <= (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE))); 379 422 380 423 Hob = InternalPeiCreateHob (EFI_HOB_TYPE_GUID_EXTENSION, (UINT16) (sizeof (EFI_HOB_GUID_TYPE) + DataLength)); … … 400 443 If Data is NULL and DataLength > 0, then ASSERT(). 401 444 If there is no additional space for HOB creation, then ASSERT(). 402 If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). 445 If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). 446 HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8. 403 447 404 448 @param Guid The GUID to tag the customized HOB. -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiHobLib/PeiHobLib.inf
r48674 r58459 4 4 # HOB Library implementation that uses PEI Services to retrieve the HOB List. 5 5 # 6 # Copyright (c) 2006 - 201 0, Intel Corporation. All rights reserved.<BR>6 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 7 7 # 8 8 # This program and the accompanying materials … … 19 19 INF_VERSION = 0x00010005 20 20 BASE_NAME = PeiHobLib 21 MODULE_UNI_FILE = PeiHobLib.uni 21 22 FILE_GUID = 9643128f-ac24-4b3e-b6be-d8849a306153 22 23 MODULE_TYPE = PEIM … … 43 44 44 45 [Guids] 45 gEfiHobMemoryAllocStackGuid ## PRODUCES ## HOB46 gEfiHobMemoryAllocBspStoreGuid ## PRODUCES ## HOB47 gEfiHobMemoryAllocModuleGuid ## PRODUCES ## HOB46 gEfiHobMemoryAllocStackGuid ## SOMETIMES_PRODUCES ## HOB # MemoryAllocation StackHob 47 gEfiHobMemoryAllocBspStoreGuid ## SOMETIMES_PRODUCES ## HOB # MemoryAllocation BspStoreHob 48 gEfiHobMemoryAllocModuleGuid ## SOMETIMES_PRODUCES ## HOB # MemoryAllocation ModuleHob 48 49 49 50 # 50 51 # [Hob] 51 # RESOURCE_DESCRIPTOR ## PRODUCES 52 # MEMORY_ALLOCATION ## PRODUCES 53 # GUID_EXTENSION ## CONSUMES 54 # GUID_EXTENSION ## PRODUCES 55 # CPU ## PRODUCES 56 # FV2 ## PRODUCES 57 # FV ## PRODUCES 52 # MEMORY_ALLOCATION ## SOMETIMES_PRODUCES 53 # RESOURCE_DESCRIPTOR ## SOMETIMES_PRODUCES 54 # FIRMWARE_VOLUME ## SOMETIMES_PRODUCES 58 55 # 59 56
Note:
See TracChangeset
for help on using the changeset viewer.