Ignore:
File:
1 edited

Legend:

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

    rb66cc97 r9d58539  
    2929.text
    3030
    31 #include <abi/asmtool.h>
     31.global context_save
     32.global context_restore
     33
    3234#include <libarch/regname.h>
    33 #include <libarch/fibril_context.h>
     35#include <libarch/context_offset.h>
    3436
    35 FUNCTION_BEGIN(context_save)
    36         stw sp, CONTEXT_OFFSET_SP(r3)
    37         stw r2, CONTEXT_OFFSET_TLS(r3)
    38         stw r13, CONTEXT_OFFSET_R13(r3)
    39         stw r14, CONTEXT_OFFSET_R14(r3)
    40         stw r15, CONTEXT_OFFSET_R15(r3)
    41         stw r16, CONTEXT_OFFSET_R16(r3)
    42         stw r17, CONTEXT_OFFSET_R17(r3)
    43         stw r18, CONTEXT_OFFSET_R18(r3)
    44         stw r19, CONTEXT_OFFSET_R19(r3)
    45         stw r20, CONTEXT_OFFSET_R20(r3)
    46         stw r21, CONTEXT_OFFSET_R21(r3)
    47         stw r22, CONTEXT_OFFSET_R22(r3)
    48         stw r23, CONTEXT_OFFSET_R23(r3)
    49         stw r24, CONTEXT_OFFSET_R24(r3)
    50         stw r25, CONTEXT_OFFSET_R25(r3)
    51         stw r26, CONTEXT_OFFSET_R26(r3)
    52         stw r27, CONTEXT_OFFSET_R27(r3)
    53         stw r28, CONTEXT_OFFSET_R28(r3)
    54         stw r29, CONTEXT_OFFSET_R29(r3)
    55         stw r30, CONTEXT_OFFSET_R30(r3)
    56         stw r31, CONTEXT_OFFSET_R31(r3)
     37context_save:
     38        CONTEXT_SAVE_ARCH_CORE r3
    5739       
    5840        mflr r4
    59         stw r4, CONTEXT_OFFSET_PC(r3)
     41        stw r4, OFFSET_PC(r3)
    6042       
    6143        mfcr r4
    62         stw r4, CONTEXT_OFFSET_CR(r3)
     44        stw r4, OFFSET_CR(r3)
    6345       
    6446        # context_save returns 1
    6547        li r3, 1
    6648        blr
    67 FUNCTION_END(context_save)
    6849
    69 FUNCTION_BEGIN(context_restore)
    70         lwz sp, CONTEXT_OFFSET_SP(r3)
    71         lwz r2, CONTEXT_OFFSET_TLS(r3)
    72         lwz r13, CONTEXT_OFFSET_R13(r3)
    73         lwz r14, CONTEXT_OFFSET_R14(r3)
    74         lwz r15, CONTEXT_OFFSET_R15(r3)
    75         lwz r16, CONTEXT_OFFSET_R16(r3)
    76         lwz r17, CONTEXT_OFFSET_R17(r3)
    77         lwz r18, CONTEXT_OFFSET_R18(r3)
    78         lwz r19, CONTEXT_OFFSET_R19(r3)
    79         lwz r20, CONTEXT_OFFSET_R20(r3)
    80         lwz r21, CONTEXT_OFFSET_R21(r3)
    81         lwz r22, CONTEXT_OFFSET_R22(r3)
    82         lwz r23, CONTEXT_OFFSET_R23(r3)
    83         lwz r24, CONTEXT_OFFSET_R24(r3)
    84         lwz r25, CONTEXT_OFFSET_R25(r3)
    85         lwz r26, CONTEXT_OFFSET_R26(r3)
    86         lwz r27, CONTEXT_OFFSET_R27(r3)
    87         lwz r28, CONTEXT_OFFSET_R28(r3)
    88         lwz r29, CONTEXT_OFFSET_R29(r3)
    89         lwz r30, CONTEXT_OFFSET_R30(r3)
    90         lwz r31, CONTEXT_OFFSET_R31(r3)
     50
     51context_restore:
     52        CONTEXT_RESTORE_ARCH_CORE r3
    9153       
    92         lwz r4, CONTEXT_OFFSET_CR(r3)
     54        lwz r4, OFFSET_CR(r3)
    9355        mtcr r4
    9456       
    95         lwz r4, CONTEXT_OFFSET_PC(r3)
     57        lwz r4, OFFSET_PC(r3)
    9658        mtlr r4
    9759       
     
    9961        li r3, 0
    10062        blr
    101 FUNCTION_END(context_restore)
Note: See TracChangeset for help on using the changeset viewer.