]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c
ArmPkg,ArmPlatformPkg: Allow dynamic PCDs for memory base and size
[mirror_edk2.git] / MdePkg / Library / UefiBootServicesTableLib / UefiBootServicesTableLib.c
index b45d12debfa0cf0edb189c81d8e64e49a2740ef7..750a26800101a4d4b1aea07361733d562ab22782 100644 (file)
@@ -1,38 +1,44 @@
 /** @file\r
-  UEFI Boot Services Table Library.\r
+  This library retrieve the EFI_BOOT_SERVICES pointer from EFI system table in \r
+  library's constructor.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials                          \r
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
+  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php.\r
 \r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-  Module Name:  UefiBootServicesTableLib.c\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
 \r
-EFI_HANDLE         gImageHandle;\r
-EFI_SYSTEM_TABLE   *gST;\r
-EFI_BOOT_SERVICES  *gBS;\r
+\r
+#include <Uefi.h>\r
+\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+EFI_HANDLE         gImageHandle = NULL;\r
+EFI_SYSTEM_TABLE   *gST         = NULL;\r
+EFI_BOOT_SERVICES  *gBS         = NULL;\r
 \r
 /**\r
   The constructor function caches the pointer of Boot Services Table.\r
-  \r
-  The constructor function caches the pointer of Boot Services Table through System Table. \r
+    \r
+  The constructor function caches the pointer of Boot Services Table through System Table.\r
   It will ASSERT() if the pointer of System Table is NULL.\r
   It will ASSERT() if the pointer of Boot Services Table is NULL.\r
   It will always return EFI_SUCCESS.\r
 \r
   @param  ImageHandle   The firmware allocated handle for the EFI image.\r
   @param  SystemTable   A pointer to the EFI System Table.\r
-  \r
+\r
   @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.\r
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UefiBootServicesTableLibConstructor (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
@@ -42,6 +48,7 @@ UefiBootServicesTableLibConstructor (
   // Cache the Image Handle\r
   //\r
   gImageHandle = ImageHandle;\r
+  ASSERT (gImageHandle != NULL);\r
 \r
   //\r
   // Cache pointer to the EFI System Table\r