Changeset 41fa6f2 in mainline
- Timestamp:
- 2006-03-16T17:01:51Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 46579c66
- Parents:
- 6eb103c
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia64/Makefile.inc
r6eb103c r41fa6f2 42 42 INIT_SIZE = 0x100000 43 43 44 CFLAGS += -mconstant-gp -fno-unwind-tables 44 CFLAGS += -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127 45 45 LFLAGS += -EL 46 46 AFLAGS += -mconstant-gp -
arch/ia64/include/context.h
r6eb103c r41fa6f2 96 96 */ 97 97 __u64 pr; 98 99 __r128 f2 __attribute__ ((aligned(16))); 100 __r128 f3; 101 __r128 f4; 102 __r128 f5; 103 104 __r128 f16; 105 __r128 f17; 106 __r128 f18; 107 __r128 f19; 108 __r128 f20; 109 __r128 f21; 110 __r128 f22; 111 __r128 f23; 112 __r128 f24; 113 __r128 f25; 114 __r128 f26; 115 __r128 f27; 116 __r128 f28; 117 __r128 f29; 118 __r128 f30; 119 __r128 f31; 98 120 99 121 ipl_t ipl; 100 122 }; 101 123 124 125 102 126 #endif -
arch/ia64/include/fpu_context.h
r6eb103c r41fa6f2 35 35 #include <arch/types.h> 36 36 37 #define FRS 128 38 #define SAVABLE_FRS_OFFSET 2 37 #define FRS 96 39 38 40 39 struct fpu_context { -
arch/ia64/include/interrupt.h
r6eb103c r41fa6f2 49 49 50 50 struct istate { 51 52 __r128 f2; 53 __r128 f3; 54 __r128 f4; 55 __r128 f5; 56 __r128 f6; 57 __r128 f7; 58 __r128 f8; 59 __r128 f9; 60 __r128 f10; 61 __r128 f11; 62 __r128 f12; 63 __r128 f13; 64 __r128 f14; 65 __r128 f15; 66 __r128 f16; 67 __r128 f17; 68 __r128 f18; 69 __r128 f19; 70 __r128 f20; 71 __r128 f21; 72 __r128 f22; 73 __r128 f23; 74 __r128 f24; 75 __r128 f25; 76 __r128 f26; 77 __r128 f27; 78 __r128 f28; 79 __r128 f29; 80 __r128 f30; 81 __r128 f31; 82 83 51 84 __address ar_bsp; 52 85 __address ar_bspstore; -
arch/ia64/src/context.S
r6eb103c r41fa6f2 105 105 */ 106 106 mov loc2 = pr ;; 107 st8 [in0] = loc2, 8 107 st8 [in0] = loc2, 16;; /*Next fpu registers should be spilled to 16B aligned address*/ 108 109 110 stf.spill [in0]=f2,16;; 111 stf.spill [in0]=f3,16;; 112 stf.spill [in0]=f4,16;; 113 stf.spill [in0]=f5,16;; 114 115 stf.spill [in0]=f16,16;; 116 stf.spill [in0]=f17,16;; 117 stf.spill [in0]=f18,16;; 118 stf.spill [in0]=f19,16;; 119 stf.spill [in0]=f20,16;; 120 stf.spill [in0]=f21,16;; 121 stf.spill [in0]=f22,16;; 122 stf.spill [in0]=f23,16;; 123 stf.spill [in0]=f24,16;; 124 stf.spill [in0]=f25,16;; 125 stf.spill [in0]=f26,16;; 126 stf.spill [in0]=f27,16;; 127 stf.spill [in0]=f28,16;; 128 stf.spill [in0]=f29,16;; 129 stf.spill [in0]=f30,16;; 130 stf.spill [in0]=f31,16;; 131 108 132 109 133 mov ar.unat = loc1 … … 188 212 * Restore predicate registers 189 213 */ 190 ld8 loc2 = [in0], 8;;214 ld8 loc2 = [in0], 16 ;; 191 215 mov pr = loc2, ~0 216 217 ldf.fill f2=[in0],16;; 218 ldf.fill f3=[in0],16;; 219 ldf.fill f4=[in0],16;; 220 ldf.fill f5=[in0],16;; 221 222 ldf.fill f16=[in0],16;; 223 ldf.fill f17=[in0],16;; 224 ldf.fill f18=[in0],16;; 225 ldf.fill f19=[in0],16;; 226 ldf.fill f20=[in0],16;; 227 ldf.fill f21=[in0],16;; 228 ldf.fill f22=[in0],16;; 229 ldf.fill f23=[in0],16;; 230 ldf.fill f24=[in0],16;; 231 ldf.fill f25=[in0],16;; 232 ldf.fill f26=[in0],16;; 233 ldf.fill f27=[in0],16;; 234 ldf.fill f28=[in0],16;; 235 ldf.fill f29=[in0],16;; 236 ldf.fill f30=[in0],16;; 237 ldf.fill f31=[in0],16;; 238 239 192 240 193 241 mov ar.unat = loc1 -
arch/ia64/src/fpu_context.c
r6eb103c r41fa6f2 32 32 #include <print.h> 33 33 34 34 35 void fpu_context_save(fpu_context_t *fctx){ 36 35 37 asm volatile( 36 "stf.spill [%2]=f2,0x80\n"37 "stf.spill [%3]=f3,0x80\n"38 "stf.spill [%4]=f4,0x80\n"39 "stf.spill [%5]=f5,0x80\n"40 "stf.spill [%6]=f6,0x80\n"41 "stf.spill [%7]=f7,0x80\n;;"42 43 "stf.spill [%0]=f8,0x80\n"44 "stf.spill [%1]=f9,0x80\n"45 "stf.spill [%2]=f10,0x80\n"46 "stf.spill [%3]=f11,0x80\n"47 "stf.spill [%4]=f12,0x80\n"48 "stf.spill [%5]=f13,0x80\n"49 "stf.spill [%6]=f14,0x80\n"50 "stf.spill [%7]=f15,0x80\n;;"51 52 "stf.spill [%0]=f16,0x80\n"53 "stf.spill [%1]=f17,0x80\n"54 "stf.spill [%2]=f18,0x80\n"55 "stf.spill [%3]=f19,0x80\n"56 "stf.spill [%4]=f20,0x80\n"57 "stf.spill [%5]=f21,0x80\n"58 "stf.spill [%6]=f22,0x80\n"59 "stf.spill [%7]=f23,0x80\n;;"60 61 "stf.spill [%0]=f24,0x80\n"62 "stf.spill [%1]=f25,0x80\n"63 "stf.spill [%2]=f26,0x80\n"64 "stf.spill [%3]=f27,0x80\n"65 "stf.spill [%4]=f28,0x80\n"66 "stf.spill [%5]=f29,0x80\n"67 "stf.spill [%6]=f30,0x80\n"68 "stf.spill [%7]=f31,0x80\n;;"69 70 38 71 39 "stf.spill [%0]=f32,0x80\n" … … 189 157 void fpu_context_restore(fpu_context_t *fctx) 190 158 { 159 191 160 asm volatile( 192 "ldf.fill f2=[%2],0x80\n"193 "ldf.fill f3=[%3],0x80\n"194 "ldf.fill f4=[%4],0x80\n"195 "ldf.fill f5=[%5],0x80\n"196 "ldf.fill f6=[%6],0x80\n"197 "ldf.fill f7=[%7],0x80\n;;"198 199 "ldf.fill f8=[%0],0x80\n"200 "ldf.fill f9=[%1],0x80\n"201 "ldf.fill f10=[%2],0x80\n"202 "ldf.fill f11=[%3],0x80\n"203 "ldf.fill f12=[%4],0x80\n"204 "ldf.fill f13=[%5],0x80\n"205 "ldf.fill f14=[%6],0x80\n"206 "ldf.fill f15=[%7],0x80\n;;"207 208 "ldf.fill f16=[%0],0x80\n"209 "ldf.fill f17=[%1],0x80\n"210 "ldf.fill f18=[%2],0x80\n"211 "ldf.fill f19=[%3],0x80\n"212 "ldf.fill f20=[%4],0x80\n"213 "ldf.fill f21=[%5],0x80\n"214 "ldf.fill f22=[%6],0x80\n"215 "ldf.fill f23=[%7],0x80\n;;"216 217 "ldf.fill f24=[%0],0x80\n"218 "ldf.fill f25=[%1],0x80\n"219 "ldf.fill f26=[%2],0x80\n"220 "ldf.fill f27=[%3],0x80\n"221 "ldf.fill f28=[%4],0x80\n"222 "ldf.fill f29=[%5],0x80\n"223 "ldf.fill f30=[%6],0x80\n"224 "ldf.fill f31=[%7],0x80\n;;"225 226 227 161 "ldf.fill f32=[%0],0x80\n" 228 162 "ldf.fill f33=[%1],0x80\n" … … 339 273 "r" (&((fctx->fr)[4])),"r" (&((fctx->fr)[5])),"r" (&((fctx->fr)[6])),"r" (&((fctx->fr)[7])) 340 274 ); 341 342 343 275 } 344 276 345 void fpu_ disable(void)277 void fpu_enable(void) 346 278 { 279 __u64 a = 0 ; 347 280 asm volatile( 348 " ssm %0;;\n"281 "rsm %0;;" 349 282 "srlz.i\n" 350 283 "srlz.d;;\n" 351 284 : 352 :"i" (PSR_DFL_MASK|PSR_DFH_MASK) 353 ); 354 355 } 356 357 void fpu_enable(void) 358 { 359 asm volatile( 360 "rsm %0;;\n" 361 "srlz.i\n" 362 "srlz.d;;\n" 363 : 364 :"i" (PSR_DFL_MASK|PSR_DFH_MASK) 365 ); 366 367 } 368 369 void fpu_init(void) 370 { 371 __u64 a = 0; 372 fpu_enable(); 285 :"i" (PSR_DFH_MASK) 286 ); 373 287 asm volatile 374 288 ( … … 379 293 : "r" (0x38) 380 294 ); 381 295 296 } 297 298 void fpu_disable(void) 299 { 300 301 __u64 a = 0 ; 302 asm volatile( 303 "ssm %0;;\n" 304 "srlz.i\n" 305 "srlz.d;;\n" 306 : 307 :"i" (PSR_DFH_MASK) 308 ); 309 asm volatile 310 ( 311 "mov %0=ar.fpsr;;\n" 312 "or %0=%0,%1;;\n" 313 "mov ar.fpsr=%0;;\n" 314 : "+r" (a) 315 : "r" (0x38) 316 ); 317 318 } 319 320 void fpu_init(void) 321 { 322 __u64 a = 0 ; 323 asm volatile 324 ( 325 "mov %0=ar.fpsr;;\n" 326 "or %0=%0,%1;;\n" 327 "mov ar.fpsr=%0;;\n" 328 : "+r" (a) 329 : "r" (0x38) 330 ); 331 382 332 asm volatile( 383 333 "mov f2=f0\n" … … 522 472 ); 523 473 524 fpu_enable();525 474 } 526 475 -
arch/ia64/src/interrupt.c
r6eb103c r41fa6f2 175 175 } 176 176 177 void fpu_enable(void); 177 178 178 179 void disabled_fp_register(__u64 vector, istate_t *istate) 179 180 { 180 #ifdef CONFIG_ CPU_LAZY181 #ifdef CONFIG_FPU_LAZY 181 182 scheduler_fpu_lazy_request(); 183 #else 184 dump_interrupted_context(istate); 185 panic("Interruption: %W (%s)\n", (__u16) vector, vector_to_string(vector)); 182 186 #endif 183 187 } -
arch/ia64/src/ivt.S
r6eb103c r41fa6f2 33 33 #include <align.h> 34 34 35 #define STACK_ITEMS 19 35 36 #define FRS_TO_SAVE 30 37 #define STACK_ITEMS (19 + FRS_TO_SAVE*2) 38 //#define STACK_ITEMS 19 39 /* 30*2 for FPU registers */ 36 40 #define STACK_FRAME_SIZE ALIGN_UP((STACK_ITEMS*STACK_ITEM_SIZE) + STACK_SCRATCH_AREA_SIZE, STACK_ALIGNMENT) 37 41 … … 79 83 * Note that r24-r31 from bank 0 can be used only as long as PSR.ic = 0. 80 84 */ 85 86 /*Set up FPU as in interrupred*/ 87 mov r24=psr 88 mov r25=cr.ipsr 89 mov r26=(PSR_DFH_MASK) 90 mov r27=(~(PSR_DFH_MASK));; 91 and r26=r25,r26 92 and r24=r24,r27;; 93 or r24=r24,r26;; 94 mov psr.l=r24;; 95 srlz.i 96 srlz.d;; 97 81 98 mov r24 = cr.iip 82 99 mov r25 = cr.ipsr … … 196 213 cover /* allocate zerro size frame (step 1 (from Intel Docs)) */ 197 214 198 add r31 = STACK_SCRATCH_AREA_SIZE, r12 ;;215 add r31 = (STACK_SCRATCH_AREA_SIZE+(FRS_TO_SAVE*2*8)), r12 ;; 199 216 200 217 ld8 r30 = [r31], +8 ;; /* load ar.bsp */ … … 231 248 ld8 r24 = [r31], +8 ;; /* load cr.iip */ 232 249 233 mov cr.iip = r24 234 mov cr.ipsr = r25 250 mov cr.iip = r24;; 235 251 mov cr.iipa = r26 236 252 mov cr.isr = r27 237 253 mov cr.ifa = r28 254 /*Set up FPU as in exception*/ 255 mov r24=psr 256 mov r26=(PSR_DFH_MASK) 257 mov r27=(~(PSR_DFH_MASK));; 258 and r25=r25,r27 259 and r24=r24,r26;; 260 or r25=r25,r24;; 261 mov cr.ipsr = r25 262 238 263 239 264 /* 18. restore predicate registers from memory stack */ … … 316 341 mov loc46 = r31 317 342 343 mov r24=96 + STACK_SCRATCH_AREA_SIZE 344 mov r25=112 + STACK_SCRATCH_AREA_SIZE 345 mov r26=0 + STACK_SCRATCH_AREA_SIZE 346 mov r27=16 + STACK_SCRATCH_AREA_SIZE 347 mov r28=32 + STACK_SCRATCH_AREA_SIZE 348 mov r29=48 + STACK_SCRATCH_AREA_SIZE 349 mov r30=64 + STACK_SCRATCH_AREA_SIZE 350 mov r31=80 + STACK_SCRATCH_AREA_SIZE;; 351 add r24=r12,r24 352 add r25=r12,r25 353 add r26=r12,r26 354 add r27=r12,r27 355 add r28=r12,r28 356 add r29=r12,r29 357 add r30=r12,r30 358 add r31=r12,r31;; 359 360 stf.spill [r26]=f2,0x80 361 stf.spill [r27]=f3,0x80 362 stf.spill [r28]=f4,0x80 363 stf.spill [r29]=f5,0x80 364 stf.spill [r30]=f6,0x80 365 stf.spill [r31]=f7,0x80;; 366 367 stf.spill [r24]=f8,0x80 368 stf.spill [r25]=f9,0x80 369 stf.spill [r26]=f10,0x80 370 stf.spill [r27]=f11,0x80 371 stf.spill [r28]=f12,0x80 372 stf.spill [r29]=f13,0x80 373 stf.spill [r30]=f14,0x80 374 stf.spill [r31]=f15,0x80;; 375 376 stf.spill [r24]=f16,0x80 377 stf.spill [r25]=f17,0x80 378 stf.spill [r26]=f18,0x80 379 stf.spill [r27]=f19,0x80 380 stf.spill [r28]=f20,0x80 381 stf.spill [r29]=f21,0x80 382 stf.spill [r30]=f22,0x80 383 stf.spill [r31]=f23,0x80;; 384 385 stf.spill [r24]=f24,0x80 386 stf.spill [r25]=f25,0x80 387 stf.spill [r26]=f26,0x80 388 stf.spill [r27]=f27,0x80 389 stf.spill [r28]=f28,0x80 390 stf.spill [r29]=f29,0x80 391 stf.spill [r30]=f30,0x80 392 stf.spill [r31]=f31,0x80;; 393 318 394 /* preserve Floating point status register */ 319 395 mov loc47 = ar.fpsr … … 344 420 /* 13. restore general and floating-point registers */ 345 421 /* TODO: restore floating-point context */ 422 mov r24=96 + STACK_SCRATCH_AREA_SIZE 423 mov r25=112 + STACK_SCRATCH_AREA_SIZE 424 mov r26=0 + STACK_SCRATCH_AREA_SIZE 425 mov r27=16 + STACK_SCRATCH_AREA_SIZE 426 mov r28=32 + STACK_SCRATCH_AREA_SIZE 427 mov r29=48 + STACK_SCRATCH_AREA_SIZE 428 mov r30=64 + STACK_SCRATCH_AREA_SIZE 429 mov r31=80 + STACK_SCRATCH_AREA_SIZE;; 430 add r24=r12,r24 431 add r25=r12,r25 432 add r26=r12,r26 433 add r27=r12,r27 434 add r28=r12,r28 435 add r29=r12,r29 436 add r30=r12,r30 437 add r31=r12,r31;; 438 439 440 ldf.fill f2=[r26],0x80 441 ldf.fill f3=[r27],0x80 442 ldf.fill f4=[r28],0x80 443 ldf.fill f5=[r29],0x80 444 ldf.fill f6=[r30],0x80 445 ldf.fill f7=[r31],0x80;; 446 447 ldf.fill f8=[r24],0x80 448 ldf.fill f9=[r25],0x80 449 ldf.fill f10=[r26],0x80 450 ldf.fill f11=[r27],0x80 451 ldf.fill f12=[r28],0x80 452 ldf.fill f13=[r29],0x80 453 ldf.fill f14=[r30],0x80 454 ldf.fill f15=[r31],0x80;; 455 456 ldf.fill f16=[r24],0x80 457 ldf.fill f17=[r25],0x80 458 ldf.fill f18=[r26],0x80 459 ldf.fill f19=[r27],0x80 460 ldf.fill f20=[r28],0x80 461 ldf.fill f21=[r29],0x80 462 ldf.fill f22=[r30],0x80 463 ldf.fill f23=[r31],0x80;; 464 465 ldf.fill f24=[r24],0x80 466 ldf.fill f25=[r25],0x80 467 ldf.fill f26=[r26],0x80 468 ldf.fill f27=[r27],0x80 469 ldf.fill f28=[r28],0x80 470 ldf.fill f29=[r29],0x80 471 ldf.fill f30=[r30],0x80 472 ldf.fill f31=[r31],0x80;; 473 474 346 475 mov r1 = loc17 347 476 mov r2 = loc18 … … 479 608 HEAVYWEIGHT_HANDLER 0x7e00 480 609 HEAVYWEIGHT_HANDLER 0x7f00 610 611 612 613 -
arch/ia64/src/start.S
r6eb103c r41fa6f2 124 124 st8 [r19] = r16 125 125 126 127 ssm (1<<19);; /*Disable f32 - f127*/ 128 srlz.i; 129 srlz.d;; 130 131 126 132 movl r18=main_bsp ;; 127 133 mov b1=r18 ;; 128 134 br.call.sptk.many b0=b1 129 135 136 130 137 0: 131 138 br 0b -
generic/src/console/cmd.c
r6eb103c r41fa6f2 294 294 }; 295 295 296 static int cmd_hello(cmd_arg_t *argv); 297 static cmd_info_t hello_info = { 298 .name = "hello", 299 .description = "Hello Message", 300 .func = cmd_hello, 301 .argc = 0 302 }; 303 296 304 /** Data and methods for 'cpus' command. */ 297 305 static int cmd_cpus(cmd_arg_t *argv); … … 335 343 &zones_info, 336 344 &zone_info, 345 &hello_info, 337 346 NULL 338 347 }; … … 676 685 return 1; 677 686 } 687 688 689 int cmd_hello(cmd_arg_t *argv) 690 { 691 printf("\nHello, World !!!\n"); 692 return 1; 693 } -
test/fpu/fpu1/test.c
r6eb103c r41fa6f2 39 39 #include <arch/arch.h> 40 40 41 #define THREADS 15 *242 #define ATTEMPTS 10 41 #define THREADS 150*2 42 #define ATTEMPTS 100 43 43 44 44 #define E_10e8 271828182
Note:
See TracChangeset
for help on using the changeset viewer.