]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | UEFI Runtime Services Table Library.\r | |
3 | \r | |
4 | This library instance retrieve EFI_RUNTIME_SERVICES pointer from EFI system table\r | |
5 | in library's constructor.\r | |
6 | \r | |
7 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r | |
8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
9 | \r | |
10 | **/\r | |
11 | \r | |
12 | #include <Uefi.h>\r | |
13 | #include <Library/DebugLib.h>\r | |
14 | \r | |
15 | EFI_RUNTIME_SERVICES *gRT = NULL;\r | |
16 | \r | |
17 | /**\r | |
18 | The constructor function caches the pointer of Runtime Services Table.\r | |
19 | \r | |
20 | The constructor function caches the pointer of Runtime Services Table.\r | |
21 | It will ASSERT() if the pointer of Runtime Services Table is NULL.\r | |
22 | It will always return EFI_SUCCESS.\r | |
23 | \r | |
24 | @param ImageHandle The firmware allocated handle for the EFI image.\r | |
25 | @param SystemTable A pointer to the EFI System Table.\r | |
26 | \r | |
27 | @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r | |
28 | \r | |
29 | **/\r | |
30 | EFI_STATUS\r | |
31 | EFIAPI\r | |
32 | UefiRuntimeServicesTableLibConstructor (\r | |
33 | IN EFI_HANDLE ImageHandle,\r | |
34 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
35 | )\r | |
36 | {\r | |
37 | //\r | |
38 | // Cache pointer to the EFI Runtime Services Table\r | |
39 | //\r | |
40 | gRT = SystemTable->RuntimeServices;\r | |
41 | ASSERT (gRT != NULL);\r | |
42 | return EFI_SUCCESS;\r | |
43 | }\r |