Annotation of coherent/d/kernel/USRSRC/ttydrv/ct.c, revision 1.1

1.1     ! root        1: /* $Header: /usr/src/sys/drv/RCS/ct.c,v 1.1 88/03/24 16:18:09 src Exp $ */
        !             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:       /usr/src/sys/drv/RCS/ct.c,v $
        !            20:  * Revision 1.1        88/03/24  16:18:09      src
        !            21:  * Initial revision
        !            22:  * 
        !            23:  * 86/11/19    Allan Cornish           /usr/src/sys/drv/ct.c
        !            24:  * Added support for System V.3 compatible polls.
        !            25:  */
        !            26: #include <sys/coherent.h>
        !            27: #include <sys/con.h>
        !            28: #include <errno.h>
        !            29: #include <sys/proc.h>
        !            30: #include <sys/stat.h>
        !            31: #include <sys/uproc.h>
        !            32: 
        !            33: /*
        !            34:  * Functions for configuration.
        !            35:  */
        !            36: int    ctopen();
        !            37: int    ctclose();
        !            38: int    ctread();
        !            39: int    ctwrite();
        !            40: int    ctioctl();
        !            41: int    ctpoll();
        !            42: int    nulldev();
        !            43: int    nonedev();
        !            44: 
        !            45: /*
        !            46:  * Configuration table.
        !            47:  */
        !            48: CON ctcon ={
        !            49:        DFCHR|DFPOL,                    /* Flags */
        !            50:        1,                              /* Major index */
        !            51:        ctopen,                         /* Open */
        !            52:        ctclose,                        /* Close */
        !            53:        nulldev,                        /* Block */
        !            54:        ctread,                         /* Read */
        !            55:        ctwrite,                        /* Write */
        !            56:        ctioctl,                        /* Ioctl */
        !            57:        nulldev,                        /* Powerfail */
        !            58:        nulldev,                        /* Timeout */
        !            59:        nulldev,                        /* Load */
        !            60:        nulldev,                        /* Unload */
        !            61:        ctpoll                          /* Poll */
        !            62: };
        !            63: 
        !            64: /*
        !            65:  * Open.
        !            66:  */
        !            67: ctopen(dev, m)
        !            68: dev_t dev;
        !            69: {
        !            70:        register dev_t ttdev;
        !            71: 
        !            72:        if ((ttdev=SELF->p_ttdev) == NODEV) {
        !            73:                u.u_error = ENXIO;
        !            74:                return;
        !            75:        }
        !            76:        dopen(ttdev, m, DFCHR);
        !            77: }
        !            78: 
        !            79: /*
        !            80:  * Close.
        !            81:  */
        !            82: ctclose(dev)
        !            83: dev_t dev;
        !            84: {
        !            85:        dclose(SELF->p_ttdev);
        !            86: }
        !            87: 
        !            88: /*
        !            89:  * Read.
        !            90:  */
        !            91: ctread(dev, iop)
        !            92: dev_t dev;
        !            93: IO *iop;
        !            94: {
        !            95:        dread(SELF->p_ttdev, iop);
        !            96: }
        !            97: 
        !            98: /*
        !            99:  * Write.
        !           100:  */
        !           101: ctwrite(dev, iop)
        !           102: dev_t dev;
        !           103: IO *iop;
        !           104: {
        !           105:        dwrite(SELF->p_ttdev, iop);
        !           106: }
        !           107: 
        !           108: /*
        !           109:  * Ioctl.
        !           110:  */
        !           111: ctioctl(dev, com, vec)
        !           112: dev_t dev;
        !           113: struct sgttyb *vec;
        !           114: {
        !           115:        dioctl(SELF->p_ttdev, com, vec);
        !           116: }
        !           117: 
        !           118: /*
        !           119:  * Poll.
        !           120:  */
        !           121: ctpoll(dev, ev)
        !           122: dev_t dev;
        !           123: int ev;
        !           124: {
        !           125:        return dpoll(SELF->p_ttdev, ev);
        !           126: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.