Home |
RTTarget-32 Programming Manual System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) Function RTMPTablePCIInterrupt Function RTMPSetupMSI |
Function RTMPSetupMSIRTMPSetupMSI configures one or all capable PCI and PCI Express devices to trigger interrupts through the Message Signaled Interrupts (MSI) mechanism: UINT RTMPSetupMSI(int PCIBus, BYTE DeviceFunc, DWORD IRQSet); ParametersPCIBusThe PCI bus number on which the PCI device to be configured is located. If this parameter is -1, all PCI buses are scanned and all devices which support MSI will be configured to use MSI. If PCIBus is not -1, the single device identified by parameters PCIBus and DeviceFunc is configured. DeviceFuncDevice number in bits 7 .. 3 and the function number in bits 2 .. 0 for the device to be configured. If parameter PCIBus is -1, this parameter is ignored. IRQSetA bitmap of IRQs which may be used to assign a new IRQ to the device(s). Each bit (0 .. 31) corresponds to IRQs 0 .. 31. RTMPSetupMSI will select IRQs with the lowest number of PCI devices sharing an IRQ from this set. If you want to force RTMPSetupMSI to use only one specific IRQ, set only one bit in this parameter. If IRQSet is 0, RTMPSetupMSI will use 0xFFFF0004 (IRQs 2, 16 .. 31) and all IRQs used by PCI devices. Please note that parameter IRQSet must not included any IRQs in use by ISA devices as ISA devices cannot share interrupts with PCI devices. return valueZero on failure or a value greater zero on success. If an error occurs, an error message is displayed via function OutputDebugString if APIC flag RT_APIC_VERBOSE was set. RTMPSetupMSI must be called for a device before a driver has installed and enabled interrupts for this device. MSI is supported by all PCI Express and many PCI devices. When configured for MSI, the device will not use the PCI interrupt pins to deliver interrupts to the IOAPIC. Rather, a PCI write cycle is issued by the device to the Local APIC which will then trigger the interrupt. The advantage of MSI is that the interrupt vector can be freely chosen. By default, RTMPSetupMSI selects IRQs such that IRQ sharing is minimized, improving interrupt performance. The function requires APIC mode and will call RTMPSetAPICMode(0) if in PIC mode. RTMPSetupMSI is not supported if run under RTVmf-32 or RTRth-32. Please note that functions RTDisableIRQ, RTEnableIRQ, RTKDisableIRQ, and RTKEnableIRQ, are not supported for MSI interrupts. MSI interrupts are always enabled. To suspend interrupts from an MSI-enabled PCI device, the device itself must be programmed to no longer generate interrupts.
|