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