User guide

150 Enhanced OS-9 for X86 PCAT
1
Installing and Configuring Enhanced OS-9
pci_write_configuration_word() - write PCI configuration
word
Syntax
#include <pcicnfg.h>
error_code pci_write_configuration_word(u_int32 bus,
u_int32 dev, u_int32 func, u_int32 index, u_int16 val);
State
System
Description
pci_write_configuration_word function() writes to the PCI configuration
space the word 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_int16 cmd;
bus = 0; /* device on bus zero */
device = 11; /* device ID = 11 */
func = 0; /* function number = 0 */
cmd = 7; /* set device to allow bus master */
error = pci_write_configuration_word(bus, dev, func,
offsetof(pci_config_reg, command_reg), cmd);
return error;
}