diff options
author | Olivier Martin <olivier.martin@arm.com> | 2015-05-05 14:58:57 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@Edk2> | 2015-05-05 14:58:57 +0000 |
commit | cc053ee6daf81059f313a9591274c239b6e4c7cd (patch) | |
tree | 67f29b9cbbd45d6c9fa88a98a3e45a86366d065b /ArmPlatformPkg | |
parent | b330087bab35a402d63a1c43dcf1f6b3de24b2df (diff) | |
download | edk2-cc053ee6daf81059f313a9591274c239b6e4c7cd.zip edk2-cc053ee6daf81059f313a9591274c239b6e4c7cd.tar.gz edk2-cc053ee6daf81059f313a9591274c239b6e4c7cd.tar.bz2 |
ArmPkg/BdsLib: Exposed ShutdownUefiBootServices() in the BdsLib interface
Other libraries/modules could use it (eg: EFI Shell command `runaxf`).
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Ronald Cron <Ronald.Cron@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17297 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg')
4 files changed, 5 insertions, 58 deletions
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf index 01d9f50..da14fc2 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf @@ -44,6 +44,7 @@ ArmLib
ArmPlatformLib
BaseMemoryLib
+ DxeServicesTableLib
MemoryAllocationLib
UefiDriverEntryPoint
UefiBootServicesTableLib
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf index 952d624..1a00762 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf @@ -32,6 +32,7 @@ [LibraryClasses]
ArmShellCmdRunAxfLib
+ DxeServicesTableLib
MemoryAllocationLib
UefiDriverEntryPoint
diff --git a/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf b/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf index 7d15f69..9a34f66 100644 --- a/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf +++ b/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf @@ -43,6 +43,7 @@ [LibraryClasses]
ArmLib
BaseLib
+ BdsLib
DebugLib
HiiLib
ShellLib
diff --git a/ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c b/ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c index e8576af..2abfb6c 100644 --- a/ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c +++ b/ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c @@ -15,11 +15,13 @@ **/
#include <Guid/GlobalVariable.h>
+
#include <Library/PrintLib.h>
#include <Library/HandleParsingLib.h>
#include <Library/DevicePathLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
+#include <Library/BdsLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
@@ -36,64 +38,6 @@ typedef VOID (*ELF_ENTRYPOINT)(UINTN arg0, UINTN arg1, STATIC
EFI_STATUS
-ShutdownUefiBootServices (
- VOID
- )
-{
- EFI_STATUS Status;
- UINTN MemoryMapSize;
- EFI_MEMORY_DESCRIPTOR *MemoryMap;
- UINTN MapKey;
- UINTN DescriptorSize;
- UINT32 DescriptorVersion;
- UINTN Pages;
-
- MemoryMap = NULL;
- MemoryMapSize = 0;
- Pages = 0;
-
- do {
- Status = gBS->GetMemoryMap (
- &MemoryMapSize,
- MemoryMap,
- &MapKey,
- &DescriptorSize,
- &DescriptorVersion
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
-
- Pages = EFI_SIZE_TO_PAGES (MemoryMapSize) + 1;
- MemoryMap = AllocatePages (Pages);
-
- //
- // Get System MemoryMap
- //
- Status = gBS->GetMemoryMap (
- &MemoryMapSize,
- MemoryMap,
- &MapKey,
- &DescriptorSize,
- &DescriptorVersion
- );
- }
-
- // Don't do anything between the GetMemoryMap() and ExitBootServices()
- if (!EFI_ERROR (Status)) {
- Status = gBS->ExitBootServices (gImageHandle, MapKey);
- if (EFI_ERROR (Status)) {
- FreePages (MemoryMap, Pages);
- MemoryMap = NULL;
- MemoryMapSize = 0;
- }
- }
- } while (EFI_ERROR (Status));
-
- return Status;
-}
-
-
-STATIC
-EFI_STATUS
PreparePlatformHardware (
VOID
)
|