]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.c
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / DxeServicesTableLib / DxeServicesTableLib.c
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.c
new file mode 100644 (file)
index 0000000..31591be
--- /dev/null
@@ -0,0 +1,61 @@
+/*++\r
+\r
+Copyright (c) 2004 - 2006, Intel Corporation                                                         \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
+                                                                                          \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
+Module Name:\r
+\r
+  DxeServicesTableLib.c\r
+  \r
+Abstract: \r
+\r
+  Dxe Services Table Lib\r
+\r
+--*/\r
+\r
+#include "EdkIIGlueDxe.h"\r
+\r
+//\r
+// Cache copy of the DXE Services Table\r
+//\r
+EFI_DXE_SERVICES  *gDS      = NULL;\r
+\r
+/**\r
+  The constructor function caches the pointer of DXE Services Table.\r
+\r
+  The constructor function caches the pointer of DXE Services Table.\r
+  It will ASSERT() if that operation fails.\r
+  It will ASSERT() if the pointer of DXE 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
+  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DxeServicesTableLibConstructor (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  //\r
+  // Cache copy of the DXE Services Table\r
+  //\r
+  Status = EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);\r
+  ASSERT_EFI_ERROR (Status);\r
+  ASSERT (gDS != NULL);\r
+\r
+  return Status;\r
+}\r