edkiigluedxedriverentrypoint.c

来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· C语言 代码 · 共 430 行 · 第 1/2 页

C
430
字号
/*++

Copyright (c) 2004 - 2006, Intel Corporation                                                         
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.  


Module Name:

  EdkIIGlueDxeDriverEntryPoint.c
  
Abstract: 

  DXE Driver entry point template file

--*/

#include "EdkIIGlueDxe.h"
#include "Common/EdkIIGlueDependencies.h"


//
// Driver Model related definitions.
// LIMITATION: only support one instance of Driver Model protocols per driver.
// In case where multiple Driver Model protocols need to be installed in a single driver,
// manually edit this file and compile/link the modified file with the driver.
//

#ifdef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__
extern EFI_DRIVER_BINDING_PROTOCOL __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__;
#endif

#ifdef __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__
extern EFI_COMPONENT_NAME_PROTOCOL __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__;
#endif

#ifdef __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__
extern EFI_DRIVER_CONFIGURATION_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__;
#endif

#ifdef __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__
extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__;
#endif

GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST  _gDriverModelProtocolList[] = {
 {
#ifdef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__
  &__EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__,
#else
  NULL,
#endif

#ifdef __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__
  &__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__,
#else
  NULL,
#endif

#ifdef __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__
  &__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__,
#else
  NULL,
#endif

#ifdef __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__
 &__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__,
#else
  NULL,
#endif
  }
};

//
// NOTE: Limitation:
// Only one handler for SetVirtualAddressMap Event and ExitBootServices Event each
//
GLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {
#ifdef __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__
  __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__,
#endif
  NULL
};

GLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {
#ifdef __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__
  __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__,
#endif
  NULL
};


//
// Module Unload Handler
//

#ifdef __EDKII_GLUE_MODULE_UNLOAD_HANDLER__
EFI_STATUS
EFIAPI
__EDKII_GLUE_MODULE_UNLOAD_HANDLER__ (
  EFI_HANDLE        ImageHandle
  );
#endif

EFI_STATUS
EFIAPI
ProcessModuleUnloadList (
  EFI_HANDLE  ImageHandle
  )
{
#ifdef __EDKII_GLUE_MODULE_UNLOAD_HANDLER__
  return (__EDKII_GLUE_MODULE_UNLOAD_HANDLER__ (ImageHandle));
#else
  return EFI_SUCCESS;
#endif
}

#ifdef __EDKII_GLUE_EFI_CALLER_ID_GUID__
  GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = __EDKII_GLUE_EFI_CALLER_ID_GUID__;
#endif

//
// Library constructors
//
VOID
ProcessLibraryConstructorList (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{
//
// Declare "Status" if any of the following libraries are used
//
#if defined(__EDKII_GLUE_DXE_HOB_LIB__)                     \
    || defined(__EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__) \
    || defined(__EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__)        \
    || defined(__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__)   \
    || defined(__EDKII_GLUE_DXE_SERVICES_TABLE_LIB__)       \
    || defined(__EDKII_GLUE_DXE_SMBUS_LIB__)                \
    || defined(__EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__)
  EFI_STATUS  Status;
#endif

//
// EdkII Glue Library Constructors: 
// NOTE: the constructors must be called according to dependency order
//
// UefiBootServicesTableLib     UefiBootServicesTableLibConstructor()
// EdkDxeRuntimeDriverLib       RuntimeDriverLibConstruct()   
// DxeHobLib                    HobLibConstructor()
// UefiDriverModelLib           UefiDriverModelLibConstructor()
// DxeSmbusLib                  SmbusLibConstructor()    
// DxeServicesTableLib          DxeServicesTableLibConstructor()
// UefiRuntimeServicesTableLib  UefiRuntimeServicesTableLibConstructor() 
// 
#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
  Status = UefiBootServicesTableLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);
#endif

#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
  Status = RuntimeDriverLibConstruct (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);
#endif

#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
  Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);
#endif

#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
  Status = UefiDriverModelLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);
#endif

#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
  Status = DxeServicesTableLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status); 
#endif

#ifdef __EDKII_GLUE_DXE_HOB_LIB__
  Status = HobLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);
#endif

#ifdef __EDKII_GLUE_DXE_SMBUS_LIB__
  Status = SmbusLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);
#endif

}

//
// Library Destructors
//
VOID
ProcessLibraryDestructorList (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{
//
// NOTE: the destructors must be called according to dependency order
//
#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
  EFI_STATUS  Status;
  Status = UefiDriverModelLibDestructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);
#endif

#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?