User guide
142 Enhanced OS-9 for X86 PCAT
1
Installing and Configuring Enhanced OS-9
• function_number
• vendor_id
• device_id
• rev_class
in the structure stat points to will reflect the proper values for the device
found. If no PCI next device is found, then _pci_next_device() will return
NO_DEVICE.
Header Files
MWOS/SRC/DEFS/HW/pcicnfg.h
Example
#include <const.h>
#include <pcicnfg.h>
#include <stdio.h>
#include <stdlib.h>
main()
{
pci_config_stat stat;
stat.bus_number = 0;
stat.device_number = 0;
if (_pci_next_device(&stat) == NO_DEVICE) {
printf("There are no more PCI devices on this machine.");
return EXIT_FAILURE;
} else {
printf("Next device at bus:%d device%d\n",
stat.bus_number, stat.device_number);
}
return EXIT_SUCCESS;
}
pci_get_config_data() - get PCI configuration data
Syntax
#include <pcicnfg.h>
error_code pci_get_config_data(u_int32 bus, u_int32 device, u_int32 func,
PCI_config_reg cnfg);
State
System