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_hurd / rswitch.c < prev    next >
Text File  |  2002-01-15  |  587b  |  28 lines

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