pci_config_getb(9F)
NAME
pci_config_getb, pci_config_getw, pci_config_getl, pci_config_getll, pci_config_putb, pci_config_putw, pci_config_putl, pci_config_putll − read or write single datum of various sizes to the PCI Local Bus Configuration space
SYNOPSIS
#include <sys/ddi.h>
#include <sys/sunddi.h>
uchar_t pci_config_getb(ddi_acc_handle_t handle, ulong_t offset);
ushort_t pci_config_getw(ddi_acc_handle_t handle, ulong_t offset);
ulong_t pci_config_getl(ddi_acc_handle_t handle, ulong_t offset);
unsigned long long pci_config_getll(ddi_acc_handle_t handle, ulong_t offset);
void pci_config_putb(ddi_acc_handle_t handle, ulong_t offset, uchar_t value);
void pci_config_putw(ddi_acc_handle_t handle, ulong_t offset, ushort_t value);
void pci_config_putl(ddi_acc_handle_t handle, ulong_t offset, ulong_t value);
void pci_config_putll(ddi_acc_handle_t handle, ulong_t offset,
unsigned long long value);
AVAILABILITY
PCI Local Bus
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
ARGUMENTS
handle The data access handle returned from pci_config_setup(9F).
offset Byte offset from the beginning of the PCI Configuration space.
value Output data.
DESCRIPTION
These routines read/write a single datum of various sizes from/to the PCI Local Bus Configuration space. The pci_config_getb(), pci_config_getw(), pci_config_getl(), and pci_config_getll() functions read 8 bits, 16 bits, 32 bits, and 64 bits of data, respectively. The pci_config_putb(), pci_config_putw(), pci_config_putl(), and pci_config_putll() functions write 8 bits, 16 bits, 32 bits, and 64 bits of data, respectively. The offset argument must be a multiple of the datum size.
Since the PCI Local Bus Configuration space is represented in little endian data format, these functions translate the data from/to native host format to/from little endian format.
pci_config_setup(9F) must be called before invoking these functions.
RETURN VALUES
pci_config_getb(), pci_config_getw(), pci_config_getl(), and pci_config_getll() return the value read from the PCI Local Bus Configuration space.
CONTEXT
These routines can be called from user, kernel, or interrupt context.
SEE ALSO
pci_config_setup(9F), pci_config_teardown(9F)
NOTES
These functions are specific to PCI bus device drivers. For drivers using these functions, a single source to support devices with multiple bus versions may not be easy to maintain.
SunOS 5.5.1 — Last change: 16 Nov 1994