]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/BdsLib: Exposed ShutdownUefiBootServices() in the BdsLib interface
authorOlivier Martin <olivier.martin@arm.com>
Tue, 5 May 2015 14:58:57 +0000 (14:58 +0000)
committeroliviermartin <oliviermartin@Edk2>
Tue, 5 May 2015 14:58:57 +0000 (14:58 +0000)
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

ArmPkg/Include/Library/BdsLib.h
ArmPkg/Library/BdsLib/BdsInternal.h
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf
ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf
ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c

index 68dbfd57f2154149ef1bb7d5c99c721ad44da11b..eb7f8f293fb1ffb4edc2aad57a409d4457bf789f 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2013, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2013-2015, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -221,4 +221,12 @@ BdsLoadImage (
   OUT    UINTN                 *FileSize\r
   );\r
 \r
+/**\r
+ * Call BS.ExitBootServices with the appropriate Memory Map information\r
+ */\r
+EFI_STATUS\r
+ShutdownUefiBootServices (\r
+  VOID\r
+  );\r
+\r
 #endif\r
index a29d8ccd8b12f8f435f6a11eda18b4848a548a92..1fab2aed4ae7a6fcc11b52ee50f17ba316f43f48 100644 (file)
@@ -103,11 +103,6 @@ typedef struct {
 } BDS_TFTP_CONTEXT;\r
 \r
 // BdsHelper.c\r
-EFI_STATUS\r
-ShutdownUefiBootServices (\r
-  VOID\r
-  );\r
-\r
 EFI_STATUS\r
 GetSystemMemoryResources (\r
   LIST_ENTRY *ResourceList\r
index 01d9f5002b40dfdf1da937795de8bc39ff32e21b..da14fc2b15f4f0b2cb852da54ab010df6d6f9ec0 100644 (file)
@@ -44,6 +44,7 @@
   ArmLib\r
   ArmPlatformLib\r
   BaseMemoryLib\r
+  DxeServicesTableLib\r
   MemoryAllocationLib\r
   UefiDriverEntryPoint\r
   UefiBootServicesTableLib\r
index 952d624b459e7be9996462d4c1967c04d90a5fe9..1a007627ad3f277b12f717b7d862c69844997633 100644 (file)
@@ -32,6 +32,7 @@
 \r
 [LibraryClasses]\r
   ArmShellCmdRunAxfLib\r
+  DxeServicesTableLib\r
   MemoryAllocationLib\r
   UefiDriverEntryPoint\r
 \r
index 7d15f6934608e3461b79a3bb82d43be69c1026e5..9a34f666612a6c8a0cf14011ae21453fe58bff4e 100644 (file)
@@ -43,6 +43,7 @@
 [LibraryClasses]\r
   ArmLib\r
   BaseLib\r
+  BdsLib\r
   DebugLib\r
   HiiLib\r
   ShellLib\r
index e8576afa75564159bc76d3f1f7476358f13944d8..2abfb6cc1053ad1bbc87e8f5200f00422b6617a3 100644 (file)
 **/\r
 \r
 #include <Guid/GlobalVariable.h>\r
+\r
 #include <Library/PrintLib.h>\r
 #include <Library/HandleParsingLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
+#include <Library/BdsLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/DebugLib.h>\r
 \r
@@ -34,64 +36,6 @@ typedef VOID (*ELF_ENTRYPOINT)(UINTN arg0, UINTN arg1,
                                UINTN arg2, UINTN arg3);\r
 \r
 \r
-STATIC\r
-EFI_STATUS\r
-ShutdownUefiBootServices (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-  UINTN                   MemoryMapSize;\r
-  EFI_MEMORY_DESCRIPTOR   *MemoryMap;\r
-  UINTN                   MapKey;\r
-  UINTN                   DescriptorSize;\r
-  UINT32                  DescriptorVersion;\r
-  UINTN                   Pages;\r
-\r
-  MemoryMap = NULL;\r
-  MemoryMapSize = 0;\r
-  Pages = 0;\r
-\r
-  do {\r
-    Status = gBS->GetMemoryMap (\r
-                    &MemoryMapSize,\r
-                    MemoryMap,\r
-                    &MapKey,\r
-                    &DescriptorSize,\r
-                    &DescriptorVersion\r
-                    );\r
-    if (Status == EFI_BUFFER_TOO_SMALL) {\r
-\r
-      Pages = EFI_SIZE_TO_PAGES (MemoryMapSize) + 1;\r
-      MemoryMap = AllocatePages (Pages);\r
-\r
-      //\r
-      // Get System MemoryMap\r
-      //\r
-      Status = gBS->GetMemoryMap (\r
-                      &MemoryMapSize,\r
-                      MemoryMap,\r
-                      &MapKey,\r
-                      &DescriptorSize,\r
-                      &DescriptorVersion\r
-                      );\r
-    }\r
-\r
-    // Don't do anything between the GetMemoryMap() and ExitBootServices()\r
-    if (!EFI_ERROR (Status)) {\r
-      Status = gBS->ExitBootServices (gImageHandle, MapKey);\r
-      if (EFI_ERROR (Status)) {\r
-        FreePages (MemoryMap, Pages);\r
-        MemoryMap = NULL;\r
-        MemoryMapSize = 0;\r
-      }\r
-    }\r
-  } while (EFI_ERROR (Status));\r
-\r
-  return Status;\r
-}\r
-\r
-\r
 STATIC\r
 EFI_STATUS\r
 PreparePlatformHardware (\r