|
|
1.1 ! root 1: /* $Header: /newbits/286_KERNEL/USRSRC/coh/RCS/ct.c,v 1.1 92/01/09 13:26:32 bin Exp Locker: bin $ */ ! 2: /* (lgl- ! 3: * The information contained herein is a trade secret of Mark Williams ! 4: * Company, and is confidential information. It is provided under a ! 5: * license agreement, and may be copied or disclosed only under the ! 6: * terms of that agreement. Any reproduction or disclosure of this ! 7: * material without the express written authorization of Mark Williams ! 8: * Company or persuant to the license agreement is unlawful. ! 9: * ! 10: * COHERENT Version 2.3.37 ! 11: * Copyright (c) 1982, 1983, 1984. ! 12: * An unpublished work by Mark Williams Company, Chicago. ! 13: * All rights reserved. ! 14: -lgl) */ ! 15: /* ! 16: * Coherent ! 17: * Console terminal driver. ! 18: * ! 19: * $Log: ct.c,v $ ! 20: * Revision 1.1 92/01/09 13:26:32 bin ! 21: * Initial revision ! 22: * ! 23: * Revision 1.1 88/03/24 16:18:09 src ! 24: * Initial revision ! 25: * ! 26: * 86/11/19 Allan Cornish /usr/src/sys/drv/ct.c ! 27: * Added support for System V.3 compatible polls. ! 28: */ ! 29: #include <sys/coherent.h> ! 30: #include <sys/con.h> ! 31: #include <errno.h> ! 32: #include <sys/proc.h> ! 33: #include <sys/stat.h> ! 34: #include <sys/uproc.h> ! 35: ! 36: /* ! 37: * Functions for configuration. ! 38: */ ! 39: int ctopen(); ! 40: int ctclose(); ! 41: int ctread(); ! 42: int ctwrite(); ! 43: int ctioctl(); ! 44: int ctpoll(); ! 45: int nulldev(); ! 46: int nonedev(); ! 47: ! 48: /* ! 49: * Configuration table. ! 50: */ ! 51: CON ctcon ={ ! 52: DFCHR|DFPOL, /* Flags */ ! 53: 1, /* Major index */ ! 54: ctopen, /* Open */ ! 55: ctclose, /* Close */ ! 56: nulldev, /* Block */ ! 57: ctread, /* Read */ ! 58: ctwrite, /* Write */ ! 59: ctioctl, /* Ioctl */ ! 60: nulldev, /* Powerfail */ ! 61: nulldev, /* Timeout */ ! 62: nulldev, /* Load */ ! 63: nulldev, /* Unload */ ! 64: ctpoll /* Poll */ ! 65: }; ! 66: ! 67: /* ! 68: * Open. ! 69: */ ! 70: ctopen(dev, m) ! 71: dev_t dev; ! 72: { ! 73: register dev_t ttdev; ! 74: ! 75: if ((ttdev=SELF->p_ttdev) == NODEV) { ! 76: u.u_error = ENXIO; ! 77: return; ! 78: } ! 79: dopen(ttdev, m, DFCHR); ! 80: } ! 81: ! 82: /* ! 83: * Close. ! 84: */ ! 85: ctclose(dev) ! 86: dev_t dev; ! 87: { ! 88: dclose(SELF->p_ttdev); ! 89: } ! 90: ! 91: /* ! 92: * Read. ! 93: */ ! 94: ctread(dev, iop) ! 95: dev_t dev; ! 96: IO *iop; ! 97: { ! 98: dread(SELF->p_ttdev, iop); ! 99: } ! 100: ! 101: /* ! 102: * Write. ! 103: */ ! 104: ctwrite(dev, iop) ! 105: dev_t dev; ! 106: IO *iop; ! 107: { ! 108: dwrite(SELF->p_ttdev, iop); ! 109: } ! 110: ! 111: /* ! 112: * Ioctl. ! 113: */ ! 114: ctioctl(dev, com, vec) ! 115: dev_t dev; ! 116: struct sgttyb *vec; ! 117: { ! 118: dioctl(SELF->p_ttdev, com, vec); ! 119: } ! 120: ! 121: /* ! 122: * Poll. ! 123: */ ! 124: ctpoll(dev, ev) ! 125: dev_t dev; ! 126: int ev; ! 127: { ! 128: return dpoll(SELF->p_ttdev, ev); ! 129: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.