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

Unit kdranges

Description

Unit kdranges contains implementations and accompanying definitions for classes modelling different address ranges of hardware, either memory or port concerned, such as: TkdMemoryRange, TkdPortRange, TkdDirectRPIOMRange, TkdDirectRRAMRange and their ancestor classes.

Classes, Interfaces and Objects

NameDescription
Class TkdDirectMemoryRangeResource class TkdDirectMemoryRange is the ancestor for all components modelling memory ranges which are directly accessible from the user space. Beside other behaviour the class introduces UserDirectAddr property to provide user programs with direct access to device memory. This class is actual to accelerate access to hardware devices which lend themselves to the Linux mmap abstraction. Most PCI periferals, for example, map their control registers to a memory address, and demanding applications might prefer to have direct access to the registers instead of having to use indirect transfers provided by TkdMemoryRange class. Depending on the nature of memory required to be accessed there have been established two descendant classes: TkdDirectRPIOMRange and TkdDirectRRAMRange whose implementations vary mainly on the GDD level.
Class TkdDirectRPIOMRangeFinal resource class TkdDirectRPIOMRange models direct memory ranges, i.e. memory regions directly accessible from the user space and represented by: 1. reserved pages whose physical addresses are between 640KB and 1 MB and 2. I/O memory regions whose physical addresses are above the top of physical memory. This is the only and sufficient class that allows to get an access to a real hardware device in the direct manner from the user space via a pointer provided. The targeted range of physical addresses accessible through objects of this class may spread from 0x9FC00 up to 0xFFFFFFFF.
Class TkdDirectRRAMRangeFinal resource class TkdDirectRRAMRange models direct memory ranges, i.e. memory regions directly accessible from the user space those physical addresses belong to the real RAM (known as Conventional Memory). The targeted range of physical addresses accessible through objects of this class may spread from 0 up to 0x9FBFF.
Class TkdHWRangeResource class TkdHWRange is the ancestor for all components modelling address ranges composed of either ports or memory areas belonging to a particular hardware device. Those areas are locations where different resources of the hardware device are mapped. This class introduces Transfer method that initiates data reading and writing operations on hardware and it introduces properties which specify rules for the transfer. By making up multifarious combination over values of the properties, required transfer operations can be easily composed. The class also introduces a number of virtual methods intended to be overridden by its port-oriented and memory-oriented descendants, including those checking the self-consistency and the inter-consistency of all instances of this class, and those maintaining instances of the dependent class TkdHWRangeRegister.
Class TkdMemoryRangeFinal resource class TkdMemoryRange models address ranges of hardware memory and is used to access I/O memory regions both directly-mapped to physical addresses and software-mapped, regardless of if these regions are low memory or high PCI buffers. In order to access the memory this class arranges for the specified range of physical addresses to be visible from the GDD - I/O remap operation. By excluding the ability to provide user programs with the direct access to device memory this class allows to advert to absolutely all memory-mapped devices from the whole 32-bit address space, even those not lending themselves to Linux mmap abstraction. The class redefines necessary methods of its parental class TkdHWRange to deal with the specificity of hardware memory and makes published all concerned properties it inherits.
Class TkdPortRangeFinal resource class TkdPortRange models address ranges of hardware ports and is used to access I/O port regions regardless of if a device is mapping its registers to a separate address space for I/O ports the periferal bus has or into a memory address region. Whatever the case, all address regions lent into the Linux concept of I/O ports on your PC are completely accessible. The class redefines necessary methods of its parental class TkdHWRange to deal with the specificity of hardware ports and makes published all concerned properties it inherits.
Class TkdRangeResource class TkdRange is the ancestor for all components modelling different address ranges which are either directly accessible through a virtual address assigned to a user process (descendants of TkdDirectMemoryRange class) or circumstantially accessible - by means of a proper remapping (TkdMemoryRange descendant of TkdHWRange class) or even port ranges. Whatever the case, the class encapsulates the fundamental behavior common to all ranges and introduces methods that can be overridden to examine the validity of bounds of the address range and reimplement the viewable representation of some published information concerned to the address range comprehension.

Types

Overview

TkdDirectMemoryRangeMemProts = set of TkdDirectMemoryRangeMemProt
TkdHWRangeTransferStruct = record TransferAutoInc: LongWord; TransferCount: LongWord; TransferDir: LongWord; TransferSize: LongWord; TransferOffset: LongWord; BufferAddr: LongWord; BufferSize: LongWord; case Integer of 0: (HWRangeTransferPortPart: TkdPortRangePart); end
TkdPortRangePart = record ArrangedLike: LongWord; TransferType: LongWord; end

Description

TkdDirectMemoryRangeMemProts = set of TkdDirectMemoryRangeMemProt

TkdDirectMemoryRangeMemProts = set of TkdDirectMemoryRangeMemProt;

TkdHWRangeTransferStruct = record TransferAutoInc: LongWord; TransferCount: LongWord; TransferDir: LongWord; TransferSize: LongWord; TransferOffset: LongWord; BufferAddr: LongWord; BufferSize: LongWord; case Integer of 0: (HWRangeTransferPortPart: TkdPortRangePart); end

TkdHWRangeTransferStruct = record TransferAutoInc: LongWord; TransferCount: LongWord; TransferDir: LongWord; TransferSize: LongWord; TransferOffset: LongWord; BufferAddr: LongWord; BufferSize: LongWord; case Integer of 0: (HWRangeTransferPortPart: TkdPortRangePart); end;

TkdPortRangePart = record ArrangedLike: LongWord; TransferType: LongWord; end

TkdPortRangePart = record ArrangedLike: LongWord; TransferType: LongWord; end;

Enumerations

TkdDirectMemoryRangeMapType
TkdDirectMemoryRangeMapType = (mtMAP_SHARED, mtMAP_PRIVATE);
 mtMAP_SHARED 
 mtMAP_PRIVATE 
TkdDirectMemoryRangeMemProt
TkdDirectMemoryRangeMemProt = (mpPROT_READ, mpPROT_WRITE);
 mpPROT_READ 
 mpPROT_WRITE 
TkdHWRangeTransferDir
TkdHWRangeTransferDir = (tdRead, tdWrite);
 tdRead 
 tdWrite 
TkdHWRangeTransferSize
TkdHWRangeTransferSize = (tsByte, tsWord, tsDword);
 tsByte 
 tsWord 
 tsDword 
TkdPortRangeArrangedLike
TkdPortRangeArrangedLike = (alPort, alMemory);
 alPort 
 alMemory 
TkdPortRangeTransferType
TkdPortRangeTransferType = (ttDefault, ttPausing, ttString);
 ttDefault 
 ttPausing 
 ttString 

Author

ETSoft Tenzor.Net (etsoft@tenzor.net)

Created

01 May 2004

Last Modified

05 February 2005