source: rtems/testsuites/tmtests/tmoverhd/testtask.c @ 9a56628

4.104.114.95
Last change on this file since 9a56628 was 9a56628, checked in by Joel Sherrill <joel.sherrill@…>, on 12/05/07 at 22:24:53

2007-12-05 Joel Sherrill <joel.sherrill@…>

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