Changeset 2617b345 in rtems
- Timestamp:
- 02/19/98 17:08:54 (25 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 6eba9b79
- Parents:
- 51c195d5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/tmtests/tm26/task1.c
r51c195d5 r2617b345 31 31 Thread_Control *Low_tcb; /* uses internal RTEMS type */ 32 32 33 /* 34 * Variables to hold execution times until they are printed 35 * at the end of the test. 36 */ 37 38 rtems_unsigned32 isr_disable_time; 39 rtems_unsigned32 isr_flash_time; 40 rtems_unsigned32 isr_enable_time; 41 rtems_unsigned32 thread_disable_dispatch_time; 42 rtems_unsigned32 thread_enable_dispatch_time; 43 rtems_unsigned32 thread_set_state_time; 44 rtems_unsigned32 thread_dispatch_no_fp_time; 45 rtems_unsigned32 context_switch_no_fp_time; 46 rtems_unsigned32 context_switch_self_time; 47 rtems_unsigned32 context_switch_another_task_time; 48 rtems_unsigned32 context_switch_restore_1st_fp_time; 49 rtems_unsigned32 context_switch_save_idle_restore_initted_time; 50 rtems_unsigned32 context_switch_save_restore_idle_time; 51 rtems_unsigned32 context_switch_save_restore_initted_time; 52 rtems_unsigned32 thread_resume_time; 53 rtems_unsigned32 thread_unblock_time; 54 rtems_unsigned32 thread_ready_time; 55 rtems_unsigned32 thread_get_time; 56 rtems_unsigned32 semaphore_get_time; 57 rtems_unsigned32 thread_get_invalid_time; 58 33 59 rtems_task High_task( 34 60 rtems_task_argument argument … … 172 198 Timer_initialize(); 173 199 rtems_interrupt_disable( level ); 174 end_time = Read_timer();200 isr_disable_time = Read_timer(); 175 201 176 put_time(177 "_ISR_Disable",178 end_time,179 1,180 0,181 0182 );183 184 202 Timer_initialize(); 185 203 rtems_interrupt_flash( level ); 186 end_time = Read_timer();204 isr_flash_time = Read_timer(); 187 205 188 put_time( 189 "_ISR_Flash", 190 end_time, 191 1, 192 0, 193 0 194 ); 206 Timer_initialize(); 207 rtems_interrupt_enable( level ); 208 isr_enable_time = Read_timer(); 195 209 196 210 Timer_initialize(); 197 rtems_interrupt_enable( level );198 end_time = Read_timer();199 200 put_time(201 "_ISR_Enable",202 end_time,203 1,204 0,205 0206 );207 208 Timer_initialize();209 211 _Thread_Disable_dispatch(); 210 end_time = Read_timer(); 211 212 put_time( 213 "_Thread_Disable_dispatch", 214 end_time, 215 1, 216 0, 217 0 218 ); 212 thread_disable_dispatch_time = Read_timer(); 219 213 220 214 Timer_initialize(); 221 215 _Thread_Enable_dispatch(); 222 end_time = Read_timer(); 223 224 put_time( 225 "_Thread_Enable_dispatch", 226 end_time, 227 1, 228 0, 229 0 230 ); 216 thread_enable_dispatch_time = Read_timer(); 231 217 232 218 Timer_initialize(); 233 219 _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED ); 234 end_time = Read_timer(); 235 236 put_time( 237 "_Thread_Set_state", 238 end_time, 239 1, 240 0, 241 0 242 ); 220 thread_set_state_time = Read_timer(); 243 221 244 222 _Context_Switch_necessary = TRUE; … … 252 230 ) 253 231 { 254 end_time = Read_timer(); 255 256 put_time( 257 "_Thread_Disptach (NO FP)", 258 end_time, 259 1, 260 0, 261 0 262 ); 232 thread_dispatch_no_fp_time = Read_timer(); 263 233 264 234 _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED ); … … 288 258 Thread_Control *executing; 289 259 290 end_time = Read_timer(); 291 292 put_time( 293 "context switch: no floating point contexts", 294 end_time, 295 1, 296 0, 297 0 298 ); 260 context_switch_no_fp_time = Read_timer(); 299 261 300 262 executing = _Thread_Executing; … … 305 267 _Context_Switch( &executing->Registers, &executing->Registers ); 306 268 307 end_time = Read_timer(); 308 309 put_time( 310 "context switch: self", 311 end_time, 312 1, 313 0, 314 0 315 ); 269 context_switch_self_time = Read_timer(); 316 270 317 271 _Context_Switch(&executing->Registers, &Middle_tcb->Registers); 318 272 319 end_time = Read_timer(); 320 321 put_time( 322 "context switch: to another task", 323 end_time, 324 1, 325 0, 326 0 327 ); 273 context_switch_another_task_time = Read_timer(); 328 274 329 275 _Thread_Executing = … … 348 294 FP_DECLARE; 349 295 350 end_time = Read_timer(); 351 352 put_time( 353 "fp context switch: restore 1st FP task", 354 end_time, 355 1, 356 0, 357 0 358 ); 296 context_switch_restore_1st_fp_time = Read_timer(); 359 297 360 298 executing = _Thread_Executing; … … 375 313 /* switch to Floating_point_task_2 */ 376 314 377 end_time = Read_timer(); 378 379 put_time( 380 "fp context switch: save idle, restore initialized", 381 end_time, 382 1, 383 0, 384 0 385 ); 315 context_switch_save_idle_restore_initted_time = Read_timer(); 386 316 387 317 FP_LOAD( 1.0 ); … … 412 342 FP_DECLARE; 413 343 414 end_time = Read_timer(); 415 416 put_time( 417 "fp context switch: save idle, restore idle", 418 end_time, 419 1, 420 0, 421 0 422 ); 344 context_switch_save_restore_idle_time = Read_timer(); 423 345 424 346 executing = _Thread_Executing; … … 441 363 /* switch to Floating_point_task_1 */ 442 364 443 end_time = Read_timer(); 444 445 put_time( 446 "fp context switch: save initialized, restore initialized", 447 end_time, 448 1, 449 0, 450 0 451 ); 365 context_switch_save_restore_initted_time = Read_timer(); 452 366 453 367 complete_test(); … … 461 375 Timer_initialize(); 462 376 _Thread_Resume( Middle_tcb ); 463 end_time = Read_timer(); 464 465 put_time( 466 "_Thread_Resume", 467 end_time, 468 1, 469 0, 470 0 471 ); 377 thread_resume_time = Read_timer(); 472 378 473 379 _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); … … 475 381 Timer_initialize(); 476 382 _Thread_Unblock( Middle_tcb ); 477 end_time = Read_timer(); 478 479 put_time( 480 "_Thread_Unblock", 481 end_time, 482 1, 483 0, 484 0 485 ); 383 thread_unblock_time = Read_timer(); 486 384 487 385 _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); … … 489 387 Timer_initialize(); 490 388 _Thread_Ready( Middle_tcb ); 491 end_time = Read_timer(); 492 493 put_time( 494 "_Thread_Ready", 495 end_time, 496 1, 497 0, 498 0 499 ); 389 thread_ready_time = Read_timer(); 500 390 501 391 Timer_initialize(); … … 509 399 for ( index=1 ; index <= OPERATION_COUNT ; index++ ) 510 400 (void) _Thread_Get( task_id, &location ); 511 end_time = Read_timer(); 512 513 put_time( 514 "_Thread_Get", 515 end_time, 516 OPERATION_COUNT, 517 0, 518 0 519 ); 401 thread_get_time = Read_timer(); 520 402 521 403 Timer_initialize(); 522 404 for ( index=1 ; index <= OPERATION_COUNT ; index++ ) 523 405 (void) _Semaphore_Get( Semaphore_id, &location ); 524 end_time = Read_timer(); 525 526 put_time( 527 "_Semaphore_Get", 528 end_time, 529 OPERATION_COUNT, 530 0, 531 0 532 ); 406 semaphore_get_time = Read_timer(); 533 407 534 408 Timer_initialize(); 535 409 for ( index=1 ; index <= OPERATION_COUNT ; index++ ) 536 410 (void) _Thread_Get( 0x3, &location ); 537 end_time = Read_timer(); 411 thread_get_invalid_time = Read_timer(); 412 413 /* 414 * Now dump all the times 415 */ 416 417 put_time( 418 "_ISR_Disable", 419 isr_disable_time, 420 1, 421 0, 422 0 423 ); 424 425 put_time( 426 "_ISR_Flash", 427 isr_flash_time, 428 1, 429 0, 430 0 431 ); 432 433 put_time( 434 "_ISR_Enable", 435 isr_enable_time, 436 1, 437 0, 438 0 439 ); 440 441 put_time( 442 "_Thread_Disable_dispatch", 443 thread_disable_dispatch_time, 444 1, 445 0, 446 0 447 ); 448 449 put_time( 450 "_Thread_Enable_dispatch", 451 thread_enable_dispatch_time, 452 1, 453 0, 454 0 455 ); 456 457 put_time( 458 "_Thread_Set_state", 459 thread_set_state_time, 460 1, 461 0, 462 0 463 ); 464 465 put_time( 466 "_Thread_Disptach (NO FP)", 467 thread_dispatch_no_fp_time, 468 1, 469 0, 470 0 471 ); 472 473 put_time( 474 "context switch: no floating point contexts", 475 context_switch_no_fp_time, 476 1, 477 0, 478 0 479 ); 480 481 put_time( 482 "context switch: self", 483 context_switch_self_time, 484 1, 485 0, 486 0 487 ); 488 489 put_time( 490 "context switch: to another task", 491 context_switch_another_task_time, 492 1, 493 0, 494 0 495 ); 496 497 put_time( 498 "fp context switch: restore 1st FP task", 499 context_switch_restore_1st_fp_time, 500 1, 501 0, 502 0 503 ); 504 505 put_time( 506 "fp context switch: save idle, restore initialized", 507 context_switch_save_idle_restore_initted_time, 508 1, 509 0, 510 0 511 ); 512 513 put_time( 514 "fp context switch: save idle, restore idle", 515 context_switch_save_restore_idle_time, 516 1, 517 0, 518 0 519 ); 520 521 put_time( 522 "fp context switch: save initialized, restore initialized", 523 context_switch_save_restore_initted_time, 524 1, 525 0, 526 0 527 ); 528 529 put_time( 530 "_Thread_Resume", 531 thread_resume_time, 532 1, 533 0, 534 0 535 ); 536 537 put_time( 538 "_Thread_Unblock", 539 thread_unblock_time, 540 1, 541 0, 542 0 543 ); 544 545 put_time( 546 "_Thread_Ready", 547 thread_ready_time, 548 1, 549 0, 550 0 551 ); 552 553 put_time( 554 "_Thread_Get", 555 thread_get_time, 556 OPERATION_COUNT, 557 0, 558 0 559 ); 560 561 put_time( 562 "_Semaphore_Get", 563 semaphore_get_time, 564 OPERATION_COUNT, 565 0, 566 0 567 ); 538 568 539 569 put_time( 540 570 "_Thread_Get: invalid id", 541 end_time,571 thread_get_invalid_time, 542 572 OPERATION_COUNT, 543 573 0, -
testsuites/tmtests/tm26/task1.c
r51c195d5 r2617b345 31 31 Thread_Control *Low_tcb; /* uses internal RTEMS type */ 32 32 33 /* 34 * Variables to hold execution times until they are printed 35 * at the end of the test. 36 */ 37 38 rtems_unsigned32 isr_disable_time; 39 rtems_unsigned32 isr_flash_time; 40 rtems_unsigned32 isr_enable_time; 41 rtems_unsigned32 thread_disable_dispatch_time; 42 rtems_unsigned32 thread_enable_dispatch_time; 43 rtems_unsigned32 thread_set_state_time; 44 rtems_unsigned32 thread_dispatch_no_fp_time; 45 rtems_unsigned32 context_switch_no_fp_time; 46 rtems_unsigned32 context_switch_self_time; 47 rtems_unsigned32 context_switch_another_task_time; 48 rtems_unsigned32 context_switch_restore_1st_fp_time; 49 rtems_unsigned32 context_switch_save_idle_restore_initted_time; 50 rtems_unsigned32 context_switch_save_restore_idle_time; 51 rtems_unsigned32 context_switch_save_restore_initted_time; 52 rtems_unsigned32 thread_resume_time; 53 rtems_unsigned32 thread_unblock_time; 54 rtems_unsigned32 thread_ready_time; 55 rtems_unsigned32 thread_get_time; 56 rtems_unsigned32 semaphore_get_time; 57 rtems_unsigned32 thread_get_invalid_time; 58 33 59 rtems_task High_task( 34 60 rtems_task_argument argument … … 172 198 Timer_initialize(); 173 199 rtems_interrupt_disable( level ); 174 end_time = Read_timer();200 isr_disable_time = Read_timer(); 175 201 176 put_time(177 "_ISR_Disable",178 end_time,179 1,180 0,181 0182 );183 184 202 Timer_initialize(); 185 203 rtems_interrupt_flash( level ); 186 end_time = Read_timer();204 isr_flash_time = Read_timer(); 187 205 188 put_time( 189 "_ISR_Flash", 190 end_time, 191 1, 192 0, 193 0 194 ); 206 Timer_initialize(); 207 rtems_interrupt_enable( level ); 208 isr_enable_time = Read_timer(); 195 209 196 210 Timer_initialize(); 197 rtems_interrupt_enable( level );198 end_time = Read_timer();199 200 put_time(201 "_ISR_Enable",202 end_time,203 1,204 0,205 0206 );207 208 Timer_initialize();209 211 _Thread_Disable_dispatch(); 210 end_time = Read_timer(); 211 212 put_time( 213 "_Thread_Disable_dispatch", 214 end_time, 215 1, 216 0, 217 0 218 ); 212 thread_disable_dispatch_time = Read_timer(); 219 213 220 214 Timer_initialize(); 221 215 _Thread_Enable_dispatch(); 222 end_time = Read_timer(); 223 224 put_time( 225 "_Thread_Enable_dispatch", 226 end_time, 227 1, 228 0, 229 0 230 ); 216 thread_enable_dispatch_time = Read_timer(); 231 217 232 218 Timer_initialize(); 233 219 _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED ); 234 end_time = Read_timer(); 235 236 put_time( 237 "_Thread_Set_state", 238 end_time, 239 1, 240 0, 241 0 242 ); 220 thread_set_state_time = Read_timer(); 243 221 244 222 _Context_Switch_necessary = TRUE; … … 252 230 ) 253 231 { 254 end_time = Read_timer(); 255 256 put_time( 257 "_Thread_Disptach (NO FP)", 258 end_time, 259 1, 260 0, 261 0 262 ); 232 thread_dispatch_no_fp_time = Read_timer(); 263 233 264 234 _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED ); … … 288 258 Thread_Control *executing; 289 259 290 end_time = Read_timer(); 291 292 put_time( 293 "context switch: no floating point contexts", 294 end_time, 295 1, 296 0, 297 0 298 ); 260 context_switch_no_fp_time = Read_timer(); 299 261 300 262 executing = _Thread_Executing; … … 305 267 _Context_Switch( &executing->Registers, &executing->Registers ); 306 268 307 end_time = Read_timer(); 308 309 put_time( 310 "context switch: self", 311 end_time, 312 1, 313 0, 314 0 315 ); 269 context_switch_self_time = Read_timer(); 316 270 317 271 _Context_Switch(&executing->Registers, &Middle_tcb->Registers); 318 272 319 end_time = Read_timer(); 320 321 put_time( 322 "context switch: to another task", 323 end_time, 324 1, 325 0, 326 0 327 ); 273 context_switch_another_task_time = Read_timer(); 328 274 329 275 _Thread_Executing = … … 348 294 FP_DECLARE; 349 295 350 end_time = Read_timer(); 351 352 put_time( 353 "fp context switch: restore 1st FP task", 354 end_time, 355 1, 356 0, 357 0 358 ); 296 context_switch_restore_1st_fp_time = Read_timer(); 359 297 360 298 executing = _Thread_Executing; … … 375 313 /* switch to Floating_point_task_2 */ 376 314 377 end_time = Read_timer(); 378 379 put_time( 380 "fp context switch: save idle, restore initialized", 381 end_time, 382 1, 383 0, 384 0 385 ); 315 context_switch_save_idle_restore_initted_time = Read_timer(); 386 316 387 317 FP_LOAD( 1.0 ); … … 412 342 FP_DECLARE; 413 343 414 end_time = Read_timer(); 415 416 put_time( 417 "fp context switch: save idle, restore idle", 418 end_time, 419 1, 420 0, 421 0 422 ); 344 context_switch_save_restore_idle_time = Read_timer(); 423 345 424 346 executing = _Thread_Executing; … … 441 363 /* switch to Floating_point_task_1 */ 442 364 443 end_time = Read_timer(); 444 445 put_time( 446 "fp context switch: save initialized, restore initialized", 447 end_time, 448 1, 449 0, 450 0 451 ); 365 context_switch_save_restore_initted_time = Read_timer(); 452 366 453 367 complete_test(); … … 461 375 Timer_initialize(); 462 376 _Thread_Resume( Middle_tcb ); 463 end_time = Read_timer(); 464 465 put_time( 466 "_Thread_Resume", 467 end_time, 468 1, 469 0, 470 0 471 ); 377 thread_resume_time = Read_timer(); 472 378 473 379 _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); … … 475 381 Timer_initialize(); 476 382 _Thread_Unblock( Middle_tcb ); 477 end_time = Read_timer(); 478 479 put_time( 480 "_Thread_Unblock", 481 end_time, 482 1, 483 0, 484 0 485 ); 383 thread_unblock_time = Read_timer(); 486 384 487 385 _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); … … 489 387 Timer_initialize(); 490 388 _Thread_Ready( Middle_tcb ); 491 end_time = Read_timer(); 492 493 put_time( 494 "_Thread_Ready", 495 end_time, 496 1, 497 0, 498 0 499 ); 389 thread_ready_time = Read_timer(); 500 390 501 391 Timer_initialize(); … … 509 399 for ( index=1 ; index <= OPERATION_COUNT ; index++ ) 510 400 (void) _Thread_Get( task_id, &location ); 511 end_time = Read_timer(); 512 513 put_time( 514 "_Thread_Get", 515 end_time, 516 OPERATION_COUNT, 517 0, 518 0 519 ); 401 thread_get_time = Read_timer(); 520 402 521 403 Timer_initialize(); 522 404 for ( index=1 ; index <= OPERATION_COUNT ; index++ ) 523 405 (void) _Semaphore_Get( Semaphore_id, &location ); 524 end_time = Read_timer(); 525 526 put_time( 527 "_Semaphore_Get", 528 end_time, 529 OPERATION_COUNT, 530 0, 531 0 532 ); 406 semaphore_get_time = Read_timer(); 533 407 534 408 Timer_initialize(); 535 409 for ( index=1 ; index <= OPERATION_COUNT ; index++ ) 536 410 (void) _Thread_Get( 0x3, &location ); 537 end_time = Read_timer(); 411 thread_get_invalid_time = Read_timer(); 412 413 /* 414 * Now dump all the times 415 */ 416 417 put_time( 418 "_ISR_Disable", 419 isr_disable_time, 420 1, 421 0, 422 0 423 ); 424 425 put_time( 426 "_ISR_Flash", 427 isr_flash_time, 428 1, 429 0, 430 0 431 ); 432 433 put_time( 434 "_ISR_Enable", 435 isr_enable_time, 436 1, 437 0, 438 0 439 ); 440 441 put_time( 442 "_Thread_Disable_dispatch", 443 thread_disable_dispatch_time, 444 1, 445 0, 446 0 447 ); 448 449 put_time( 450 "_Thread_Enable_dispatch", 451 thread_enable_dispatch_time, 452 1, 453 0, 454 0 455 ); 456 457 put_time( 458 "_Thread_Set_state", 459 thread_set_state_time, 460 1, 461 0, 462 0 463 ); 464 465 put_time( 466 "_Thread_Disptach (NO FP)", 467 thread_dispatch_no_fp_time, 468 1, 469 0, 470 0 471 ); 472 473 put_time( 474 "context switch: no floating point contexts", 475 context_switch_no_fp_time, 476 1, 477 0, 478 0 479 ); 480 481 put_time( 482 "context switch: self", 483 context_switch_self_time, 484 1, 485 0, 486 0 487 ); 488 489 put_time( 490 "context switch: to another task", 491 context_switch_another_task_time, 492 1, 493 0, 494 0 495 ); 496 497 put_time( 498 "fp context switch: restore 1st FP task", 499 context_switch_restore_1st_fp_time, 500 1, 501 0, 502 0 503 ); 504 505 put_time( 506 "fp context switch: save idle, restore initialized", 507 context_switch_save_idle_restore_initted_time, 508 1, 509 0, 510 0 511 ); 512 513 put_time( 514 "fp context switch: save idle, restore idle", 515 context_switch_save_restore_idle_time, 516 1, 517 0, 518 0 519 ); 520 521 put_time( 522 "fp context switch: save initialized, restore initialized", 523 context_switch_save_restore_initted_time, 524 1, 525 0, 526 0 527 ); 528 529 put_time( 530 "_Thread_Resume", 531 thread_resume_time, 532 1, 533 0, 534 0 535 ); 536 537 put_time( 538 "_Thread_Unblock", 539 thread_unblock_time, 540 1, 541 0, 542 0 543 ); 544 545 put_time( 546 "_Thread_Ready", 547 thread_ready_time, 548 1, 549 0, 550 0 551 ); 552 553 put_time( 554 "_Thread_Get", 555 thread_get_time, 556 OPERATION_COUNT, 557 0, 558 0 559 ); 560 561 put_time( 562 "_Semaphore_Get", 563 semaphore_get_time, 564 OPERATION_COUNT, 565 0, 566 0 567 ); 538 568 539 569 put_time( 540 570 "_Thread_Get: invalid id", 541 end_time,571 thread_get_invalid_time, 542 572 OPERATION_COUNT, 543 573 0,
Note: See TracChangeset
for help on using the changeset viewer.