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

4.104.114.95
Last change on this file since c610850e was c610850e, checked in by Joel Sherrill <joel.sherrill@…>, on 12/04/07 at 22:18:39

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

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