1: /*
   2:  *	SCCS id	%W% (Berkeley)	%G%
   3:  */
   4: 
   5: #include    "param.h"
   6: #include    <sys/systm.h>
   7: #include    <sys/buf.h>
   8: #include    <sys/tty.h>
   9: #include    <sys/conf.h>
  10: #include    <sys/proc.h>
  11: #include    <sys/text.h>
  12: #include    <sys/dir.h>
  13: #include    <sys/user.h>
  14: #include    <sys/file.h>
  15: #include    <sys/inode.h>
  16: #include    <sys/acct.h>
  17: #include    <sys/map.h>
  18: #include    <sys/filsys.h>
  19: #include    <sys/mount.h>
  20: 
  21: 
  22: int nulldev();
  23: int nodev();
  24: int nullioctl();
  25: 
  26: #include    "bk.h"
  27: #if NBK > 0
  28: int bkopen(), bkclose(), bkread(), bkioctl(), bkinput();
  29: #else
  30: #define bkopen      nodev
  31: #define bkclose     nodev
  32: #define bkread      nodev
  33: #define bkioctl     nodev
  34: #define bkinput     nodev
  35: #endif	NBK
  36: 
  37: #include    "dh.h"
  38: #if NDH > 0
  39: int dhopen(), dhclose(), dhread(), dhwrite(), dhioctl(), dhstop();
  40: extern  struct  tty dh11[];
  41: #else
  42: #define dhopen      nodev
  43: #define dhclose     nodev
  44: #define dhread      nodev
  45: #define dhwrite     nodev
  46: #define dhioctl     nodev
  47: #define dhstop      nodev
  48: #define dh11        ((struct tty *) NULL)
  49: #endif	NDH
  50: 
  51: #include    "dn.h"
  52: #if NDN > 0
  53: int dnopen(), dnclose(), dnwrite();
  54: #else
  55: #define dnopen      nodev
  56: #define dnclose     nodev
  57: #define dnwrite     nodev
  58: #endif	NDN
  59: 
  60: #include    "dz.h"
  61: #if NDZ > 0
  62: int dzopen(), dzclose(), dzread(), dzwrite(), dzioctl();
  63: #ifdef  DZ_PDMA
  64: int dzstop();
  65: #else
  66: #define dzstop      nulldev
  67: #endif
  68: extern  struct  tty dz11[];
  69: #else
  70: #define dzopen      nodev
  71: #define dzclose     nodev
  72: #define dzread      nodev
  73: #define dzwrite     nodev
  74: #define dzioctl     nodev
  75: #define dzstop      nodev
  76: #define dz11        ((struct tty *) NULL)
  77: #endif	NDZ
  78: 
  79: #include    "hk.h"
  80: #if NHK > 0
  81: int hkstrategy(), hkread(), hkwrite(), hkroot();
  82: extern  struct  buf hktab;
  83: #define hkopen      nulldev
  84: #define hkclose     nulldev
  85: #define _hktab      &hktab
  86: #else
  87: #define hkopen      nodev
  88: #define hkclose     nodev
  89: #define hkstrategy  nodev
  90: #define hkread      nodev
  91: #define hkwrite     nodev
  92: #define hkroot      nulldev
  93: #define _hktab      ((struct buf *) NULL)
  94: #endif	NHK
  95: 
  96: #include    "hp.h"
  97: #if NHP > 0
  98: int hpstrategy(), hpread(), hpwrite(), hproot();
  99: extern  struct  buf hptab;
 100: #define hpopen      nulldev
 101: #define hpclose     nulldev
 102: #define _hptab      &hptab
 103: #else
 104: #define hpopen      nodev
 105: #define hpclose     nodev
 106: #define hproot      nulldev
 107: #define hpstrategy  nodev
 108: #define hpread      nodev
 109: #define hpwrite     nodev
 110: #define _hptab      ((struct buf *) NULL)
 111: #endif	NHP
 112: 
 113: #include    "hs.h"
 114: #if NHS > 0
 115: int hsstrategy(), hsread(), hswrite(), hsroot();
 116: extern  struct  buf hstab;
 117: #define _hstab      &hstab
 118: #define hsopen      nulldev
 119: #define hsclose     nulldev
 120: #else
 121: #define hsopen      nodev
 122: #define hsclose     nodev
 123: #define hsstrategy  nodev
 124: #define hsread      nodev
 125: #define hswrite     nodev
 126: #define hsroot      nulldev
 127: #define _hstab      ((struct buf *) NULL)
 128: #endif	NHS
 129: 
 130: #include    "ht.h"
 131: #if NHT > 0
 132: int htopen(), htclose(), htread(), htwrite(), htstrategy();
 133: #ifdef  HT_IOCTL
 134: int htioctl();
 135: #else
 136: #define htioctl     nodev
 137: #endif
 138: extern  struct  buf httab;
 139: #define _httab      &httab
 140: #else
 141: #define htopen      nodev
 142: #define htclose     nodev
 143: #define htread      nodev
 144: #define htwrite     nodev
 145: #define htioctl     nodev
 146: #define htstrategy  nodev
 147: #define _httab      ((struct buf *) NULL)
 148: #endif	NHT
 149: 
 150: #include    "lp.h"
 151: #if NLP > 0
 152: int lpopen(), lpclose(), lpwrite();
 153: #else
 154: #define lpopen      nodev
 155: #define lpclose     nodev
 156: #define lpwrite     nodev
 157: #endif	NLP
 158: 
 159: #include    "rk.h"
 160: #if NRK > 0
 161: int rkstrategy(), rkread(), rkwrite();
 162: extern  struct  buf rktab;
 163: #define rkopen      nulldev
 164: #define rkclose     nulldev
 165: #define _rktab      &rktab
 166: #else
 167: #define rkopen      nodev
 168: #define rkclose     nodev
 169: #define rkstrategy  nodev
 170: #define rkread      nodev
 171: #define rkwrite     nodev
 172: #define _rktab      ((struct buf *) NULL)
 173: #endif	NRK
 174: 
 175: #include    "rl.h"
 176: #if NRL > 0
 177: int rlstrategy(), rlread(), rlwrite();
 178: extern  struct  buf rltab;
 179: #define rlopen      nulldev
 180: #define rlclose     nulldev
 181: #define _rltab      &rltab
 182: #else
 183: #define rlopen      nodev
 184: #define rlclose     nodev
 185: #define rlstrategy  nodev
 186: #define rlread      nodev
 187: #define rlwrite     nodev
 188: #define _rltab      ((struct buf *) NULL)
 189: #endif	NRL
 190: 
 191: #include    "rm.h"
 192: #if NRM > 0
 193: int rmstrategy(), rmread(), rmwrite(), rmroot();
 194: extern  struct  buf rmtab;
 195: #define rmopen      nulldev
 196: #define rmclose     nulldev
 197: #define _rmtab      &rmtab
 198: #else
 199: #define rmopen      nodev
 200: #define rmclose     nodev
 201: #define rmroot      nulldev
 202: #define rmstrategy  nodev
 203: #define rmread      nodev
 204: #define rmwrite     nodev
 205: #define _rmtab      ((struct buf *) NULL)
 206: #endif	NRM
 207: 
 208: #include    "rp.h"
 209: #if NRP > 0
 210: int rpstrategy(), rpread(), rpwrite();
 211: extern  struct  buf rptab;
 212: #define rpopen      nulldev
 213: #define rpclose     nulldev
 214: #define _rptab      &rptab
 215: #else
 216: #define rpopen      nodev
 217: #define rpclose     nodev
 218: #define rpstrategy  nodev
 219: #define rpread      nodev
 220: #define rpwrite     nodev
 221: #define _rptab      ((struct buf *) NULL)
 222: #endif	NRP
 223: 
 224: #include    "tm.h"
 225: #if NTM > 0
 226: int tmopen(), tmclose(), tmread(), tmwrite(), tmstrategy();
 227: #ifdef  TM_IOCTL
 228: int tmioctl();
 229: #else
 230: #define tmioctl     nodev
 231: #endif
 232: extern  struct  buf tmtab;
 233: #define _tmtab      &tmtab
 234: #else
 235: #define tmopen      nodev
 236: #define tmclose     nodev
 237: #define tmread      nodev
 238: #define tmwrite     nodev
 239: #define tmioctl     nodev
 240: #define tmstrategy  nodev
 241: #define _tmtab      ((struct buf *) NULL)
 242: #endif	NTM
 243: 
 244: #include    "ts.h"
 245: #if NTS > 0
 246: int tsopen(), tsclose(), tsread(), tswrite(), tsstrategy();
 247: #ifdef  TS_IOCTL
 248: int tsioctl();
 249: #else
 250: #define tsioctl     nodev
 251: #endif
 252: extern  struct  buf tstab;
 253: #define _tstab      &tstab
 254: #else
 255: #define tsopen      nodev
 256: #define tsclose     nodev
 257: #define tsread      nodev
 258: #define tswrite     nodev
 259: #define tsioctl     nodev
 260: #define tsstrategy  nodev
 261: #define _tstab      ((struct buf *) NULL)
 262: #endif	NTS
 263: 
 264: #include    "vp.h"
 265: #if NVP > 0
 266: int vpopen(), vpclose(), vpwrite(), vpioctl();
 267: #else
 268: #define vpopen      nodev
 269: #define vpclose     nodev
 270: #define vpwrite     nodev
 271: #define vpioctl     nodev
 272: #endif	NVP
 273: 
 274: #include    "xp.h"
 275: #if NXP > 0
 276: int xpstrategy(), xpread(), xpwrite(), xproot();
 277: extern  struct  buf xptab;
 278: #define xpopen      nulldev
 279: #define xpclose     nulldev
 280: #define _xptab      &xptab
 281: #else
 282: #define xpopen      nodev
 283: #define xpclose     nodev
 284: #define xproot      nulldev
 285: #define xpstrategy  nodev
 286: #define xpread      nodev
 287: #define xpwrite     nodev
 288: #define _xptab      ((struct buf *) NULL)
 289: #endif	NXP
 290: 
 291: struct  bdevsw  bdevsw[] =
 292: {
 293:     rkopen,     rkclose,    rkstrategy,
 294:     nulldev,    _rktab,     /* rk = 0 */
 295: 
 296:     rpopen,     rpclose,    rpstrategy,
 297:     nulldev,    _rptab,     /* rp = 1 */
 298: 
 299:     nodev,      nodev,      nodev,
 300:     nulldev,    0,      /* rf = 2 */
 301: 
 302:     tmopen,     tmclose,    tmstrategy,
 303:     nulldev,    _tmtab,     /* tm = 3 */
 304: 
 305:     hkopen,     hkclose,    hkstrategy,
 306:     hkroot,     _hktab,     /* hk = 4 */
 307: 
 308:     hsopen,     hsclose,    hsstrategy,
 309:     hsroot,     _hstab,     /* hs = 5 */
 310: 
 311: #if NXP > 0
 312:     xpopen,     xpclose,    xpstrategy,
 313:     xproot,     _xptab,     /* xp = 6 */
 314: #else
 315: 
 316: #if NHP > 0
 317:     hpopen,     hpclose,    hpstrategy,
 318:     hproot,     _hptab,     /* hp = 6 */
 319: #else
 320: 
 321:     rmopen,     rmclose,    rmstrategy,
 322:     rmroot,     _rmtab,     /* rm = 6 */
 323: #endif
 324: #endif
 325: 
 326:     htopen,     htclose,    htstrategy,
 327:     nulldev,    _httab,     /* ht = 7 */
 328: 
 329:     rlopen,     rlclose,    rlstrategy,
 330:     nulldev,    _rltab,     /* rl = 8 */
 331: 
 332:     tsopen,     tsclose,    tsstrategy,
 333:     nulldev,    _tstab,     /* ts = 9 */
 334: };
 335: int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
 336: 
 337: int klopen(), klclose(), klread(), klwrite(), klioctl();
 338: extern  struct  tty kl11[];
 339: int mmread(), mmwrite();
 340: int syopen(), syread(), sywrite(), sysioctl();
 341: 
 342: struct  cdevsw  cdevsw[] =
 343: {
 344:     klopen,     klclose,    klread,     klwrite,
 345:     klioctl,    nulldev,    kl11,       /* kl = 0 */
 346: 
 347:     nodev,      nodev,      nodev,      nodev,
 348:     nodev,      nodev,      0,      /* pc = 1 */
 349: 
 350:     vpopen,     vpclose,    nodev,      vpwrite,
 351:     vpioctl,    nulldev,    0,      /* vp = 2 */
 352: 
 353:     lpopen,     lpclose,    nodev,      lpwrite,
 354:     nodev,      nulldev,    0,      /* lp = 3 */
 355: 
 356:     dhopen,     dhclose,    dhread,     dhwrite,
 357:     dhioctl,    dhstop,     dh11,       /* dh = 4 */
 358: 
 359:     nodev,      nodev,      nodev,      nodev,
 360:     nodev,      nodev,      0,      /* dp = 5 */
 361: 
 362:     nodev,      nodev,      nodev,      nodev,
 363:     nodev,      nodev,      0,      /* dj = 6 */
 364: 
 365:     dnopen,     dnclose,    nodev,      dnwrite,
 366:     nodev,      nulldev,    0,      /* dn = 7 */
 367: 
 368:     nulldev,    nulldev,    mmread,     mmwrite,
 369:     nodev,      nulldev,    0,      /* mem = 8 */
 370: 
 371:     rkopen,     rkclose,    rkread,     rkwrite,
 372:     nodev,      nulldev,    0,      /* rk = 9 */
 373: 
 374:     nodev,      nodev,      nodev,      nodev,
 375:     nodev,      nodev,      0,      /* rf = 10 */
 376: 
 377:     rpopen,     rpclose,    rpread,     rpwrite,
 378:     nodev,      nulldev,    0,      /* rp = 11 */
 379: 
 380:     tmopen,     tmclose,    tmread,     tmwrite,
 381:     tmioctl,    nulldev,    0,      /* tm = 12 */
 382: 
 383:     hsopen,     hsclose,    hsread,     hswrite,
 384:     nodev,      nulldev,    0,      /* hs = 13 */
 385: 
 386: #if NXP > 0
 387:     xpopen,     xpclose,    xpread,     xpwrite,
 388:     nodev,      nulldev,    0,      /* xp = 14 */
 389: #else
 390: #if NHP > 0
 391: 
 392:     hpopen,     hpclose,    hpread,     hpwrite,
 393:     nodev,      nulldev,    0,      /* hp = 14 */
 394: #else
 395: 
 396:     rmopen,     rmclose,    rmread,     rmwrite,
 397:     nodev,      nulldev,    0,      /* rm = 14 */
 398: #endif
 399: #endif
 400: 
 401:     htopen,     htclose,    htread,     htwrite,
 402:     htioctl,    nulldev,    0,      /* ht = 15 */
 403: 
 404:     nodev,      nodev,      nodev,      nodev,
 405:     nodev,      nodev,      0,      /* du = 16 */
 406: 
 407:     syopen,     nulldev,    syread,     sywrite,
 408:     sysioctl,   nulldev,    0,      /* tty = 17 */
 409: 
 410:     rlopen,     rlclose,    rlread,     rlwrite,
 411:     nodev,      nulldev,    0,      /* rl = 18 */
 412: 
 413:     hkopen,     hkclose,    hkread,     hkwrite,
 414:     nodev,      nulldev,    0,      /* hk = 19 */
 415: 
 416:     tsopen,     tsclose,    tsread,     tswrite,
 417:     tsioctl,    nulldev,    0,      /* ts = 20 */
 418: 
 419:     dzopen,     dzclose,    dzread,     dzwrite,
 420:     dzioctl,    dzstop,     dz11,       /* dz = 21 */
 421: 
 422: };
 423: 
 424: int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
 425: 
 426: #ifdef  OLDTTY
 427: int ttread(), ttyinput(), ttyoutput();
 428: caddr_t ttwrite();
 429: #define ttopen      nulldev
 430: #define ttclose     nulldev
 431: #define ttioctl     nullioctl
 432: #define ttmodem     nulldev
 433: #else
 434: #define ttopen      nodev
 435: #define ttclose     nodev
 436: #define ttread      nodev
 437: #define ttwrite     nodev
 438: #define ttioctl     nodev
 439: #define ttyinput    nodev
 440: #define ttyoutput   nodev
 441: #define ttmodem     nodev
 442: #endif
 443: 
 444: 
 445: #ifdef  UCB_NTTY
 446: int ntyopen(), ntyclose(), ntread(), ntyinput(), ntyoutput();
 447: caddr_t ntwrite();
 448: #define ntyioctl    nullioctl
 449: #define ntymodem    nulldev
 450: #else
 451: #define ntyopen     nodev
 452: #define ntyclose    nodev
 453: #define ntread      nodev
 454: #define ntwrite     nodev
 455: #define ntyioctl    nodev
 456: #define ntyinput    nodev
 457: #define ntyoutput   nodev
 458: #define ntymodem    nodev
 459: #endif
 460: 
 461: struct  linesw linesw[] =
 462: {
 463:     ttopen,     ttclose,    ttread,     ttwrite,
 464:     ttioctl,    ttyinput,   ttyoutput,  ttmodem,    /*0*/
 465: 
 466:     ntyopen,    ntyclose,   ntread,     ntwrite,
 467:     ntyioctl,   ntyinput,   ntyoutput,  ntymodem,   /*1*/
 468: 
 469: #if NBK > 0
 470:     bkopen,     bkclose,    bkread,     ttwrite,
 471:     bkioctl,    bkinput,    nodev,      nulldev     /*2*/
 472: #endif
 473: };
 474: 
 475: #ifndef MPX_FILS
 476: int nldisp  = sizeof(linesw) / sizeof(linesw[0]);
 477: #else
 478: int nldisp  = sizeof(linesw) / sizeof(linesw[0]) - 1;
 479: int mpxchan();
 480: int (*ldmpx)()  = mpxchan;
 481: #endif

