Changes in kernel/arch/ia32/src/context.S [5eae56a:d6f9fff] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/context.S
r5eae56a rd6f9fff 27 27 # 28 28 29 #include <abi/asmtool.h> 29 30 #include <arch/context_struct.h> 31 #include <arch/vreg.h> 30 32 31 33 .text 32 33 .global context_save_arch34 .global context_restore_arch35 36 34 37 35 ## Save current CPU context … … 40 38 # pointed by the 1st argument. Returns 1 in EAX. 41 39 # 42 context_save_arch: 40 FUNCTION_BEGIN(context_save_arch) 43 41 movl 0(%esp), %eax # save pc value into eax 44 42 movl 4(%esp), %edx # address of the context variable to save context to … … 52 50 movl %ebp, CONTEXT_OFFSET_EBP(%edx) # %ebp -> ctx->ebp 53 51 52 mov vreg_ptr, %ecx 53 movl %gs:VREG_TP(%ecx), %ecx 54 movl %ecx, CONTEXT_OFFSET_TP(%edx) 55 54 56 xorl %eax, %eax # context_save returns 1 55 57 incl %eax 56 58 ret 59 FUNCTION_END(context_save_arch) 57 60 58 61 … … 62 65 # pointed by the 1st argument. Returns 0 in EAX. 63 66 # 64 context_restore_arch: 67 FUNCTION_BEGIN(context_restore_arch) 65 68 movl 4(%esp), %eax # address of the context variable to restore context from 66 69 … … 74 77 75 78 movl %edx, 0(%esp) # put saved pc on stack 79 80 mov vreg_ptr, %ecx 81 movl CONTEXT_OFFSET_TP(%eax), %edx 82 movl %edx, %gs:VREG_TP(%ecx) 83 76 84 xorl %eax, %eax # context_restore returns 0 77 85 ret 78
Note:
See TracChangeset
for help on using the changeset viewer.