Revision: 16701
http://sourceforge.net/p/edk2/code/16701
Author: vanjeff
Date: 2015-02-03 06:39:33 +0000 (Tue, 03 Feb 2015)
Log Message:
-----------
MdePkg/IntelFrameworkPkg HobLib: Add BuildResourceDescriptorWithOwnerHob() API.
(Sync patch r16230 from main trunk.)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Revision Links:
--------------
http://sourceforge.net/p/edk2/code/16230
Modified Paths:
--------------
branches/UDK2014.SP1/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c
branches/UDK2014.SP1/MdePkg/Include/Library/HobLib.h
branches/UDK2014.SP1/MdePkg/Library/DxeCoreHobLib/HobLib.c
branches/UDK2014.SP1/MdePkg/Library/DxeHobLib/HobLib.c
branches/UDK2014.SP1/MdePkg/Library/PeiHobLib/HobLib.c
Modified:
branches/UDK2014.SP1/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c
===================================================================
--- branches/UDK2014.SP1/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c
2015-02-03 00:53:37 UTC (rev 16700)
+++ branches/UDK2014.SP1/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c
2015-02-03 06:39:33 UTC (rev 16701)
@@ -5,7 +5,7 @@
This library instance uses EFI_HOB_TYPE_CV defined in Intel framework HOB
specification v0.9
to implement HobLib BuildCvHob() API.
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
which accompanies this distribution. The full text of the license may be
found at
@@ -304,6 +304,46 @@
Hob->EntryPoint = EntryPoint;
}
+/**
+ Builds a HOB that describes a chunk of system memory with Owner GUID.
+
+ This function builds a HOB that describes a chunk of system memory.
+ It can only be invoked during PEI phase;
+ for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
+
+ If there is no additional space for HOB creation, then ASSERT().
+
+ @param ResourceType The type of resource described by this HOB.
+ @param ResourceAttribute The resource attributes of the memory described
by this HOB.
+ @param PhysicalStart The 64 bit physical address of memory described
by this HOB.
+ @param NumberOfBytes The length of the memory described by this HOB
in bytes.
+ @param OwnerGUID GUID for the owner of this resource.
+
+**/
+VOID
+EFIAPI
+BuildResourceDescriptorWithOwnerHob (
+ IN EFI_RESOURCE_TYPE ResourceType,
+ IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
+ IN EFI_PHYSICAL_ADDRESS PhysicalStart,
+ IN UINT64 NumberOfBytes,
+ IN EFI_GUID *OwnerGUID
+ )
+{
+ EFI_HOB_RESOURCE_DESCRIPTOR *Hob;
+ EFI_STATUS Status;
+
+ Status = PeiServicesCreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, sizeof
(EFI_HOB_RESOURCE_DESCRIPTOR), (void **)&Hob);
+ ASSERT_EFI_ERROR (Status);
+
+ Hob->ResourceType = ResourceType;
+ Hob->ResourceAttribute = ResourceAttribute;
+ Hob->PhysicalStart = PhysicalStart;
+ Hob->ResourceLength = NumberOfBytes;
+
+ CopyGuid (&Hob->Owner, OwnerGUID);
+}
+
/**
Builds a HOB that describes a chunk of system memory.
@@ -339,6 +379,7 @@
Hob->ResourceAttribute = ResourceAttribute;
Hob->PhysicalStart = PhysicalStart;
Hob->ResourceLength = NumberOfBytes;
+ ZeroMem (&(Hob->Owner), sizeof (EFI_GUID));
}
/**
Modified: branches/UDK2014.SP1/MdePkg/Include/Library/HobLib.h
===================================================================
--- branches/UDK2014.SP1/MdePkg/Include/Library/HobLib.h 2015-02-03
00:53:37 UTC (rev 16700)
+++ branches/UDK2014.SP1/MdePkg/Include/Library/HobLib.h 2015-02-03
06:39:33 UTC (rev 16701)
@@ -8,7 +8,7 @@
allows the PEI phase to pass information to the DXE phase. HOBs are position
independent and can be relocated easily to different memory memory locations.
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
which accompanies this distribution. The full text of the license may be
found at
@@ -184,6 +184,32 @@
IN EFI_PHYSICAL_ADDRESS EntryPoint
);
+/**
+ Builds a HOB that describes a chunk of system memory with Owner GUID.
+
+ This function builds a HOB that describes a chunk of system memory.
+ It can only be invoked during PEI phase;
+ for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
+
+ If there is no additional space for HOB creation, then ASSERT().
+
+ @param ResourceType The type of resource described by this HOB.
+ @param ResourceAttribute The resource attributes of the memory described
by this HOB.
+ @param PhysicalStart The 64 bit physical address of memory described
by this HOB.
+ @param NumberOfBytes The length of the memory described by this HOB
in bytes.
+ @param OwnerGUID GUID for the owner of this resource.
+
+**/
+VOID
+EFIAPI
+BuildResourceDescriptorWithOwnerHob (
+ IN EFI_RESOURCE_TYPE ResourceType,
+ IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
+ IN EFI_PHYSICAL_ADDRESS PhysicalStart,
+ IN UINT64 NumberOfBytes,
+ IN EFI_GUID *OwnerGUID
+ );
+
/**
Builds a HOB that describes a chunk of system memory.
Modified: branches/UDK2014.SP1/MdePkg/Library/DxeCoreHobLib/HobLib.c
===================================================================
--- branches/UDK2014.SP1/MdePkg/Library/DxeCoreHobLib/HobLib.c 2015-02-03
00:53:37 UTC (rev 16700)
+++ branches/UDK2014.SP1/MdePkg/Library/DxeCoreHobLib/HobLib.c 2015-02-03
06:39:33 UTC (rev 16701)
@@ -1,7 +1,7 @@
/** @file
HOB Library implementation for DxeCore driver.
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
which accompanies this distribution. The full text of the license may be
found at
@@ -239,6 +239,38 @@
ASSERT (FALSE);
}
+/**
+ Builds a HOB that describes a chunk of system memory with Owner GUID.
+
+ This function builds a HOB that describes a chunk of system memory.
+ It can only be invoked during PEI phase;
+ for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
+
+ If there is no additional space for HOB creation, then ASSERT().
+
+ @param ResourceType The type of resource described by this HOB.
+ @param ResourceAttribute The resource attributes of the memory described
by this HOB.
+ @param PhysicalStart The 64 bit physical address of memory described
by this HOB.
+ @param NumberOfBytes The length of the memory described by this HOB
in bytes.
+ @param OwnerGUID GUID for the owner of this resource.
+
+**/
+VOID
+EFIAPI
+BuildResourceDescriptorWithOwnerHob (
+ IN EFI_RESOURCE_TYPE ResourceType,
+ IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
+ IN EFI_PHYSICAL_ADDRESS PhysicalStart,
+ IN UINT64 NumberOfBytes,
+ IN EFI_GUID *OwnerGUID
+ )
+{
+ //
+ // PEI HOB is read only for DXE phase
+ //
+ ASSERT (FALSE);
+}
+
/**
Builds a HOB that describes a chunk of system memory.
Modified: branches/UDK2014.SP1/MdePkg/Library/DxeHobLib/HobLib.c
===================================================================
--- branches/UDK2014.SP1/MdePkg/Library/DxeHobLib/HobLib.c 2015-02-03
00:53:37 UTC (rev 16700)
+++ branches/UDK2014.SP1/MdePkg/Library/DxeHobLib/HobLib.c 2015-02-03
06:39:33 UTC (rev 16701)
@@ -1,7 +1,7 @@
/** @file
HOB Library implemenation for Dxe Phase.
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
which accompanies this distribution. The full text of the license may be
found at
@@ -272,6 +272,38 @@
ASSERT (FALSE);
}
+/**
+ Builds a HOB that describes a chunk of system memory with Owner GUID.
+
+ This function builds a HOB that describes a chunk of system memory.
+ It can only be invoked during PEI phase;
+ for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
+
+ If there is no additional space for HOB creation, then ASSERT().
+
+ @param ResourceType The type of resource described by this HOB.
+ @param ResourceAttribute The resource attributes of the memory described
by this HOB.
+ @param PhysicalStart The 64 bit physical address of memory described
by this HOB.
+ @param NumberOfBytes The length of the memory described by this HOB
in bytes.
+ @param OwnerGUID GUID for the owner of this resource.
+
+**/
+VOID
+EFIAPI
+BuildResourceDescriptorWithOwnerHob (
+ IN EFI_RESOURCE_TYPE ResourceType,
+ IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
+ IN EFI_PHYSICAL_ADDRESS PhysicalStart,
+ IN UINT64 NumberOfBytes,
+ IN EFI_GUID *OwnerGUID
+ )
+{
+ //
+ // PEI HOB is read only for DXE phase
+ //
+ ASSERT (FALSE);
+}
+
/**
Builds a HOB that describes a chunk of system memory.
Modified: branches/UDK2014.SP1/MdePkg/Library/PeiHobLib/HobLib.c
===================================================================
--- branches/UDK2014.SP1/MdePkg/Library/PeiHobLib/HobLib.c 2015-02-03
00:53:37 UTC (rev 16700)
+++ branches/UDK2014.SP1/MdePkg/Library/PeiHobLib/HobLib.c 2015-02-03
06:39:33 UTC (rev 16701)
@@ -300,6 +300,46 @@
Hob->EntryPoint = EntryPoint;
}
+/**
+ Builds a HOB that describes a chunk of system memory with Owner GUID.
+
+ This function builds a HOB that describes a chunk of system memory.
+ It can only be invoked during PEI phase;
+ for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
+
+ If there is no additional space for HOB creation, then ASSERT().
+
+ @param ResourceType The type of resource described by this HOB.
+ @param ResourceAttribute The resource attributes of the memory described
by this HOB.
+ @param PhysicalStart The 64 bit physical address of memory described
by this HOB.
+ @param NumberOfBytes The length of the memory described by this HOB
in bytes.
+ @param OwnerGUID GUID for the owner of this resource.
+
+**/
+VOID
+EFIAPI
+BuildResourceDescriptorWithOwnerHob (
+ IN EFI_RESOURCE_TYPE ResourceType,
+ IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
+ IN EFI_PHYSICAL_ADDRESS PhysicalStart,
+ IN UINT64 NumberOfBytes,
+ IN EFI_GUID *OwnerGUID
+ )
+{
+ EFI_HOB_RESOURCE_DESCRIPTOR *Hob;
+ EFI_STATUS Status;
+
+ Status = PeiServicesCreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, sizeof
(EFI_HOB_RESOURCE_DESCRIPTOR), (void **)&Hob);
+ ASSERT_EFI_ERROR (Status);
+
+ Hob->ResourceType = ResourceType;
+ Hob->ResourceAttribute = ResourceAttribute;
+ Hob->PhysicalStart = PhysicalStart;
+ Hob->ResourceLength = NumberOfBytes;
+
+ CopyGuid (&Hob->Owner, OwnerGUID);
+}
+
/**
Builds a HOB that describes a chunk of system memory.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits