阅读:2686回复:2
有没有介绍pciConfigInLong和pcifinddevice等函数使用的手册!
10分求助!
|
|
|
沙发#
发布于:2003-08-21 11:43
已经找到!
|
|
|
板凳#
发布于:2003-08-21 12:00
The routines pciConfigInByte(), pciConfigInWord(), pciConfigInLong(),
pciConfigOutByte(), pciConfigOutWord(), and pciConfigOutLong() may be used to access the Configuration Space of any PCI device, once the library has been properly initialized. It should be noted that, if no device exists at the given BDF address, the resultant behavior of the Configuration Space access routines is to return a value with all bits set, as set forth in the PCI bus standard. In addition to the BDF numbers obtained from the pciFindXxx functions, an additional parameter specifying an offset into the PCI Configuration Space must be specified when using the access routines. VxWorks includes defined offsets for all of the standard PCI Configuration Space structure members as set forth in the PCI Local Bus Specification 2.1 and the PCI Local Bus PCI to PCI Bridge Architecture Specification 1.0. The defined offsets are all prefixed by \"PCI_CFG_\". For example, if Vendor ID information is required, PCI_CFG_VENDOR_ID would be passed as the offset argument to the access routines. In summary, the pci configuration space access functions described above accept the following parameters. Input routines: .IP \"busNo\" bus segment number on which the device resides .IP \"deviceNo\" device ID of the device .IP \"funcNo\" function number of the device .IP \"offset\" offset into the device configuration space .IP \"pData\" where to return the data .LP Ouput routines: .IP \"busNo\" bus segment number on which the device resides .IP \"deviceNo\" device ID of the device .IP \"funcNo\" function number of the device .IP \"offset\" offset into the device configuration space .IP \"Data\" data to be written .LP .SH PCI CONFIG SPACE OFFSET CHECKING PciConfigWordIn(), pciConfigWordOut(), pciConfigLongIn(), and pciConfigLongOut() check the offset parameter for proper offset alignment. Offsets should be multiples of 4 for longword accesses and multiples of 2 for word accesses. Misaligned accesses will not be performed and ERROR will be returned. The previous default behaviour for this library was to not check for valid offset values. This has been changed and checks are now done by default. These checks exist to insure that the user gets the correct data using the correct configuration address offsets. The user should define PCI_CONFIG_OFFSET_NOCHECK to achieve the older behaviour. If user code behaviour changes, the user should investigate why and fix the code that is calling into this library with invalid offset values. |
|