Annotation of researchv10dc/cmd/icon/setup/sun/rswitch.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * This is the co-expression context switch for the Sun Workstation
        !             3:  * operating under Berkley 4.2bsd UNIX.
        !             4:  */
        !             5: 
        !             6: /*
        !             7:  * coswitch
        !             8:  */
        !             9: coswitch(old_cs, new_cs, first)
        !            10: int *old_cs, *new_cs;
        !            11: int first;
        !            12: {
        !            13:    asm("  movl a6@(8),a0");            /* a0 = old */
        !            14:    asm("  movl a6@(12),a1");           /* a1 = new */
        !            15:    asm("  movl a7,a0@");               /* save sp in cstate[0] */
        !            16:    asm("  movl a6,a0@(4)");            /* save a6 (fp) in cstate[0] */
        !            17:    asm("  moveml #0x3cfc,a0@(8)");     /* store d2-d7, a2-a6 in old->cstate */
        !            18:    if (first == 0) {   /* this is first activation */
        !            19:       asm("  movl a1@,a7");
        !            20:       asm("  movl #0,a6");
        !            21:       interp(0, 0);
        !            22:       syserr("interp() returned in coswitch");
        !            23:       }
        !            24:    else {
        !            25:       asm(" movl a1@,a7");             /* restore sp */
        !            26:       asm(" movl a1@(4),a6");          /* restore fp */
        !            27:       asm(" moveml a1@(8),#0x3cfc");   /* restore d2-d7, a2-a6 */
        !            28:       }
        !            29: }

unix.superglobalmegacorp.com

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