kernel reorg
[unix-history] / usr / src / sys / vax / stand / conf.c
index e5363ae..eb27333 100644 (file)
 /*
 /*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
+ * All rights reserved.
  *
  *
- *     @(#)conf.c      7.3 (Berkeley) %G%
+ * %sccs.include.redist.c%
+ *
+ *     @(#)conf.c      7.9 (Berkeley) %G%
  */
 
  */
 
-#include "../machine/pte.h"
-
-#include "../h/param.h"
-#include "../h/inode.h"
-#include "../h/fs.h"
-
-#include "../vaxmba/mbareg.h"
-
-#include "saio.h"
-
-devread(io)
-       register struct iob *io;
-{
-       int cc;
-
-       io->i_flgs |= F_RDDATA;
-       io->i_error = 0;
-       cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ);
-       io->i_flgs &= ~F_TYPEMASK;
-       return (cc);
-}
-
-devwrite(io)
-       register struct iob *io;
-{
-       int cc;
-
-       io->i_flgs |= F_WRDATA;
-       io->i_error = 0;
-       cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE);
-       io->i_flgs &= ~F_TYPEMASK;
-       return (cc);
-}
-
-devopen(io)
-       register struct iob *io;
-{
-
-       return (*devsw[io->i_ino.i_dev].dv_open)(io);
-}
-
-devclose(io)
-       register struct iob *io;
-{
-
-       (*devsw[io->i_ino.i_dev].dv_close)(io);
-}
-
-devioctl(io, cmd, arg)
-       register struct iob *io;
-       int cmd;
-       caddr_t arg;
-{
-
-       return ((*devsw[io->i_ino.i_dev].dv_ioctl)(io, cmd, arg));
-}
-
-/*ARGSUSED*/
-nullsys(io)
-       struct iob *io;
-{
-
-       ;
-}
+#include "sys/param.h"
+#include "stand/saio.h"
 
 
-/*ARGSUSED*/
-nodev(io)
-       struct iob *io;
-{
-
-       errno = EBADF;
-}
-
-/*ARGSUSED*/
-noioctl(io, cmd, arg)
-       struct iob *io;
-       int cmd;
-       caddr_t arg;
-{
-
-       return (ECMD);
-}
+extern int     nullsys(), nodev(), noioctl();
 
 #if defined(VAX780) || defined(VAX750) || defined(VAX8600)
 #define        HP              "hp"
 
 #if defined(VAX780) || defined(VAX750) || defined(VAX8600)
 #define        HP              "hp"
-int    hpstrategy(), hpopen(), hpioctl();
+int    hpstrategy(), hpopen();
+#ifdef SMALL
+#define        hpioctl         noioctl
 #else
 #else
-#define        HP              ""
+int    hpioctl();
+#endif
+#else
+#define        HP              0
 #define        hpstrategy      nodev
 #define        hpopen          nodev
 #define        hpioctl         noioctl
 #endif
 #define        hpstrategy      nodev
 #define        hpopen          nodev
 #define        hpioctl         noioctl
 #endif
-int    upstrategy(), upopen(), upioctl();
-int    rkstrategy(), rkopen(), rkioctl();
-int    rastrategy(), raopen(), raioctl();
+
+int    upstrategy(), upopen();
+#ifdef SMALL
+#define        upioctl         noioctl
+#else
+int    upioctl();
+#endif
+
+int    rkstrategy(), rkopen();
+int    rastrategy(), raopen();
+
 #if defined(VAX730)
 #define        RB              "rb"
 #if defined(VAX730)
 #define        RB              "rb"
-int    idcstrategy(), idcopen(), idcioctl();
+int    idcstrategy(), idcopen();
 #else
 #else
-#define        RB              ""
+#define        RB              0
 #define        idcstrategy     nodev
 #define        idcopen         nodev
 #define        idcstrategy     nodev
 #define        idcopen         nodev
-#define        idcioctl        noioctl
 #endif
 #endif
-int    rlstrategy(), rlopen(), rlioctl();
 
 
-#ifndef BOOT
+int    rlstrategy(), rlopen();
+
+#ifdef BOOT
+#define        TM              0
+#define        tmstrategy      nodev
+#define        tmopen          nodev
+#define        tmclose         nodev
+#define        TS              0
+#define        tsstrategy      nodev
+#define        tsopen          nodev
+#define        tsclose         nodev
+#define        HT              0
+#define        htstrategy      nodev
+#define        htopen          nodev
+#define        htclose         nodev
+#define        MT              0
+#define        mtstrategy      nodev
+#define        mtopen          nodev
+#define        mtclose         nodev
+#define        UT              0
+#define        utstrategy      nodev
+#define        utopen          nodev
+#define        utclose         nodev
+#define        TMSCP           0
+#define        tmscpstrategy   nodev
+#define        tmscpopen       nodev
+#define        tmscpclose      nodev
+#else /* !BOOT */
 #define        TM              "tm"
 int    tmstrategy(), tmopen(), tmclose();
 #define        TS              "ts"
 int    tsstrategy(), tsopen(), tsclose();
 #define        TM              "tm"
 int    tmstrategy(), tmopen(), tmclose();
 #define        TS              "ts"
 int    tsstrategy(), tsopen(), tsclose();
+
 #if defined(VAX780) || defined(VAX750) || defined(VAX8600)
 #define        HT              "ht"
 int    htstrategy(), htopen(), htclose();
 #define        MT              "mt"
 int    mtstrategy(), mtopen(), mtclose();
 #if defined(VAX780) || defined(VAX750) || defined(VAX8600)
 #define        HT              "ht"
 int    htstrategy(), htopen(), htclose();
 #define        MT              "mt"
 int    mtstrategy(), mtopen(), mtclose();
