1 .globl __switch_to 2 .type __switch_to, @function 3__switch_to: 4 movl __current, %edx 5 pushl %ebx 6 pushl %ebp 7 pushl %esi 8 pushl %edi 9 pushl RealModeSSSP 10 pushl errno /* Hack! */ 11 movl %esp, (%edx) 12 13 movl %eax, __current 14 movl (%eax), %esp 15 popl errno 16 popl RealModeSSSP 17 popl %edi 18 popl %esi 19 popl %ebp 20 popl %ebx 21 ret 22 .size __switch_to, .-__switch_to 23 24 .globl __start_thread 25 .type __start_thread, @function 26__start_thread: 27 movl %edi, %eax /* Thread function argument */ 28 29 pushl $0 /* For gdb's benefit */ 30 movl %esp, %ebp /* For gdb's benefit */ 31 32 pushl %ebx /* Set up the flags/interrupt state */ 33 popfl 34 35 call *%esi /* Run the desired function */ 36 jmp __exit_thread /* If we get here, kill the thread */ 37 .size __start_thread, .-__start_thread 38