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_bsdos / rswitch.c < prev    next >
Text File  |  2000-07-29  |  661b  |  30 lines

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