class PciePlatformInterface

Defined at line 35 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

PciePlatformInterface

The definitions of an interface responsible for managing runtime platform

resource allocation. In particular, blocks of MSI interrupts. Platforms

must provide an implementation of this interface to the PcieBusDriver when it

gets instantiated.

TODO(johngro): If/when the kernel interface to interrupt management becomes

more standardized (and includes the concept of MSI IRQ blocks), this

interface can be eliminated and the PCI bus driver can interact with the

omnipresent interrupt management interface instead of an implementation of

this interface.

Public Methods

void ~PciePlatformInterface ()

Defined at line 37 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

bool supports_msi ()

Methods used to determine if a platform supports MSI or not, and if so,

whether or not the platform can mask individual MSI vectors at the

platform level.

If the platform supports MSI, it must supply valid implementations of

Alloc/FreeMsiBlock, and RegisterMsiHandler.

If the platform supports MSI masking, it must supply a valid

implementation of MaskUnmaskMsi.

Defined at line 50 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

bool supports_msi_masking ()

Defined at line 51 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

zx_status_t AllocMsiBlock (uint requested_irqs, bool can_target_64bit, bool is_msix, msi_block_t * out_block)

Method used for platform allocation of blocks of MSI and MSI-X compatible

IRQ targets.

Parameters

requested_irqs The total number of irqs being requested.
can_target_64bit True if the target address of the MSI block can be located past the 4GB boundary. False if the target address must be in low memory.
is_msix True if this request is for an MSI-X compatible block. False for plain old MSI.
out_block A pointer to the allocation bookkeeping to be filled out upon successful allocation of the requested block of IRQs.

Returns

A status code indicating the success or failure of the operation.

Defined at line 68 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

void FreeMsiBlock (msi_block_t * block)

Method used by the bus driver to return a block of MSI IRQs previously

allocated with a call to a AllocMsiBlock implementation to the platform

pool.

Parameters

block A pointer to the block to be returned.

Defined at line 83 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

void RegisterMsiHandler (const msi_block_t * block, uint msi_id, interrupt_handler_t handler)

Method used for registration of MSI handlers with the platform.

Parameters

block A pointer to a block of MSIs allocated using a platform supplied platform_msi_alloc_block_t callback.
msi_id The ID (indexed from 0) with the block of MSIs to register a handler for.
handler A pointer to the handler to register, or NULL to unregister.

Defined at line 98 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

void MaskUnmaskMsi (const msi_block_t * block, uint msi_id, bool mask)

Method used for masking/unmasking of MSI handlers at the platform level.

Parameters

block A pointer to a block of MSIs allocated using a platform supplied platform_msi_alloc_block_t callback.
msi_id The ID (indexed from 0) with the block of MSIs to mask or unmask.
mask If true, mask the handler. Otherwise, unmask it.

Defined at line 114 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

void PciePlatformInterface (const PciePlatformInterface & )

Defined at line 120 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

void PciePlatformInterface (PciePlatformInterface && )

Defined at line 120 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

PciePlatformInterface & operator= (const PciePlatformInterface & )

Defined at line 120 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

PciePlatformInterface & operator= (PciePlatformInterface && )

Defined at line 120 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

Protected Methods

void PciePlatformInterface (MsiSupportLevel msi_support)

Defined at line 124 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h

Enumerations

enum MsiSupportLevel
Name Value
NONE 0
MSI 1
MSI_WITH_MASKING 2

Defined at line 123 of file ../../zircon/kernel/dev/pcie/include/dev/pcie_platform.h