Changeset 2c9de7e in mainline
- Timestamp:
- 2005-09-06T22:09:25Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2bd4fdf
- Parents:
- 2cd073bd
- Location:
- arch/ia32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/include/context.h
r2cd073bd r2c9de7e 46 46 __u32 pc; 47 47 __u32 ebx; 48 __u32 ecx;49 __u32 edx;50 48 __u32 esi; 51 49 __u32 edi; -
arch/ia32/src/context.s
r2cd073bd r2c9de7e 39 39 # 40 40 context_save: 41 push %ebx 41 movl 0(%esp),%eax # the caller's return %eip 42 movl 4(%esp),%edx # address of the kernel_context variable to save context to 42 43 43 movl 4(%esp),%eax # the caller's return %eip 44 movl 8(%esp),%ebx # address of the kernel_context variable to save context to 45 movl %eax,4(%ebx) # %eip -> ctx->pc 46 movl %esp,(%ebx) # %esp -> ctx->sp 47 48 movl %ebx,%eax 49 pop %ebx 50 51 movl %ebx,8(%eax) 52 movl %ecx,12(%eax) 53 movl %edx,16(%eax) 54 movl %esi,20(%eax) 55 movl %edi,24(%eax) 56 movl %ebp,28(%eax) 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 57 50 58 51 xorl %eax,%eax # context_save returns 1 … … 68 61 context_restore: 69 62 movl 4(%esp),%eax # address of the kernel_context variable to restore context from 70 movl (%eax),%esp # ctx->sp -> %esp 71 addl $4,%esp # this is for the pop we don't do 63 movl 0(%eax),%esp # ctx->sp -> %esp 64 movl 4(%eax),%edx # ctx->pc -> %edx 65 movl 8(%eax),%ebx # ctx->ebx -> %ebx 66 movl 12(%eax),%esi # ctx->esi -> %esi 67 movl 16(%eax),%edi # ctx->edi -> %edi 68 movl 20(%eax),%ebp # ctx->ebp -> %ebp 72 69 73 movl 8(%eax),%ebx 74 movl 12(%eax),%ecx 75 movl 16(%eax),%edx 76 movl 20(%eax),%esi 77 movl 24(%eax),%edi 78 movl 28(%eax),%ebp 79 80 movl 4(%eax),%eax 81 movl %eax,(%esp) # ctx->pc -> saver's return %eip 70 movl %edx,0(%esp) # ctx->pc -> saver's return %eip 82 71 xorl %eax,%eax # context_restore returns 0 83 72 ret
Note:
See TracChangeset
for help on using the changeset viewer.