source: rtems/testsuites/tmtests/tmoverhd/testtask.c @ 8389628

4.104.114.84.95
Last change on this file since 8389628 was ba39113, checked in by Joel Sherrill <joel.sherrill@…>, on 02/22/96 at 20:14:36

The name of the test support routine pause was changed to rtems_test_pause
to avoid conflict with the standard POSIX routine pause(2).

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