PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Memory Management Types

This section defines some types and values that are fundamental to memory management for native drivers.

Values of type LogicalAddress represent a location in an address space:

typedef void *LogicalAddress;

Values of type PhysicalAddress represent location in physical memory. They are used primarily with DMA I/O operations:

typedef void *PhysicalAddress;

A LogicalAddressRange structure is a description of a single logically addressed buffer:

struct LogicalAddressRange
{
    LogicalAddress          address;
    ByteCount               count;
};

typedef struct LogicalAddressRange LogicalAddressRange;
typedef struct LogicalAddressRange *LogicalAddressRangePtr;

A PhysicalAddressRange structure is a description of a single physically addressed buffer:

struct PhysicalAddressRange
{
    PhysicalAddress         address;
    ByteCount               count;
};

typedef struct PhysicalAddressRange PhysicalAddressRange;
typedef struct PhysicalAddressRange *PhysicalAddressRangePtr;

An AddressRange structure is a description of a single buffer, in which the buffer address may be either logical or physical:

struct AddressRange
{
    void            *base;
    ByteCount       length;
};

typedef struct AddressRange AddressRange;

Address spaces are referred to by values of type AddressSpaceID. The value kCurrentAddressSpaceID refers to the current address space:

typedef KernelID AddressSpaceID;
enum
{
    kCurrentAddressSpaceID = 0
};

© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)