Using Cross-Memory Kernel Services
Occasionally, access to user-mode data is required when not in the environment of the user-mode process that has addressability to the data. Such cases occur when the data is to be accessed asynchronously.
Examples of asynchronous accessing include:
- Direct memory access to the user data by I/O devices
- Data access by interrupt handlers
- Data access by a kernel process
In these circumstances, the kernel cross-memory services are required to provide the necessary access. The xmattach kernel service allows a cross-memory descriptor to be obtained for the data area to be accessed. These services must be called in the process environment of the process containing the data area.
After a cross-memory descriptor has been obtained, the xmemin and xmemout kernel services can be used to access the data area outside the process environment containing the data. When access to the data area is no longer required, the access must be removed by calling the xmdetach kernel service. Kernel extensions should use these services only when absolutely necessary. Because of the machine dependencies of cross-memory operations, using them increases the difficulty of porting the kernel extension to other machine platforms.