Annotation of coherent/f/etc/conf/streams/src/stub.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * This file contains the entry points into the STREAMS system called by the
                      3:  * Coherent kernel. In this file, they are all stubs, for use when other parts
                      4:  * of the kernel have had STREAMS support enabled but you really don't want
                      5:  * STREAMS.
                      6:  */
                      7: 
                      8: #define        _DDI_DKI        1
                      9: #define        _SYSV3          1
                     10: 
                     11: #include <common/ccompat.h>
                     12: #include <sys/inline.h>
                     13: #include <stddef.h>
                     14: 
                     15: #define        __KERNEL__      2
                     16: 
                     17: #if    __MSDOS__
                     18: #include <sys/_con.h>
                     19: #else
                     20: #include <sys/con.h>
                     21: #endif
                     22: 
                     23: #undef __KERNEL__
                     24: 
                     25: 
                     26: #if    __USE_PROTO__
                     27: void (STREAMS_SCHEDULER) (void)
                     28: #else
                     29: void
                     30: STREAMS_SCHEDULER __ARGS (())
                     31: #endif
                     32: {
                     33: }
                     34: 
                     35: 
                     36: /*
                     37:  * Shut things down, in the right order.
                     38:  */
                     39: 
                     40: #if    __USE_PROTO__
                     41: void (STREAMS_EXIT) (void)
                     42: #else
                     43: void
                     44: STREAMS_EXIT __ARGS (())
                     45: #endif
                     46: {
                     47: }
                     48: 
                     49: 
                     50: /*
                     51:  * Get an old Coherent "CON" entry.
                     52:  */
                     53: 
                     54: #if    __USE_PROTO__
                     55: CON * (STREAMS_GETCON) (o_dev_t dev)
                     56: #else
                     57: CON *
                     58: STREAMS_GETCON __ARGS ((dev))
                     59: o_dev_t                dev;
                     60: #endif
                     61: {
                     62:        return NULL;
                     63: }
                     64: 
                     65: 
                     66: /*
                     67:  * Start things up, in the right order. If we can't proceed, panic.
                     68:  */
                     69: 
                     70: #if    __USE_PROTO__
                     71: void (STREAMS_INIT) (void)
                     72: #else
                     73: void
                     74: STREAMS_INIT __ARGS (())
                     75: #endif
                     76: {
                     77: }
                     78: 
                     79: 
                     80: /*
                     81:  * Check STREAMS timeouts.
                     82:  */
                     83: 
                     84: #if    __USE_PROTO__
                     85: void (STREAMS_TIMEOUT) (void)
                     86: #else
                     87: void
                     88: STREAMS_TIMEOUT __ARGS (())
                     89: #endif
                     90: {
                     91: }
                     92: 
                     93: 
                     94: /*
                     95:  * Set an interrupt mask.
                     96:  */
                     97: 
                     98: #if    __USE_PROTO__
                     99: void (DDI_BASE_MASTER_MASK) (uchar_t mask)
                    100: #else
                    101: void
                    102: DDI_BASE_MASTER_MASK __ARGS ((mask))
                    103: uchar_t                mask;
                    104: #endif
                    105: {
                    106:        outb (__PICM__, mask);
                    107: }
                    108: 
                    109: #if    __USE_PROTO__
                    110: void (DDI_BASE_SLAVE_MASK) (uchar_t mask)
                    111: #else
                    112: void
                    113: DDI_BASE_SLAVE_MASK __ARGS ((mask))
                    114: uchar_t                mask;
                    115: #endif
                    116: {
                    117:        outb (__SPICM__, mask);
                    118: }
                    119: 
                    120: #if    __USE_PROTO__
                    121: void (__assert_fail2) (__CONST__ char * exp, __CONST__ char * info,
                    122:                       int lineno)      
                    123: #else
                    124: void
                    125: __assert_fail2 __ARGS ((exp, info, lineno))
                    126: __CONST__ char * exp;
                    127: __CONST__ char * info;
                    128: int            lineno;
                    129: #endif
                    130: {
                    131: }
                    132: 
                    133: #if    __COHERENT__
                    134: #include <sys/cmn_err.h>
                    135: 
                    136: #if    __USE_PROTO__
                    137: void (cmn_err) (int level, char * format, ...)
                    138: #else
                    139: void
                    140: cmn_err __ARGS ((level, format))
                    141: int            level;
                    142: char         * format;
                    143: #endif
                    144: {
                    145:        switch(level) {
                    146:        case CE_CONT:
                    147:                printf("%r", & format);
                    148:                break;
                    149:        case CE_NOTE:
                    150:                printf("NOTICE: %r\n", & format);
                    151:                break;
                    152:        case CE_WARN:
                    153:                printf("WARNING: %r\n", & format);
                    154:                break;
                    155:        case CE_PANIC:
                    156:                panic("%r", & format);
                    157:                break;
                    158:        }
                    159: }
                    160: #endif
                    161: 
                    162: /* copyin() and copyout() */
                    163: 
                    164: #define        TOUSER(usr,ker,n)       kucopy ((caddr_t) ker, (caddr_t) usr, n)
                    165: #define        FROMUSER(ker,usr,n)     ukcopy ((caddr_t) usr, (caddr_t) ker, n)
                    166: 
                    167: #if    __USE_PROTO__
                    168: int (copyin) (_VOID * userbuf, _VOID * driverbuf, size_t count)
                    169: #else
                    170: int
                    171: copyin __ARGS ((userbuf, driverbuf, count))
                    172: _VOID        * userbuf;
                    173: _VOID        * driverbuf;
                    174: size_t         count;
                    175: #endif
                    176: {
                    177:        ASSERT (driverbuf != 0);
                    178: 
                    179:        return FROMUSER (driverbuf, userbuf, count) != count ? -1 : 0;
                    180: }
                    181: 
                    182: #if    __USE_PROTO__
                    183: int (copyout) (_VOID * driverbuf, _VOID * userbuf, size_t count)
                    184: #else
                    185: int
                    186: copyout __ARGS ((driverbuf, userbuf, count))
                    187: _VOID        * driverbuf;
                    188: _VOID        * userbuf;
                    189: size_t         count;
                    190: #endif
                    191: {
                    192:        ASSERT (driverbuf != NULL);
                    193: 
                    194:        return TOUSER (userbuf, driverbuf, count) != count ? -1 : 0;
                    195: }
                    196: 

unix.superglobalmegacorp.com

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