Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/context.S

    re98f1c3e r5eae56a  
    2727#
    2828
    29 #include <abi/asmtool.h>
    3029#include <arch/context_struct.h>
    31 #include <arch/vreg.h>
    3230
    3331.text
     32
     33.global context_save_arch
     34.global context_restore_arch
     35
    3436
    3537## Save current CPU context
     
    3840# pointed by the 1st argument. Returns 1 in EAX.
    3941#
    40 FUNCTION_BEGIN(context_save_arch)
     42context_save_arch:
    4143        movl 0(%esp), %eax      # save pc value into eax       
    4244        movl 4(%esp), %edx      # address of the context variable to save context to
     
    5052        movl %ebp, CONTEXT_OFFSET_EBP(%edx)     # %ebp -> ctx->ebp
    5153
    52         mov vreg_ptr, %ecx
    53         movl %gs:VREG_TP(%ecx), %ecx
    54         movl %ecx, CONTEXT_OFFSET_TP(%edx)
    55 
    5654        xorl %eax, %eax         # context_save returns 1
    5755        incl %eax
    5856        ret
    59 FUNCTION_END(context_save_arch)
     57
    6058
    6159## Restore saved CPU context
     
    6462# pointed by the 1st argument. Returns 0 in EAX.
    6563#
    66 FUNCTION_BEGIN(context_restore_arch)
     64context_restore_arch:
    6765        movl 4(%esp), %eax      # address of the context variable to restore context from
    6866
     
    7674
    7775        movl %edx, 0(%esp)      # put saved pc on stack
    78 
    79         mov vreg_ptr, %ecx
    80         movl CONTEXT_OFFSET_TP(%eax), %edx
    81         movl %edx, %gs:VREG_TP(%ecx)
    82 
    8376        xorl %eax, %eax         # context_restore returns 0
    8477        ret
     78
Note: See TracChangeset for help on using the changeset viewer.