OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [tmtests/] [tmoverhd/] [testtask.c] - Blame information for rev 507

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *
3
 *  COPYRIGHT (c) 1989-1999.
4
 *  On-Line Applications Research Corporation (OAR).
5
 *
6
 *  The license and distribution terms for this file may be
7
 *  found in the file LICENSE in this distribution or at
8
 *  http://www.OARcorp.com/rtems/license.html.
9
 *
10
 *  $Id: testtask.c,v 1.2 2001-09-27 12:02:46 chris Exp $
11
 */
12
 
13
#define TEST_INIT
14
#include "system.h"
15
 
16
rtems_unsigned8 Memory_area[ 2048 ];
17
rtems_unsigned8 Internal_port_area[ 256 ];
18
rtems_unsigned8 External_port_area[ 256 ];
19
 
20
rtems_task Task_1(
21
  rtems_task_argument argument
22
);
23
 
24
rtems_task Init(
25
  rtems_task_argument argument
26
)
27
{ rtems_id id;
28
  rtems_status_code status;
29
 
30
  Set_find_average_overhead( TRUE );
31
 
32
  Print_Warning();
33
 
34
  puts( "\n\n*** TIME TEST OVERHEAD ***" );
35
 
36
  status = rtems_task_create(
37
    rtems_build_name( 'T', 'A', '1', ' ' ),
38
    254,
39
    RTEMS_MINIMUM_STACK_SIZE,
40
    RTEMS_DEFAULT_MODES,
41
    RTEMS_DEFAULT_ATTRIBUTES,
42
    &id
43
  );
44
  directive_failed( status, "rtems_task_create of TA1" );
45
 
46
  status = rtems_task_start( id, Task_1, 0 );
47
  directive_failed( status, "rtems_task_start of TA1" );
48
 
49
  status = rtems_task_delete( RTEMS_SELF );
50
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
51
}
52
 
53
/* comment out the following include to verify type are correct */
54
#include "dumrtems.h"
55
 
