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