PM_allocLockedMem

Allocate a block of locked, physical memory for DMA operations.

Declaration

void * PMAPI PM_allocLockedMem(
    uint size,
    ulong *physAddr,
    ibool contiguous,
    ibool below16M)

Prototype In

pmapi.h

Parameters

size

Size of memory block to allocate

physAddr

Place to return the physical memory address

contiguous

True if the block should be contiguous

below16M

True if the block must be below 16M physical

 

Return Value

Linear pointer to memory block, or NULL on failure.

Description

This function is used to allocate a block of locked, physical memory for use in hardware DMA operations. If the contiguous parameter is set to true, then the memory block requested must be contiguous in physical memory or this function will fail (requesting physically contiguous memory usually does not succeed for large blocks except immediately after the operating system is loaded or during the boot process). If the below16M flag is set to true, then the physical memory block must be allocated below the 16Mb physical memory address (required for old ISA bus sound card DMA buffers for instance). When this function succeeds, it will return a regular C pointer to the allocated memory block.

Note also that the memory block allocated by this function must also be globally shared, such that the linear address returned will be valid in all processes in the system at the same location.

See Also

PM_freeLockedMem

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com