]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c
afaa913c8c229e64bf22500efedb69c3c4c2a9c3
[mirror_edk2.git] / MdePkg / Library / DxeServicesTableLib / DxeServicesTableLib.c
1 /** @file
2 DXE Library.
3
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: DxeServicesTableLib.c
14
15 **/
16
17 #include <PiDxe.h>
18 #include <Guid/DxeServices.h>
19 #include <Library/DxeServicesTableLib.h>
20 #include <Library/DebugLib.h>
21 #include <Library/UefiLib.h>
22
23 #include "DxeServicesTableLibInternal.h"
24
25 //
26 // Cache copy of the DXE Services Table
27 //
28 EFI_DXE_SERVICES *gDS = NULL;
29
30 /**
31 The constructor function caches the pointer of DXE Services Table.
32
33 The constructor function caches the pointer of DXE Services Table.
34 It will ASSERT() if that operation fails.
35 It will ASSERT() if the pointer of DXE Services Table is NULL.
36 It will always return EFI_SUCCESS.
37
38 @param ImageHandle The firmware allocated handle for the EFI image.
39 @param SystemTable A pointer to the EFI System Table.
40
41 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
42
43 **/
44 EFI_STATUS
45 EFIAPI
46 DxeServicesTableLibConstructor (
47 IN EFI_HANDLE ImageHandle,
48 IN EFI_SYSTEM_TABLE *SystemTable
49 )
50 {
51 EFI_STATUS Status;
52
53 //
54 // Cache copy of the DXE Services Table
55 //
56 Status = EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
57 ASSERT_EFI_ERROR (Status);
58 ASSERT (gDS != NULL);
59
60 return Status;
61 }