Class TkdPCIConfig
Unit
kdpcihdr
Declaration
type TkdPCIConfig = class(TkdResource
)
Description
Resource class TkdPCIConfig is the ancestor for all components modelling different configuration spaces of PCI devices. All PCI devices (and, consequently, their configuration spaces) are subdivided into 3 classes: normal PCI devices (PCI non-bridges), PCI bridges, and PCI cardbus bridges. Device driving is a process of reading from and writing to three address spaces: memory, port and configuration. Thus, in particular, accessing the configuration space is vital to the driver because it is the only way it can find out where the device is mapped in memory and in port space. Configuration space is a specifically structured memory area that consists of registers and those overall layout looks like TPciCfg
record. This record is 256 bytes long; the first 64 bytes is device general info depending on PCI device class; remaining 192 bytes is device specific info. This class introduces 12 properties for specifying and accessing the corresponding registers of configuration space common to all PCI devices. Also, this class introduces 3 additional properties for specifying PCI logical vector that represents: bus number, slot number and function number of PCI device. This vector resolves the situation that more than one PCI device with the same device identifier and vendor identifier is in the system.Hierarchy
TkdResource
Methods
Overview
Description
GetRegisterPriority method is overridden to result dependent2l_registration_priority
constant, so that to allow all of other resources, except for interrupt resource(s), if any, to be registered ahead. This is because the configuration space can be referenced by any resource of TkdInterrupt
class in its hardware interrupt handler script hosted at InterruptHandler
property.
RaiseOnAddResource method is overridden to raise an exception that there can not be more than one instance of configuration space per application if there was an attempt to attach another configuration space to the resources list of the hardware device.
RaiseOnRemoveItem method is overridden to prevent from detaching the configuration space from the resources list of the hardware device if the configuration space is currently referenced by at least one resource of TkdInterrupt
class in its hardware interrupt handler script hosted at InterruptHandler
property.
SetName method is overridden to update all references to the configuration space. This is because the configuration space can be referenced by name by any resource of TkdInterrupt
class in its hardware interrupt handler script hosted at InterruptHandler
property.
Properties
Overview
Description
BIST property is an accessor for BIST register of the configuration space. It is specified as a hexadecimal string.
Bus property specifies the logically vectorized bus number (0-255) the PCI device (the configuration space) is located on.
CacheLineSize property is an accessor for cacheline_size register of the configuration space. It is specified as a hexadecimal string.
ClassCode property is an accessor for classcode register of the configuration space. It is specified as a hexadecimal string.
CommandReg property is an accessor for command_reg register of the configuration space. It is specified as a hexadecimal string.
DeviceId property specifies the device identifier of the PCI device. It corresponds to (and is a read-only accessor for) deviceID register of the configuration space. It is specified as a hexadecimal string.
Slot property specifies the logically vectorized function number (0-7) the PCI device (the configuration space) is located on.
HeaderType property is an accessor for header_type register of the configuration space. It is specified as a hexadecimal string.
Latency property is an accessor for latency register of the configuration space. It is specified as a hexadecimal string.
ProgIf property is an accessor for progIF register of the configuration space. It is specified as a hexadecimal string.
RevisionId property is an accessor for revisionID register of the configuration space. It is specified as a hexadecimal string.
Slot property specifies the logically vectorized slot number (0-31) the PCI device (the configuration space) is located on.
StatusReg property is an accessor for status_reg register of the configuration space. It is specified as a hexadecimal string.
SubClass property is an accessor for subclass register of the configuration space. It is specified as a hexadecimal string.
VendorId property specifies the vendor identifier of the PCI device. It corresponds to (and is a read-only accessor for) vendorID register of the configuration space. It is specified as a hexadecimal string.