/* store cr3 in task structure */
movl 8(%esp), %eax
- movl %eax, 4(%edi)
+ movl %eax, OFFSET_CR3(%edi)
/* calculate stack start (since it grows down) */
- movl $CONFIG_KERNEL_STACK_SIZE, %ecx
- movl (%esp), %eax
- leal OFFSET_KSTACK(%eax, %ecx, 1), %eax
+ movl OFFSET_KSTACK(%edi), %eax
+ addl $CONFIG_KERNEL_STACK_SIZE, %eax
/*
* We will use _int_restore (the lower half of the interrupt handler)
movl (%eax), %ecx
movl %ecx, 60(%eax)
- /* put EAX into the task structure */
- movl 4(%esp), %ecx
- movl %eax, OFFSET_ESP0(%ecx)
+ /* put EAX into the task structure - task pointer is still in EDI */
+ movl %eax, OFFSET_ESP0(%edi)
/* that should be it */
ret