Changeset 58459 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiHobLib/HobLib.c
- Timestamp:
- Oct 28, 2015 8:17:18 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 2 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.
Note:
See TracChangeset
for help on using the changeset viewer.