summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-11-29 12:38:49 +0000
committerjulian <julian@FreeBSD.org>1995-11-29 12:38:49 +0000
commit1758bf79ff52b23e5828e97e6ed62be161d761bf (patch)
treedf6dd6d66e59ff032233912a9ab538539945f4f6 /sys/i386
parente9b6a008cf513b0c36b6787afae1bf903ef945fb (diff)
downloadFreeBSD-src-1758bf79ff52b23e5828e97e6ed62be161d761bf.zip
FreeBSD-src-1758bf79ff52b23e5828e97e6ed62be161d761bf.tar.gz
#ifdef out nearly the entire file of conf.c when JREMOD is defined
add a few safety checks in specfs because now it's possible to get entries in [cd]devsw[] which are ALL NULL so it's better to discover this BEFORE jumping into the d_open() entry.. more check to come later.. this getsthe code to the stage where I can start testing it, even if I haven't caught every little error case... I guess I'll find them quick enough..
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/conf.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/i386/i386/conf.c b/sys/i386/i386/conf.c
index 3f60d83..997101d 100644
--- a/sys/i386/i386/conf.c
+++ b/sys/i386/i386/conf.c
@@ -42,7 +42,7 @@
* SUCH DAMAGE.
*
* from: @(#)conf.c 5.8 (Berkeley) 5/12/91
- * $Id: conf.c,v 1.105 1995/11/06 00:35:44 bde Exp $
+ * $Id: conf.c,v 1.106 1995/11/11 05:10:48 bde Exp $
*/
#include <sys/param.h>
@@ -54,6 +54,17 @@
#include <sys/tty.h>
#include <sys/conf.h>
+#ifdef JREMOD
+
+#define NUMCDEV 96
+#define NUMBDEV 32
+
+struct bdevsw bdevsw[NUMBDEV];
+int nblkdev = NUMBDEV
+struct cdevsw cdevsw[NUMCDEV];
+int nchrdev = NUMCDEV
+
+#else /*JREMOD*/
/* Bogus defines for compatibility. */
#define noioc noioctl
#define nostrat nostrategy
@@ -874,6 +885,11 @@ struct cdevsw cdevsw[] =
};
int nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);
+#endif /*JREMOD*/
+/*
+ * The routines below are total "BULLSHIT" and will be trashed
+ * When I have 'proved' the JREMOD changes above..
+ */
/*
* Swapdev is a fake device implemented
@@ -1021,7 +1037,11 @@ register_cdev(name, cdp)
dst_cdp = getcdevbyname(name);
if (dst_cdp == NULL)
return (ENXIO);
+#ifdef JREMOD
+ if ((dst_cdp->d_open != nxopen) && (dst_cdp->d_open != NULL))
+#else /*JREMOD*/
if (dst_cdp->d_open != nxopen)
+#endif /*JREMOD*/
return (EBUSY);
*dst_cdp = *cdp;
return (0);
OpenPOWER on IntegriCloud