From 9f7fe9b1c98b403257acbb556aa24e6e8a91a89a Mon Sep 17 00:00:00 2001 From: christos Date: Mon, 15 May 2006 14:31:29 +0000 Subject: [PATCH] - cast to uint32_t for shift. - add an array of names so that the lists don't get out of sync. - no comma after last enum. --- sys/sys/lkm.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/sys/lkm.h b/sys/sys/lkm.h index bbefda551483..11d6a9fdc0c6 100644 --- a/sys/sys/lkm.h +++ b/sys/sys/lkm.h @@ -1,4 +1,4 @@ -/* $NetBSD: lkm.h,v 1.38 2005/11/25 20:13:54 thorpej Exp $ */ +/* $NetBSD: lkm.h,v 1.39 2006/05/15 14:31:29 christos Exp $ */ /* * Header file used by loadable kernel modules and loadable kernel module @@ -53,9 +53,19 @@ typedef enum loadmod { LM_EXEC, LM_COMPAT, LM_MISC, - LM_DRV, + LM_DRV } MODTYPE; +#define MODTYPE_NAMES \ + "SYSCALL", \ + "VFS", \ + "DEV", \ + "STRMOD", \ + "EXEC", \ + "COMPAT", \ + "MISC", \ + "DRV" + /* * Version of module interface. Bump if kernel structures or API affecting * LKM modules change, unless the kernel version is bumped at the @@ -424,7 +434,7 @@ struct lmc_stat { }; #define LKM_MAKEMAJOR(b, c) ((((b) & 0xffff) << 16) | ((c) & 0xffff)) -#define LKM_BLOCK_MAJOR(v) (int)((int16_t)(((v) >> 16) & 0xffff)) +#define LKM_BLOCK_MAJOR(v) (int)((int16_t)(((uint32_t)(v) >> 16) & 0xffff)) #define LKM_CHAR_MAJOR(v) (int)((int16_t)((v) & 0xffff)) #endif /* !_SYS_LKM_H_ */