]>
Commit | Line | Data |
---|---|---|
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 | |
c892d846 | 15 | \r |
c7d265a9 | 16 | #include <PiDxe.h>\r |
c892d846 | 17 | \r |
18 | \r | |
c7d265a9 | 19 | #include <Library/UefiBootServicesTableLib.h>\r |
20 | #include <Library/DebugLib.h>\r | |
a73480f6 | 21 | #include "UefiBootServicesTableLibInternal.h"\r |
e386b444 | 22 | \r |
23 | EFI_HANDLE gImageHandle = NULL;\r | |
24 | EFI_SYSTEM_TABLE *gST = NULL;\r | |
25 | EFI_BOOT_SERVICES *gBS = NULL;\r | |
26 | \r | |
27 | /**\r | |
28 | The constructor function caches the pointer of Boot Services Table.\r | |
a73480f6 | 29 | \r |
e386b444 | 30 | The constructor function caches the pointer of Boot Services Table through System Table.\r |
31 | It will ASSERT() if the pointer of System Table is NULL.\r | |
32 | It will ASSERT() if the pointer of Boot Services Table is NULL.\r | |
33 | It will always return EFI_SUCCESS.\r | |
34 | \r | |
35 | @param ImageHandle The firmware allocated handle for the EFI image.\r | |
36 | @param SystemTable A pointer to the EFI System Table.\r | |
37 | \r | |
38 | @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r | |
39 | \r | |
40 | **/\r | |
41 | EFI_STATUS\r | |
42 | EFIAPI\r | |
43 | UefiBootServicesTableLibConstructor (\r | |
44 | IN EFI_HANDLE ImageHandle,\r | |
45 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
46 | )\r | |
47 | {\r | |
48 | //\r | |
49 | // Cache the Image Handle\r | |
50 | //\r | |
51 | gImageHandle = ImageHandle;\r | |
52 | ASSERT (gImageHandle != NULL);\r | |
53 | \r | |
54 | //\r | |
55 | // Cache pointer to the EFI System Table\r | |
56 | //\r | |
57 | gST = SystemTable;\r | |
58 | ASSERT (gST != NULL);\r | |
59 | \r | |
60 | //\r | |
61 | // Cache pointer to the EFI Boot Services Table\r | |
62 | //\r | |
63 | gBS = SystemTable->BootServices;\r | |
64 | ASSERT (gBS != NULL);\r | |
65 | \r | |
66 | return EFI_SUCCESS;\r | |
67 | }\r |