56
rtems_task Task_1(
57
  rtems_task_argument argument
58
)
59
{
60
  rtems_name                 name;
61
  rtems_unsigned32           index;
62
  rtems_cpu_table            cpu_table;
63
  rtems_id                   id;
64
  rtems_task_priority        in_priority;
65
  rtems_task_priority        out_priority;
66
  rtems_mode                 in_mode;
67
  rtems_mode                 mask;
68
  rtems_mode                 out_mode;
69
  rtems_unsigned32           note;
70
  rtems_time_of_day          time;
71
  rtems_interval             timeout;
72
  rtems_signal_set           signals;
73
  void                      *address_1;
74
  rtems_event_set            events;
75
  long                       buffer[ 4 ];
76
  rtems_unsigned32           count;
77
  rtems_device_major_number  major;
78
  rtems_device_minor_number  minor;
79
  rtems_unsigned32           io_result;
80
  rtems_unsigned32           error;
81
  rtems_clock_get_options    options;
82
 
83
  name        = rtems_build_name( 'N', 'A', 'M', 'E' );
84
  in_priority = 250;
85
  in_mode     = RTEMS_NO_PREEMPT;
86
  mask        = RTEMS_PREEMPT_MASK;
87
  note        = 8;
88
  timeout     = 100;
89
  signals     = RTEMS_SIGNAL_1 | RTEMS_SIGNAL_3;
90
  major       = 10;
91
  minor       = 0;
92
  error       = 100;
93
  options     = 0;
94
 
95
/* rtems_initialize_executive */
96
  Timer_initialize();
97
    for ( index=1 ; index <= OPERATION_COUNT ; index++ )
98
      (void) rtems_initialize_executive( rtems_configuration_get_table(), &cpu_table );
99
  end_time = Read_timer();
100
 
101
  put_time(
102
    "rtems_initialize_executive",
103
    end_time,
104
    OPERATION_COUNT,
105
    overhead,
106
 
107
  );
108
 
109
/* rtems_shutdown_executive */
110
 
111
  Timer_initialize();
112
    for ( index=1 ; index <= OPERATION_COUNT ; index++ )
113
      (void) rtems_shutdown_executive( error );
114
  end_time = Read_timer();
115
 
116
  put_time(
117
    "rtems_shutdown_executive",
118
    end_time,
119
    OPERATION_COUNT,
120
    overhead,
121
 
122
  );
123
 
124
/* rtems_task_create */
125
 
126
      Timer_initialize();
127
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
128
            (void) rtems_task_create(
129
               name,
130
               in_priority,
131
               RTEMS_MINIMUM_STACK_SIZE,
132
               RTEMS_DEFAULT_MODES,
133
               RTEMS_DEFAULT_ATTRIBUTES,
134
               &id
135
            );
136
      end_time = Read_timer();
137
 
138
      put_time(
139
         "rtems_task_create",
140
         end_time,
141
         OPERATION_COUNT,
142
         overhead,
143
 
144
      );
145
 
146
/* rtems_task_ident */
147
 
148
      Timer_initialize();
149
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
150
            (void) rtems_task_ident( name, RTEMS_SEARCH_ALL_NODES, id );
151
      end_time = Read_timer();
152
 
153
      put_time(
154
         "rtems_task_ident",
155
         end_time,
156
         OPERATION_COUNT,
157
         overhead,
158
 
159
      );
160
 
161
/* rtems_task_start */
162
 
163
      Timer_initialize();
164
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
165
            (void) rtems_task_start( id, Task_1, 0 );
166
      end_time = Read_timer();
167
 
168
      put_time(
169
         "rtems_task_start",
170
         end_time,
171
         OPERATION_COUNT,
172
         overhead,
173
 
174
      );
175
 
176
/* rtems_task_restart */
177
 
178
      Timer_initialize();
179
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
180
            (void) rtems_task_restart( id, 0 );
181
      end_time = Read_timer();
182
 
183
      put_time(
184
         "rtems_task_restart",
185
         end_time,
186
         OPERATION_COUNT,
187
         overhead,
188
 
189
      );
190
 
191
/* rtems_task_delete */
192
 
193
      Timer_initialize();
194
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
195
            (void) rtems_task_delete( id );
196
      end_time = Read_timer();
197
 
198
      put_time(
199
         "rtems_task_delete",
200
         end_time,
201
         OPERATION_COUNT,
202
         overhead,
203
 
204
      );
205
 
206
/* rtems_task_suspend */
207
 
208
      Timer_initialize();
209
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
210
            (void) rtems_task_suspend( id );
211
      end_time = Read_timer();
212
 
213
      put_time(
214
         "rtems_task_suspend",
215
         end_time,
216
         OPERATION_COUNT,
217
         overhead,
218
 
219
      );
220
 
221
/* rtems_task_resume */
222
 
223
      Timer_initialize();
224
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
225
            (void) rtems_task_resume( id );
226
      end_time = Read_timer();
227
 
228
      put_time(
229
         "rtems_task_resume",
230
         end_time,
231
         OPERATION_COUNT,
232
         overhead,
233
 
234
      );
235
 
236
/* rtems_task_set_priority */
237
 
238
      Timer_initialize();
239
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
240
            (void) rtems_task_set_priority( id, in_priority, &out_priority );
241
      end_time = Read_timer();
242
 
243
      put_time(
244
         "rtems_task_set_priority",
245
         end_time,
246
         OPERATION_COUNT,
247
         overhead,
248
 
249
      );
250
 
251
/* rtems_task_mode */
252
 
253
      Timer_initialize();
254
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
255
            (void) rtems_task_mode( in_mode, mask, &out_mode );
256
      end_time = Read_timer();
257
 
258
      put_time(
259
         "rtems_task_mode",
260
         end_time,
261
         OPERATION_COUNT,
262
         overhead,
263
 
264
      );
265
 
266
/* rtems_task_get_note */
267
 
268
      Timer_initialize();
269
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
270
            (void) rtems_task_get_note( id, 1, note );
271
      end_time = Read_timer();
272
 
273
      put_time(
274
         "rtems_task_get_note",
275
         end_time,
276
         OPERATION_COUNT,
277
         overhead,
278
 
279
      );
280
 
281
/* rtems_task_set_note */
282
 
283
      Timer_initialize();
284
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
285
            (void) rtems_task_set_note( id, 1, note );
286
      end_time = Read_timer();
287
 
288
      put_time(
289
         "rtems_task_set_note",
290
         end_time,
291
         OPERATION_COUNT,
292
         overhead,
293
 
294
      );
295
 
296
/* rtems_task_wake_when */
297
 
298
      Timer_initialize();
299
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
300
            (void) rtems_task_wake_when( time );
301
      end_time = Read_timer();
302
 
303
      put_time(
304
         "rtems_task_wake_when",
305
         end_time,
306
         OPERATION_COUNT,
307
         overhead,
308
 
309
      );
310
 
311
/* rtems_task_wake_after */
312
 
313
      Timer_initialize();
314
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
315
            (void) rtems_task_wake_after( timeout );
316
      end_time = Read_timer();
317
 
318
      put_time(
319
         "rtems_task_wake_after",
320
         end_time,
321
         OPERATION_COUNT,
322
         overhead,
323
 
324
      );
325
 
326
/* rtems_interrupt_catch */
327
 
328
      Timer_initialize();
329
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
330
            (void) rtems_interrupt_catch( Isr_handler, 5, address_1 );
331
      end_time = Read_timer();
332
 
333
      put_time(
334
         "rtems_interrupt_catch",
335
         end_time,
336
         OPERATION_COUNT,
337
         overhead,
338
 
339
      );
340
 
341
/* rtems_clock_get */
342
 
343
      Timer_initialize();
344
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
345
            (void) rtems_clock_get( options, time );
346
      end_time = Read_timer();
347
 
348
      put_time(
349
         "rtems_clock_get",
350
         end_time,
351
         OPERATION_COUNT,
352
         overhead,
353
 
354
      );
355
 
356
/* rtems_clock_set */
357
 
358
      Timer_initialize();
359
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
360
            (void) rtems_clock_set( time );
361
      end_time = Read_timer();
362
 
363
      put_time(
364
         "rtems_clock_set",
365
         end_time,
366
         OPERATION_COUNT,
367
         overhead,
368
 
369
      );
370
 
371
/* rtems_clock_tick */
372
 
373
      Timer_initialize();
374
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
375
           (void) rtems_clock_tick();
376
      end_time = Read_timer();
377
 
378
      put_time(
379
         "rtems_clock_tick",
380
         end_time,
381
         OPERATION_COUNT,
382
         overhead,
383
 
384
      );
385
 
386
rtems_test_pause();
387
 
388
/* rtems_timer_create */
389
 
390
      Timer_initialize();
391
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
392
            (void) rtems_timer_create( name, &id );
393
      end_time = Read_timer();
394
 
395
      put_time(
396
         "rtems_timer_create",
397
         end_time,
398
         OPERATION_COUNT,
399
         overhead,
400
 
401
      );
402
 
403
/* rtems_timer_delete */
404
 
405
      Timer_initialize();
406
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
407
            (void) rtems_timer_delete( id );
408
      end_time = Read_timer();
409
 
410
      put_time(
411
         "rtems_timer_delete",
412
         end_time,
413
         OPERATION_COUNT,
414
         overhead,
415
 
416
      );
417
 
418
/* rtems_timer_ident */
419
 
420
      Timer_initialize();
421
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
422
            (void) rtems_timer_ident( name, id );
423
      end_time = Read_timer();
424
 
425
      put_time(
426
         "rtems_timer_ident",
427
         end_time,
428
         OPERATION_COUNT,
429
         overhead,
430
 
431
      );
432
 
433
/* rtems_timer_fire_after */
434
 
435
      Timer_initialize();
436
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
437
            (void) rtems_timer_fire_after(
438
               id,
439
               timeout,
440
               Timer_handler,
441
               NULL
442
            );
443
      end_time = Read_timer();
444
 
445
      put_time(
446
         "rtems_timer_fire_after",
447
         end_time,
448
         OPERATION_COUNT,
449
         overhead,
450
 
451
      );
452
 
453
/* rtems_timer_fire_when */
454
 
455
      Timer_initialize();
456
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
457
            (void) rtems_timer_fire_when(
458
               id,
459
               time,
460
               Timer_handler,
461
               NULL
462
            );
463
      end_time = Read_timer();
464
 
465
      put_time(
466
         "rtems_timer_fire_when",
467
         end_time,
468
         OPERATION_COUNT,
469
         overhead,
470
 
471
      );
472
 
473
/* rtems_timer_reset */
474
 
475
      Timer_initialize();
476
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
477
            (void) rtems_timer_reset( id );
478
      end_time = Read_timer();
479
 
480
      put_time(
481
         "rtems_timer_reset",
482
         end_time,
483
         OPERATION_COUNT,
484
         overhead,
485
 
486
      );
487
 
488
/* rtems_timer_cancel */
489
 
490
      Timer_initialize();
491
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
492
            (void) rtems_timer_cancel( id );
493
      end_time = Read_timer();
494
 
495
      put_time(
496
         "rtems_timer_cancel",
497
         end_time,
498
         OPERATION_COUNT,
499
         overhead,
500
 
501
      );
502
 
503
/* rtems_semaphore_create */
504
 
505
      Timer_initialize();
506
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
507
            (void) rtems_semaphore_create(
508
               name,
509
               128,
510
               RTEMS_DEFAULT_ATTRIBUTES,
511
               RTEMS_NO_PRIORITY,
512
               &id
513
            );
514
      end_time = Read_timer();
515
 
516
      put_time(
517
         "rtems_semaphore_create",
518
         end_time,
519
         OPERATION_COUNT,
520
         overhead,
521
 
522
      );
523
 
524
/* rtems_semaphore_delete */
525
 
526
      Timer_initialize();
527
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
528
            (void) rtems_semaphore_delete( id );
529
      end_time = Read_timer();
530
 
531
      put_time(
532
         "rtems_semaphore_delete",
533
         end_time,
534
         OPERATION_COUNT,
535
         overhead,
536
 
537
      );
538
 
539
/* rtems_semaphore_ident */
540
 
541
      Timer_initialize();
542
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
543
            (void) rtems_semaphore_ident( name, RTEMS_SEARCH_ALL_NODES, id );
544
      end_time = Read_timer();
545
 
546
      put_time(
547
         "rtems_semaphore_ident",
548
         end_time,
549
         OPERATION_COUNT,
550
         overhead,
551
 
552
      );
553
 
554
/* rtems_semaphore_obtain */
555
 
556
      Timer_initialize();
557
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
558
            (void) rtems_semaphore_obtain( id, RTEMS_DEFAULT_OPTIONS, timeout );
559
      end_time = Read_timer();
560
 
561
      put_time(
562
         "rtems_semaphore_obtain",
563
         end_time,
564
         OPERATION_COUNT,
565
         overhead,
566
 
567
      );
568
 
569
/* rtems_semaphore_release */
570
 
571
      Timer_initialize();
572
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
573
            (void) rtems_semaphore_release( id );
574
      end_time = Read_timer();
575
 
576
      put_time(
577
         "rtems_semaphore_release",
578
         end_time,
579
         OPERATION_COUNT,
580
         overhead,
581
 
582
      );
583
 
584
/* rtems_message_queue_create */
585
 
586
      Timer_initialize();
587
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
588
            (void) rtems_message_queue_create(
589
               name,
590
               128,
591
               RTEMS_DEFAULT_ATTRIBUTES,
592
               &id
593
            );
594
      end_time = Read_timer();
595
 
596
      put_time(
597
         "rtems_message_queue_create",
598
         end_time,
599
         OPERATION_COUNT,
600
         overhead,
601
 
602
      );
603
 
604
/* rtems_message_queue_ident */
605
 
606
      Timer_initialize();
607
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
608
            (void) rtems_message_queue_ident(
609
              name,
610
              RTEMS_SEARCH_ALL_NODES,
611
              id
612
            );
613
      end_time = Read_timer();
614
 
615
      put_time(
616
         "rtems_message_queue_ident",
617
         end_time,
618
         OPERATION_COUNT,
619
         overhead,
620
 
621
      );
622
 
623
/* rtems_message_queue_delete */
624
 
625
      Timer_initialize();
626
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
627
            (void) rtems_message_queue_delete( id );
628
      end_time = Read_timer();
629
 
630
      put_time(
631
         "rtems_message_queue_delete",
632
         end_time,
633
         OPERATION_COUNT,
634
         overhead,
635
 
636
      );
637
 
638
/* rtems_message_queue_send */
639
 
640
      Timer_initialize();
641
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
642
            (void) rtems_message_queue_send( id, (long (*)[4])buffer );
643
      end_time = Read_timer();
644
 
645
      put_time(
646
         "rtems_message_queue_send",
647
         end_time,
648
         OPERATION_COUNT,
649
         overhead,
650
 
651
      );
652
 
653
/* rtems_message_queue_urgent */
654
 
655
      Timer_initialize();
656
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
657
            (void) rtems_message_queue_urgent( id, (long (*)[4])buffer );
658
      end_time = Read_timer();
659
 
660
      put_time(
661
         "rtems_message_queue_urgent",
662
         end_time,
663
         OPERATION_COUNT,
664
         overhead,
665
 
666
      );
667
 
668
/* rtems_message_queue_broadcast */
669
 
670
      Timer_initialize();
671
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
672
            (void) rtems_message_queue_broadcast(
673
               id,
674
               (long (*)[4])buffer,
675
               &count
676
            );
677
      end_time = Read_timer();
678
 
679
      put_time(
680
         "rtems_message_queue_broadcast",
681
         end_time,
682
         OPERATION_COUNT,
683
         overhead,
684
 
685
      );
686
 
687
/* rtems_message_queue_receive */
688
 
689
      Timer_initialize();
690
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
691
            (void) rtems_message_queue_receive(
692
               id,
693
               (long (*)[4])buffer,
694
               RTEMS_DEFAULT_OPTIONS,
695
               timeout
696
            );
697
      end_time = Read_timer();
698
 
699
      put_time(
700
         "rtems_message_queue_receive",
701
         end_time,
702
         OPERATION_COUNT,
703
         overhead,
704
 
705
      );
706
 
707
/* rtems_message_queue_flush */
708
 
709
      Timer_initialize();
710
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
711
            (void) rtems_message_queue_flush( id, &count );
712
      end_time = Read_timer();
713
 
714
      put_time(
715
         "rtems_message_queue_flush",
716
         end_time,
717
         OPERATION_COUNT,
718
         overhead,
719
 
720
      );
721
 
722
rtems_test_pause();
723
 
724
/* rtems_event_send */
725
 
726
      Timer_initialize();
727
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
728
            (void) rtems_event_send( id, events );
729
      end_time = Read_timer();
730
 
731
      put_time(
732
         "rtems_event_send",
733
         end_time,
734
         OPERATION_COUNT,
735
         overhead,
736
 
737
      );
738
 
739
/* rtems_event_receive */
740
 
741
      Timer_initialize();
742
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
743
            (void) rtems_event_receive(
744
               RTEMS_EVENT_16,
745
               RTEMS_DEFAULT_OPTIONS,
746
               timeout,
747
               &events
748
            );
749
      end_time = Read_timer();
750
 
751
      put_time(
752
         "rtems_event_receive",
753
         end_time,
754
         OPERATION_COUNT,
755
         overhead,
756
 
757
      );
758
 
759
/* rtems_signal_catch */
760
 
761
      Timer_initialize();
762
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
763
            (void) rtems_signal_catch( Asr_handler, RTEMS_DEFAULT_MODES );
764
      end_time = Read_timer();
765
 
766
      put_time(
767
         "rtems_signal_catch",
768
         end_time,
769
         OPERATION_COUNT,
770
         overhead,
771
 
772
      );
773
 
774
/* rtems_signal_send */
775
 
776
      Timer_initialize();
777
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
778
            (void) rtems_signal_send( id, signals );
779
      end_time = Read_timer();
780
 
781
      put_time(
782
         "rtems_signal_send",
783
         end_time,
784
         OPERATION_COUNT,
785
         overhead,
786
 
787
      );
788
 
789
/* rtems_partition_create */
790
 
791
      Timer_initialize();
792
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
793
            (void) rtems_partition_create(
794
               name,
795
               Memory_area,
796
               2048,
797
               128,
798
               RTEMS_DEFAULT_ATTRIBUTES,
799
               &id
800
            );
801
      end_time = Read_timer();
802
 
803
      put_time(
804
         "rtems_partition_create",
805
         end_time,
806
         OPERATION_COUNT,
807
         overhead,
808
 
809
      );
810
 
811
/* rtems_partition_ident */
812
 
813
      Timer_initialize();
814
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
815
            (void) rtems_partition_ident( name, RTEMS_SEARCH_ALL_NODES, id );
816
      end_time = Read_timer();
817
 
818
      put_time(
819
         "rtems_partition_ident",
820
         end_time,
821
         OPERATION_COUNT,
822
         overhead,
823
 
824
      );
825
 
826
/* rtems_partition_delete */
827
 
828
      Timer_initialize();
829
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
830
            (void) rtems_partition_delete( id );
831
      end_time = Read_timer();
832
 
833
      put_time(
834
         "rtems_partition_delete",
835
         end_time,
836
         OPERATION_COUNT,
837
         overhead,
838
 
839
      );
840
 
841
/* rtems_partition_get_buffer */
842
 
843
      Timer_initialize();
844
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
845
            (void) rtems_partition_get_buffer( id, address_1 );
846
      end_time = Read_timer();
847
 
848
      put_time(
849
         "rtems_partition_get_buffer",
850
         end_time,
851
         OPERATION_COUNT,
852
         overhead,
853
 
854
      );
855
 
856
/* rtems_partition_return_buffer */
857
 
858
      Timer_initialize();
859
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
860
            (void) rtems_partition_return_buffer( id, address_1 );
861
      end_time = Read_timer();
862
 
863
      put_time(
864
         "rtems_partition_return_buffer",
865
         end_time,
866
         OPERATION_COUNT,
867
         overhead,
868
 
869
      );
870
 
871
/* rtems_region_create */
872
 
873
      Timer_initialize();
874
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
875
            (void) rtems_region_create(
876
               name,
877
               Memory_area,
878
               2048,
879
               128,
880
               RTEMS_DEFAULT_ATTRIBUTES,
881
               &id
882
            );
883
      end_time = Read_timer();
884
 
885
      put_time(
886
         "rtems_region_create",
887
         end_time,
888
         OPERATION_COUNT,
889
         overhead,
890
 
891
      );
892
 
893
/* rtems_region_ident */
894
 
895
      Timer_initialize();
896
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
897
            (void) rtems_region_ident( name, id );
898
      end_time = Read_timer();
899
 
900
      put_time(
901
         "rtems_region_ident",
902
         end_time,
903
         OPERATION_COUNT,
904
         overhead,
905
 
906
      );
907
 
908
/* rtems_region_delete */
909
 
910
      Timer_initialize();
911
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
912
            (void) rtems_region_delete( id );
913
      end_time = Read_timer();
914
 
915
      put_time(
916
         "rtems_region_delete",
917
         end_time,
918
         OPERATION_COUNT,
919
         overhead,
920
 
921
      );
922
 
923
/* rtems_region_get_segment */
924
 
925
      Timer_initialize();
926
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
927
            (void) rtems_region_get_segment(
928
               id,
929
               243,
930
               RTEMS_DEFAULT_OPTIONS,
931
               timeout,
932
               &address_1
933
            );
934
      end_time = Read_timer();
935
 
936
      put_time(
937
         "rtems_region_get_segment",
938
         end_time,
939
         OPERATION_COUNT,
940
         overhead,
941
 
942
      );
943
 
944
/* rtems_region_return_segment */
945
 
946
      Timer_initialize();
947
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
948
            (void) rtems_region_return_segment( id, address_1 );
949
      end_time = Read_timer();
950
 
951
      put_time(
952
         "rtems_region_return_segment",
953
         end_time,
954
         OPERATION_COUNT,
955
         overhead,
956
 
957
      );
958
 
959
/* rtems_port_create */
960
 
961
      Timer_initialize();
962
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
963
            (void) rtems_port_create(
964
               name,
965
               Internal_port_area,
966
               External_port_area,
967
               0xff,
968
               &id
969
            );
970
      end_time = Read_timer();
971
 
972
      put_time(
973
         "rtems_port_create",
974
         end_time,
975
         OPERATION_COUNT,
976
         overhead,
977
 
978
      );
979
 
980
/* rtems_port_ident */
981
 
982
      Timer_initialize();
983
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
984
            (void) rtems_port_ident( name, id );
985
      end_time = Read_timer();
986
 
987
      put_time(
988
         "rtems_port_ident",
989
         end_time,
990
         OPERATION_COUNT,
991
         overhead,
992
 
993
      );
994
 
995
/* rtems_port_delete */
996
 
997
      Timer_initialize();
998
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
999
            (void) rtems_port_delete( id );
1000
      end_time = Read_timer();
1001
 
1002
      put_time(
1003
         "rtems_port_delete",
1004
         end_time,
1005
         OPERATION_COUNT,
1006
         overhead,
1007
 
1008
      );
1009
 
1010
/* rtems_port_external_to_internal */
1011
 
1012
      Timer_initialize();
1013
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1014
            (void) rtems_port_external_to_internal(
1015
               id,
1016
               &External_port_area[ 7 ],
1017
               address_1
1018
            );
1019
      end_time = Read_timer();
1020
 
1021
      put_time(
1022
         "rtems_port_external_to_internal",
1023
         end_time,
1024
         OPERATION_COUNT,
1025
         overhead,
1026
 
1027
      );
1028
 
1029
/* rtems_port_internal_to_external */
1030
 
1031
      Timer_initialize();
1032
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1033
            (void) rtems_port_internal_to_external(
1034
               id,
1035
               &Internal_port_area[ 7 ],
1036
               address_1
1037
            );
1038
      end_time = Read_timer();
1039
 
1040
      put_time(
1041
         "rtems_port_internal_to_external",
1042
         end_time,
1043
         OPERATION_COUNT,
1044
         overhead,
1045
 
1046
      );
1047
 
1048
rtems_test_pause();
1049
 
1050
/* rtems_io_initialize */
1051
 
1052
      Timer_initialize();
1053
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1054
            (void) rtems_io_initialize(
1055
               major,
1056
               minor,
1057
               address_1,
1058
               &io_result
1059
            );
1060
      end_time = Read_timer();
1061
 
1062
      put_time(
1063
         "rtems_io_initialize",
1064
         end_time,
1065
         OPERATION_COUNT,
1066
         overhead,
1067
 
1068
      );
1069
 
1070
/* rtems_io_open */
1071
 
1072
      Timer_initialize();
1073
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1074
            (void) rtems_io_open(
1075
               major,
1076
               minor,
1077
               address_1,
1078
               &io_result
1079
            );
1080
      end_time = Read_timer();
1081
 
1082
      put_time(
1083
         "rtems_io_open",
1084
         end_time,
1085
         OPERATION_COUNT,
1086
         overhead,
1087
 
1088
      );
1089
 
1090
/* rtems_io_close */
1091
 
1092
      Timer_initialize();
1093
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1094
            (void) rtems_io_close(
1095
               major,
1096
               minor,
1097
               address_1,
1098
               &io_result
1099
            );
1100
      end_time = Read_timer();
1101
 
1102
      put_time(
1103
         "rtems_io_close",
1104
         end_time,
1105
         OPERATION_COUNT,
1106
         overhead,
1107
 
1108
      );
1109
 
1110
/* rtems_io_read */
1111
 
1112
      Timer_initialize();
1113
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1114
            (void) rtems_io_read(
1115
               major,
1116
               minor,
1117
               address_1,
1118
               &io_result
1119
            );
1120
      end_time = Read_timer();
1121
 
1122
      put_time(
1123
         "rtems_io_read",
1124
         end_time,
1125
         OPERATION_COUNT,
1126
         overhead,
1127
 
1128
      );
1129
 
1130
/* rtems_io_write */
1131
 
1132
      Timer_initialize();
1133
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1134
            (void) rtems_io_write(
1135
               major,
1136
               minor,
1137
               address_1,
1138
               &io_result
1139
            );
1140
      end_time = Read_timer();
1141
 
1142
      put_time(
1143
         "rtems_io_write",
1144
         end_time,
1145
         OPERATION_COUNT,
1146
         overhead,
1147
 
1148
      );
1149
 
1150
/* rtems_io_control */
1151
 
1152
      Timer_initialize();
1153
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1154
            (void) rtems_io_control(
1155
               major,
1156
               minor,
1157
               address_1,
1158
               &io_result
1159
            );
1160
      end_time = Read_timer();
1161
 
1162
      put_time(
1163
         "rtems_io_control",
1164
         end_time,
1165
         OPERATION_COUNT,
1166
         overhead,
1167
 
1168
      );
1169
 
1170
/* rtems_fatal_error_occurred */
1171
 
1172
      Timer_initialize();
1173
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1174
            (void) rtems_fatal_error_occurred( error );
1175
      end_time = Read_timer();
1176
 
1177
      put_time(
1178
         "rtems_fatal_error_occurred",
1179
         end_time,
1180
         OPERATION_COUNT,
1181
         overhead,
1182
 
1183
      );
1184
 
1185
/* rtems_rate_monotonic_create */
1186
 
1187
      Timer_initialize();
1188
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1189
            (void) rtems_rate_monotonic_create( name, &id );
1190
      end_time = Read_timer();
1191
 
1192
      put_time(
1193
         "rtems_rate_monotonic_create",
1194
         end_time,
1195
         OPERATION_COUNT,
1196
         overhead,
1197
 
1198
      );
1199
 
1200
/* rtems_rate_monotonic_ident */
1201
 
1202
      Timer_initialize();
1203
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1204
            (void) rtems_rate_monotonic_ident( name, id );
1205
      end_time = Read_timer();
1206
 
1207
      put_time(
1208
         "rtems_rate_monotonic_ident",
1209
         end_time,
1210
         OPERATION_COUNT,
1211
         overhead,
1212
 
1213
      );
1214
 
1215
/* rtems_rate_monotonic_delete */
1216
 
1217
      Timer_initialize();
1218
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1219
            (void) rtems_rate_monotonic_delete( id );
1220
      end_time = Read_timer();
1221
 
1222
      put_time(
1223
         "rtems_rate_monotonic_delete",
1224
         end_time,
1225
         OPERATION_COUNT,
1226
         overhead,
1227
 
1228
      );
1229
 
1230
/* rtems_rate_monotonic_cancel */
1231
 
1232
      Timer_initialize();
1233
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1234
            (void) rtems_rate_monotonic_cancel( id );
1235
      end_time = Read_timer();
1236
 
1237
      put_time(
1238
         "rtems_rate_monotonic_cancel",
1239
         end_time,
1240
         OPERATION_COUNT,
1241
         overhead,
1242
 
1243
      );
1244
 
1245
/* rtems_rate_monotonic_period */
1246
 
1247
      Timer_initialize();
1248
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1249
            (void) rtems_rate_monotonic_period( id, timeout );
1250
      end_time = Read_timer();
1251
 
1252
      put_time(
1253
         "rtems_rate_monotonic_period",
1254
         end_time,
1255
         OPERATION_COUNT,
1256
         overhead,
1257
 
1258
      );
1259
 
1260
/* rtems_multiprocessing_announce */
1261
 
1262
      Timer_initialize();
1263
         for ( index = 1 ; index <= OPERATION_COUNT ; index ++ )
1264
            (void) rtems_multiprocessing_announce();
1265
      end_time = Read_timer();
1266
 
1267
      put_time(
1268
         "rtems_multiprocessing_announce",
1269
         end_time,
1270
         OPERATION_COUNT,
1271
         overhead,
1272
 
1273
      );
1274
 
1275
  puts( "*** END OF TIME OVERHEAD ***" );
1276
 
1277
  exit( 0 );
1278
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.