VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c

最後變更 在這個檔案是 99404,由 vboxsync 提交於 2 年 前

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, 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#include <Uefi.h>
11
12#include <Library/UefiBootServicesTableLib.h>
13#include <Library/DebugLib.h>
14
15EFI_HANDLE gImageHandle = NULL;
16EFI_SYSTEM_TABLE *gST = NULL;
17EFI_BOOT_SERVICES *gBS = NULL;
18
19/**
20 The constructor function caches the pointer of Boot Services Table.
21
22 The constructor function caches the pointer of Boot Services Table through System Table.
23 It will ASSERT() if the pointer of System Table is NULL.
24 It will ASSERT() if the pointer of Boot Services Table is NULL.
25 It will always return EFI_SUCCESS.
26
27 @param ImageHandle The firmware allocated handle for the EFI image.
28 @param SystemTable A pointer to the EFI System Table.
29
30 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
31
32**/
33EFI_STATUS
34EFIAPI
35UefiBootServicesTableLibConstructor (
36 IN EFI_HANDLE ImageHandle,
37 IN EFI_SYSTEM_TABLE *SystemTable
38 )
39{
40 //
41 // Cache the Image Handle
42 //
43 gImageHandle = ImageHandle;
44 ASSERT (gImageHandle != NULL);
45
46 //
47 // Cache pointer to the EFI System Table
48 //
49 gST = SystemTable;
50 ASSERT (gST != NULL);
51
52 //
53 // Cache pointer to the EFI Boot Services Table
54 //
55 gBS = SystemTable->BootServices;
56 ASSERT (gBS != NULL);
57
58 return EFI_SUCCESS;
59}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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