Annotation of xinu/sys/halt.s, revision 1.1.1.1

1.1       root        1: /* halt.s -- halt */
                      2: 
                      3: #include <procreg.h>
                      4: #include <conf.h>
                      5: #include <qbus.h>
                      6: #include <mach.h>
                      7: 
                      8: /* declare global for use after uploading, with pm */
                      9:        .data
                     10:        .comm   _pslsave, 4
                     11:        .comm   _spsave, 4
                     12: 
                     13: /*------------------------------------------------------------------------
                     14:  *  halt -- simulate halt on VAX (really halt on UVAXII)
                     15:  *------------------------------------------------------------------------
                     16:  */
                     17:        .text
                     18:        .globl  __halt
                     19: __halt:
                     20:                                /* no entry mask--not called            */
                     21:        movpsl  _pslsave        /* save old psl for pm after upload     */
                     22:        mtpr    $DISABLE, $IPL  /* disable interrupts                   */
                     23: 
                     24:        mfpr    $SID, r1        /* get system id register value         */
                     25:        bicl2   $SYSTYPE, r1    /* mask off system id                   */
                     26:        cmpl    r1, $UVAXIISID  /* compare with UVAX II sid reg. value  */
                     27:        jneq    uvaxi
                     28:        movw    $QMHALT,*$QMCPMBX/* raise console program mailbox flag  */
                     29:        halt                    /* can halt if UVAXII                   */
                     30:        jmp     savepc
                     31: 
                     32: uvaxi: movl    sp, _spsave
                     33:        movl    $kernstk, sp    /* give stack memory for kprintf call   */
                     34:        pushab  haltmesg
                     35:        calls   $1, _kprintf
                     36:        movl    _spsave, sp     /* restore stack pointer                */
                     37: forever:
                     38:        jbr     forever         /* simulate halt by tight loop --       */
                     39:                                /* if halted, the cpu may try to reboot */
                     40: savepc:        movl    _pslsave, -(sp) /* in case user moves PC past loop and  */
                     41:        movab   unhalt, -(sp)   /* issues console "C"                   */
                     42:        rei                     /* load old psl                         */
                     43: unhalt:
                     44:        ret
                     45: 
                     46: haltmesg:
                     47:        .ascii  "\nCpu executing tight loop, may be halted at console\n\0"

unix.superglobalmegacorp.com

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