Changeset 308cdd1 in mainline
- Timestamp:
- 2008-03-15T12:21:09Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ca21eb4b
- Parents:
- 8476a8d
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/include/context_offset.h
r8476a8d r308cdd1 42 42 #define OFFSET_S8 0x28 43 43 #define OFFSET_GP 0x2c 44 45 #ifdef KERNEL 46 # define OFFSET_IPL 0x30 47 #else 48 # define OFFSET_TLS 0x30 49 50 # define OFFSET_F20 0x34 51 # define OFFSET_F21 0x38 52 # define OFFSET_F22 0x3c 53 # define OFFSET_F23 0x40 54 # define OFFSET_F24 0x44 55 # define OFFSET_F25 0x48 56 # define OFFSET_F26 0x4c 57 # define OFFSET_F27 0x50 58 # define OFFSET_F28 0x54 59 # define OFFSET_F29 0x58 60 # define OFFSET_F30 0x5c 61 #endif /* KERNEL */ 44 62 45 63 /* istate_t */ … … 80 98 #define REGISTER_SPACE 136 81 99 100 #ifdef __ASM__ 101 102 #include <arch/asm/regname.h> 103 104 # ctx: address of the structure with saved context 105 .macro CONTEXT_SAVE_ARCH_CORE ctx:req 106 sw $s0,OFFSET_S0(\ctx) 107 sw $s1,OFFSET_S1(\ctx) 108 sw $s2,OFFSET_S2(\ctx) 109 sw $s3,OFFSET_S3(\ctx) 110 sw $s4,OFFSET_S4(\ctx) 111 sw $s5,OFFSET_S5(\ctx) 112 sw $s6,OFFSET_S6(\ctx) 113 sw $s7,OFFSET_S7(\ctx) 114 sw $s8,OFFSET_S8(\ctx) 115 sw $gp,OFFSET_GP(\ctx) 116 117 #ifndef KERNEL 118 sw $k1,OFFSET_TLS(\ctx) 119 120 # ifdef CONFIG_MIPS_FPU 121 mfc1 $t0,$20 122 sw $t0, OFFSET_F20(\ctx) 123 124 mfc1 $t0,$21 125 sw $t0, OFFSET_F21(\ctx) 126 127 mfc1 $t0,$22 128 sw $t0, OFFSET_F22(\ctx) 129 130 mfc1 $t0,$23 131 sw $t0, OFFSET_F23(\ctx) 132 133 mfc1 $t0,$24 134 sw $t0, OFFSET_F24(\ctx) 135 136 mfc1 $t0,$25 137 sw $t0, OFFSET_F25(\ctx) 138 139 mfc1 $t0,$26 140 sw $t0, OFFSET_F26(\ctx) 141 142 mfc1 $t0,$27 143 sw $t0, OFFSET_F27(\ctx) 144 145 mfc1 $t0,$28 146 sw $t0, OFFSET_F28(\ctx) 147 148 mfc1 $t0,$29 149 sw $t0, OFFSET_F29(\ctx) 150 151 mfc1 $t0,$30 152 sw $t0, OFFSET_F30(\ctx) 153 # endif /* CONFIG_MIPS_FPU */ 154 #endif /* KERNEL */ 155 156 sw $ra,OFFSET_PC(\ctx) 157 sw $sp,OFFSET_SP(\ctx) 158 .endm 159 160 # ctx: address of the structure with saved context 161 .macro CONTEXT_RESTORE_ARCH_CORE ctx:req 162 lw $s0,OFFSET_S0(\ctx) 163 lw $s1,OFFSET_S1(\ctx) 164 lw $s2,OFFSET_S2(\ctx) 165 lw $s3,OFFSET_S3(\ctx) 166 lw $s4,OFFSET_S4(\ctx) 167 lw $s5,OFFSET_S5(\ctx) 168 lw $s6,OFFSET_S6(\ctx) 169 lw $s7,OFFSET_S7(\ctx) 170 lw $s8,OFFSET_S8(\ctx) 171 lw $gp,OFFSET_GP(\ctx) 172 #ifndef KERNEL 173 lw $k1,OFFSET_TLS(\ctx) 174 175 # ifdef CONFIG_MIPS_FPU 176 lw $t0, OFFSET_F20(\ctx) 177 mtc1 $t0,$20 178 179 lw $t0, OFFSET_F21(\ctx) 180 mtc1 $t0,$21 181 182 lw $t0, OFFSET_F22(\ctx) 183 mtc1 $t0,$22 184 185 lw $t0, OFFSET_F23(\ctx) 186 mtc1 $t0,$23 187 188 lw $t0, OFFSET_F24(\ctx) 189 mtc1 $t0,$24 190 191 lw $t0, OFFSET_F25(\ctx) 192 mtc1 $t0,$25 193 194 lw $t0, OFFSET_F26(\ctx) 195 mtc1 $t0,$26 196 197 lw $t0, OFFSET_F27(\ctx) 198 mtc1 $t0,$27 199 200 lw $t0, OFFSET_F28(\ctx) 201 mtc1 $t0,$28 202 203 lw $t0, OFFSET_F29(\ctx) 204 mtc1 $t0,$29 205 206 lw $t0, OFFSET_F30(\ctx) 207 mtc1 $t0,$30 208 # endif /* CONFIG_MIPS_FPU */ 209 210 #endif /* KERNEL */ 211 lw $ra,OFFSET_PC(\ctx) 212 lw $sp,OFFSET_SP(\ctx) 213 .endm 214 82 215 #endif 216 217 218 #endif -
kernel/arch/mips32/src/context.S
r8476a8d r308cdd1 27 27 # 28 28 29 #include <arch/asm/regname.h>30 29 #include <arch/context_offset.h> 31 30 … … 39 38 .global context_restore_arch 40 39 41 .macro CONTEXT_STORE r42 sw $s0,OFFSET_S0(\r)43 sw $s1,OFFSET_S1(\r)44 sw $s2,OFFSET_S2(\r)45 sw $s3,OFFSET_S3(\r)46 sw $s4,OFFSET_S4(\r)47 sw $s5,OFFSET_S5(\r)48 sw $s6,OFFSET_S6(\r)49 sw $s7,OFFSET_S7(\r)50 sw $s8,OFFSET_S8(\r)51 sw $gp,OFFSET_GP(\r)52 53 sw $ra,OFFSET_PC(\r)54 sw $sp,OFFSET_SP(\r)55 .endm56 57 .macro CONTEXT_LOAD r58 lw $s0,OFFSET_S0(\r)59 lw $s1,OFFSET_S1(\r)60 lw $s2,OFFSET_S2(\r)61 lw $s3,OFFSET_S3(\r)62 lw $s4,OFFSET_S4(\r)63 lw $s5,OFFSET_S5(\r)64 lw $s6,OFFSET_S6(\r)65 lw $s7,OFFSET_S7(\r)66 lw $s8,OFFSET_S8(\r)67 lw $gp,OFFSET_GP(\r)68 69 lw $ra,OFFSET_PC(\r)70 lw $sp,OFFSET_SP(\r)71 .endm72 73 40 74 41 context_save_arch: 75 CONTEXT_S TORE $a042 CONTEXT_SAVE_ARCH_CORE $a0 76 43 77 44 # context_save returns 1 … … 80 47 81 48 context_restore_arch: 82 CONTEXT_ LOAD$a049 CONTEXT_RESTORE_ARCH_CORE $a0 83 50 84 51 # context_restore returns 0 -
uspace/lib/libc/arch/mips32/src/fibril.S
r8476a8d r308cdd1 32 32 .set noreorder 33 33 34 35 #include <arch/asm/regname.h> 36 #include <libarch/context_offset.h> 34 #include <arch/context_offset.h> 37 35 38 36 .global context_save 39 37 .global context_restore 40 38 41 .macro CONTEXT_STORE r42 sw $s0,OFFSET_S0(\r)43 sw $s1,OFFSET_S1(\r)44 sw $s2,OFFSET_S2(\r)45 sw $s3,OFFSET_S3(\r)46 sw $s4,OFFSET_S4(\r)47 sw $s5,OFFSET_S5(\r)48 sw $s6,OFFSET_S6(\r)49 sw $s7,OFFSET_S7(\r)50 sw $s8,OFFSET_S8(\r)51 sw $gp,OFFSET_GP(\r)52 sw $k1,OFFSET_TLS(\r)53 54 #ifdef CONFIG_MIPS_FPU55 mfc1 $t0,$2056 sw $t0, OFFSET_F20(\r)57 58 mfc1 $t0,$2159 sw $t0, OFFSET_F21(\r)60 61 mfc1 $t0,$2262 sw $t0, OFFSET_F22(\r)63 64 mfc1 $t0,$2365 sw $t0, OFFSET_F23(\r)66 67 mfc1 $t0,$2468 sw $t0, OFFSET_F24(\r)69 70 mfc1 $t0,$2571 sw $t0, OFFSET_F25(\r)72 73 mfc1 $t0,$2674 sw $t0, OFFSET_F26(\r)75 76 mfc1 $t0,$2777 sw $t0, OFFSET_F27(\r)78 79 mfc1 $t0,$2880 sw $t0, OFFSET_F28(\r)81 82 mfc1 $t0,$2983 sw $t0, OFFSET_F29(\r)84 85 mfc1 $t0,$3086 sw $t0, OFFSET_F30(\r)87 #endif88 89 sw $ra,OFFSET_PC(\r)90 sw $sp,OFFSET_SP(\r)91 .endm92 93 .macro CONTEXT_LOAD r94 lw $s0,OFFSET_S0(\r)95 lw $s1,OFFSET_S1(\r)96 lw $s2,OFFSET_S2(\r)97 lw $s3,OFFSET_S3(\r)98 lw $s4,OFFSET_S4(\r)99 lw $s5,OFFSET_S5(\r)100 lw $s6,OFFSET_S6(\r)101 lw $s7,OFFSET_S7(\r)102 lw $s8,OFFSET_S8(\r)103 lw $gp,OFFSET_GP(\r)104 lw $k1,OFFSET_TLS(\r)105 106 #ifdef CONFIG_MIPS_FPU107 lw $t0, OFFSET_F20(\r)108 mtc1 $t0,$20109 110 lw $t0, OFFSET_F21(\r)111 mtc1 $t0,$21112 113 lw $t0, OFFSET_F22(\r)114 mtc1 $t0,$22115 116 lw $t0, OFFSET_F23(\r)117 mtc1 $t0,$23118 119 lw $t0, OFFSET_F24(\r)120 mtc1 $t0,$24121 122 lw $t0, OFFSET_F25(\r)123 mtc1 $t0,$25124 125 lw $t0, OFFSET_F26(\r)126 mtc1 $t0,$26127 128 lw $t0, OFFSET_F27(\r)129 mtc1 $t0,$27130 131 lw $t0, OFFSET_F28(\r)132 mtc1 $t0,$28133 134 lw $t0, OFFSET_F29(\r)135 mtc1 $t0,$29136 137 lw $t0, OFFSET_F30(\r)138 mtc1 $t0,$30139 #endif140 141 lw $ra,OFFSET_PC(\r)142 lw $sp,OFFSET_SP(\r)143 .endm144 145 39 context_save: 146 CONTEXT_S TORE $a040 CONTEXT_SAVE_ARCH_CORE $a0 147 41 148 42 # context_save returns 1 … … 151 45 152 46 context_restore: 153 CONTEXT_ LOAD$a047 CONTEXT_RESTORE_ARCH_CORE $a0 154 48 155 49 # Just for the jump into first function, but one instruction
Note:
See TracChangeset
for help on using the changeset viewer.