-
-#else massbus vax
-#define        HT              ""
+#else /* massbus vax */
+#define        HT              0
 #define        htstrategy      nodev
 #define        htopen          nodev
 #define        htclose         nodev
 #define        htstrategy      nodev
 #define        htopen          nodev
 #define        htclose         nodev
-#define        MT              ""
+#define        MT              0
 #define        mtstrategy      nodev
 #define        mtopen          nodev
 #define        mtclose         nodev
 #define        mtstrategy      nodev
 #define        mtopen          nodev
 #define        mtclose         nodev
-#endif massbus vax
+#endif /* massbus vax */
 
 #define        UT              "ut"
 int    utstrategy(), utopen(), utclose();
 
 #define        UT              "ut"
 int    utstrategy(), utopen(), utclose();
-#else BOOT
-#define        TM              ""
-#define        tmstrategy      nodev
-#define        tmopen          nodev
-#define        tmclose         nodev
-#define        TS              ""
-#define        tsstrategy      nodev
-#define        tsopen          nodev
-#define        tsclose         nodev
-#define        HT              ""
-#define        htstrategy      nodev
-#define        htopen          nodev
-#define        htclose         nodev
-#define        MT              ""
-#define        mtstrategy      nodev
-#define        mtopen          nodev
-#define        mtclose         nodev
-#define        UT              ""
-#define        utstrategy      nodev
-#define        utopen          nodev
-#define        utclose         nodev
+#define        TMSCP           "tms"
+int    tmscpstrategy(), tmscpopen(), tmscpclose();
+#endif /* BOOT */
+
+#ifdef VAX8200
+#define        KRA             "kra"
+int    krastrategy(), kraopen();
+#else
+#define        KRA             0
+#define        krastrategy     nodev
+#define        kraopen         nodev
 #endif
 
 struct devsw devsw[] = {
 #endif
 
 struct devsw devsw[] = {
-       { HP,   hpstrategy,     hpopen, nullsys,        hpioctl }, /* 0 = hp */
-       { HT,   htstrategy,     htopen, htclose,        noioctl }, /* 1 = ht */
-       { "up", upstrategy,     upopen, nullsys,        upioctl }, /* 2 = up */
-       { "hk", rkstrategy,     rkopen, nullsys,        rkioctl }, /* 3 = hk */
-       { "",   nodev,          nodev,  nullsys,        noioctl }, /* 4 = sw */
-       { TM,   tmstrategy,     tmopen, tmclose,        noioctl }, /* 5 = tm */
-       { TS,   tsstrategy,     tsopen, tsclose,        noioctl }, /* 6 = ts */
-       { MT,   mtstrategy,     mtopen, mtclose,        noioctl }, /* 7 = mt */
-       { "",   nodev,          nodev,  nullsys,        noioctl }, /* 8 = tu */
-       { "ra", rastrategy,     raopen, nullsys,        raioctl }, /* 9 = ra */
-       { UT,   utstrategy,     utopen, utclose,        noioctl }, /* 10 = ut */
-       { RB,   idcstrategy,    idcopen,nullsys,        idcioctl },/* 11 = rb */
-       { "",   nodev,          nodev,  nullsys,        noioctl }, /* 12 = uu */
-       { "",   nodev,          nodev,  nullsys,        noioctl }, /* 13 = rx */
-       { "rl", rlstrategy,     rlopen, nullsys,        rlioctl }, /* 14 = rl */
-       { 0, 0, 0, 0, 0 },
+       { HP,   hpstrategy,     hpopen, nullsys, hpioctl },  /*  0 = hp */
+       { HT,   htstrategy,     htopen, htclose, noioctl },  /*  1 = ht */
+       { "up", upstrategy,     upopen, nullsys, upioctl },  /*  2 = up */
+       { "hk", rkstrategy,     rkopen, nullsys, noioctl },  /*  3 = hk */
+       { 0,    nodev,          nodev,  nullsys, noioctl },  /*  4 = sw */
+       { TM,   tmstrategy,     tmopen, tmclose, noioctl },  /*  5 = tm */
+       { TS,   tsstrategy,     tsopen, tsclose, noioctl },  /*  6 = ts */
+       { MT,   mtstrategy,     mtopen, mtclose, noioctl },  /*  7 = mt */
+       { 0,    nodev,          nodev,  nullsys, noioctl },  /*  8 = tu */
+       { "ra", rastrategy,     raopen, nullsys, noioctl },  /*  9 = ra */
+       { UT,   utstrategy,     utopen, utclose, noioctl },  /* 10 = ut */
+       { RB,   idcstrategy,    idcopen,nullsys, noioctl },  /* 11 = rb */
+       { 0,    nodev,          nodev,  nullsys, noioctl },  /* 12 = uu */
+       { 0,    nodev,          nodev,  nullsys, noioctl },  /* 13 = rx */
+       { "rl", rlstrategy,     rlopen, nullsys, noioctl },  /* 14 = rl */
+       { TMSCP,tmscpstrategy,tmscpopen,tmscpclose,noioctl}, /* 15 = tmscp */
+       { KRA,  krastrategy,    kraopen,nullsys, noioctl},   /* 16 = kra */
 };
 
 };
 
-int    ndevs = (sizeof(devsw) / sizeof(devsw[0]) - 1);
+int    ndevs = (sizeof(devsw)/sizeof(devsw[0]));