Changeset a595f5a in mainline
- Timestamp:
- 2014-09-03T22:29:01Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 309a894
- Parents:
- fe124d63
- Location:
- kernel/arch/ppc32
- Files:
-
- 2 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/Makefile.inc
rfe124d63 ra595f5a 60 60 61 61 ARCH_AUTOGENS_AG = \ 62 arch/$(KARCH)/include/arch/istate_struct.ag 62 arch/$(KARCH)/include/arch/istate_struct.ag \ 63 arch/$(KARCH)/include/arch/context_struct.ag \ 64 arch/$(KARCH)/include/arch/fpu_context_struct.ag 63 65 -
kernel/arch/ppc32/include/arch/context.h
rfe124d63 ra595f5a 36 36 #define KERN_ppc32_CONTEXT_H_ 37 37 38 #include < typedefs.h>38 #include <arch/context_struct.h> 39 39 40 40 #define SP_DELTA 16 … … 43 43 context_set_generic(ctx, pc, stack, size) 44 44 45 typedef struct {46 uintptr_t sp;47 uintptr_t pc;48 49 uint32_t r2;50 uint32_t r13;51 uint32_t r14;52 uint32_t r15;53 uint32_t r16;54 uint32_t r17;55 uint32_t r18;56 uint32_t r19;57 uint32_t r20;58 uint32_t r21;59 uint32_t r22;60 uint32_t r23;61 uint32_t r24;62 uint32_t r25;63 uint32_t r26;64 uint32_t r27;65 uint32_t r28;66 uint32_t r29;67 uint32_t r30;68 uint32_t r31;69 70 uint32_t cr;71 72 ipl_t ipl;73 } __attribute__((packed)) context_t;74 75 45 #endif 76 46 -
kernel/arch/ppc32/include/arch/fpu_context.h
rfe124d63 ra595f5a 38 38 #define FPU_CONTEXT_ALIGN 8 39 39 40 #include <typedefs.h> 41 42 typedef struct { 43 uint64_t fr0; 44 uint64_t fr1; 45 uint64_t fr2; 46 uint64_t fr3; 47 uint64_t fr4; 48 uint64_t fr5; 49 uint64_t fr6; 50 uint64_t fr7; 51 uint64_t fr8; 52 uint64_t fr9; 53 uint64_t fr10; 54 uint64_t fr11; 55 uint64_t fr12; 56 uint64_t fr13; 57 uint64_t fr14; 58 uint64_t fr15; 59 uint64_t fr16; 60 uint64_t fr17; 61 uint64_t fr18; 62 uint64_t fr19; 63 uint64_t fr20; 64 uint64_t fr21; 65 uint64_t fr22; 66 uint64_t fr23; 67 uint64_t fr24; 68 uint64_t fr25; 69 uint64_t fr26; 70 uint64_t fr27; 71 uint64_t fr28; 72 uint64_t fr29; 73 uint64_t fr30; 74 uint64_t fr31; 75 uint64_t fpscr; 76 } __attribute__ ((packed)) fpu_context_t; 40 #include <arch/fpu_context_struct.h> 77 41 78 42 #endif -
kernel/arch/ppc32/src/context.S
rfe124d63 ra595f5a 27 27 # 28 28 29 #include <arch/context_offset.h> 29 #include <arch/context_struct.h> 30 #include <arch/asm/regname.h> 30 31 31 32 .text … … 35 36 36 37 context_save_arch: 37 CONTEXT_SAVE_ARCH_CORE r3 38 stw sp, CONTEXT_OFFSET_SP(r3) 39 stw r2, CONTEXT_OFFSET_R2(r3) 40 stw r13, CONTEXT_OFFSET_R13(r3) 41 stw r14, CONTEXT_OFFSET_R14(r3) 42 stw r15, CONTEXT_OFFSET_R15(r3) 43 stw r16, CONTEXT_OFFSET_R16(r3) 44 stw r17, CONTEXT_OFFSET_R17(r3) 45 stw r18, CONTEXT_OFFSET_R18(r3) 46 stw r19, CONTEXT_OFFSET_R19(r3) 47 stw r20, CONTEXT_OFFSET_R20(r3) 48 stw r21, CONTEXT_OFFSET_R21(r3) 49 stw r22, CONTEXT_OFFSET_R22(r3) 50 stw r23, CONTEXT_OFFSET_R23(r3) 51 stw r24, CONTEXT_OFFSET_R24(r3) 52 stw r25, CONTEXT_OFFSET_R25(r3) 53 stw r26, CONTEXT_OFFSET_R26(r3) 54 stw r27, CONTEXT_OFFSET_R27(r3) 55 stw r28, CONTEXT_OFFSET_R28(r3) 56 stw r29, CONTEXT_OFFSET_R29(r3) 57 stw r30, CONTEXT_OFFSET_R30(r3) 58 stw r31, CONTEXT_OFFSET_R31(r3) 38 59 39 60 mflr r4 40 stw r4, OFFSET_PC(r3)61 stw r4, CONTEXT_OFFSET_PC(r3) 41 62 42 63 mfcr r4 43 stw r4, OFFSET_CR(r3)64 stw r4, CONTEXT_OFFSET_CR(r3) 44 65 45 66 # context_save returns 1 … … 48 69 49 70 context_restore_arch: 50 CONTEXT_RESTORE_ARCH_CORE r3 71 lwz sp, CONTEXT_OFFSET_SP(r3) 72 lwz r2, CONTEXT_OFFSET_R2(r3) 73 lwz r13, CONTEXT_OFFSET_R13(r3) 74 lwz r14, CONTEXT_OFFSET_R14(r3) 75 lwz r15, CONTEXT_OFFSET_R15(r3) 76 lwz r16, CONTEXT_OFFSET_R16(r3) 77 lwz r17, CONTEXT_OFFSET_R17(r3) 78 lwz r18, CONTEXT_OFFSET_R18(r3) 79 lwz r19, CONTEXT_OFFSET_R19(r3) 80 lwz r20, CONTEXT_OFFSET_R20(r3) 81 lwz r21, CONTEXT_OFFSET_R21(r3) 82 lwz r22, CONTEXT_OFFSET_R22(r3) 83 lwz r23, CONTEXT_OFFSET_R23(r3) 84 lwz r24, CONTEXT_OFFSET_R24(r3) 85 lwz r25, CONTEXT_OFFSET_R25(r3) 86 lwz r26, CONTEXT_OFFSET_R26(r3) 87 lwz r27, CONTEXT_OFFSET_R27(r3) 88 lwz r28, CONTEXT_OFFSET_R28(r3) 89 lwz r29, CONTEXT_OFFSET_R29(r3) 90 lwz r30, CONTEXT_OFFSET_R30(r3) 91 lwz r31, CONTEXT_OFFSET_R31(r3) 51 92 52 lwz r4, OFFSET_CR(r3)93 lwz r4, CONTEXT_OFFSET_CR(r3) 53 94 mtcr r4 54 95 55 lwz r4, OFFSET_PC(r3)96 lwz r4, CONTEXT_OFFSET_PC(r3) 56 97 mtlr r4 57 98 -
kernel/arch/ppc32/src/fpu_context.S
rfe124d63 ra595f5a 28 28 29 29 #include <arch/asm/regname.h> 30 #include <arch/ context_offset.h>30 #include <arch/fpu_context_struct.h> 31 31 #include <arch/msr.h> 32 32 … … 40 40 41 41 .macro FPU_CONTEXT_STORE r 42 stfd fr0, OFFSET_FR0(\r)43 stfd fr1, OFFSET_FR1(\r)44 stfd fr2, OFFSET_FR2(\r)45 stfd fr3, OFFSET_FR3(\r)46 stfd fr4, OFFSET_FR4(\r)47 stfd fr5, OFFSET_FR5(\r)48 stfd fr6, OFFSET_FR6(\r)49 stfd fr7, OFFSET_FR7(\r)50 stfd fr8, OFFSET_FR8(\r)51 stfd fr9, OFFSET_FR9(\r)52 stfd fr10, OFFSET_FR10(\r)53 stfd fr11, OFFSET_FR11(\r)54 stfd fr12, OFFSET_FR12(\r)55 stfd fr13, OFFSET_FR13(\r)56 stfd fr14, OFFSET_FR14(\r)57 stfd fr15, OFFSET_FR15(\r)58 stfd fr16, OFFSET_FR16(\r)59 stfd fr17, OFFSET_FR17(\r)60 stfd fr18, OFFSET_FR18(\r)61 stfd fr19, OFFSET_FR19(\r)62 stfd fr20, OFFSET_FR20(\r)63 stfd fr21, OFFSET_FR21(\r)64 stfd fr22, OFFSET_FR22(\r)65 stfd fr23, OFFSET_FR23(\r)66 stfd fr24, OFFSET_FR24(\r)67 stfd fr25, OFFSET_FR25(\r)68 stfd fr26, OFFSET_FR26(\r)69 stfd fr27, OFFSET_FR27(\r)70 stfd fr28, OFFSET_FR28(\r)71 stfd fr29, OFFSET_FR29(\r)72 stfd fr30, OFFSET_FR30(\r)73 stfd fr31, OFFSET_FR31(\r)42 stfd fr0, FPU_CONTEXT_OFFSET_FR0(\r) 43 stfd fr1, FPU_CONTEXT_OFFSET_FR1(\r) 44 stfd fr2, FPU_CONTEXT_OFFSET_FR2(\r) 45 stfd fr3, FPU_CONTEXT_OFFSET_FR3(\r) 46 stfd fr4, FPU_CONTEXT_OFFSET_FR4(\r) 47 stfd fr5, FPU_CONTEXT_OFFSET_FR5(\r) 48 stfd fr6, FPU_CONTEXT_OFFSET_FR6(\r) 49 stfd fr7, FPU_CONTEXT_OFFSET_FR7(\r) 50 stfd fr8, FPU_CONTEXT_OFFSET_FR8(\r) 51 stfd fr9, FPU_CONTEXT_OFFSET_FR9(\r) 52 stfd fr10, FPU_CONTEXT_OFFSET_FR10(\r) 53 stfd fr11, FPU_CONTEXT_OFFSET_FR11(\r) 54 stfd fr12, FPU_CONTEXT_OFFSET_FR12(\r) 55 stfd fr13, FPU_CONTEXT_OFFSET_FR13(\r) 56 stfd fr14, FPU_CONTEXT_OFFSET_FR14(\r) 57 stfd fr15, FPU_CONTEXT_OFFSET_FR15(\r) 58 stfd fr16, FPU_CONTEXT_OFFSET_FR16(\r) 59 stfd fr17, FPU_CONTEXT_OFFSET_FR17(\r) 60 stfd fr18, FPU_CONTEXT_OFFSET_FR18(\r) 61 stfd fr19, FPU_CONTEXT_OFFSET_FR19(\r) 62 stfd fr20, FPU_CONTEXT_OFFSET_FR20(\r) 63 stfd fr21, FPU_CONTEXT_OFFSET_FR21(\r) 64 stfd fr22, FPU_CONTEXT_OFFSET_FR22(\r) 65 stfd fr23, FPU_CONTEXT_OFFSET_FR23(\r) 66 stfd fr24, FPU_CONTEXT_OFFSET_FR24(\r) 67 stfd fr25, FPU_CONTEXT_OFFSET_FR25(\r) 68 stfd fr26, FPU_CONTEXT_OFFSET_FR26(\r) 69 stfd fr27, FPU_CONTEXT_OFFSET_FR27(\r) 70 stfd fr28, FPU_CONTEXT_OFFSET_FR28(\r) 71 stfd fr29, FPU_CONTEXT_OFFSET_FR29(\r) 72 stfd fr30, FPU_CONTEXT_OFFSET_FR30(\r) 73 stfd fr31, FPU_CONTEXT_OFFSET_FR31(\r) 74 74 .endm 75 75 76 76 .macro FPU_CONTEXT_LOAD r 77 lfd fr0, OFFSET_FR0(\r)78 lfd fr1, OFFSET_FR1(\r)79 lfd fr2, OFFSET_FR2(\r)80 lfd fr3, OFFSET_FR3(\r)81 lfd fr4, OFFSET_FR4(\r)82 lfd fr5, OFFSET_FR5(\r)83 lfd fr6, OFFSET_FR6(\r)84 lfd fr7, OFFSET_FR7(\r)85 lfd fr8, OFFSET_FR8(\r)86 lfd fr9, OFFSET_FR9(\r)87 lfd fr10, OFFSET_FR10(\r)88 lfd fr11, OFFSET_FR11(\r)89 lfd fr12, OFFSET_FR12(\r)90 lfd fr13, OFFSET_FR13(\r)91 lfd fr14, OFFSET_FR14(\r)92 lfd fr15, OFFSET_FR15(\r)93 lfd fr16, OFFSET_FR16(\r)94 lfd fr17, OFFSET_FR17(\r)95 lfd fr18, OFFSET_FR18(\r)96 lfd fr19, OFFSET_FR19(\r)97 lfd fr20, OFFSET_FR20(\r)98 lfd fr21, OFFSET_FR21(\r)99 lfd fr22, OFFSET_FR22(\r)100 lfd fr23, OFFSET_FR23(\r)101 lfd fr24, OFFSET_FR24(\r)102 lfd fr25, OFFSET_FR25(\r)103 lfd fr26, OFFSET_FR26(\r)104 lfd fr27, OFFSET_FR27(\r)105 lfd fr28, OFFSET_FR28(\r)106 lfd fr29, OFFSET_FR29(\r)107 lfd fr30, OFFSET_FR30(\r)108 lfd fr31, OFFSET_FR31(\r)77 lfd fr0, FPU_CONTEXT_OFFSET_FR0(\r) 78 lfd fr1, FPU_CONTEXT_OFFSET_FR1(\r) 79 lfd fr2, FPU_CONTEXT_OFFSET_FR2(\r) 80 lfd fr3, FPU_CONTEXT_OFFSET_FR3(\r) 81 lfd fr4, FPU_CONTEXT_OFFSET_FR4(\r) 82 lfd fr5, FPU_CONTEXT_OFFSET_FR5(\r) 83 lfd fr6, FPU_CONTEXT_OFFSET_FR6(\r) 84 lfd fr7, FPU_CONTEXT_OFFSET_FR7(\r) 85 lfd fr8, FPU_CONTEXT_OFFSET_FR8(\r) 86 lfd fr9, FPU_CONTEXT_OFFSET_FR9(\r) 87 lfd fr10, FPU_CONTEXT_OFFSET_FR10(\r) 88 lfd fr11, FPU_CONTEXT_OFFSET_FR11(\r) 89 lfd fr12, FPU_CONTEXT_OFFSET_FR12(\r) 90 lfd fr13, FPU_CONTEXT_OFFSET_FR13(\r) 91 lfd fr14, FPU_CONTEXT_OFFSET_FR14(\r) 92 lfd fr15, FPU_CONTEXT_OFFSET_FR15(\r) 93 lfd fr16, FPU_CONTEXT_OFFSET_FR16(\r) 94 lfd fr17, FPU_CONTEXT_OFFSET_FR17(\r) 95 lfd fr18, FPU_CONTEXT_OFFSET_FR18(\r) 96 lfd fr19, FPU_CONTEXT_OFFSET_FR19(\r) 97 lfd fr20, FPU_CONTEXT_OFFSET_FR20(\r) 98 lfd fr21, FPU_CONTEXT_OFFSET_FR21(\r) 99 lfd fr22, FPU_CONTEXT_OFFSET_FR22(\r) 100 lfd fr23, FPU_CONTEXT_OFFSET_FR23(\r) 101 lfd fr24, FPU_CONTEXT_OFFSET_FR24(\r) 102 lfd fr25, FPU_CONTEXT_OFFSET_FR25(\r) 103 lfd fr26, FPU_CONTEXT_OFFSET_FR26(\r) 104 lfd fr27, FPU_CONTEXT_OFFSET_FR27(\r) 105 lfd fr28, FPU_CONTEXT_OFFSET_FR28(\r) 106 lfd fr29, FPU_CONTEXT_OFFSET_FR29(\r) 107 lfd fr30, FPU_CONTEXT_OFFSET_FR30(\r) 108 lfd fr31, FPU_CONTEXT_OFFSET_FR31(\r) 109 109 .endm 110 110 … … 113 113 114 114 mffs fr0 115 stfd fr0, OFFSET_FPSCR(r3)115 stfd fr0, FPU_CONTEXT_OFFSET_FPSCR(r3) 116 116 117 117 blr 118 118 119 119 fpu_context_restore: 120 lfd fr0, OFFSET_FPSCR(r3)120 lfd fr0, FPU_CONTEXT_OFFSET_FPSCR(r3) 121 121 mtfsf 7, fr0 122 122
Note:
See TracChangeset
for help on using the changeset viewer.