alder_lake_bios/Insyde/InsydeModulePkg/Library/DxeChipsetSvcLib/DxeCsSvcIrqRoutingInformati...

71 lines
3.3 KiB
C

/** @file
DXE Chipset Services Library.
This file contains only one function that is DxeCsSvcSkipGetPciRom().
The function DxeCsSvcSkipGetPciRom() use chipset services to return
a PCI ROM image for the device is represented or not.
***************************************************************************
* Copyright (c) 2013, Insyde Software Corp. All Rights Reserved.
*
* You may not reproduce, distribute, publish, display, perform, modify, adapt,
* transmit, broadcast, present, recite, release, license or otherwise exploit
* any part of this publication in any form, by any means, without the prior
* written permission of Insyde Software Corporation.
*
******************************************************************************
*/
#include <PiDxe.h>
#include <Library/DebugLib.h>
#include <Library/DxeChipsetSvcLib.h>
#include <Protocol/H2ODxeChipsetServices.h>
//
// Global Variables (This Source File Only)
//
extern H2O_CHIPSET_SERVICES_PROTOCOL *mChipsetSvc;
/**
Provide IRQ Routing table according to platform specific information.
@param[OUT] VirtualBusTablePtr A pointer to the VirtualBusTable that list all bridges in this platform
and bridges' virtual secondary bus.
@param[OUT] VirtualBusTableEntryNumber A pointer to the VirtualBusTable entry number.
@param[OUT] IrqPoolTablePtr, A pointer to the IRQ Pool Table.
@param[OUT] IrqPoolTableNumber, A pointer to the IRQ Pool Table entry number.
@param[OUT] PirqPriorityTable, A pointer to the PIRQ priority used Table.
@param[OUT] PirqPriorityTableEntryNumber A pointer to the PIRQ priority used Table entry number.
@param[OUT] IrqTablePtr A pointer to the IRQ routing Table.
@retval EFI_SUCCESS Get Platform specific IRQ Routing Info successfully..
@retval EFI_UNSUPPORTED If the function is not implemented.
*/
EFI_STATUS
DxeCsSvcIrqRoutingInformation (
OUT LEGACY_MODIFY_PIR_TABLE **VirtualBusTablePtr,
OUT UINT8 *VirtualBusTableEntryNumber,
OUT EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY **IrqPoolTablePtr,
OUT UINT8 *IrqPoolTableNumber,
OUT UINT8 **PirqPriorityTablePtr,
OUT UINT8 *PirqPriorityTableEntryNumber,
OUT IRQ_ROUTING_TABLE **IrqRoutingTableInfoPtr
)
{
//
// Verify that the protocol interface structure contains the function
// pointer and whether that function pointer is non-NULL. If not, return
// an error.
//
if (mChipsetSvc == NULL ||
mChipsetSvc->Size < (OFFSET_OF (H2O_CHIPSET_SERVICES_PROTOCOL, IrqRoutingInformation) + sizeof (VOID*)) ||
mChipsetSvc->IrqRoutingInformation == NULL) {
DEBUG ((EFI_D_ERROR, "H2O DXE Chipset Services can not be found or member SkipGetPciRom() isn't implement!\n"));
return EFI_UNSUPPORTED;
}
return mChipsetSvc->IrqRoutingInformation (VirtualBusTablePtr, VirtualBusTableEntryNumber,
IrqPoolTablePtr, IrqPoolTableNumber,
PirqPriorityTablePtr, PirqPriorityTableEntryNumber,
IrqRoutingTableInfoPtr);
}