home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / config / unix / intel_netbsd / rswitch.c < prev    next >
Text File  |  2000-07-29  |  615b  |  29 lines

  1. /*
  2.  * This is the co-expression context switch for the Intel 80386
  3.  * under Microport Unix System V/386
  4.  */
  5.  
  6. /*
  7.  * coswitch
  8.  */
  9.  
  10. coswitch(old_cs, new_cs, first)
  11. int *old_cs, *new_cs;
  12. int first;
  13.    {
  14.    asm("  movl 8(%ebp),%eax");
  15.    asm("  movl %esp,0(%eax)");
  16.    asm("  movl %ebp,4(%eax)");
  17.    asm("  movl 12(%ebp),%eax");
  18.    if (first == 0) {        /* this is the first activation */
  19.       asm("  movl 0(%eax),%esp");
  20.       asm("  movl $0,%ebp");
  21.       new_context(0, 0);
  22.       syserr("interp() returned in coswitch");
  23.       }
  24.    else {
  25.       asm("  movl 0(%eax),%esp");
  26.       asm("  movl 4(%eax),%ebp");
  27.       }
  28.    }
  29.