Annotation of coherent/f/etc/conf/streams/src/dosint.c, revision 1.1

1.1     ! root        1: #if    ! __BORLANDC__
        !             2: #error This file is for Borland C++ support only.
        !             3: #endif
        !             4: 
        !             5: #define        _DDI_DKI        1
        !             6: #define        _SYSV4          1
        !             7: 
        !             8: #include <kernel/ddi_glob.h>
        !             9: #include <kernel/ddi_cpu.h>
        !            10: #include <kernel/x86lock.h>
        !            11: #include <kernel/defer.h>
        !            12: #include <sys/confinfo.h>
        !            13: #include <stdlib.h>
        !            14: #include <dos.h>
        !            15: 
        !            16: __EXTERN_C_BEGIN__
        !            17: 
        !            18: void           STREAMS_TIMEOUT __PROTO ((void));
        !            19: 
        !            20: __EXTERN_C_END__
        !            21: 
        !            22: 
        !            23: /*
        !            24:  * Clock-interrupt handler and friends.
        !            25:  */
        !            26: 
        !            27: static void clock_deferred_a (void) {
        !            28:        (* (char __far *) MK_FP (0xB800, 1)) ++;
        !            29: }
        !            30: static void clock_deferred_b (void) {
        !            31:        (* (char __far *) MK_FP (0xB800, 2)) ++;
        !            32: }
        !            33: static void clock_deferred_c (void) {
        !            34:        (* (char __far *) MK_FP (0xB800, 3)) ++;
        !            35: }
        !            36: 
        !            37: __EXTERN_C__
        !            38: void clock_intr (int __NOTUSED (unused)) {
        !            39:        (* (char __far *) MK_FP (0xB800, 0)) ++;
        !            40:        defer_int_cpu (clock_deferred_c, 0);
        !            41:        defer_int_here (clock_deferred_a);
        !            42:        defer_int_any (clock_deferred_b);
        !            43:        defer_int_any (STREAMS_TIMEOUT);
        !            44: }
        !            45: 
        !            46: /*
        !            47:  * Emulate the Coherent vector-manipulation routines in the DOS environment.
        !            48:  */
        !            49: 
        !            50: __EXTERN_C__
        !            51: void SETIVEC (int num) {
        !            52:        intthunk_t      prevint;
        !            53:        intmask_t       mask = __GET_BASE_MASK ();
        !            54:        int             vect = inttab [num].int_vector;
        !            55:        int             newmask = 1 << (vect & 7);
        !            56: 
        !            57:        ASSERT (vect != 2);
        !            58:        ASSERT_BASE_LEVEL ();
        !            59: 
        !            60:        prevint = getvect (vect < 8 ? vect + 8 : vect + 0x70);
        !            61: 
        !            62:        __emit__ (__CLI__);
        !            63: 
        !            64:        setvect (vect < 8 ? vect + 8 : vect + 0x70, inttab [num].int_thunk);
        !            65: 
        !            66:        mask = ddi_cpu_data ()->dc_base_mask;
        !            67: 
        !            68:        /*
        !            69:         * Set up for chaining if the interrupt was previously enabled.
        !            70:         */
        !            71: 
        !            72:        if ((mask & newmask) == 0)
        !            73:                (* inttab [num].int_prev) = prevint;
        !            74:        else {
        !            75: 
        !            76:                mask &= ~ newmask;
        !            77:                __SET_BASE_MASK (mask);
        !            78:        }
        !            79: 
        !            80:        __emit__ (__STI__);
        !            81: }
        !            82: 
        !            83: 
        !            84: /*
        !            85:  * Note that the way our interrupt nesting system works, it would be a Bad
        !            86:  * Idea to try and clear an interrupt vector from an interrupt service
        !            87:  * routine.
        !            88:  */
        !            89: 
        !            90: __EXTERN_C__
        !            91: void CLRIVEC (int num) {
        !            92:        int             vect = inttab [num].int_vector;
        !            93:        int             newmask = 1 << (vect & 7);
        !            94:        intmask_t       mask = __GET_BASE_MASK ();
        !            95: 
        !            96:        ASSERT_BASE_LEVEL ();
        !            97: 
        !            98:        __emit__ (__CLI__);
        !            99: 
        !           100:        if (* inttab [num].int_prev != NULL)
        !           101:                setvect (vect < 8 ? vect + 8 : vect + 0x70,
        !           102:                         * inttab [num].int_prev);
        !           103:        else {
        !           104: 
        !           105:                mask |= newmask;
        !           106:                __SET_BASE_MASK (mask);
        !           107:        }
        !           108: 
        !           109:        __emit__ (__STI__);
        !           110: }

unix.superglobalmegacorp.com

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