Unmaps and deallocates a region in the current user address space that was mapped using the as_lw_att64 kernel service.
#include <sys/errno.h>
#include <sys/adspace.h>
#include <sys/xmem.h>
int as_lw_det64 (dp, addr, length)
xmem* dp;
void* addr;
size_t length;
Item | Description |
---|---|
dp | The cross memory descriptor describing the attached virtual memory. |
addr | Specifies the first effective address of the region to be deallocated. |
length | Specifies the length of the region to be deallocated. |
The as_lw_det64 kernel service unmaps the virtual memory from the region starting at the specified effective address, which is specified by the addr parameter. This service (and only this service) must be used to unmap regions mapped by the as_lw_att64 kernel service. It must be called by the same thread that called the as_lw_att64 kernel service. The addr parameter must be the value returned by the as_lw_att64 kernel service, and the dp parameter and the length parameter must be the same dp and length passed to it. The xmdetach kernel service must not be called to release the dp parameter until any outstanding attaches of the dp parameter using the as_lw_att64 kernel service have been detached using the as_lw_det64 kernel service.
The as_lw_det64 kernel service cannot be used to detach a region not mapped by the as_lw_att64 kernel service.
The as_lw_det64 kernel service will operate correctly only for 64-bit user address spaces. It will not work for kernel processes (kprocs).
The as_lw_det64 kernel service can be called from the process environment only.
Item | Description |
---|---|
0 | The region was successfully unmapped and deallocated. |
EINVAL | An attempt was made to deallocate a region that should not have been deallocated. |
ENOSYS | The service was called by a 32-bit process. |
ENOMEM | No lightweight resources allocated to this thread. |
EIO | Indicates a failure of the lightweight subsystem, process should discontinue use of lightweight kernel services. |
EPERM | Called by a user thread that is not 1:1 with a kernel thread. |
The as_lw_det64 kernel service is part of Base Operating System (BOS) Runtime.