Make MOD_* macros almost consistent:

Use the name argument almost the same in all LKM types.  Maintain
the current behavior for the external (e.g., modstat) name for DEV,
EXEC, and MISC types being #name ## "_mod" and SYCALL and VFS only
#name.  This is a candidate for change and I vote just the name without
the "_mod".

Change the DISPATCH macro to MOD_DISPATCH for consistency with the
other macros.

Add an LKM_ANON #define to eliminate the magic -1 and associated
signed/unsigned warnings.

Add MOD_PRIVATE to support wcd.c's poking around in the lkm structure.

Change source in tree to use the new interface.

Reviewed by:	Bruce Evans
This commit is contained in:
dufault 1997-04-06 10:49:22 +00:00
parent 1ee56436b6
commit daf3dc095e
18 changed files with 54 additions and 50 deletions

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: coff.c,v 1.8 1997/02/22 12:47:47 peter Exp $
*/
#include <sys/param.h>
@ -57,6 +57,6 @@ ibcs2_coff_unload(struct lkm_table *lkmtp, int cmd)
int
ibcs2_coff_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, ibcs2_coff_load, ibcs2_coff_unload,
lkm_nullcmd);
MOD_DISPATCH(ibcs2_coff, lkmtp, cmd, ver,
ibcs2_coff_load, ibcs2_coff_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: ibcs2.c,v 1.9 1997/02/22 12:48:01 peter Exp $
*/
#include <sys/param.h>
@ -55,5 +55,6 @@ ibcs2_unload(struct lkm_table *lkmtp, int cmd)
int
ibcs2_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, ibcs2_load, ibcs2_unload, lkm_nullcmd);
MOD_DISPATCH(ibcs2, lkmtp, cmd, ver,
ibcs2_load, ibcs2_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: linux.c,v 1.10 1997/02/22 12:48:31 peter Exp $
*/
#include <sys/param.h>
@ -64,5 +64,6 @@ linux_unload(struct lkm_table *lkmtp, int cmd)
int
linux_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, linux_load, linux_unload, lkm_nullcmd);
MOD_DISPATCH(linux,lkmtp, cmd, ver,
linux_load, linux_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: blank_saver.c,v 1.8 1997/02/22 12:49:06 peter Exp $
*/
#include <sys/param.h>
@ -78,6 +78,6 @@ blank_saver_unload(struct lkm_table *lkmtp, int cmd)
int
blank_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, blank_saver_load, blank_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(blank_saver, lkmtp, cmd, ver,
blank_saver_load, blank_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: fade_saver.c,v 1.9 1997/02/22 12:49:10 peter Exp $
*/
#include <sys/param.h>
@ -93,6 +93,6 @@ fade_saver_unload(struct lkm_table *lkmtp, int cmd)
int
fade_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, fade_saver_load, fade_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(fade_saver, lkmtp, cmd, ver,
fade_saver_load, fade_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: green_saver.c,v 1.8 1997/02/22 12:49:15 peter Exp $
*/
#include <sys/param.h>
@ -82,6 +82,6 @@ green_saver_unload(struct lkm_table *lkmtp, int cmd)
int
green_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, green_saver_load, green_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(green_saver, lkmtp, cmd, ver,
green_saver_load, green_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: snake_saver.c,v 1.13 1997/02/22 12:49:19 peter Exp $
*/
#include <sys/param.h>
@ -122,6 +122,6 @@ snake_saver_unload(struct lkm_table *lkmtp, int cmd)
int
snake_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, snake_saver_load, snake_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(snake_saver, lkmtp, cmd, ver,
snake_saver_load, snake_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: blank_saver.c,v 1.8 1997/02/22 12:49:06 peter Exp $
*/
#include <sys/param.h>
@ -78,6 +78,6 @@ blank_saver_unload(struct lkm_table *lkmtp, int cmd)
int
blank_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, blank_saver_load, blank_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(blank_saver, lkmtp, cmd, ver,
blank_saver_load, blank_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: fade_saver.c,v 1.9 1997/02/22 12:49:10 peter Exp $
*/
#include <sys/param.h>
@ -93,6 +93,6 @@ fade_saver_unload(struct lkm_table *lkmtp, int cmd)
int
fade_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, fade_saver_load, fade_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(fade_saver, lkmtp, cmd, ver,
fade_saver_load, fade_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: green_saver.c,v 1.8 1997/02/22 12:49:15 peter Exp $
*/
#include <sys/param.h>
@ -82,6 +82,6 @@ green_saver_unload(struct lkm_table *lkmtp, int cmd)
int
green_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, green_saver_load, green_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(green_saver, lkmtp, cmd, ver,
green_saver_load, green_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: snake_saver.c,v 1.13 1997/02/22 12:49:19 peter Exp $
*/
#include <sys/param.h>
@ -122,6 +122,6 @@ snake_saver_unload(struct lkm_table *lkmtp, int cmd)
int
snake_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, snake_saver_load, snake_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(snake_saver, lkmtp, cmd, ver,
snake_saver_load, snake_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: coff.c,v 1.8 1997/02/22 12:47:47 peter Exp $
*/
#include <sys/param.h>
@ -57,6 +57,6 @@ ibcs2_coff_unload(struct lkm_table *lkmtp, int cmd)
int
ibcs2_coff_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, ibcs2_coff_load, ibcs2_coff_unload,
lkm_nullcmd);
MOD_DISPATCH(ibcs2_coff, lkmtp, cmd, ver,
ibcs2_coff_load, ibcs2_coff_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: ibcs2.c,v 1.9 1997/02/22 12:48:01 peter Exp $
*/
#include <sys/param.h>
@ -55,5 +55,6 @@ ibcs2_unload(struct lkm_table *lkmtp, int cmd)
int
ibcs2_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, ibcs2_load, ibcs2_unload, lkm_nullcmd);
MOD_DISPATCH(ibcs2, lkmtp, cmd, ver,
ibcs2_load, ibcs2_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: linux.c,v 1.10 1997/02/22 12:48:31 peter Exp $
*/
#include <sys/param.h>
@ -64,5 +64,6 @@ linux_unload(struct lkm_table *lkmtp, int cmd)
int
linux_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, linux_load, linux_unload, lkm_nullcmd);
MOD_DISPATCH(linux,lkmtp, cmd, ver,
linux_load, linux_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: blank_saver.c,v 1.8 1997/02/22 12:49:06 peter Exp $
*/
#include <sys/param.h>
@ -78,6 +78,6 @@ blank_saver_unload(struct lkm_table *lkmtp, int cmd)
int
blank_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, blank_saver_load, blank_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(blank_saver, lkmtp, cmd, ver,
blank_saver_load, blank_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: fade_saver.c,v 1.9 1997/02/22 12:49:10 peter Exp $
*/
#include <sys/param.h>
@ -93,6 +93,6 @@ fade_saver_unload(struct lkm_table *lkmtp, int cmd)
int
fade_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, fade_saver_load, fade_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(fade_saver, lkmtp, cmd, ver,
fade_saver_load, fade_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: green_saver.c,v 1.8 1997/02/22 12:49:15 peter Exp $
*/
#include <sys/param.h>
@ -82,6 +82,6 @@ green_saver_unload(struct lkm_table *lkmtp, int cmd)
int
green_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, green_saver_load, green_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(green_saver, lkmtp, cmd, ver,
green_saver_load, green_saver_unload, lkm_nullcmd);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
* $Id: snake_saver.c,v 1.13 1997/02/22 12:49:19 peter Exp $
*/
#include <sys/param.h>
@ -122,6 +122,6 @@ snake_saver_unload(struct lkm_table *lkmtp, int cmd)
int
snake_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
DISPATCH(lkmtp, cmd, ver, snake_saver_load, snake_saver_unload,
lkm_nullcmd);
MOD_DISPATCH(snake_saver, lkmtp, cmd, ver,
snake_saver_load, snake_saver_unload, lkm_nullcmd);
}