Annotation of coherent/b/kernel/i386/vio.s, revision 1.1

1.1     ! root        1: /      vio.s
        !             2: 
        !             3: / This code was dropped in favor of a simpler implementation.
        !             4: / I am keeping it around in case I need a similar call gate interface
        !             5: / some day. - hws
        !             6: 
        !             7: / Ring 0 services for video
        !             8: / this routine is a stub for the ring 0 code
        !             9: /
        !            10: /      int vio(int a1, int a2, int a3)
        !            11:        .globl  vio
        !            12: vio:
        !            13:        pushf                   / irpts off during trip to ring 0
        !            14:        cli
        !            15: 
        !            16:        movl    16(%esp),%eax   / fetch a3
        !            17:        pushl   %eax
        !            18:        movl    16(%esp),%eax   / fetch a2
        !            19:        pushl   %eax
        !            20:        movl    16(%esp),%eax   / fetch a1
        !            21:        pushl   %eax
        !            22: 
        !            23:        lcall   $SEG_VIO,$0     / gate to viofR0
        !            24:        / viofR0 will delete 12 bytes of stack args
        !            25:        popf                    / re-enable interrupts, if they were on before
        !            26:        ret
        !            27: 
        !            28: / Ring 0 video services.  Called via a gate.
        !            29: / Want interrupts off when we arrive since the interrupt gates
        !            30: / lead into Ring 1.
        !            31: /
        !            32: / I/O map manipulations affect bitmap in tss.
        !            33: / I/O map offsets are in bytes from start of map.
        !            34: /
        !            35: / a1:  VIO_OR_IO       bitwise or a2 into 32-bit word at offset a3
        !            36: /   return the new word value stored back into the io map.
        !            37: / a1:  VIO_AND_IO      bitwise and a2 into 32-bit word at offset a3
        !            38: /   return the new word value stored back into the io map.
        !            39: viofR0:
        !            40:        enter   $0,$8   / 8 bytes of auto storage
        !            41: 
        !            42:        pushl   12(%ebp)        / print a1
        !            43:        call    print32
        !            44:        popl    %eax
        !            45: 
        !            46:        pushl   16(%ebp) / print a2
        !            47:        call    print32
        !            48:        popl    %eax
        !            49: 
        !            50:        pushl   20(%ebp) / print a3
        !            51:        call    print32
        !            52:        popl    %eax
        !            53: 
        !            54:        xorl    %eax,%eax
        !            55:        movl    20(%ebp),%ecx   / fetch a3
        !            56:        cmpl    $0,%ecx         / don't allow access to tss below iomap
        !            57:        jl      vioNfg
        !            58: 
        !            59:        cmpl    $TSS_MAPLEN,%ecx / or above iomap
        !            60:        jge     vioNfg
        !            61: 
        !            62:        movl    tss+TSS_IOMAP(%ecx),%eax
        !            63:        pushl   %eax
        !            64:        call    print32
        !            65:        popl    %eax
        !            66: 
        !            67: vioNfg:
        !            68:        cmpb    $0,12(%ebp)     / look at a1
        !            69:        jnz     vioAnd
        !            70:        orl     16(%ebp),%eax   / or a2 with %eax
        !            71:        jmp     vioDone
        !            72: 
        !            73: vioAnd:
        !            74:        andl    16(%ebp),%eax   / and a2 with %eax
        !            75: 
        !            76: vioDone:
        !            77:        leave
        !            78:        / make 12-byte arg list disappear
        !            79:        lret    $12
        !            80: 

unix.superglobalmegacorp.com

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