summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-09 00:45:25 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-09 00:45:25 +0000
commit727fb9b1d3a076f4ecd46dab97ec64a114ac89ab (patch)
tree1ce6a8310c442f7f23d0cb3bdde3d974d2678ac0 /MdePkg
parentb9c8d8bd154e42963d16ff4e821fb8ac6b5c4f69 (diff)
downloadedk2-727fb9b1d3a076f4ecd46dab97ec64a114ac89ab.zip
edk2-727fb9b1d3a076f4ecd46dab97ec64a114ac89ab.tar.gz
edk2-727fb9b1d3a076f4ecd46dab97ec64a114ac89ab.tar.bz2
1) Clarify file and function header comments for the PE/COFF Extra Action library class
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
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Library/PeCoffExtraActionLib.h33
-rw-r--r--MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf5
-rw-r--r--MdePkg/Library/BasePeCoffExtraActionLibNull/PeCoffExtraActionLib.c28
3 files changed, 31 insertions, 35 deletions
diff --git a/MdePkg/Include/Library/PeCoffExtraActionLib.h b/MdePkg/Include/Library/PeCoffExtraActionLib.h
index c12c18e..391c1a6 100644
--- a/MdePkg/Include/Library/PeCoffExtraActionLib.h
+++ b/MdePkg/Include/Library/PeCoffExtraActionLib.h
@@ -1,6 +1,7 @@
/** @file
- Provides services to perform additional actions to relocate and unload
- PE/Coff image for some environment specific purpose say for souce level debug.
+ Provides services to perform additional actions when a PE/COFF image is loaded
+ or unloaded. This is useful for environment where symbols need to be loaded
+ and unloaded to support source level debugging.
Copyright (c) 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
@@ -15,17 +16,16 @@
#ifndef __PE_COFF_EXTRA_ACTION_LIB_H__
#define __PE_COFF_EXTRA_ACTION_LIB_H__
+
#include <Library/PeCoffLib.h>
+
/**
- Applies additional actions to relocate fixups to a PE/COFF image.
+ Performs additional actions after a PE/COFF image has been loaded and relocated.
- Generally this function is called after sucessfully Applying relocation fixups
- to a PE/COFF image for some specicial purpose.
- As a example, For NT32 emulator, the function should be implemented and called
- to support source level debug.
-
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image that is being relocated.
+ If ImageContext is NULL, then ASSERT().
+
+ @param ImageContext Pointer to the image context structure that describes the
+ PE/COFF image that has already been loaded and relocated.
**/
VOID
@@ -35,17 +35,13 @@ PeCoffLoaderRelocateImageExtraAction (
);
/**
- Unloads a loaded PE/COFF image from memory and releases its taken resource.
-
- Releases any environment specific resources that were allocated when the image
- specified by ImageContext was loaded using PeCoffLoaderLoadImage().
- For NT32 emulator, the PE/COFF image loaded by system needs to release.
- For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded,
+ Performs additional actions just before a PE/COFF image is unloaded. Any resources
+ that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.
If ImageContext is NULL, then ASSERT().
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image to be unloaded.
+ @param ImageContext Pointer to the image context structure that describes the
+ PE/COFF image that is being unloaded.
**/
VOID
@@ -53,4 +49,5 @@ EFIAPI
PeCoffLoaderUnloadImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
);
+
#endif
diff --git a/MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf b/MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
index 50b5bb3..de951da 100644
--- a/MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
+++ b/MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
@@ -29,7 +29,10 @@
[Sources.common]
PeCoffExtraActionLib.c
-
[Packages]
MdePkg/MdePkg.dec
+[LibraryClasses.common]
+ DebugLib
+
+
diff --git a/MdePkg/Library/BasePeCoffExtraActionLibNull/PeCoffExtraActionLib.c b/MdePkg/Library/BasePeCoffExtraActionLibNull/PeCoffExtraActionLib.c
index 47bb0db..6f52003 100644
--- a/MdePkg/Library/BasePeCoffExtraActionLibNull/PeCoffExtraActionLib.c
+++ b/MdePkg/Library/BasePeCoffExtraActionLibNull/PeCoffExtraActionLib.c
@@ -14,17 +14,15 @@
#include <Base.h>
#include <Library/PeCoffExtraActionLib.h>
+#include <Library/DebugLib.h>
/**
- Applies additional actions to relocate fixups to a PE/COFF image.
+ Performs additional actions after a PE/COFF image has been loaded and relocated.
- Generally this function is called after sucessfully Applying relocation fixups
- to a PE/COFF image for some specicial purpose.
- As a example, For NT32 emulator, the function should be implemented and called
- to support source level debug.
-
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image that is being relocated.
+ If ImageContext is NULL, then ASSERT().
+
+ @param ImageContext Pointer to the image context structure that describes the
+ PE/COFF image that has already been loaded and relocated.
**/
VOID
@@ -33,20 +31,17 @@ PeCoffLoaderRelocateImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
+ ASSERT (ImageContext != NULL);
}
/**
- Unloads a loaded PE/COFF image from memory and releases its taken resource.
-
- Releases any environment specific resources that were allocated when the image
- specified by ImageContext was loaded using PeCoffLoaderLoadImage().
- For NT32 emulator, the PE/COFF image loaded by system needs to release.
- For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded,
+ Performs additional actions just before a PE/COFF image is unloaded. Any resources
+ that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.
If ImageContext is NULL, then ASSERT().
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image to be unloaded.
+ @param ImageContext Pointer to the image context structure that describes the
+ PE/COFF image that is being unloaded.
**/
VOID
@@ -55,4 +50,5 @@ PeCoffLoaderUnloadImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
+ ASSERT (ImageContext != NULL);
}