Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Make it possible to specify a minor number for an autoge...
details: https://anonhg.NetBSD.org/src/rev/2f27fbcd3c54
branches: trunk
changeset: 761888:2f27fbcd3c54
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Feb 10 11:00:45 2011 +0000
description:
Make it possible to specify a minor number for an autogenerated device node.
diffstat:
sys/rump/librump/rumpvfs/devnodes.c | 13 ++++++++++---
sys/sys/conf.h | 8 ++++++--
2 files changed, 16 insertions(+), 5 deletions(-)
diffs (66 lines):
diff -r 43b6a0add89b -r 2f27fbcd3c54 sys/rump/librump/rumpvfs/devnodes.c
--- a/sys/rump/librump/rumpvfs/devnodes.c Thu Feb 10 10:52:01 2011 +0000
+++ b/sys/rump/librump/rumpvfs/devnodes.c Thu Feb 10 11:00:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: devnodes.c,v 1.5 2010/04/30 21:02:36 pooka Exp $ */
+/* $NetBSD: devnodes.c,v 1.6 2011/02/10 11:00:45 pooka Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: devnodes.c,v 1.5 2010/04/30 21:02:36 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: devnodes.c,v 1.6 2011/02/10 11:00:45 pooka Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -170,6 +170,7 @@
rump_vfs_builddevs(struct devsw_conv *dcvec, size_t dcvecsize)
{
char *pnbuf = PNBUF_GET();
+ devminor_t themin;
struct devsw_conv *dc;
size_t i;
int v1, v2;
@@ -181,8 +182,14 @@
case DEVNODE_DONTBOTHER:
break;
case DEVNODE_SINGLE:
+ if (dc->d_flags & DEVNODE_FLAG_ISMINOR0) {
+ themin = dc->d_vectdim[0];
+ } else {
+ themin = 0;
+ }
makeonenode(pnbuf,
- dc->d_bmajor, dc->d_cmajor, 0, dc->d_name, -1, -1);
+ dc->d_bmajor, dc->d_cmajor, themin,
+ dc->d_name, -1, -1);
break;
case DEVNODE_VECTOR:
for (v1 = 0; v1 < dc->d_vectdim[0]; v1++) {
diff -r 43b6a0add89b -r 2f27fbcd3c54 sys/sys/conf.h
--- a/sys/sys/conf.h Thu Feb 10 10:52:01 2011 +0000
+++ b/sys/sys/conf.h Thu Feb 10 11:00:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.h,v 1.138 2011/01/05 17:00:25 jmcneill Exp $ */
+/* $NetBSD: conf.h,v 1.139 2011/02/10 11:00:45 pooka Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -231,9 +231,13 @@
enum devnode_class {
DEVNODE_DONTBOTHER,
DEVNODE_SINGLE,
- DEVNODE_VECTOR
+ DEVNODE_VECTOR,
};
#define DEVNODE_FLAG_LINKZERO 0x01 /* create name -> name0 link */
+#define DEVNODE_FLAG_ISMINOR0 0x02 /* vector[0] specifies minor */
+#ifdef notyet
+#define DEVNODE_FLAG_ISMINOR1 0x04 /* vector[1] specifies starting minor */
+#endif
struct devsw_conv {
const char *d_name;
Home |
Main Index |
Thread Index |
Old Index