Rev 534 | Rev 993 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 534 | Rev 979 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | * |
27 | * |
28 | */ |
28 | */ |
29 | 29 | ||
30 | #include <fpu_context.h> |
30 | #include <fpu_context.h> |
31 | 31 | ||
32 | void fpu_context_save(fpu_context_t *fctx) |
32 | void fpu_context_save(fpu_context_t *fctx){ |
- | 33 | asm volatile( |
|
- | 34 | "stf.spill [%2]=f2,0x80\n" |
|
- | 35 | "stf.spill [%3]=f3,0x80\n" |
|
- | 36 | "stf.spill [%4]=f4,0x80\n" |
|
- | 37 | "stf.spill [%5]=f5,0x80\n" |
|
- | 38 | "stf.spill [%6]=f6,0x80\n" |
|
- | 39 | "stf.spill [%7]=f7,0x80\n;;" |
|
- | 40 | ||
- | 41 | "stf.spill [%0]=f8,0x80\n" |
|
- | 42 | "stf.spill [%1]=f9,0x80\n" |
|
- | 43 | "stf.spill [%2]=f10,0x80\n" |
|
- | 44 | "stf.spill [%3]=f11,0x80\n" |
|
- | 45 | "stf.spill [%4]=f12,0x80\n" |
|
- | 46 | "stf.spill [%5]=f13,0x80\n" |
|
- | 47 | "stf.spill [%6]=f14,0x80\n" |
|
- | 48 | "stf.spill [%7]=f15,0x80\n;;" |
|
- | 49 | ||
- | 50 | "stf.spill [%0]=f16,0x80\n" |
|
- | 51 | "stf.spill [%1]=f17,0x80\n" |
|
- | 52 | "stf.spill [%2]=f18,0x80\n" |
|
- | 53 | "stf.spill [%3]=f19,0x80\n" |
|
- | 54 | "stf.spill [%4]=f20,0x80\n" |
|
- | 55 | "stf.spill [%5]=f21,0x80\n" |
|
- | 56 | "stf.spill [%6]=f22,0x80\n" |
|
- | 57 | "stf.spill [%7]=f23,0x80\n;;" |
|
- | 58 | ||
- | 59 | "stf.spill [%0]=f24,0x80\n" |
|
- | 60 | "stf.spill [%1]=f25,0x80\n" |
|
- | 61 | "stf.spill [%2]=f26,0x80\n" |
|
- | 62 | "stf.spill [%3]=f27,0x80\n" |
|
- | 63 | "stf.spill [%4]=f28,0x80\n" |
|
- | 64 | "stf.spill [%5]=f29,0x80\n" |
|
- | 65 | "stf.spill [%6]=f30,0x80\n" |
|
- | 66 | "stf.spill [%7]=f31,0x80\n;;" |
|
- | 67 | ||
- | 68 | ||
- | 69 | "stf.spill [%0]=f32,0x80\n" |
|
- | 70 | "stf.spill [%1]=f33,0x80\n" |
|
- | 71 | "stf.spill [%2]=f34,0x80\n" |
|
- | 72 | "stf.spill [%3]=f35,0x80\n" |
|
- | 73 | "stf.spill [%4]=f36,0x80\n" |
|
- | 74 | "stf.spill [%5]=f37,0x80\n" |
|
- | 75 | "stf.spill [%6]=f38,0x80\n" |
|
- | 76 | "stf.spill [%7]=f39,0x80\n;;" |
|
- | 77 | ||
- | 78 | "stf.spill [%0]=f40,0x80\n" |
|
- | 79 | "stf.spill [%1]=f41,0x80\n" |
|
- | 80 | "stf.spill [%2]=f42,0x80\n" |
|
- | 81 | "stf.spill [%3]=f43,0x80\n" |
|
- | 82 | "stf.spill [%4]=f44,0x80\n" |
|
- | 83 | "stf.spill [%5]=f45,0x80\n" |
|
- | 84 | "stf.spill [%6]=f46,0x80\n" |
|
- | 85 | "stf.spill [%7]=f47,0x80\n;;" |
|
- | 86 | ||
- | 87 | "stf.spill [%0]=f48,0x80\n" |
|
- | 88 | "stf.spill [%1]=f49,0x80\n" |
|
- | 89 | "stf.spill [%2]=f50,0x80\n" |
|
- | 90 | "stf.spill [%3]=f51,0x80\n" |
|
- | 91 | "stf.spill [%4]=f52,0x80\n" |
|
- | 92 | "stf.spill [%5]=f53,0x80\n" |
|
- | 93 | "stf.spill [%6]=f54,0x80\n" |
|
- | 94 | "stf.spill [%7]=f55,0x80\n;;" |
|
- | 95 | ||
- | 96 | "stf.spill [%0]=f56,0x80\n" |
|
- | 97 | "stf.spill [%1]=f57,0x80\n" |
|
- | 98 | "stf.spill [%2]=f58,0x80\n" |
|
- | 99 | "stf.spill [%3]=f59,0x80\n" |
|
- | 100 | "stf.spill [%4]=f60,0x80\n" |
|
- | 101 | "stf.spill [%5]=f61,0x80\n" |
|
- | 102 | "stf.spill [%6]=f62,0x80\n" |
|
- | 103 | "stf.spill [%7]=f63,0x80\n;;" |
|
- | 104 | ||
- | 105 | "stf.spill [%0]=f64,0x80\n" |
|
- | 106 | "stf.spill [%1]=f65,0x80\n" |
|
- | 107 | "stf.spill [%2]=f66,0x80\n" |
|
- | 108 | "stf.spill [%3]=f67,0x80\n" |
|
- | 109 | "stf.spill [%4]=f68,0x80\n" |
|
- | 110 | "stf.spill [%5]=f69,0x80\n" |
|
- | 111 | "stf.spill [%6]=f70,0x80\n" |
|
- | 112 | "stf.spill [%7]=f71,0x80\n;;" |
|
- | 113 | ||
- | 114 | "stf.spill [%0]=f72,0x80\n" |
|
- | 115 | "stf.spill [%1]=f73,0x80\n" |
|
- | 116 | "stf.spill [%2]=f74,0x80\n" |
|
- | 117 | "stf.spill [%3]=f75,0x80\n" |
|
- | 118 | "stf.spill [%4]=f76,0x80\n" |
|
- | 119 | "stf.spill [%5]=f77,0x80\n" |
|
- | 120 | "stf.spill [%6]=f78,0x80\n" |
|
- | 121 | "stf.spill [%7]=f79,0x80\n;;" |
|
- | 122 | ||
- | 123 | "stf.spill [%0]=f80,0x80\n" |
|
- | 124 | "stf.spill [%1]=f81,0x80\n" |
|
- | 125 | "stf.spill [%2]=f82,0x80\n" |
|
- | 126 | "stf.spill [%3]=f83,0x80\n" |
|
- | 127 | "stf.spill [%4]=f84,0x80\n" |
|
- | 128 | "stf.spill [%5]=f85,0x80\n" |
|
- | 129 | "stf.spill [%6]=f86,0x80\n" |
|
- | 130 | "stf.spill [%7]=f87,0x80\n;;" |
|
- | 131 | ||
- | 132 | "stf.spill [%0]=f88,0x80\n" |
|
- | 133 | "stf.spill [%1]=f89,0x80\n" |
|
- | 134 | "stf.spill [%2]=f90,0x80\n" |
|
- | 135 | "stf.spill [%3]=f91,0x80\n" |
|
- | 136 | "stf.spill [%4]=f92,0x80\n" |
|
- | 137 | "stf.spill [%5]=f93,0x80\n" |
|
- | 138 | "stf.spill [%6]=f94,0x80\n" |
|
- | 139 | "stf.spill [%7]=f95,0x80\n;;" |
|
- | 140 | ||
- | 141 | ||
- | 142 | "stf.spill [%0]=f96,0x80\n" |
|
- | 143 | "stf.spill [%1]=f97,0x80\n" |
|
- | 144 | "stf.spill [%2]=f98,0x80\n" |
|
- | 145 | "stf.spill [%3]=f99,0x80\n" |
|
- | 146 | "stf.spill [%4]=f100,0x80\n" |
|
- | 147 | "stf.spill [%5]=f101,0x80\n" |
|
- | 148 | "stf.spill [%6]=f102,0x80\n" |
|
- | 149 | "stf.spill [%7]=f103,0x80\n;;" |
|
- | 150 | ||
- | 151 | "stf.spill [%0]=f104,0x80\n" |
|
- | 152 | "stf.spill [%1]=f105,0x80\n" |
|
- | 153 | "stf.spill [%2]=f106,0x80\n" |
|
- | 154 | "stf.spill [%3]=f107,0x80\n" |
|
- | 155 | "stf.spill [%4]=f108,0x80\n" |
|
- | 156 | "stf.spill [%5]=f109,0x80\n" |
|
- | 157 | "stf.spill [%6]=f110,0x80\n" |
|
- | 158 | "stf.spill [%7]=f111,0x80\n;;" |
|
- | 159 | ||
- | 160 | "stf.spill [%0]=f112,0x80\n" |
|
- | 161 | "stf.spill [%1]=f113,0x80\n" |
|
- | 162 | "stf.spill [%2]=f114,0x80\n" |
|
- | 163 | "stf.spill [%3]=f115,0x80\n" |
|
- | 164 | "stf.spill [%4]=f116,0x80\n" |
|
- | 165 | "stf.spill [%5]=f117,0x80\n" |
|
- | 166 | "stf.spill [%6]=f118,0x80\n" |
|
- | 167 | "stf.spill [%7]=f119,0x80\n;;" |
|
- | 168 | ||
- | 169 | "stf.spill [%0]=f120,0x80\n" |
|
- | 170 | "stf.spill [%1]=f121,0x80\n" |
|
- | 171 | "stf.spill [%2]=f122,0x80\n" |
|
- | 172 | "stf.spill [%3]=f123,0x80\n" |
|
- | 173 | "stf.spill [%4]=f124,0x80\n" |
|
- | 174 | "stf.spill [%5]=f125,0x80\n" |
|
- | 175 | "stf.spill [%6]=f126,0x80\n" |
|
- | 176 | "stf.spill [%7]=f127,0x80\n;;" |
|
- | 177 | ||
- | 178 | ||
- | 179 | : |
|
- | 180 | :"r" (&((fctx->fr)[0])),"r" (&((fctx->fr)[1])),"r" (&((fctx->fr)[2])),"r" (&((fctx->fr)[3])), |
|
- | 181 | "r" (&((fctx->fr)[4])),"r" (&((fctx->fr)[5])),"r" (&((fctx->fr)[6])),"r" (&((fctx->fr)[7])) |
|
- | 182 | ); |
|
33 | { |
183 | |
34 | } |
184 | } |
35 | 185 | ||
36 | 186 | ||
37 | void fpu_context_restore(fpu_context_t *fctx) |
187 | void fpu_context_restore(fpu_context_t *fctx) |
38 | { |
188 | { |
- | 189 | ||
- | 190 | asm volatile( |
|
- | 191 | "ldf.fill f2=[%2],0x80\n" |
|
- | 192 | "ldf.fill f3=[%3],0x80\n" |
|
- | 193 | "ldf.fill f4=[%4],0x80\n" |
|
- | 194 | "ldf.fill f5=[%5],0x80\n" |
|
- | 195 | "ldf.fill f6=[%6],0x80\n" |
|
- | 196 | "ldf.fill f7=[%7],0x80\n;;" |
|
- | 197 | ||
- | 198 | "ldf.fill f8=[%0],0x80\n" |
|
- | 199 | "ldf.fill f9=[%1],0x80\n" |
|
- | 200 | "ldf.fill f10=[%2],0x80\n" |
|
- | 201 | "ldf.fill f11=[%3],0x80\n" |
|
- | 202 | "ldf.fill f12=[%4],0x80\n" |
|
- | 203 | "ldf.fill f13=[%5],0x80\n" |
|
- | 204 | "ldf.fill f14=[%6],0x80\n" |
|
- | 205 | "ldf.fill f15=[%7],0x80\n;;" |
|
- | 206 | ||
- | 207 | "ldf.fill f16=[%0],0x80\n" |
|
- | 208 | "ldf.fill f17=[%1],0x80\n" |
|
- | 209 | "ldf.fill f18=[%2],0x80\n" |
|
- | 210 | "ldf.fill f19=[%3],0x80\n" |
|
- | 211 | "ldf.fill f20=[%4],0x80\n" |
|
- | 212 | "ldf.fill f21=[%5],0x80\n" |
|
- | 213 | "ldf.fill f22=[%6],0x80\n" |
|
- | 214 | "ldf.fill f23=[%7],0x80\n;;" |
|
- | 215 | ||
- | 216 | "ldf.fill f24=[%0],0x80\n" |
|
- | 217 | "ldf.fill f25=[%1],0x80\n" |
|
- | 218 | "ldf.fill f26=[%2],0x80\n" |
|
- | 219 | "ldf.fill f27=[%3],0x80\n" |
|
- | 220 | "ldf.fill f28=[%4],0x80\n" |
|
- | 221 | "ldf.fill f29=[%5],0x80\n" |
|
- | 222 | "ldf.fill f30=[%6],0x80\n" |
|
- | 223 | "ldf.fill f31=[%7],0x80\n;;" |
|
- | 224 | ||
- | 225 | ||
- | 226 | "ldf.fill f32=[%0],0x80\n" |
|
- | 227 | "ldf.fill f33=[%1],0x80\n" |
|
- | 228 | "ldf.fill f34=[%2],0x80\n" |
|
- | 229 | "ldf.fill f35=[%3],0x80\n" |
|
- | 230 | "ldf.fill f36=[%4],0x80\n" |
|
- | 231 | "ldf.fill f37=[%5],0x80\n" |
|
- | 232 | "ldf.fill f38=[%6],0x80\n" |
|
- | 233 | "ldf.fill f39=[%7],0x80\n;;" |
|
- | 234 | ||
- | 235 | "ldf.fill f40=[%0],0x80\n" |
|
- | 236 | "ldf.fill f41=[%1],0x80\n" |
|
- | 237 | "ldf.fill f42=[%2],0x80\n" |
|
- | 238 | "ldf.fill f43=[%3],0x80\n" |
|
- | 239 | "ldf.fill f44=[%4],0x80\n" |
|
- | 240 | "ldf.fill f45=[%5],0x80\n" |
|
- | 241 | "ldf.fill f46=[%6],0x80\n" |
|
- | 242 | "ldf.fill f47=[%7],0x80\n;;" |
|
- | 243 | ||
- | 244 | "ldf.fill f48=[%0],0x80\n" |
|
- | 245 | "ldf.fill f49=[%1],0x80\n" |
|
- | 246 | "ldf.fill f50=[%2],0x80\n" |
|
- | 247 | "ldf.fill f51=[%3],0x80\n" |
|
- | 248 | "ldf.fill f52=[%4],0x80\n" |
|
- | 249 | "ldf.fill f53=[%5],0x80\n" |
|
- | 250 | "ldf.fill f54=[%6],0x80\n" |
|
- | 251 | "ldf.fill f55=[%7],0x80\n;;" |
|
- | 252 | ||
- | 253 | "ldf.fill f56=[%0],0x80\n" |
|
- | 254 | "ldf.fill f57=[%1],0x80\n" |
|
- | 255 | "ldf.fill f58=[%2],0x80\n" |
|
- | 256 | "ldf.fill f59=[%3],0x80\n" |
|
- | 257 | "ldf.fill f60=[%4],0x80\n" |
|
- | 258 | "ldf.fill f61=[%5],0x80\n" |
|
- | 259 | "ldf.fill f62=[%6],0x80\n" |
|
- | 260 | "ldf.fill f63=[%7],0x80\n;;" |
|
- | 261 | ||
- | 262 | "ldf.fill f64=[%0],0x80\n" |
|
- | 263 | "ldf.fill f65=[%1],0x80\n" |
|
- | 264 | "ldf.fill f66=[%2],0x80\n" |
|
- | 265 | "ldf.fill f67=[%3],0x80\n" |
|
- | 266 | "ldf.fill f68=[%4],0x80\n" |
|
- | 267 | "ldf.fill f69=[%5],0x80\n" |
|
- | 268 | "ldf.fill f70=[%6],0x80\n" |
|
- | 269 | "ldf.fill f71=[%7],0x80\n;;" |
|
- | 270 | ||
- | 271 | "ldf.fill f72=[%0],0x80\n" |
|
- | 272 | "ldf.fill f73=[%1],0x80\n" |
|
- | 273 | "ldf.fill f74=[%2],0x80\n" |
|
- | 274 | "ldf.fill f75=[%3],0x80\n" |
|
- | 275 | "ldf.fill f76=[%4],0x80\n" |
|
- | 276 | "ldf.fill f77=[%5],0x80\n" |
|
- | 277 | "ldf.fill f78=[%6],0x80\n" |
|
- | 278 | "ldf.fill f79=[%7],0x80\n;;" |
|
- | 279 | ||
- | 280 | "ldf.fill f80=[%0],0x80\n" |
|
- | 281 | "ldf.fill f81=[%1],0x80\n" |
|
- | 282 | "ldf.fill f82=[%2],0x80\n" |
|
- | 283 | "ldf.fill f83=[%3],0x80\n" |
|
- | 284 | "ldf.fill f84=[%4],0x80\n" |
|
- | 285 | "ldf.fill f85=[%5],0x80\n" |
|
- | 286 | "ldf.fill f86=[%6],0x80\n" |
|
- | 287 | "ldf.fill f87=[%7],0x80\n;;" |
|
- | 288 | ||
- | 289 | "ldf.fill f88=[%0],0x80\n" |
|
- | 290 | "ldf.fill f89=[%1],0x80\n" |
|
- | 291 | "ldf.fill f90=[%2],0x80\n" |
|
- | 292 | "ldf.fill f91=[%3],0x80\n" |
|
- | 293 | "ldf.fill f92=[%4],0x80\n" |
|
- | 294 | "ldf.fill f93=[%5],0x80\n" |
|
- | 295 | "ldf.fill f94=[%6],0x80\n" |
|
- | 296 | "ldf.fill f95=[%7],0x80\n;;" |
|
- | 297 | ||
- | 298 | ||
- | 299 | "ldf.fill f96=[%0],0x80\n" |
|
- | 300 | "ldf.fill f97=[%1],0x80\n" |
|
- | 301 | "ldf.fill f98=[%2],0x80\n" |
|
- | 302 | "ldf.fill f99=[%3],0x80\n" |
|
- | 303 | "ldf.fill f100=[%4],0x80\n" |
|
- | 304 | "ldf.fill f101=[%5],0x80\n" |
|
- | 305 | "ldf.fill f102=[%6],0x80\n" |
|
- | 306 | "ldf.fill f103=[%7],0x80\n;;" |
|
- | 307 | ||
- | 308 | "ldf.fill f104=[%0],0x80\n" |
|
- | 309 | "ldf.fill f105=[%1],0x80\n" |
|
- | 310 | "ldf.fill f106=[%2],0x80\n" |
|
- | 311 | "ldf.fill f107=[%3],0x80\n" |
|
- | 312 | "ldf.fill f108=[%4],0x80\n" |
|
- | 313 | "ldf.fill f109=[%5],0x80\n" |
|
- | 314 | "ldf.fill f110=[%6],0x80\n" |
|
- | 315 | "ldf.fill f111=[%7],0x80\n;;" |
|
- | 316 | ||
- | 317 | "ldf.fill f112=[%0],0x80\n" |
|
- | 318 | "ldf.fill f113=[%1],0x80\n" |
|
- | 319 | "ldf.fill f114=[%2],0x80\n" |
|
- | 320 | "ldf.fill f115=[%3],0x80\n" |
|
- | 321 | "ldf.fill f116=[%4],0x80\n" |
|
- | 322 | "ldf.fill f117=[%5],0x80\n" |
|
- | 323 | "ldf.fill f118=[%6],0x80\n" |
|
- | 324 | "ldf.fill f119=[%7],0x80\n;;" |
|
- | 325 | ||
- | 326 | "ldf.fill f120=[%0],0x80\n" |
|
- | 327 | "ldf.fill f121=[%1],0x80\n" |
|
- | 328 | "ldf.fill f122=[%2],0x80\n" |
|
- | 329 | "ldf.fill f123=[%3],0x80\n" |
|
- | 330 | "ldf.fill f124=[%4],0x80\n" |
|
- | 331 | "ldf.fill f125=[%5],0x80\n" |
|
- | 332 | "ldf.fill f126=[%6],0x80\n" |
|
- | 333 | "ldf.fill f127=[%7],0x80\n;;" |
|
- | 334 | ||
- | 335 | ||
- | 336 | : |
|
- | 337 | :"r" (&((fctx->fr)[0])),"r" (&((fctx->fr)[1])),"r" (&((fctx->fr)[2])),"r" (&((fctx->fr)[3])), |
|
- | 338 | "r" (&((fctx->fr)[4])),"r" (&((fctx->fr)[5])),"r" (&((fctx->fr)[6])),"r" (&((fctx->fr)[7])) |
|
- | 339 | ); |
|
- | 340 | ||
- | 341 | ||
39 | } |
342 | } |
40 | 343 | ||
- | 344 | ||
- | 345 |