ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference

 


IODeviceMemory

Inherits from:
Declared In:

Overview

An IOMemoryDescriptor used for device physical memory ranges.

Discussion

The IODeviceMemory class is a simple subclass of IOMemoryDescriptor that uses its methods to describe a single range of physical memory on a device. IODeviceMemory objects are usually looked up with IOService or IOPCIDevice accessors, and are created by memory-mapped bus families. IODeviceMemory implements only some factory methods in addition to the methods of IOMemoryDescriptor.



Functions

arrayFromList

Constructs an OSArray of IODeviceMemory instances, each describing one physical range, and a tag value.

withRange

Constructs an IODeviceMemory instance, describing one physical range.

withSubRange

Constructs an IODeviceMemory instance, describing a subset of an existing IODeviceMemory range.


arrayFromList


Constructs an OSArray of IODeviceMemory instances, each describing one physical range, and a tag value.

public

static OSArray * arrayFromList( InitElement list[], IOItemCount count );
Parameters
list

An array of IODeviceMemory::InitElement structures.

count

The number of elements in the list.

Return Value

Returns a created OSArray of IODeviceMemory objects, to be released by the caller, or zero on failure.

Discussion

This method creates IODeviceMemory instances for each physical range passed in an IODeviceMemory::InitElement array. Each element consists of a physical address, length and tag value for the IODeviceMemory. The instances are returned as a created OSArray.


withRange


Constructs an IODeviceMemory instance, describing one physical range.

public

static IODeviceMemory * withRange( IOPhysicalAddress start, IOPhysicalLength length );
Parameters
address

The physical address of the first byte in the memory.

withLength

The length of memory.

Return Value

Returns the created IODeviceMemory on success, to be released by the caller, or zero on failure.

Discussion

This method creates an IODeviceMemory instance for one physical range passed as a physical address and length. It just calls IOMemoryDescriptor::withPhysicalAddress.


withSubRange


Constructs an IODeviceMemory instance, describing a subset of an existing IODeviceMemory range.

public

static IODeviceMemory * withSubRange( IODeviceMemory *of, IOPhysicalAddress offset, IOPhysicalLength length );
Parameters
of

The parent IODeviceMemory of which a subrange is to be used for the new descriptor, which will be retained by the subrange IODeviceMemory.

offset

A byte offset into the parent's memory.

length

The length of the subrange.

Return Value

Returns the created IODeviceMemory on success, to be released by the caller, or zero on failure.

Discussion

This method creates an IODeviceMemory instance for a subset of an existing IODeviceMemory range, passed as a physical address offset and length. It just calls IOMemoryDescriptor::withSubRange.

Structs and Unions


InitElement


public

struct InitElement;
Fields
start

First physical address in the range.

length

Length of the range.

tag

32-bit value not interpreted by IODeviceMemory or IOMemoryDescriptor, for use by the bus family.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-12-19