Ignore:
File:
1 edited

Legend:

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

    r9d58539 r0407636  
    2727#
    2828
    29 #include <arch/context_offset.h>
     29#include <abi/asmtool.h>
     30#include <arch/context_struct.h>
    3031
    3132.text
     
    3536.set nomacro
    3637
    37 .global context_save_arch
    38 .global context_restore_arch
    39 
    40 context_save_arch:
    41         CONTEXT_SAVE_ARCH_CORE $a0
     38FUNCTION_BEGIN(context_save_arch)
     39        sw $s0, CONTEXT_OFFSET_S0($a0)
     40        sw $s1, CONTEXT_OFFSET_S1($a0)
     41        sw $s2, CONTEXT_OFFSET_S2($a0)
     42        sw $s3, CONTEXT_OFFSET_S3($a0)
     43        sw $s4, CONTEXT_OFFSET_S4($a0)
     44        sw $s5, CONTEXT_OFFSET_S5($a0)
     45        sw $s6, CONTEXT_OFFSET_S6($a0)
     46        sw $s7, CONTEXT_OFFSET_S7($a0)
     47        sw $s8, CONTEXT_OFFSET_S8($a0)
     48        sw $gp, CONTEXT_OFFSET_GP($a0)
     49       
     50        sw $ra, CONTEXT_OFFSET_PC($a0)
     51        sw $sp, CONTEXT_OFFSET_SP($a0)
    4252       
    4353        # context_save returns 1
    4454        j $31
    4555        li $2, 1
     56FUNCTION_END(context_save_arch)
    4657
    47 context_restore_arch:
    48         CONTEXT_RESTORE_ARCH_CORE $a0
     58FUNCTION_BEGIN(context_restore_arch)
     59        lw $s0, CONTEXT_OFFSET_S0($a0)
     60        lw $s1, CONTEXT_OFFSET_S1($a0)
     61        lw $s2, CONTEXT_OFFSET_S2($a0)
     62        lw $s3, CONTEXT_OFFSET_S3($a0)
     63        lw $s4, CONTEXT_OFFSET_S4($a0)
     64        lw $s5, CONTEXT_OFFSET_S5($a0)
     65        lw $s6, CONTEXT_OFFSET_S6($a0)
     66        lw $s7, CONTEXT_OFFSET_S7($a0)
     67        lw $s8, CONTEXT_OFFSET_S8($a0)
     68        lw $gp, CONTEXT_OFFSET_GP($a0)
     69       
     70        lw $ra, CONTEXT_OFFSET_PC($a0)
     71        lw $sp, CONTEXT_OFFSET_SP($a0)
    4972       
    5073        # context_restore returns 0
    5174        j $31
    5275        xor $2, $2
     76FUNCTION_END(context_restore_arch)
Note: See TracChangeset for help on using the changeset viewer.