add comments on switch.S
This commit is contained in:
parent
f8d953397b
commit
91d8793b24
@ -5,24 +5,24 @@ switch_to: # switch_to(from, to)
|
|||||||
# save from's registers
|
# save from's registers
|
||||||
movl 4(%esp), %eax # eax points to from
|
movl 4(%esp), %eax # eax points to from
|
||||||
popl 0(%eax) # save eip !popl
|
popl 0(%eax) # save eip !popl
|
||||||
movl %esp, 4(%eax)
|
movl %esp, 4(%eax) # save esp::context of from
|
||||||
movl %ebx, 8(%eax)
|
movl %ebx, 8(%eax) # save ebx::context of from
|
||||||
movl %ecx, 12(%eax)
|
movl %ecx, 12(%eax) # save ecx::context of from
|
||||||
movl %edx, 16(%eax)
|
movl %edx, 16(%eax) # save edx::context of from
|
||||||
movl %esi, 20(%eax)
|
movl %esi, 20(%eax) # save esi::context of from
|
||||||
movl %edi, 24(%eax)
|
movl %edi, 24(%eax) # save edi::context of from
|
||||||
movl %ebp, 28(%eax)
|
movl %ebp, 28(%eax) # save ebp::context of from
|
||||||
|
|
||||||
# restore to's registers
|
# restore to's registers
|
||||||
movl 4(%esp), %eax # not 8(%esp): popped return address already
|
movl 4(%esp), %eax # not 8(%esp): popped return address already
|
||||||
# eax now points to to
|
# eax now points to to
|
||||||
movl 28(%eax), %ebp
|
movl 28(%eax), %ebp # restore ebp::context of to
|
||||||
movl 24(%eax), %edi
|
movl 24(%eax), %edi # restore edi::context of to
|
||||||
movl 20(%eax), %esi
|
movl 20(%eax), %esi # restore esi::context of to
|
||||||
movl 16(%eax), %edx
|
movl 16(%eax), %edx # restore edx::context of to
|
||||||
movl 12(%eax), %ecx
|
movl 12(%eax), %ecx # restore ecx::context of to
|
||||||
movl 8(%eax), %ebx
|
movl 8(%eax), %ebx # restore ebx::context of to
|
||||||
movl 4(%eax), %esp
|
movl 4(%eax), %esp # restore esp::context of to
|
||||||
|
|
||||||
pushl 0(%eax) # push eip
|
pushl 0(%eax) # push eip
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user