Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/sparc64/src/fibril.S

    ra52e2f4 r9d58539  
    2727#
    2828
    29 #include <abi/asmtool.h>
    30 #include <libarch/fibril_context.h>
     29#include <libarch/context_offset.h>
    3130
    3231.text
    3332
    34 FUNCTION_BEGIN(context_save)
     33.global context_save
     34.global context_restore
     35
     36context_save:
    3537        #
    3638        # We rely on the kernel to flush our active register windows to memory
    3739        # should a thread switch occur.
    3840        #
    39         stx %sp, [%o0 + CONTEXT_OFFSET_SP]
    40         stx %o7, [%o0 + CONTEXT_OFFSET_PC]
    41         stx %i0, [%o0 + CONTEXT_OFFSET_I0]
    42         stx %i1, [%o0 + CONTEXT_OFFSET_I1]
    43         stx %i2, [%o0 + CONTEXT_OFFSET_I2]
    44         stx %i3, [%o0 + CONTEXT_OFFSET_I3]
    45         stx %i4, [%o0 + CONTEXT_OFFSET_I4]
    46         stx %i5, [%o0 + CONTEXT_OFFSET_I5]
    47         stx %fp, [%o0 + CONTEXT_OFFSET_FP]
    48         stx %i7, [%o0 + CONTEXT_OFFSET_I7]
    49         stx %l0, [%o0 + CONTEXT_OFFSET_L0]
    50         stx %l1, [%o0 + CONTEXT_OFFSET_L1]
    51         stx %l2, [%o0 + CONTEXT_OFFSET_L2]
    52         stx %l3, [%o0 + CONTEXT_OFFSET_L3]
    53         stx %l4, [%o0 + CONTEXT_OFFSET_L4]
    54         stx %l5, [%o0 + CONTEXT_OFFSET_L5]
    55         stx %l6, [%o0 + CONTEXT_OFFSET_L6]
    56         stx %l7, [%o0 + CONTEXT_OFFSET_L7]
    57         stx %g7, [%o0 + CONTEXT_OFFSET_TP]
     41        CONTEXT_SAVE_ARCH_CORE %o0
    5842        retl
    5943        mov 1, %o0              ! context_save_arch returns 1
    60 FUNCTION_END(context_save)
    6144
    62 FUNCTION_BEGIN(context_restore)
     45context_restore:
    6346        #
    6447        # Flush all active windows.
     
    6952        flushw
    7053       
    71         ldx [%o0 + CONTEXT_OFFSET_SP], %sp
    72         ldx [%o0 + CONTEXT_OFFSET_PC], %o7
    73         ldx [%o0 + CONTEXT_OFFSET_I0], %i0
    74         ldx [%o0 + CONTEXT_OFFSET_I1], %i1
    75         ldx [%o0 + CONTEXT_OFFSET_I2], %i2
    76         ldx [%o0 + CONTEXT_OFFSET_I3], %i3
    77         ldx [%o0 + CONTEXT_OFFSET_I4], %i4
    78         ldx [%o0 + CONTEXT_OFFSET_I5], %i5
    79         ldx [%o0 + CONTEXT_OFFSET_FP], %fp
    80         ldx [%o0 + CONTEXT_OFFSET_I7], %i7
    81         ldx [%o0 + CONTEXT_OFFSET_L0], %l0
    82         ldx [%o0 + CONTEXT_OFFSET_L1], %l1
    83         ldx [%o0 + CONTEXT_OFFSET_L2], %l2
    84         ldx [%o0 + CONTEXT_OFFSET_L3], %l3
    85         ldx [%o0 + CONTEXT_OFFSET_L4], %l4
    86         ldx [%o0 + CONTEXT_OFFSET_L5], %l5
    87         ldx [%o0 + CONTEXT_OFFSET_L6], %l6
    88         ldx [%o0 + CONTEXT_OFFSET_L7], %l7
    89         ldx [%o0 + CONTEXT_OFFSET_TP], %g7
     54        CONTEXT_RESTORE_ARCH_CORE %o0
    9055        retl
    9156        xor %o0, %o0, %o0       ! context_restore_arch returns 0
    92 FUNCTION_END(context_restore)
Note: See TracChangeset for help on using the changeset viewer.