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 / openbsd / i386.c < prev    next >
Text File  |  2002-01-25  |  528b  |  24 lines

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