Changeset 1aede82 in mainline
- Timestamp:
- 2008-03-15T09:21:51Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- baac911
- Parents:
- 7397c73
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/context.S
r7397c73 r1aede82 27 27 # 28 28 29 #include <arch/context_offset.h> 30 29 31 .text 30 32 … … 39 41 # 40 42 context_save_arch: 41 movl 0(%esp),%eax # the caller's return %eip42 movl 4(%esp),%edx # address of the context variable to save context to 43 movl 0(%esp),%eax # save pc value into eax 44 movl 4(%esp),%edx # address of the context variable to save context to 43 45 44 movl %esp,0(%edx) # %esp -> ctx->sp 45 movl %eax,4(%edx) # %eip -> ctx->pc 46 movl %ebx,8(%edx) # %ebx -> ctx->ebx 47 movl %esi,12(%edx) # %esi -> ctx->esi 48 movl %edi,16(%edx) # %edi -> ctx->edi 49 movl %ebp,20(%edx) # %ebp -> ctx->ebp 46 # save registers to given structure 47 CONTEXT_SAVE_ARCH_CORE %edx %eax 50 48 51 49 xorl %eax,%eax # context_save returns 1 … … 61 59 context_restore_arch: 62 60 movl 4(%esp),%eax # address of the context variable to restore context from 63 movl 0(%eax),%esp # ctx->sp -> %esp64 movl 4(%eax),%edx # ctx->pc -> %edx65 movl 8(%eax),%ebx # ctx->ebx -> %ebx66 movl 12(%eax),%esi # ctx->esi -> %esi67 movl 16(%eax),%edi # ctx->edi -> %edi68 movl 20(%eax),%ebp # ctx->ebp -> %ebp69 61 70 movl %edx,0(%esp) # ctx->pc -> saver's return %eip 62 # restore registers from given structure 63 CONTEXT_RESTORE_ARCH_CORE %eax %edx 64 65 movl %edx,0(%esp) # put saved pc on stack 71 66 xorl %eax,%eax # context_restore returns 0 72 67 ret
Note:
See TracChangeset
for help on using the changeset viewer.