Index: lib/sthread_switch_i386.h =================================================================== RCS file: /homes/gws/rick/cvs/cse451/simplethreads/lib/sthread_switch_i386.h,v retrieving revision 1.1 diff -c -r1.1 sthread_switch_i386.h *** lib/sthread_switch_i386.h 17 Jan 2004 21:17:34 -0000 1.1 --- lib/sthread_switch_i386.h 31 Jan 2004 00:50:05 -0000 *************** *** 29,38 **** void __attribute__((regparm(2))) Xsthread_switch(char **old_sp, char *new_sp); /* Tell the stack-setup code how much space we expect ! * to be pushed on the stack. We push 3 extra ! * values on i386. */ ! #define STHREAD_CPU_SWITCH_REGISTERS 3 #else /* in assembly mode */ --- 29,38 ---- void __attribute__((regparm(2))) Xsthread_switch(char **old_sp, char *new_sp); /* Tell the stack-setup code how much space we expect ! * to be pushed on the stack. We push all 8 general ! * purpose registers on i386. */ ! #define STHREAD_CPU_SWITCH_REGISTERS 8 #else /* in assembly mode */ *************** *** 44,53 **** /* in C terms: void Xsthread_switch(void) */ Xsthread_switch: ! /* Push register state onto our current (old) stack */ ! pushl %ebp ! pushl %esi ! pushl %edi /* Save old stack into *old_sp */ movl %esp,(%eax) --- 44,52 ---- /* in C terms: void Xsthread_switch(void) */ Xsthread_switch: ! /* Push register state onto our current (old) stack ! * (pusha = push all registers) */ ! pusha /* Save old stack into *old_sp */ movl %esp,(%eax) *************** *** 55,64 **** /* Load new stack from new_sp */ movl %edx,%esp ! /* Pop saved registers off new stack */ ! popl %edi ! popl %esi ! popl %ebp /* Return to whatever PC the current (new) stack * tells us to. */ --- 54,62 ---- /* Load new stack from new_sp */ movl %edx,%esp ! /* Pop saved registers off new stack ! * (popa = pop all registers) */ ! popa /* Return to whatever PC the current (new) stack * tells us to. */