VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiApplicationEntryPoint/ApplicationEntryPoint.c@ 62180

最後變更 在這個檔案從62180是 58466,由 vboxsync 提交於 9 年 前

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

  • 屬性 svn:eol-style 設為 native
檔案大小: 3.5 KB
 
1/** @file
2 Entry point library instance to a UEFI application.
3
4Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
5This program and the accompanying materials
6are licensed and made available under the terms and conditions of the BSD License
7which accompanies this distribution. The full text of the license may be found at
8http://opensource.org/licenses/bsd-license.php.
9
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13**/
14
15#include <Uefi.h>
16#include <Library/UefiApplicationEntryPoint.h>
17#include <Library/BaseLib.h>
18#include <Library/DebugLib.h>
19#include <Library/UefiBootServicesTableLib.h>
20
21
22/**
23 Entry point to UEFI Application.
24
25 This function is the entry point for a UEFI Application. This function must call
26 ProcessLibraryConstructorList(), ProcessModuleEntryPointList(), and ProcessLibraryDestructorList().
27 The return value from ProcessModuleEntryPointList() is returned.
28 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
29 then return EFI_INCOMPATIBLE_VERSION.
30
31 @param ImageHandle The image handle of the UEFI Application.
32 @param SystemTable A pointer to the EFI System Table.
33
34 @retval EFI_SUCCESS The UEFI Application exited normally.
35 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
36 @retval Other Return value from ProcessModuleEntryPointList().
37
38**/
39EFI_STATUS
40EFIAPI
41_ModuleEntryPoint (
42 IN EFI_HANDLE ImageHandle,
43 IN EFI_SYSTEM_TABLE *SystemTable
44 )
45{
46 EFI_STATUS Status;
47
48 if (_gUefiDriverRevision != 0) {
49 //
50 // Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI spec revision of the application.
51 //
52 if (SystemTable->Hdr.Revision < _gUefiDriverRevision) {
53 return EFI_INCOMPATIBLE_VERSION;
54 }
55 }
56
57 //
58 // Call constructor for all libraries.
59 //
60 ProcessLibraryConstructorList (ImageHandle, SystemTable);
61
62 //
63 // Call the module's entry point
64 //
65 Status = ProcessModuleEntryPointList (ImageHandle, SystemTable);
66
67 //
68 // Process destructor for all libraries.
69 //
70 ProcessLibraryDestructorList (ImageHandle, SystemTable);
71
72 //
73 // Return the return status code from the driver entry point
74 //
75 return Status;
76}
77
78
79/**
80 Invokes the library destructors for all dependent libraries and terminates
81 the UEFI Application.
82
83 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
84 with a status specified by Status.
85
86 @param Status Status returned by the application that is exiting.
87
88**/
89VOID
90EFIAPI
91Exit (
92 IN EFI_STATUS Status
93 )
94
95{
96 ProcessLibraryDestructorList (gImageHandle, gST);
97
98 gBS->Exit (gImageHandle, Status, 0, NULL);
99}
100
101
102/**
103 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
104
105 @param ImageHandle The image handle of the UEFI Application.
106 @param SystemTable A pointer to the EFI System Table.
107
108 @retval EFI_SUCCESS The UEFI Application exited normally.
109 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
110 @retval Other Return value from ProcessModuleEntryPointList().
111
112**/
113EFI_STATUS
114EFIAPI
115EfiMain (
116 IN EFI_HANDLE ImageHandle,
117 IN EFI_SYSTEM_TABLE *SystemTable
118 )
119{
120 return _ModuleEntryPoint (ImageHandle, SystemTable);
121}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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