Memory-Mapping Overview

Memory-mapping is the process of mapping physical file addresses to a range of virtual memory addresses that exist within an application. Memory-mapping allows for faster read and write times within an application and operating system. The range of available virtual addresses must have been previously allocated and must not already contain an existing memory-mapping process.

Memory-Mapping APIs

The Cafe SDK memory-mapping APIs are as follows.

OSAllocVirtAddr Allocates a range of size bytes of virtual addresses for memory-mapping later.
OSFreeVirtAddr Frees a range of virtual addresses that were previously allocated using OSAllocVirtAddr.
OSGetAvailPhysAddrRange Returns the range of available physical addresses that may be memory-mapped.
OSGetDataPhysAddrRange Returns the range of data physical addresses that may be memory-mapped.
OSGetMapVirtAddrRange Returns the range of virtual addresses that are available for memory-mapping.
OSGetMemBound Retrieves the maximum bounds of a memory arena, regardless of any heaps that may be in use in that arena.
OSGetPageSize Returns the system memory page size.
OSMapMemory Maps a range of physical memory addresses to a range of virtual addresses, either read-only or read-write.
OSUnmapMemory Unmaps a range of physical memory addresses that were previously mapped using OSMapMemory.

Considerations

Use of OSMapMemory is not recommended because Cafe Core OS (COS) and device driver operations may fail in unexpected ways if they are passed virtual addresses from regions that are mapped by OSMapMemory. For more information see, OSMapMemory.

See Also

Cafe Core OS (COS) API Functions

Revision History

2014/03/12 Topic creation.


CONFIDENTIAL