Ignore:
File:
1 edited

Legend:

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

    r9d58539 ra52e2f4  
    2727#
    2828
    29 #include <arch/context_offset.h>
     29#include <abi/asmtool.h>
     30#include <arch/context_struct.h>
    3031#include <arch/arch.h>
    3132#include <arch/regdef.h>
     
    3334.text   
    3435
    35 .global context_save_arch
    36 .global context_restore_arch
    37 
    3836/*
    3937 * context_save_arch() is required not to create its own stack frame. See the
    4038 * generic context.h for explanation.
    4139 */
    42 context_save_arch:
     40FUNCTION_BEGIN(context_save_arch)
    4341        #
    4442        # Force all our active register windows to memory so that we can find
     
    4745        flushw
    4846
    49         CONTEXT_SAVE_ARCH_CORE %o0
     47        stx %sp, [%o0 + CONTEXT_OFFSET_SP]
     48        stx %o7, [%o0 + CONTEXT_OFFSET_PC]
     49        stx %i0, [%o0 + CONTEXT_OFFSET_I0]
     50        stx %i1, [%o0 + CONTEXT_OFFSET_I1]
     51        stx %i2, [%o0 + CONTEXT_OFFSET_I2]
     52        stx %i3, [%o0 + CONTEXT_OFFSET_I3]
     53        stx %i4, [%o0 + CONTEXT_OFFSET_I4]
     54        stx %i5, [%o0 + CONTEXT_OFFSET_I5]
     55        stx %fp, [%o0 + CONTEXT_OFFSET_FP]
     56        stx %i7, [%o0 + CONTEXT_OFFSET_I7]
     57        stx %l0, [%o0 + CONTEXT_OFFSET_L0]
     58        stx %l1, [%o0 + CONTEXT_OFFSET_L1]
     59        stx %l2, [%o0 + CONTEXT_OFFSET_L2]
     60        stx %l3, [%o0 + CONTEXT_OFFSET_L3]
     61        stx %l4, [%o0 + CONTEXT_OFFSET_L4]
     62        stx %l5, [%o0 + CONTEXT_OFFSET_L5]
     63        stx %l6, [%o0 + CONTEXT_OFFSET_L6]
     64        stx %l7, [%o0 + CONTEXT_OFFSET_L7]
    5065        retl
    5166        mov 1, %o0              ! context_save_arch returns 1
     67FUNCTION_END(context_save_arch)
    5268
    53 context_restore_arch:
     69FUNCTION_BEGIN(context_restore_arch)
    5470        #
    5571        # Forget all previous windows, they are not going to be needed again.
     
    6985        wrpr %l0, %pstate
    7086
    71         CONTEXT_RESTORE_ARCH_CORE %o0
     87        ldx [%o0 + CONTEXT_OFFSET_SP], %sp
     88        ldx [%o0 + CONTEXT_OFFSET_PC], %o7
     89        ldx [%o0 + CONTEXT_OFFSET_I0], %i0
     90        ldx [%o0 + CONTEXT_OFFSET_I1], %i1
     91        ldx [%o0 + CONTEXT_OFFSET_I2], %i2
     92        ldx [%o0 + CONTEXT_OFFSET_I3], %i3
     93        ldx [%o0 + CONTEXT_OFFSET_I4], %i4
     94        ldx [%o0 + CONTEXT_OFFSET_I5], %i5
     95        ldx [%o0 + CONTEXT_OFFSET_FP], %fp
     96        ldx [%o0 + CONTEXT_OFFSET_I7], %i7
     97        ldx [%o0 + CONTEXT_OFFSET_L0], %l0
     98        ldx [%o0 + CONTEXT_OFFSET_L1], %l1
     99        ldx [%o0 + CONTEXT_OFFSET_L2], %l2
     100        ldx [%o0 + CONTEXT_OFFSET_L3], %l3
     101        ldx [%o0 + CONTEXT_OFFSET_L4], %l4
     102        ldx [%o0 + CONTEXT_OFFSET_L5], %l5
     103        ldx [%o0 + CONTEXT_OFFSET_L6], %l6
     104        ldx [%o0 + CONTEXT_OFFSET_L7], %l7
    72105        retl
    73106        xor %o0, %o0, %o0       ! context_restore_arch returns 0
     107FUNCTION_END(context_restore_arch)
Note: See TracChangeset for help on using the changeset viewer.