Ignore:
File:
1 edited

Legend:

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

    r9d58539 ra52e2f4  
    2727#
    2828
    29 #include <libarch/context_offset.h>
     29#include <abi/asmtool.h>
     30#include <libarch/fibril_context.h>
    3031
    3132.text
    3233
    33 .global context_save
    34 .global context_restore
    35 
    36 context_save:
     34FUNCTION_BEGIN(context_save)
    3735        #
    3836        # We rely on the kernel to flush our active register windows to memory
    3937        # should a thread switch occur.
    4038        #
    41         CONTEXT_SAVE_ARCH_CORE %o0
     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]
    4258        retl
    4359        mov 1, %o0              ! context_save_arch returns 1
     60FUNCTION_END(context_save)
    4461
    45 context_restore:
     62FUNCTION_BEGIN(context_restore)
    4663        #
    4764        # Flush all active windows.
     
    5269        flushw
    5370       
    54         CONTEXT_RESTORE_ARCH_CORE %o0
     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
    5590        retl
    5691        xor %o0, %o0, %o0       ! context_restore_arch returns 0
     92FUNCTION_END(context_restore)
Note: See TracChangeset for help on using the changeset viewer.