]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c
4c0c74556679527c55f76ea72519da0cbc31d0fa
[mirror_edk2.git] / MdePkg / Library / UefiRuntimeServicesTableLib / UefiRuntimeServicesTableLib.c
1 /** @file
2 UEFI Runtime Services Table Library.
3
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 //
16 // The package level header files this module uses
17 //
18 #include <PiDxe.h>
19 //
20 // The protocols, PPI and GUID defintions for this module
21 //
22 //
23 // The Library classes this module consumes
24 //
25 #include <Library/UefiRuntimeServicesTableLib.h>
26 #include <Library/DebugLib.h>
27
28 #include "UefiRuntimeServicesTableLibInternal.h"
29
30 EFI_RUNTIME_SERVICES *gRT = NULL;
31
32 /**
33 The constructor function caches the pointer of Runtime Services Table.
34
35 The constructor function caches the pointer of Runtime Services Table.
36 It will ASSERT() if the pointer of Runtime Services Table is NULL.
37 It will always return EFI_SUCCESS.
38
39 @param ImageHandle The firmware allocated handle for the EFI image.
40 @param SystemTable A pointer to the EFI System Table.
41
42 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
43
44 **/
45 EFI_STATUS
46 EFIAPI
47 UefiRuntimeServicesTableLibConstructor (
48 IN EFI_HANDLE ImageHandle,
49 IN EFI_SYSTEM_TABLE *SystemTable
50 )
51 {
52 //
53 // Cache pointer to the EFI Runtime Services Table
54 //
55 gRT = SystemTable->RuntimeServices;
56 ASSERT (gRT != NULL);
57 return EFI_SUCCESS;
58 }