<title>SPARC Architectural Model: Device and Utility API
</title>
<body bgcolor=
"#FFFFFF" LANG=
"en-US">
virtual const char *devif_getBusName();
virtual int devif_getDevice();
virtual int devif_getFunction();
virtual module_t *devif_getInstance();
virtual const char *devif_getName();
virtual int devif_access(pci_space_t, uint64_t paddr, uint64_t offset, bool_t wr, uint32_t size, uint64_t* buf);
This is an abstract class that defines the interface to a PCI device.
A PCI bus calls this interface in each of its devices.
<p>This interface is included with
<b>class PciDev
</b> and mostly handled by
<b>common/pci_dev.h
</b>.
<p><b>devif_access
</b> is downstream I/O access to a device.
The type of access is indicated by
<i>pci_space_t
</i>: configuration, I/O, mem32, or mem64.
pci_dev.h defines a stub function which returns -
1.
Most devices will define this function.
It is the main entry point for performing I/O to a device.
<p>The other interfaces are all defined in pci_dev.h. They return information about the device.
<p>All PCI device modules must export this interface, for example:
Sample::get_interface(const char *name)
if (!strcmp(name, SAMPLE_INTERFACE))
if (!strcmp(name, PCI_DEV_INTERFACE))