aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/types.h
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-01-28 17:57:16 +0000
committerEd Schouten <ed@FreeBSD.org>2009-01-28 17:57:16 +0000
commita4611ab612f1eaf057262b5251d6745a90f99294 (patch)
treea4d8791bcffe7b700a58d406674efaab2d6f59ee /sys/sys/types.h
parent688ff09fed446a18bcc970902f91f9c516d7c07d (diff)
downloadsrc-a4611ab612f1eaf057262b5251d6745a90f99294.tar.gz
src-a4611ab612f1eaf057262b5251d6745a90f99294.zip
Last step of splitting up minor and unit numbers: remove minor().
Inside the kernel, the minor() function was responsible for obtaining the device minor number of a character device. Because we made device numbers dynamically allocated and independent of the unit number passed to make_dev() a long time ago, it was actually a misnomer. If you really want to obtain the device number, you should use dev2udev(). We already converted all the drivers to use dev2unit() to obtain the device unit number, which is still used by a lot of drivers. I've noticed not a single driver passes NULL to dev2unit(). Even if they would, its behaviour would make little sense. This is why I've removed the NULL check. Ths commit removes minor(), minor2unit() and unit2minor() from the kernel. Because there was a naming collision with uminor(), we can rename umajor() and uminor() back to major() and minor(). This means that the makedev(3) manual page also applies to kernel space code now. I suspect umajor() and uminor() isn't used that often in external code, but to make it easier for other parties to port their code, I've increased __FreeBSD_version to 800062.
Notes
Notes: svn path=/head/; revision=187830
Diffstat (limited to 'sys/sys/types.h')
-rw-r--r--sys/sys/types.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/sys/sys/types.h b/sys/sys/types.h
index cf9264a599b7..66be699d6e07 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -317,17 +317,9 @@ typedef struct vm_page *vm_page_t;
* minor() gives a cookie instead of an index since we don't want to
* change the meanings of bits 0-15 or waste time and space shifting
* bits 16-31 for devices that don't use them.
- *
- * XXX: In the kernel we must name it umajor() and uminor(), because
- * minor() is still in use by <sys/conf.h>.
*/
-#ifdef _KERNEL
-#define umajor(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
-#define uminor(x) ((int)((x)&0xffff00ff)) /* minor number */
-#else /* !_KERNEL */
-#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
+#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
-#endif /* _KERNEL */
#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
/*