summaryrefslogtreecommitdiff
path: root/MdePkg/Include
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-09 08:17:21 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-09 08:17:21 +0000
commitb244c7dc74ba82c687aa0bb67b52943ed951208e (patch)
tree4abaf8f3afd51e44f9c1f0be93bb9323c832ba99 /MdePkg/Include
parentfe64f4ffd6dba2d37f5adf77969ef8ef4a2bb220 (diff)
downloadedk2-b244c7dc74ba82c687aa0bb67b52943ed951208e.zip
edk2-b244c7dc74ba82c687aa0bb67b52943ed951208e.tar.gz
edk2-b244c7dc74ba82c687aa0bb67b52943ed951208e.tar.bz2
Add in UefiApplicationEntryPoint library class and library instance.
The major difference between UefiApplicationEntryPoint and UefiDriverEntryPoint is that: 1) UEFI application will always be unloaded no matter what is the return status code from the application. Therefore, the library destructors should be called always. 2) UEFI application should not register any callback to evevnt such as EFI_EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE and EFI_EVENT_GROUP_EXIT_BOOT_SERVICES. 3) UEFI application does not support module merger like Uefi Driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2199 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include')
-rw-r--r--MdePkg/Include/Library/UefiApplicationEntryPoint.h129
1 files changed, 129 insertions, 0 deletions
diff --git a/MdePkg/Include/Library/UefiApplicationEntryPoint.h b/MdePkg/Include/Library/UefiApplicationEntryPoint.h
new file mode 100644
index 0000000..ff8b5b2
--- /dev/null
+++ b/MdePkg/Include/Library/UefiApplicationEntryPoint.h
@@ -0,0 +1,129 @@
+/** @file
+ Entry point to a UEFI Application.
+
+Copyright (c) 2007, Intel Corporation<BR>
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __UEFI_APPLICATION_ENTRY_POINT_H__
+#define __UEFI_APPLICATION_ENTRY_POINT_H__
+
+//
+// Declare the EFI/UEFI Specification Revision to which this driver is implemented
+//
+extern const UINT32 _gUefiDriverRevision;
+
+/**
+ Enrty point to UEFI Application.
+
+ @param ImageHandle ImageHandle of the loaded driver.
+ @param SystemTable Pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS One or more of the drivers returned a success code.
+ @retval !EFI_SUCESS The return status from the last driver entry point in the list.
+
+**/
+EFI_STATUS
+EFIAPI
+_ModuleEntryPoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
+
+/**
+ Enrty point wrapper of UEFI Application.
+
+ @param ImageHandle ImageHandle of the loaded driver.
+ @param SystemTable Pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS One or more of the drivers returned a success code.
+ @retval !EFI_SUCESS The return status from the last driver entry point in the list.
+
+**/
+EFI_STATUS
+EFIAPI
+EfiMain (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
+
+/**
+ Invoke the destuctors of all libraries and call gBS->Exit
+ to return control to firmware core.
+
+ @param Status Status returned by the application that is exiting.
+
+ @retval VOID
+
+**/
+VOID
+EFIAPI
+Exit (
+ IN EFI_STATUS Status
+ );
+
+
+/**
+ Call constructors for all libraries. Autogen tool inserts the implementation
+ of this function into Autogen.c.
+
+ @param ImageHandle ImageHandle of the loaded driver.
+ @param SystemTable Pointer to the EFI System Table.
+
+ @retval VOID
+
+**/
+VOID
+EFIAPI
+ProcessLibraryConstructorList (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
+
+/**
+ Call destructors for all libraries. Autogen tool inserts the implementation
+ of this function into Autogen.c.
+
+ @param ImageHandle ImageHandle of the loaded driver.
+ @param SystemTable Pointer to the EFI System Table.
+
+ @retval VOID
+**/
+VOID
+EFIAPI
+ProcessLibraryDestructorList (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
+/**
+ Call driver entry point. For UEFI application, user
+ can only specify one entry point. Tool will automatically insert
+ this to Autogen.c.
+
+ @param ImageHandle ImageHandle of the loaded driver.
+ @param SystemTable Pointer to the EFI System Table.
+
+ @return Status returned by entry points specified by
+ the user.
+
+**/
+
+EFI_STATUS
+EFIAPI
+ProcessModuleEntryPointList (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
+#endif