Cross-Memory Kernel Services

The cross-memory kernel services allow data to be moved between the kernel and an address space other than the current process address space.

A data area within one region of an address space is attached by calling the xmattach service. As a result, the virtual memory object cannot be deleted while data is being moved in or out of pages belonging to it. A cross-memory descriptor is filled out by the xmattach service. The attach operation must be done while under a process. When the data movement is completed, the xmdetach service can be called. The detach operation can be done from an interrupt handler.

The xmemin service can be used to transfer data from an address space to kernel space. The xmemout service can be used to transfer data from kernel space to an address space. These routines may be called from interrupt handler level routines if the referenced buffers are in memory.

Cross-memory services provide the xmemdma64 service to prepare a page for DMA processing. The xmemdma64 service can be called from the process or interrupt environments. The xmemdma64 service returns the real address of the page for use in preparing DMA address lists. When the DMA transfer is completed, the xmemdma64 service must be called again to unhide the page.

Data movement by DMA or an interrupt handler requires that the pages remain in memory. This is ensured by pinning the data areas using the xmempin service. This can only be done under a process, because the memory pinning services page-fault on pages not present in memory.

The xmemunpin service unpins pinned pages. This can be done by an interrupt handler if the data area is the global kernel address space. It must be done under the process if the data area is in user process space.

The Cross-Memory services are:

Item Description
xmattach Attaches to a user buffer for cross-memory operations.
xmdetach Detaches from a user buffer used for cross-memory operations.
xmemin Performs a cross-memory move by copying data from the specified address space to kernel global memory.
xmemout Performs a cross-memory move by copying data from kernel global memory to a specified address space.
xmemdma64 Prepares a page for DMA I/O or processes a page after DMA I/O is complete. Returns 64-bit real address.
xmemzero Zeroes a buffer described by a cross-memory descriptor.