VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c@ 80721

最後變更 在這個檔案從80721是 80721,由 vboxsync 提交於 6 年 前

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.4 KB
 
1/** @file
2 This library retrieve the EFI_BOOT_SERVICES pointer from EFI system table in
3 library's constructor.
4
5 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10
11#include <Uefi.h>
12
13#include <Library/UefiBootServicesTableLib.h>
14#include <Library/DebugLib.h>
15
16EFI_HANDLE gImageHandle = NULL;
17EFI_SYSTEM_TABLE *gST = NULL;
18EFI_BOOT_SERVICES *gBS = NULL;
19
20/**
21 The constructor function caches the pointer of Boot Services Table.
22
23 The constructor function caches the pointer of Boot Services Table through System Table.
24 It will ASSERT() if the pointer of System Table is NULL.
25 It will ASSERT() if the pointer of Boot Services Table is NULL.
26 It will always return EFI_SUCCESS.
27
28 @param ImageHandle The firmware allocated handle for the EFI image.
29 @param SystemTable A pointer to the EFI System Table.
30
31 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
32
33**/
34EFI_STATUS
35EFIAPI
36UefiBootServicesTableLibConstructor (
37 IN EFI_HANDLE ImageHandle,
38 IN EFI_SYSTEM_TABLE *SystemTable
39 )
40{
41 //
42 // Cache the Image Handle
43 //
44 gImageHandle = ImageHandle;
45 ASSERT (gImageHandle != NULL);
46
47 //
48 // Cache pointer to the EFI System Table
49 //
50 gST = SystemTable;
51 ASSERT (gST != NULL);
52
53 //
54 // Cache pointer to the EFI Boot Services Table
55 //
56 gBS = SystemTable->BootServices;
57 ASSERT (gBS != NULL);
58
59 return EFI_SUCCESS;
60}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette