A P P E N D I X B |
FCode Memory Allocation |
To get general purpose memory, use buffer: or alloc-mem. Use free-mem to de-allocate memory obtained with alloc-mem.
To map in portions of your SBus device for ordinary access, use " map-in" $call-parent as in:
To later map out those portions of your device, use " map-out" $call-parent as in:
To use a region of system memory for DMA (for example, for both direct CPU access and DMA access from a device), first define the following mapping and allocation routines, then follow the steps below to ensure data coherency.
1. Allocate the DMA region with:
The CPU accesses the region using virt from dma-alloc,
3. Start DMA operation, using devaddr from dma-map-in.
a. Wait for DMA complete status.
b. Repeat DMA as needed, then perform dma-sync.
4. Repeat Steps 2 and 3 as needed.
5. Deallocate the region when completed with:
Copyright © 2004, Sun Microsystems, Inc. All Rights Reserved.