User guide
1
Installing and Configuring Enhanced OS-9
Enhanced OS-9 for X86 PCAT 151
pci_write_configuration_dword() - write PCI
configuration dword
Syntax
#include <pcicnfg.h>
error_code pci_write_configuration_dword(u_int32 bus,
u_int32 dev, u_int32 func, u_int32 index, u_int32 val);
State
System
Description
pci_write_configuration_dword() writes to the PCI configuration space
the dword value ’val’ for the PCI device at ’bus’ bus number, ’dev’ device
number, ’func’ function number, ’index’ offset into the configuration
space.
Header File
MWOS/SRC/DEFS/HW/pcicnfg.h
Example
#include <const.h>
#include <pcicnfg.h>
#include <stdio.h>
main()
{
u_int8 bus, dev, func;
u_int32 value;
bus = 0; /* device on bus zero */
device = 11; /* device ID = 11 */
func = 0; /* function number = 0 */
value = 0xffffffff; /* get size info from device */
error = pci_write_configuration_dword(bus, dev, func,
offsetof(pci_config_reg, base_addrs[0]), value);
return error;
}