Defined variables

bdevsw defined in line 291; used 2 times
  • in line 335(2)
cdevsw defined in line 342; used 2 times
  • in line 424(2)
linesw defined in line 461; used 4 times
nblkdev defined in line 335; never used
nchrdev defined in line 424; never used
nldisp defined in line 478; never used

Defined macros

_hktab defined in line 93; used 1 times
_hptab defined in line 110; used 1 times
_hstab defined in line 127; used 1 times
_httab defined in line 147; used 1 times
_rktab defined in line 172; used 1 times
_rltab defined in line 188; used 1 times
_rmtab defined in line 205; used 1 times
_rptab defined in line 221; used 1 times
_tmtab defined in line 241; used 1 times
_tstab defined in line 261; used 1 times
_xptab defined in line 288; used 1 times
bkclose defined in line 31; used 2 times
bkinput defined in line 34; used 2 times
bkioctl defined in line 33; used 2 times
bkopen defined in line 30; used 2 times
bkread defined in line 32; used 2 times
dh11 defined in line 48; used 1 times
dhclose defined in line 43; used 2 times
dhioctl defined in line 46; used 2 times
dhopen defined in line 42; used 2 times
dhread defined in line 44; used 2 times
dhstop defined in line 47; used 2 times
dhwrite defined in line 45; used 2 times
dnclose defined in line 56; used 2 times
dnopen defined in line 55; used 2 times
dnwrite defined in line 57; used 2 times
dz11 defined in line 76; used 1 times
dzclose defined in line 71; used 2 times
dzioctl defined in line 74; used 2 times
dzopen defined in line 70; used 2 times
dzread defined in line 72; used 2 times
dzstop defined in line 75; used 2 times
dzwrite defined in line 73; used 2 times
hkclose defined in line 88; used 2 times
hkopen defined in line 87; used 2 times
hkread defined in line 90; used 2 times
hkroot defined in line 92; used 2 times
hkstrategy defined in line 89; used 2 times
hkwrite defined in line 91; used 2 times
hpclose defined in line 105; used 2 times
hpopen defined in line 104; used 2 times
hpread defined in line 108; used 2 times
hproot defined in line 106; used 2 times
hpstrategy defined in line 107; used 2 times
hpwrite defined in line 109; used 2 times
hsclose defined in line 122; used 2 times
hsopen defined in line 121; used 2 times
hsread defined in line 124; used 2 times
hsroot defined in line 126; used 2 times
hsstrategy defined in line 123; used 2 times
hswrite defined in line 125; used 2 times
htclose defined in line 142; used 3 times
htioctl defined in line 145; used 2 times
htopen defined in line 141; used 3 times
htread defined in line 143; used 2 times
htstrategy defined in line 146; used 2 times
htwrite defined in line 144; used 2 times
lpclose defined in line 155; used 2 times
lpopen defined in line 154; used 2 times
lpwrite defined in line 156; used 2 times
ntread defined in line 453; used 2 times
ntwrite defined in line 454; used 2 times
ntyclose defined in line 452; used 2 times
ntyinput defined in line 456; used 2 times
ntyioctl defined in line 455; used 1 times
ntymodem defined in line 458; used 1 times
ntyopen defined in line 451; used 2 times
ntyoutput defined in line 457; used 2 times
rkclose defined in line 168; used 2 times
rkopen defined in line 167; used 2 times
rkread defined in line 170; used 2 times
rkstrategy defined in line 169; used 2 times
rkwrite defined in line 171; used 2 times
rlclose defined in line 184; used 2 times
rlopen defined in line 183; used 2 times
rlread defined in line 186; used 2 times
rlstrategy defined in line 185; used 2 times
rlwrite defined in line 187; used 2 times
rmclose defined in line 200; used 2 times
rmopen defined in line 199; used 2 times
rmread defined in line 203; used 2 times
rmroot defined in line 201; used 2 times
rmstrategy defined in line 202; used 2 times
rmwrite defined in line 204; used 2 times
rpclose defined in line 217; used 2 times
rpopen defined in line 216; used 2 times
rpread defined in line 219; used 2 times
rpstrategy defined in line 218; used 2 times
rpwrite defined in line 220; used 2 times
tmclose defined in line 236; used 3 times
tmioctl defined in line 239; used 2 times
tmopen defined in line 235; used 3 times
tmread defined in line 237; used 2 times
tmstrategy defined in line 240; used 2 times
tmwrite defined in line 238; used 2 times
tsclose defined in line 256; used 3 times
tsioctl defined in line 259; used 2 times
tsopen defined in line 255; used 3 times
tsread defined in line 257; used 2 times
tsstrategy defined in line 260; used 2 times
tswrite defined in line 258; used 2 times
ttclose defined in line 435; used 1 times
ttioctl defined in line 438; used 1 times
ttmodem defined in line 441; used 1 times
ttopen defined in line 434; used 1 times
ttread defined in line 436; used 2 times
ttwrite defined in line 437; used 3 times
ttyinput defined in line 439; used 2 times
ttyoutput defined in line 440; used 2 times
vpclose defined in line 269; used 2 times
vpioctl defined in line 271; used 2 times
vpopen defined in line 268; used 2 times
vpwrite defined in line 270; used 2 times
xpclose defined in line 283; used 2 times
xpopen defined in line 282; used 2 times
xpread defined in line 286; used 2 times
xproot defined in line 284; used 2 times
xpstrategy defined in line 285; used 2 times
xpwrite defined in line 287; used 2 times
Last modified: 1983-12-22
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2544
Valid CSS Valid XHTML 1.0 Strict