Changes in kernel/arch/ia32/src/context.S [e98f1c3e:5eae56a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/context.S
re98f1c3e 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) 57 60 58 61 59 ## Restore saved CPU context … … 64 62 # pointed by the 1st argument. Returns 0 in EAX. 65 63 # 66 FUNCTION_BEGIN(context_restore_arch) 64 context_restore_arch: 67 65 movl 4(%esp), %eax # address of the context variable to restore context from 68 66 … … 76 74 77 75 movl %edx, 0(%esp) # put saved pc on stack 78 79 mov vreg_ptr, %ecx80 movl CONTEXT_OFFSET_TP(%eax), %edx81 movl %edx, %gs:VREG_TP(%ecx)82 83 76 xorl %eax, %eax # context_restore returns 0 84 77 ret 78
Note:
See TracChangeset
for help on using the changeset viewer.