Annotation of coherent/d/PS2_KERNEL/i286/clist.s, revision 1.1.1.1

1.1       root        1: / $Header: /kernel/kersrc/i286/RCS/clist.s,v 1.1 92/07/17 15:21:23 bin Exp Locker: bin $
                      2: 
                      3: / (lgl-
                      4: /      The information contained herein is a trade secret of Mark Williams
                      5: /      Company, and  is confidential information.  It is provided  under a
                      6: /      license agreement,  and may be  copied or disclosed  only under the
                      7: /      terms of  that agreement.  Any  reproduction or disclosure  of this
                      8: /      material without the express written authorization of Mark Williams
                      9: /      Company or persuant to the license agreement is unlawful.
                     10: /
                     11: /      COHERENT Version 2.3.37
                     12: /      Copyright (c) 1982, 1983, 1984.
                     13: /      An unpublished work by Mark Williams Company, Chicago.
                     14: /      All rights reserved.
                     15: / -lgl)
                     16: ////////
                     17: /
                     18: / i8086 coherent clist hack.
                     19: / cltinit, getq and putq have been tuned.
                     20: / the remaining functions are as produced by cc -S coh/clist.c
                     21: / with NCPCL substituted
                     22: /
                     23: / $Log:        clist.s,v $
                     24: / Revision 1.1  92/07/17  15:21:23  bin
                     25: / Initial revision
                     26: /
                     27: / Revision 1.1 88/03/24  17:39:16      src
                     28: / Initial revision
                     29: / 
                     30: 
                     31: #include <sys/const.h>
                     32: 
                     33:        .shri
                     34: L10001:        .word   NCPCL+2
                     35:        .globl  cltinit_
                     36: cltinit_:
                     37:        push    si
                     38:        push    di
                     39:        push    bp
                     40:        mov     bp, sp
                     41:        sub     sp, $0x0C
                     42: 
                     43:        pushf                   / s =
                     44:        cli                     / sphi()
                     45:        sub     di, di
                     46:        mov     ax, NCLIST_
                     47:        imul    cs:L10001
                     48:        mov     -0x0C(bp), ax
                     49:        add     ax, clistp_
                     50:        mov     -0x04(bp), ax
                     51: 
                     52: L3:    sub     -0x04(bp), $NCPCL+2
                     53:        mov     ax, -0x04(bp)
                     54:        cmp     ax, clistp_
                     55:        jb      L2
                     56: 
                     57: L10002:        mov     si, -0x04(bp)
                     58:        mov     (si), di
                     59:        mov     di, si
                     60:        jmp     L3
                     61: 
                     62: L2:    mov     cltfree_, di
                     63:        call    spl_
                     64:        add     sp, $0x02
                     65: 
                     66:        mov     sp, bp
                     67:        pop     bp
                     68:        pop     di
                     69:        pop     si
                     70:        ret
                     71: 
                     72:        .globl  getq_
                     73: 
                     74: getq_:
                     75:        mov     dx, si
                     76:        push    bp
                     77:        mov     bp, sp
                     78: 
                     79:        mov     bp, 4(bp)       / bp = cqp
                     80:        sub     ax, ax          / ax = 0
                     81:        cmp     (bp), ax        / if (cqp->cq_cc == 0)
                     82:        jne     0f
                     83:        dec     ax              / return (-1)
                     84:        jmp     2f
                     85: 
                     86: 0:     pushf                   / s =
                     87:        cli                     / sphi()
                     88:        mov     si, 6(bp)       / si = op = cqp->cq_op
                     89:        mov     bx, 8(bp)       / bx = ox = cqp->cq_ox
                     90:        movb    al, 2(bx,si)    / ax = op->cl_ch[ox]
                     91:        dec     (bp)            / if (--cqp->cq_cc == 0)
                     92:        je      0f
                     93:        inc     bx              / ++ox
                     94:        cmp     bx, $NCPCL      / if (ox == NCPL)
                     95:        jne     1f
                     96: 
                     97: 0:     sub     bx, bx          / ox = 0;
                     98:        mov     cx, (si)        / cx = np = op->cl_fp
                     99:        mov     6(bp), cx       / cqp->cq_op = np
                    100:        cmp     cx, bx          / if (np == 0)
                    101:        jne     0f
                    102:        mov     2(bp), bx       / cqp->cq_ip = 0
                    103:        mov     4(bp), bx       / cqp->cq_ix = 0
                    104: 
                    105: 0:     mov     cx, cltfree_    / cx = tmp = cltfree
                    106:        mov     (si), cx        / op->cl_fp = tmp
                    107:        mov     cltfree_, si    / cltfree = op
                    108:        cmp     cltwant_, bx    / if (cltwant != 0)
                    109:        je      1f
                    110:        mov     cltwant_, bx    / cltwant = 0
                    111:        mov     cx, $cltwant_   / wakeup(&cltwant)
                    112:        push    bx      / save
                    113:        push    dx      / save
                    114:        push    ax      / save
                    115:        push    cx
                    116:        call    wakeup_
                    117:        pop     cx      / clear stack
                    118:        pop     ax      / restore
                    119:        pop     dx      / restore
                    120:        pop     bx      / restore
                    121: 
                    122: 1:     mov     8(bp), bx       / cqp->cq_ox = ox
                    123:        mov     cx, ax
                    124:        call    spl_            / spl(s)
                    125:        add     sp, $2
                    126:        mov     ax, cx
                    127: 
                    128: 2:     pop     bp
                    129:        mov     si, dx
                    130:        ret
                    131: 
                    132:        .globl  putq_
                    133: 
                    134: putq_:
                    135:        mov     dx, si
                    136:        push    bp
                    137:        mov     bp, sp
                    138: 
                    139:        mov     cx, 6(bp)       / cx = c
                    140:        mov     bp, 4(bp)       / bp = cqp
                    141:        sub     ax, ax          / ax = 0
                    142:        pushf                   / s =
                    143:        cli                     / sphi()
                    144:        mov     si, 2(bp)       / si = ip = cqp->cq_ip
                    145:        mov     bx, 4(bp)       / bx = ix = cqp->cq_ix
                    146:        cmp     bx, ax          / if (ix == 0)
                    147:        jne     2f
                    148:        mov     si, cltfree_    / ip = cltfree
                    149:        cmp     si, ax          / if (ip == 0)
                    150:        jne     0f
                    151:        call    spl_            / spl(s)
                    152:        add     sp, $2
                    153:        mov     ax, $-1         / return (-1)
                    154:        jmp     3f
                    155: 
                    156: 0:     mov     bx, (si)        / tmp = ip->cl_fp
                    157:        mov     cltfree_, bx    / cltfree = tmp
                    158:        mov     (si), ax        / ip->cl_fp = 0
                    159:        mov     bx, 2(bp)       / np = cqp->cq_ip
                    160:        cmp     bx, ax          / if (np == 0)
                    161:        jne     0f
                    162:        mov     6(bp), si       / cqp->cq_op = ip
                    163:        jmp     1f
                    164: 
                    165: 0:     mov     (bx), si        / np->cl_fp = ip
                    166: 
                    167: 1:     mov     2(bp), si       / cqp->cq_ip = ip
                    168:        mov     bx, ax          / bx = ix = cqp->cq_ix = 0
                    169: 
                    170: 2:     movb    2(bx,si), cl    / ip->cl_ch[ix] = c
                    171:        inc     bx              / ix++
                    172:        cmp     bx, $NCPCL      / if (ix == NCPCL)
                    173:        jne     0f
                    174:        mov     bx, ax          / ix = 0
                    175: 
                    176: 0:     mov     4(bp), bx       / cqp->cq_ix = ix
                    177:        inc     (bp)            / cqp->cq_cc++
                    178:        call    spl_            / spl(s)
                    179:        add     sp, $2
                    180:        mov     ax, cx          / return (c)
                    181: 
                    182: 3:     pop     bp
                    183:        mov     si, dx
                    184:        ret
                    185: 
                    186:        .globl  clrq_
                    187: 
                    188: clrq_:
                    189:        push    si
                    190:        push    di
                    191:        push    bp
                    192:        mov     bp, sp
                    193: 
                    194:        mov     si, 0x08(bp)
                    195:        call    sphi_
                    196:        mov     di, ax
                    197: 
                    198: L18:   push    si
                    199:        call    getq_
                    200:        add     sp, $0x02
                    201:        or      ax, ax
                    202:        jge     L18
                    203:        push    di
                    204:        call    spl_
                    205:        add     sp, $0x02
                    206: 
                    207:        pop     bp
                    208:        pop     di
                    209:        pop     si
                    210:        ret
                    211: 
                    212:        .globl  waitq_
                    213: 
                    214: waitq_:
                    215:        push    si
                    216:        push    di
                    217:        push    bp
                    218:        mov     bp, sp
                    219: 
                    220: L21:   cmp     cltfree_, $0x00
                    221:        jne     L19
                    222:        mov     cltwant_, $0x01
                    223:        sub     ax, ax
                    224:        push    ax
                    225:        push    ax
                    226:        mov     ax, $0x0100
                    227:        push    ax
                    228:        mov     ax, $cltwant_
                    229:        push    ax
                    230:        call    sleep_
                    231:        add     sp, $0x08
                    232:        jmp     L21
                    233: 
                    234: L19:   pop     bp
                    235:        pop     di
                    236:        pop     si
                    237:        ret

unix.superglobalmegacorp.com

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