Annotation of researchv10no/sys/ml/setjmp.s, revision 1.1

1.1     ! root        1: 
        !             2: /*
        !             3:  * non-local goto's
        !             4:  */
        !             5: 
        !             6: /*
        !             7:  * the microvax constantly updates the ksp in the pcb block so
        !             8:  * we can't trust a ldpctx to get the right sp for longjmps
        !             9:  */
        !            10:        .text
        !            11: 
        !            12:        .set    PCLOC,16        # location of pc in calls frame
        !            13:        .set    APLOC,8         # location of ap,fp in calls frame
        !            14: 
        !            15:        .globl  _Longjmp
        !            16: _Longjmp:
        !            17:        movl    (r0)+,newfp     # must save parameters in memory as all
        !            18:        movl    (r0),newpc      # registers may be clobbered.
        !            19: 1:
        !            20:        cmpl    fp,newfp        # are we there yet?
        !            21:        bgequ   2f              # yes
        !            22:        moval   1b,PCLOC(fp)    # redirect return pc to us!
        !            23:        ret                     # pop next frame
        !            24: 2:
        !            25:        beql    3f              # did we miss our frame?
        !            26:        pushab  4f              # yep ?!?
        !            27:        calls   $1,_panic
        !            28: 3:
        !            29:        movl    newpc,r0        # all done, just return to the `setjmp'
        !            30:        jmp     (r0)            # ``rsb''
        !            31: 
        !            32:        .data
        !            33: newpc: .space  4
        !            34: newfp: .space  4
        !            35: 4:     .asciz  "longjmp"
        !            36:        .text
        !            37: /*
        !            38:  * setjmp that saves all registers as the call frame may not
        !            39:  * be available to recover them in the usual mannor by longjmp.
        !            40:  * Called before swapping out the u. area, restored by resume()
        !            41:  * below.
        !            42:  */
        !            43: 
        !            44:        .globl  _savectx
        !            45:        .align  1
        !            46: _savectx:
        !            47:        .word   0
        !            48:        movl    4(ap),r0
        !            49:        movq    r6,(r0)+
        !            50:        movq    r8,(r0)+
        !            51:        movq    r10,(r0)+
        !            52:        movq    APLOC(fp),(r0)+ # save ap, fp
        !            53:        addl3   $8,ap,(r0)+     # save sp
        !            54:        movl    PCLOC(fp),(r0)  # save pc
        !            55:        clrl    r0
        !            56:        ret

unix.superglobalmegacorp.com

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