2 This library retrieve the EFI_BOOT_SERVICES pointer from EFI system table in
5 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #include <Library/UefiBootServicesTableLib.h>
14 #include <Library/DebugLib.h>
16 EFI_HANDLE gImageHandle
= NULL
;
17 EFI_SYSTEM_TABLE
*gST
= NULL
;
18 EFI_BOOT_SERVICES
*gBS
= NULL
;
21 The constructor function caches the pointer of Boot Services Table.
23 The constructor function caches the pointer of Boot Services Table through System Table.
24 It will ASSERT() if the pointer of System Table is NULL.
25 It will ASSERT() if the pointer of Boot Services Table is NULL.
26 It will always return EFI_SUCCESS.
28 @param ImageHandle The firmware allocated handle for the EFI image.
29 @param SystemTable A pointer to the EFI System Table.
31 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
36 UefiBootServicesTableLibConstructor (
37 IN EFI_HANDLE ImageHandle
,
38 IN EFI_SYSTEM_TABLE
*SystemTable
42 // Cache the Image Handle
44 gImageHandle
= ImageHandle
;
45 ASSERT (gImageHandle
!= NULL
);
48 // Cache pointer to the EFI System Table
54 // Cache pointer to the EFI Boot Services Table
56 gBS
= SystemTable
->BootServices
;