_unload(D2) _unload(D2)
NAME
_unload - clean up a loadable kernel module
SYNOPSIS
#include <sys/moddefs.h>
#include <sys/ddi.h>
int prefix_unload(void);
DESCRIPTION
The module _unload routine handles any cleanup a loadable
kernel module must perform before it can be dynamically
unloaded from a running system. Typically, a module's _unload
routine undoes whatever was done in the module's _load(D2)
routine.
Return Values
The _unload routine should return 0 for success, or the
appropriate error number.
USAGE
This entry point is optional.
A loadable module's _unload routine is defined in module-
specific initialization code called wrapper code. The _unload
routine can perform activities such as:
disable and remove device interrupts by calling the
mod_drvdetach(D3) routine
deallocate memory acquired for private data
cancel any outstanding timeout(D3) or bufcall(D3)
requests made by the module
Synchronization Constraints
The _unload routine should not sleep, and should not call any
functions that sleep.
Examples
See _load(D2) for an example of _unload.
REFERENCES
_load(D2), mod_drvdetach(D3)
Copyright 1994 Novell, Inc. Page 1
_unload(D2) _unload(D2)
NOTICES
Portability
All processors
Applicability
ddi: 4, 5, 5mp, 6, 6mp, 7, 7mp
Copyright 1994 Novell, Inc. Page 2