Home |
RTTarget-32 Programming Manual Function RTT_BIOS_NextDevice Function RTT_BIOS_FindClassCode Function RTT_BIOS_GetInterruptRouting Function RTT_BIOS_GenSpecialCycle Function RTT_BIOS_ReadConfigData Function RTT_BIOS_WriteConfigData Function RTT_BIOS_LocateCapability System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTT_BIOS_NextDeviceThis function returns the location of the next PCI device: int RTT_BIOS_NextDevice(BYTE * Bus, BYTE * DeviceFunc); ParametersBusPointer to the returned PCI bus number. DeviceFuncPointer to the returned device number in bits 7 .. 3 and the function number in bits 2 .. 0. return valueRTT_BIOS_SUCCESSFUL or an error code, see section PCI BIOS. To retrieve the bus number and device/function of the first installed PCI or PCI Express function, parameter *Bus should be initialized with value RTT_BIOS_NO_PCI_BUS. Subsequent calls will then return each PCI device until the function returns a value other than RTT_BIOS_SUCCESSFUL. Example:BYTE Bus, DeviceFunc; WORD VendorId, DeviceId; printf("List of all installed PCI[e] devices:\n"); Bus = RTT_BIOS_NO_PCI_BUS; while (RTT_BIOS_NextDevice(&Bus, &DeviceFunc) == RTT_BIOS_SUCCESSFUL) { RTT_BIOS_ReadConfigData(Bus, DeviceFunc, RTT_BIOS_VENDOR_ID, sizeof(WORD), &VendorId); RTT_BIOS_ReadConfigData(Bus, DeviceFunc, RTT_BIOS_DEVICE_ID, sizeof(WORD), &DeviceId); printf("%04X %04X\n", VendorId, DeviceId); }
|