RtGetPciMsixFreeMessages

RtGetPciMsixFreeMessages returns a PCI device’s MSI-X free messages (the MSI-X table entries available for attaching messages).

Note: RtGetPciMsixFreeMessages is only supported in the RTSS environment. It cannot be called from a Windows application linked to wRTOS.

Syntax

Copy
ULONG RtGetPciMsixFreeMessages(
    [in]    ULONG BusNumber,
    [in]    PCI_SLOT_NUMBER SlotNumber,
    [in]    ULONG *TotalMessagesInCapability,
    [out]   BYTE *FreeMessageIdBitMap
);

Parameters

[in] BusNumber

The bus the device is on in a multiple bus environment, with the count starting at zero.

[in] SlotNumber

The logical slot number. This is a PCI_SLOT_NUMBER type value.

[in] TotalMessagesInCapability

A pointer to ULONG variable. If non-NULL, it stores the number of MSI-X table entries in the device’s MSI-X capability. FreeMessageIdBitMap buffer needs to be allocated according to this size.

[out] FreeMessageIdBitMap

A pointer to the user allocated buffer. If non-NULL, it stores the device’s MSI-X free messages.

The value stored is a bit map. The offset of each setting bit represents a free MessageId, which is the index of MSI-X table entry available for attaching a message.

Return Value

If the function succeeds, it returns the number of MSI-X table entries available for attaching messages. If the function fails, it returns zero.

Remarks

To determine the FreeMessageIdBitMap buffer size, call RtGetPciMsixFreeMessages with parameter FreeMessageIdBitMap set to NULL. The returning value in TotalMessagesInCapability is the number of bits required for the bit map buffer to allocate.

We recommend calling RtGetPciMsixFreeMessages to get the device’s MSI-X free messages before calling RtAttachInterrupt with AttachVersion as ATTACH_MESSAGE_BASED_MULTI_VECTOR.

See the MultiVectorI350 sample for an example use of the RtGetPciMsixFreeMessages function.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

RtssApi.h

Startup.lib

See Also: