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

4.115
Last change on this file since a4bc4d6e was a4bc4d6e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 10:00:39

Add HAVE_CONFIG_H.

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