Ejemplo n.º 1
0
/**
  Initialize DMA protection.
**/
VOID
InitializeDmaProtection (
  VOID
  )
{
  EFI_STATUS  Status;
  EFI_EVENT   ExitBootServicesEvent;
  EFI_EVENT   LegacyBootEvent;
  EFI_EVENT   EventAcpi10;
  EFI_EVENT   EventAcpi20;

  Status = gBS->CreateEventEx (
                  EVT_NOTIFY_SIGNAL,
                  VTD_TPL_LEVEL,
                  AcpiNotificationFunc,
                  NULL,
                  &gEfiAcpi10TableGuid,
                  &EventAcpi10
                  );
  ASSERT_EFI_ERROR (Status);

  Status = gBS->CreateEventEx (
                  EVT_NOTIFY_SIGNAL,
                  VTD_TPL_LEVEL,
                  AcpiNotificationFunc,
                  NULL,
                  &gEfiAcpi20TableGuid,
                  &EventAcpi20
                  );
  ASSERT_EFI_ERROR (Status);

  //
  // Signal the events initially for the case
  // that DMAR table has been installed.
  //
  gBS->SignalEvent (EventAcpi20);
  gBS->SignalEvent (EventAcpi10);

  Status = gBS->CreateEventEx (
                  EVT_NOTIFY_SIGNAL,
                  TPL_CALLBACK,
                  OnExitBootServices,
                  NULL,
                  &gEfiEventExitBootServicesGuid,
                  &ExitBootServicesEvent
                  );
  ASSERT_EFI_ERROR (Status);

  Status = EfiCreateEventLegacyBootEx (
             TPL_CALLBACK,
             OnLegacyBoot,
             NULL,
             &LegacyBootEvent
             );
  ASSERT_EFI_ERROR (Status);

  return ;
}
Ejemplo n.º 2
0
/**
  Creates an EFI event in the Legacy Boot Event Group.

  Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library
  abstracts the implementation mechanism of this event from the caller. This function
  abstracts the creation of the Legacy Boot Event. The Framework moved from a proprietary
  to UEFI 2.0 based mechanism.  This library abstracts the caller from how this event
  is created to prevent to code form having to change with the version of the
  specification supported.
  If LegacyBootEvent is NULL, then ASSERT().

  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).

  @retval EFI_SUCCESS       Event was created.
  @retval Other             Event was not created.

**/
EFI_STATUS
EFIAPI
EfiCreateEventLegacyBoot (
    OUT EFI_EVENT  *LegacyBootEvent
)
{
    return EfiCreateEventLegacyBootEx (
               TPL_CALLBACK,
               InternalEmptyFunction,
               NULL,
               LegacyBootEvent
           );
}