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