]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c
Removed MdePkg usage of ModuleName: in file headers
[mirror_edk2.git] / MdePkg / Library / UefiBootServicesTableLib / UefiBootServicesTableLib.c
CommitLineData
e386b444 1/** @file\r
2 UEFI Boot Services Table Library.\r
3\r
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
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
9\r
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
12\r
e386b444 13**/\r
14\r
15//\r
c7d265a9 16// The package level header files this module uses\r
e386b444 17//\r
c7d265a9 18#include <PiDxe.h>\r
19//\r
20// The protocols, PPI and GUID defintions for this module\r
21//\r
22//\r
23// The Library classes this module consumes\r
24//\r
25#include <Library/UefiBootServicesTableLib.h>\r
26#include <Library/DebugLib.h>\r
a73480f6 27#include "UefiBootServicesTableLibInternal.h"\r
e386b444 28\r
29EFI_HANDLE gImageHandle = NULL;\r
30EFI_SYSTEM_TABLE *gST = NULL;\r
31EFI_BOOT_SERVICES *gBS = NULL;\r
32\r
33/**\r
34 The constructor function caches the pointer of Boot Services Table.\r
a73480f6 35 \r
e386b444 36 The constructor function caches the pointer of Boot Services Table through System Table.\r
37 It will ASSERT() if the pointer of System Table is NULL.\r
38 It will ASSERT() if the pointer of Boot Services Table is NULL.\r
39 It will always return EFI_SUCCESS.\r
40\r
41 @param ImageHandle The firmware allocated handle for the EFI image.\r
42 @param SystemTable A pointer to the EFI System Table.\r
43\r
44 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
45\r
46**/\r
47EFI_STATUS\r
48EFIAPI\r
49UefiBootServicesTableLibConstructor (\r
50 IN EFI_HANDLE ImageHandle,\r
51 IN EFI_SYSTEM_TABLE *SystemTable\r
52 )\r
53{\r
54 //\r
55 // Cache the Image Handle\r
56 //\r
57 gImageHandle = ImageHandle;\r
58 ASSERT (gImageHandle != NULL);\r
59\r
60 //\r
61 // Cache pointer to the EFI System Table\r
62 //\r
63 gST = SystemTable;\r
64 ASSERT (gST != NULL);\r
65\r
66 //\r
67 // Cache pointer to the EFI Boot Services Table\r
68 //\r
69 gBS = SystemTable->BootServices;\r
70 ASSERT (gBS != NULL);\r
71\r
72 return EFI_SUCCESS;\r
73}\r