Пример #1
0
/**
  Main entry for PCD DXE driver.

  This routine initialize the PCD database and install PCD_PROTOCOL.

  @param ImageHandle     Image handle for PCD DXE driver.
  @param SystemTable     Pointer to SystemTable.

  @return Status of gBS->InstallProtocolInterface()

**/
EFI_STATUS
EFIAPI
PcdDxeInit (
    IN EFI_HANDLE           ImageHandle,
    IN EFI_SYSTEM_TABLE     *SystemTable
)
{
    EFI_STATUS Status;

    //
    // Make sure the Pcd Protocol is not already installed in the system
    //

    ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gPcdProtocolGuid);

    BuildPcdDxeDataBase ();

    //
    // Install PCD_PROTOCOL to handle dynamic type PCD
    // Install EFI_PCD_PROTOCOL to handle dynamicEx type PCD
    //
    Status = gBS->InstallMultipleProtocolInterfaces (
                 &mPcdHandle,
                 &gPcdProtocolGuid,     &mPcdInstance,
                 &gEfiPcdProtocolGuid,  &mEfiPcdInstance,
                 NULL
             );

    ASSERT_EFI_ERROR (Status);

    return Status;

}
Пример #2
0
Файл: Pcd.c Проект: b-man/edk2
/**
  Main entry for PCD DXE driver.

  This routine initialize the PCD database and install PCD_PROTOCOL.

  @param ImageHandle     Image handle for PCD DXE driver.
  @param SystemTable     Pointer to SystemTable.

  @return Status of gBS->InstallProtocolInterface()

**/
EFI_STATUS
EFIAPI
PcdDxeInit (
  IN EFI_HANDLE           ImageHandle,
  IN EFI_SYSTEM_TABLE     *SystemTable
  )
{
  EFI_STATUS Status;
  VOID       *Registration;

  //
  // Make sure the Pcd Protocol is not already installed in the system
  //

  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gPcdProtocolGuid);

  BuildPcdDxeDataBase ();

  //
  // Install PCD_PROTOCOL to handle dynamic type PCD
  // Install EFI_PCD_PROTOCOL to handle dynamicEx type PCD
  //
  Status = gBS->InstallMultipleProtocolInterfaces (
                  &mPcdHandle,
                  &gPcdProtocolGuid,     &mPcdInstance,
                  &gEfiPcdProtocolGuid,  &mEfiPcdInstance,
                  NULL
                  );
  ASSERT_EFI_ERROR (Status);

  //
  // Install GET_PCD_INFO_PROTOCOL to handle dynamic type PCD
  // Install EFI_GET_PCD_INFO_PROTOCOL to handle dynamicEx type PCD
  //
  Status = gBS->InstallMultipleProtocolInterfaces (
                  &mPcdHandle,
                  &gGetPcdInfoProtocolGuid,     &mGetPcdInfoInstance,
                  &gEfiGetPcdInfoProtocolGuid,  &mEfiGetPcdInfoInstance,
                  NULL
                  );
  ASSERT_EFI_ERROR (Status);

  //
  // Register callback function upon VariableLockProtocol
  // to lock the variables referenced by DynamicHii PCDs with RO property set in *.dsc.
  //
  EfiCreateProtocolNotifyEvent (
    &gEdkiiVariableLockProtocolGuid,
    TPL_CALLBACK,
    VariableLockCallBack,
    NULL,
    &Registration
    );

  return Status;
}
Пример #3
0
Файл: Pcd.c Проект: B-Rich/edk2
/**
  Main entry for PCD DXE driver.
  
  This routine initialize the PCD database and install PCD_PROTOCOL.
  
  @param ImageHandle     Image handle for PCD DXE driver.
  @param SystemTable     Pointer to SystemTable.

  @return Status of gBS->InstallProtocolInterface()

**/
EFI_STATUS
EFIAPI
PcdDxeInit (
  IN EFI_HANDLE           ImageHandle,
  IN EFI_SYSTEM_TABLE     *SystemTable
  )
{
  EFI_STATUS Status;
  
  //
  // Make sure the Pcd Protocol is not already installed in the system
  //

  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gPcdProtocolGuid);

  BuildPcdDxeDataBase ();

  //
  // Install PCD_PROTOCOL to handle dynamic type PCD
  // Install EFI_PCD_PROTOCOL to handle dynamicEx type PCD
  //
  Status = gBS->InstallMultipleProtocolInterfaces (
                  &mPcdHandle,
                  &gPcdProtocolGuid,     &mPcdInstance,
                  &gEfiPcdProtocolGuid,  &mEfiPcdInstance,
                  NULL
                  );
  ASSERT_EFI_ERROR (Status);

  //
  // Only install PcdInfo PROTOCOL when PCD info content is present. 
  //
  if (mPcdDatabase.DxeDb->PcdNameTableOffset != 0) {
    //
    // Install GET_PCD_INFO_PROTOCOL to handle dynamic type PCD
    // Install EFI_GET_PCD_INFO_PROTOCOL to handle dynamicEx type PCD
    //
    Status = gBS->InstallMultipleProtocolInterfaces (
                    &mPcdHandle,
                    &gGetPcdInfoProtocolGuid,     &mGetPcdInfoInstance,
                    &gEfiGetPcdInfoProtocolGuid,  &mEfiGetPcdInfoInstance,
                    NULL
                    );
    ASSERT_EFI_ERROR (Status);
  }

  return Status;
}