コード例 #1
0
ファイル: AutoGen.c プロジェクト: lihas/UEFI
VOID
EFIAPI
ProcessLibraryConstructorList (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{
  EFI_STATUS  Status;

  Status = UefiBootServicesTableLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);

  Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);

  Status = UefiLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);

  Status = RuntimeDriverLibConstruct (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);

  Status = HobLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);

}
コード例 #2
0
//
// Library constructors
//
VOID
EFIAPI
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__) \
    || defined(__EDKII_GLUE_EDK_DXE_SAL_LIB__)              \
    || defined(__EDKII_GLUE_DXE_IO_LIB_CPU_IO__)            \
    || defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)
  EFI_STATUS  Status;
#endif

//
// EdkII Glue Library Constructors: 
// NOTE: the constructors must be called according to dependency order
//
// UefiBootServicesTableLib     UefiBootServicesTableLibConstructor()
// UefiRuntimeServicesTableLib  UefiRuntimeServicesTableLibConstructor() 
// DxeServicesTableLib          DxeServicesTableLibConstructor()
// DxeIoLibCpuIo                IoLibConstructor()
// DxeSalLib                    DxeSalLibConstructor(), IPF only
// EdkDxeRuntimeDriverLib       RuntimeDriverLibConstruct()
// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
// UefiDriverModelLib           UefiDriverModelLibConstructor()
// DxeHobLib                    HobLibConstructor()
// DxeSmbusLib                  SmbusLibConstructor()    
// 

#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
  Status = UefiBootServicesTableLibConstructor (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_DXE_SERVICES_TABLE_LIB__
  Status = DxeServicesTableLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status); 
#endif

#ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
  Status = IoLibConstructor (ImageHandle, SystemTable);
  ASSERT_EFI_ERROR (Status);
#endif

#ifdef __EDKII_GLUE_EDK_DXE_SAL_LIB__
  Status = DxeSalLibConstructor(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_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
  Status = ReportStatusCodeLibConstruct (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_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

}