|
|
1.1 ! root 1: /* $Header: /kernel/kersrc/coh.286/RCS/ct.c,v 1.1 92/07/17 15:18:00 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/07/17 15:18:00 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: ! 35: /* ! 36: * Functions for configuration. ! 37: */ ! 38: int ctopen(); ! 39: int ctclose(); ! 40: int ctread(); ! 41: int ctwrite(); ! 42: int ctioctl(); ! 43: int ctpoll(); ! 44: int nulldev(); ! 45: int nonedev(); ! 46: ! 47: /* ! 48: * Configuration table. ! 49: */ ! 50: CON ctcon ={ ! 51: DFCHR|DFPOL, /* Flags */ ! 52: 1, /* Major index */ ! 53: ctopen, /* Open */ ! 54: ctclose, /* Close */ ! 55: nulldev, /* Block */ ! 56: ctread, /* Read */ ! 57: ctwrite, /* Write */ ! 58: ctioctl, /* Ioctl */ ! 59: nulldev, /* Powerfail */ ! 60: nulldev, /* Timeout */ ! 61: nulldev, /* Load */ ! 62: nulldev, /* Unload */ ! 63: ctpoll /* Poll */ ! 64: }; ! 65: ! 66: /* ! 67: * Open. ! 68: */ ! 69: ctopen(dev, m) ! 70: dev_t dev; ! 71: { ! 72: register dev_t ttdev; ! 73: ! 74: if ((ttdev=SELF->p_ttdev) == NODEV) { ! 75: u.u_error = ENXIO; ! 76: return; ! 77: } ! 78: dopen(ttdev, m, DFCHR); ! 79: } ! 80: ! 81: /* ! 82: * Close. ! 83: */ ! 84: ctclose(dev) ! 85: dev_t dev; ! 86: { ! 87: dclose(SELF->p_ttdev); ! 88: } ! 89: ! 90: /* ! 91: * Read. ! 92: */ ! 93: ctread(dev, iop) ! 94: dev_t dev; ! 95: IO *iop; ! 96: { ! 97: dread(SELF->p_ttdev, iop); ! 98: } ! 99: ! 100: /* ! 101: * Write. ! 102: */ ! 103: ctwrite(dev, iop) ! 104: dev_t dev; ! 105: IO *iop; ! 106: { ! 107: dwrite(SELF->p_ttdev, iop); ! 108: } ! 109: ! 110: /* ! 111: * Ioctl. ! 112: */ ! 113: ctioctl(dev, com, vec) ! 114: dev_t dev; ! 115: struct sgttyb *vec; ! 116: { ! 117: dioctl(SELF->p_ttdev, com, vec); ! 118: } ! 119: ! 120: /* ! 121: * Poll. ! 122: */ ! 123: ctpoll(dev, ev) ! 124: dev_t dev; ! 125: int ev; ! 126: { ! 127: return dpoll(SELF->p_ttdev, ev); ! 128: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.