]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1) Clarify file and function header comments for the PE/COFF Extra Action library...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 9 May 2009 00:45:25 +0000 (00:45 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 9 May 2009 00:45:25 +0000 (00:45 +0000)
2) Update the file and function header comments in the BasePeCoffExtraActionLibNull
3) Add ASSERT() statements to APIs in BasePeCoffExtraActionLibNull is ImageContext is NULL.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8272 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Library/PeCoffExtraActionLib.h
MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
MdePkg/Library/BasePeCoffExtraActionLibNull/PeCoffExtraActionLib.c

index c12c18ebf5fa4bc0f7c3d77982e875971303b575..391c1a66fe8bc39e1fd240cef1bae0f3c5c0ad88 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
-  Provides services to perform additional actions to relocate and unload\r
-  PE/Coff image for some environment specific purpose say for souce level debug.\r
+  Provides services to perform additional actions when a PE/COFF image is loaded\r
+  or unloaded.  This is useful for environment where symbols need to be loaded \r
+  and unloaded to support source level debugging.\r
 \r
   Copyright (c) 2009, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials\r
 \r
 #ifndef __PE_COFF_EXTRA_ACTION_LIB_H__\r
 #define __PE_COFF_EXTRA_ACTION_LIB_H__\r
+\r
 #include <Library/PeCoffLib.h>\r
+\r
 /**\r
-  Applies additional actions to relocate fixups to a PE/COFF image.\r
+  Performs additional actions after a PE/COFF image has been loaded and relocated.\r
 \r
-  Generally this function is called after sucessfully Applying relocation fixups \r
-  to a PE/COFF image for some specicial purpose. \r
-  As a example, For NT32 emulator, the function should be implemented and called\r
-  to support source level debug.  \r
-  \r
-  @param  ImageContext        Pointer to the image context structure that describes the PE/COFF\r
-                              image that is being relocated.\r
+  If ImageContext is NULL, then ASSERT().\r
+\r
+  @param  ImageContext  Pointer to the image context structure that describes the\r
+                        PE/COFF image that has already been loaded and relocated.\r
 \r
 **/\r
 VOID\r
@@ -35,17 +35,13 @@ PeCoffLoaderRelocateImageExtraAction (
   );\r
 \r
 /**\r
-  Unloads a loaded PE/COFF image from memory and releases its taken resource.\r
-  \r
-  Releases any environment specific resources that were allocated when the image \r
-  specified by ImageContext was loaded using PeCoffLoaderLoadImage(). \r
-  For NT32 emulator, the PE/COFF image loaded by system needs to release.\r
-  For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded, \r
+  Performs additional actions just before a PE/COFF image is unloaded.  Any resources\r
+  that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
   \r
   If ImageContext is NULL, then ASSERT().\r
   \r
-  @param  ImageContext              Pointer to the image context structure that describes the PE/COFF\r
-                                    image to be unloaded.\r
+  @param  ImageContext  Pointer to the image context structure that describes the\r
+                        PE/COFF image that is being unloaded.\r
 \r
 **/\r
 VOID\r
@@ -53,4 +49,5 @@ EFIAPI
 PeCoffLoaderUnloadImageExtraAction (\r
   IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
   );\r
+\r
 #endif\r
index 50b5bb37be8dc4b3a2f20725f20dc444a474dcb9..de951da269920b8b72f834b87c83b5569b63b0ab 100644 (file)
 [Sources.common]\r
   PeCoffExtraActionLib.c\r
 \r
-\r
 [Packages]\r
   MdePkg/MdePkg.dec\r
 \r
+[LibraryClasses.common]\r
+  DebugLib\r
+\r
+\r
index 47bb0db89187b27711dcaefbf3a37546c9d5c64e..6f5200361d1422bdd410ca222f49ac1beb710dd8 100644 (file)
 \r
 #include <Base.h>\r
 #include <Library/PeCoffExtraActionLib.h>\r
+#include <Library/DebugLib.h>\r
 \r
 /**\r
-  Applies additional actions to relocate fixups to a PE/COFF image.\r
+  Performs additional actions after a PE/COFF image has been loaded and relocated.\r
 \r
-  Generally this function is called after sucessfully Applying relocation fixups \r
-  to a PE/COFF image for some specicial purpose. \r
-  As a example, For NT32 emulator, the function should be implemented and called\r
-  to support source level debug.  \r
-  \r
-  @param  ImageContext        Pointer to the image context structure that describes the PE/COFF\r
-                              image that is being relocated.\r
+  If ImageContext is NULL, then ASSERT().\r
+\r
+  @param  ImageContext  Pointer to the image context structure that describes the\r
+                        PE/COFF image that has already been loaded and relocated.\r
 \r
 **/\r
 VOID\r
@@ -33,20 +31,17 @@ PeCoffLoaderRelocateImageExtraAction (
   IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
   )\r
 {\r
+  ASSERT (ImageContext != NULL);\r
 }  \r
 \r
 /**\r
-  Unloads a loaded PE/COFF image from memory and releases its taken resource.\r
-  \r
-  Releases any environment specific resources that were allocated when the image \r
-  specified by ImageContext was loaded using PeCoffLoaderLoadImage(). \r
-  For NT32 emulator, the PE/COFF image loaded by system needs to release.\r
-  For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded, \r
+  Performs additional actions just before a PE/COFF image is unloaded.  Any resources\r
+  that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
   \r
   If ImageContext is NULL, then ASSERT().\r
   \r
-  @param  ImageContext              Pointer to the image context structure that describes the PE/COFF\r
-                                    image to be unloaded.\r
+  @param  ImageContext  Pointer to the image context structure that describes the\r
+                        PE/COFF image that is being unloaded.\r
 \r
 **/\r
 VOID\r
@@ -55,4 +50,5 @@ PeCoffLoaderUnloadImageExtraAction (
   IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
   )\r
 {\r
+  ASSERT (ImageContext != NULL);\r
 }\r