summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-11-29 10:49:16 +0000
committerjulian <julian@FreeBSD.org>1995-11-29 10:49:16 +0000
commitf2f63c6ece7d25485976323df6d684743fe14bb6 (patch)
tree5ed2d747156a38098db0e540f833114bc9dd1b51 /sys/miscfs
parentbe48321f04abe146ffbc5091fe940b107f46c175 (diff)
downloadFreeBSD-src-f2f63c6ece7d25485976323df6d684743fe14bb6.zip
FreeBSD-src-f2f63c6ece7d25485976323df6d684743fe14bb6.tar.gz
OK, that's it..
That's EVERY SINGLE driver that has an entry in conf.c.. my next trick will be to define cdevsw[] and bdevsw[] as empty arrays and remove all those DAMNED defines as well.. Each of these drivers has a SYSINIT linker set entry that comes in very early.. and asks teh driver to add it's own entry to the two devsw[] tables. some slight reworking of the commits from yesterday (added the SYSINIT stuff and some usually wrong but token DEVFS entries to all these devices. BTW does anyone know where the 'ata' entries in conf.c actually reside? seems we don't actually have a 'ataopen() etc... If you want to add a new device in conf.c please make sure I know so I can keep it up to date too.. as before, this is all dependent on #if defined(JREMOD) (and #ifdef DEVFS in parts)
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/devfs/devfs_tree.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c
index bf50492..0110f8b 100644
--- a/sys/miscfs/devfs/devfs_tree.c
+++ b/sys/miscfs/devfs/devfs_tree.c
@@ -2,7 +2,7 @@
/*
* Written by Julian Elischer (julian@DIALix.oz.au)
*
- * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.7 1995/09/09 18:10:18 davidg Exp $
+ * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.8 1995/10/10 07:12:25 julian Exp $
*/
#include "param.h"
@@ -906,6 +906,50 @@ int dev_add_entry(char *name, dn_p parent, int type, union typeinfo *by, devnm_p
* Add the named device entry into the given directory, and make it *
* The appropriate type... (called (sometimes indirectly) by drivers..) *
\***********************************************************************/
+void *devfs_add_devsw(char *path,
+ char *name,
+ int major,
+ int minor,
+ int chrblk,
+ uid_t uid,
+ gid_t gid,
+ int perms)
+{
+ devnm_p new_dev;
+ dn_p dnp; /* devnode for parent directory */
+ int retval;
+ union typeinfo by;
+
+ DBPRINT(("dev_add\n"));
+ retval = dev_finddir(path,NULL,1,&dnp);
+ if (retval) return 0;
+ switch(chrblk)
+ {
+ case DV_CHR:
+ by.Cdev.cdevsw = cdevsw + major;
+ by.Cdev.dev = makedev(major, minor);
+ if( dev_add_entry(name, dnp, DEV_CDEV, &by,&new_dev))
+ return NULL;
+ break;
+ case DV_BLK:
+ by.Bdev.bdevsw = bdevsw + major;
+ by.Bdev.dev = makedev(major, minor);
+ if( dev_add_entry(name, dnp, DEV_BDEV, &by, &new_dev))
+ return NULL;
+ break;
+ default:
+ return NULL;
+ }
+ new_dev->dnp->gid = gid;
+ new_dev->dnp->uid = uid;
+ new_dev->dnp->mode |= perms;
+ return new_dev;
+}
+
+/***********************************************************************\
+* Add the named device entry into the given directory, and make it *
+* The appropriate type... (called (sometimes indirectly) by drivers..) *
+\***********************************************************************/
void *dev_add(char *path,
char *name,
void *funct,
OpenPOWER on IntegriCloud