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

4.115
Last change on this file since d1c5c01f was a03d4453, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/12 at 14:25:49

tmoverhd - Eliminate warnings

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