Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

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

Protectedfunction GetRegisterPriority: Byte; override;
Protectedprocedure RaiseOnAddResource; override;
Protectedprocedure RaiseOnRemoveItem; override;
Protectedprocedure SetName(const NewName: TComponentName); override;

Description

Protectedfunction GetRegisterPriority: Byte; override;

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.

Protectedprocedure RaiseOnAddResource; override;

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.

Protectedprocedure RaiseOnRemoveItem; override;

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.

Protectedprocedure SetName(const NewName: TComponentName); override;

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

Protectedproperty BIST: String;
Protectedproperty Bus: Byte;
Protectedproperty CacheLineSize: String;
Protectedproperty ClassCode: String;
Protectedproperty CommandReg: String;
Protectedproperty DeviceId: String;
Protectedproperty Func: Byte;
Protectedproperty HeaderType: String;
Protectedproperty Latency: String;
Protectedproperty ProgIf: String;
Protectedproperty RevisionId: String;
Protectedproperty Slot: Byte;
Protectedproperty StatusReg: String;
Protectedproperty SubClass: String;
Protectedproperty VendorId: String;

Description

Protectedproperty BIST: String;

BIST property is an accessor for BIST register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty Bus: Byte;

Bus property specifies the logically vectorized bus number (0-255) the PCI device (the configuration space) is located on.

Protectedproperty CacheLineSize: String;

CacheLineSize property is an accessor for cacheline_size register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty ClassCode: String;

ClassCode property is an accessor for classcode register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty CommandReg: String;

CommandReg property is an accessor for command_reg register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty DeviceId: 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.

Protectedproperty Func: Byte;

Slot property specifies the logically vectorized function number (0-7) the PCI device (the configuration space) is located on.

Protectedproperty HeaderType: String;

HeaderType property is an accessor for header_type register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty Latency: String;

Latency property is an accessor for latency register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty ProgIf: String;

ProgIf property is an accessor for progIF register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty RevisionId: String;

RevisionId property is an accessor for revisionID register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty Slot: Byte;

Slot property specifies the logically vectorized slot number (0-31) the PCI device (the configuration space) is located on.

Protectedproperty StatusReg: String;

StatusReg property is an accessor for status_reg register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty SubClass: String;

SubClass property is an accessor for subclass register of the configuration space. It is specified as a hexadecimal string.

Protectedproperty VendorId: 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.