movl $-1, %eax
ret
+ /* put the task's ESP0 into the TSS */
+ movl OFFSET_ESP0(%edi), %ecx
+ movl %ecx, CPU_ESP0(%eax)
+ movl $KERNEL_DATA, CPU_SS0(%eax)
+
+ /*
+ * We need to figure out the task's privilege level and
+ * set the segment registers accordingly
+ */
+ /*
+ movl $KERNEL_CODE, CPU_CS(%eax)
+ movl $KERNEL_DATA, CPU_DS(%eax)
+ movl $KERNEL_DATA, CPU_ES(%eax)
+ movl $KERNEL_DATA, CPU_FS(%eax)
+ movl $KERNEL_DATA, CPU_GS(%eax)
+ */
+
2: movl OFFSET_CR3(%edi), %ecx
/* check if we can avoid writing to cr3, which would clear the TLB */