]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / UefiBootServicesTableLib / UefiBootServicesTableLib.c
1 /*++
2
3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13 Module Name:
14
15 UefiBootServicesTableLib.c
16
17 Abstract:
18
19 UEFI Boot Services Table Library.
20
21 --*/
22
23 #include "EdkIIGlueUefi.h"
24
25 EFI_HANDLE gImageHandle;
26 EFI_SYSTEM_TABLE *gST;
27 EFI_BOOT_SERVICES *gBS;
28
29 /**
30 The constructor function caches the pointer of Boot Services Table.
31
32 The constructor function caches the pointer of Boot Services Table through System Table.
33 It will ASSERT() if the pointer of System Table is NULL.
34 It will ASSERT() if the pointer of Boot Services Table is NULL.
35 It will always return EFI_SUCCESS.
36
37 @param ImageHandle The firmware allocated handle for the EFI image.
38 @param SystemTable A pointer to the EFI System Table.
39
40 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
41
42 **/
43 EFI_STATUS
44 EFIAPI
45 UefiBootServicesTableLibConstructor (
46 IN EFI_HANDLE ImageHandle,
47 IN EFI_SYSTEM_TABLE *SystemTable
48 )
49 {
50 //
51 // Cache the Image Handle
52 //
53 gImageHandle = ImageHandle;
54
55 //
56 // Cache pointer to the EFI System Table
57 //
58 gST = SystemTable;
59 ASSERT (gST != NULL);
60
61 //
62 // Cache pointer to the EFI Boot Services Table
63 //
64 gBS = SystemTable->BootServices;
65 ASSERT (gBS != NULL);
66
67 return EFI_SUCCESS;
68 }