Frees up PDIAGEX Kernel Extension resources.
#include <sys/pdiagex.h> #include <sy/pdiag_def.h> int pdiag_close( handle ) pdiag_info_handle_t handle;
pdiag_close() frees the DMA and interrupt channels, if they were initialized. This function also masks the DMA channel; that is, you are not required to do a pdiag_dd_dma_complete(). Any memory that was allocated, pinned, or cross-memory attached is detached, unpinned, and freed appropriately.
If this is the last use of the user's interrupt-handler routine, it is unloaded from kernel memory.
Both this routine and pdiag_open() share a common lock while executing to prevent simultaneous resource allocation and deallocation. If a call is made to this routine or pdiag_open() while the lock is being held by a previous call, the calling process will sleep until the routine is available.
Note: All pdiag_dd_dma_setup() ) calls should be matched with a pdiag_dd_dma_complete() call prior to calling this routine. Any outstanding DMA operations will result in the failure of this routine.
The pdiag_close() function can be called from the process environment only.
handle | Pointer to pdiag_info_handle_t structure which is returned from pdiag_open(). |
The pdiag_close function returns one of the following values:
DGX_OK | The operation was successful. The errno is not set. |
DGX_INVALID_HANDLE | Specified handle has been closed or was not generated by the pdiag_open() call. The errno is not set. |
DGX_OUTSTANDINGDMA_FAIL | An outstanding DMA operation is preventing closure. The errno is not set. |
pdiag_open() function.