Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 5301662 in mainline


Ignore:
Timestamp:
2014-09-08T20:56:13Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
24c394b
Parents:
9827b5b
Message:

Autogenerate mips32 fpu_context_t and its #defines.

Location:
kernel/arch/mips32
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/Makefile.inc

    r9827b5b r5301662  
    8787ARCH_AUTOGENS_AG = \
    8888        arch/$(KARCH)/include/arch/istate_struct.ag \
    89         arch/$(KARCH)/include/arch/context_struct.ag
     89        arch/$(KARCH)/include/arch/context_struct.ag \
     90        arch/$(KARCH)/include/arch/fpu_context_struct.ag
    9091
  • kernel/arch/mips32/include/arch/fpu_context.h

    r9827b5b r5301662  
    3737
    3838#include <typedefs.h>
     39#include <arch/fpu_context_struct.h>
    3940
    4041#define FPU_CONTEXT_ALIGN    sizeof(sysarg_t)
    41 
    42 typedef struct {
    43         sysarg_t dregs[32];
    44         sysarg_t cregs[32];
    45 } fpu_context_t;
    4642
    4743#endif
  • kernel/arch/mips32/src/asm.S

    r9827b5b r5301662  
    2828
    2929#include <arch/asm/regname.h>
     30#include <arch/fpu_context_struct.h>
    3031
    3132.text
     
    136137.macro fpu_gp_save reg ctx
    137138        mfc1 $t0, $\reg
    138         sw $t0, \reg * 4(\ctx)
     139        sw $t0, FPU_CONTEXT_OFFSET_DREGS + \reg * FPU_CONTEXT_DREGS_ITEM_SIZE(\ctx)
    139140.endm
    140141
    141142.macro fpu_gp_restore reg ctx
    142         lw $t0, \reg * 4(\ctx)
     143        lw $t0, FPU_CONTEXT_OFFSET_DREGS + \reg * FPU_CONTEXT_DREGS_ITEM_SIZE(\ctx)
    143144        mtc1 $t0, $\reg
    144145.endm
     
    146147.macro fpu_ct_save reg ctx
    147148        cfc1 $t0, $1
    148         sw $t0, (\reg + 32) * 4(\ctx)
     149        sw $t0, FPU_CONTEXT_OFFSET_CREGS + \reg * FPU_CONTEXT_CREGS_ITEM_SIZE(\ctx)
    149150.endm
    150151
    151152.macro fpu_ct_restore reg ctx
    152         lw $t0, (\reg + 32) * 4(\ctx)
     153        lw $t0, FPU_CONTEXT_OFFSET_CREGS + \reg * FPU_CONTEZT_CREGS_ITEM_SIZE(\ctx)
    153154        ctc1 $t0, $\reg
    154155.endm
Note: See TracChangeset for help on using the changeset viewer.