- Timestamp:
- 10/17/07 20:55:06 (16 years ago)
- Branches:
- ada-examples-4-10-branch, ada-examples-4-9-branch, master
- Children:
- 36fcd41
- Parents:
- 2059da6
- Location:
- irq_test
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
irq_test/interrupt_pkg.adb
r2059da6 r14f44a3 13 13 -- European Space Agency, 1999. 14 14 -- 15 -- The license and distribution terms for this file may be 16 -- found in the file LICENSE in this distribution or at 17 -- http://www.rtems.com/license/LICENSE. 18 -- 19 -- $Id$ 20 -- 21 15 22 16 23 … … 18 25 with System; 19 26 with Ada.Text_IO; 27 with Ada.Real_Time; use Ada.Real_Time; 20 28 21 29 package body Interrupt_pkg is … … 25 33 Protected_Priority : constant System.Interrupt_Priority := 26 34 System.Interrupt_Priority'First; 35 36 Start_Time : Ada.Real_Time.Time; 37 Stop_Time : Ada.Real_Time.Time; 27 38 28 39 -- Protected object, including interrupt handler (Signal) and conditional entry. … … 42 53 BARRIER := LOW; 43 54 end Signal; 55 44 56 entry Wait when (BARRIER = LOW) is 57 Took : Time_Span; 45 58 begin 59 Stop_Time := Ada.Real_Time.Clock; 46 60 BARRIER := HIGH; 61 62 Took := Stop_Time - Start_Time; 63 64 Ada.Text_IO.Put_line ( "Interrupt took: " & 65 Duration'Image(To_Duration(Took))); 47 66 end Wait; 48 67 end Handler; … … 51 70 52 71 task sporadic is 53 pragma Priority ( 8);72 pragma Priority (100); 54 73 end sporadic; 55 74 56 75 task body sporadic is 57 Message : constant STRING := 58 "sporadic activated"; 76 Message : constant STRING := "sporadic activated"; 59 77 begin 60 78 loop 61 79 Handler.Wait; 62 Ada.Text_IO.Put_line (Message); 80 63 81 end loop; 64 82 end sporadic; … … 70 88 pragma Import (C, irqforce, "irqforce"); 71 89 begin 90 91 Start_Time := Ada.Real_Time.Clock; 92 Stop_Time := Ada.Real_Time.Clock; 93 94 Ada.Text_IO.Put_line ( "Timer Overhead: " & 95 Duration'Image(To_Duration(Stop_Time - Start_Time))); 96 72 97 for i in 1..10 loop 98 Start_Time := Ada.Real_Time.Clock; 73 99 irqforce(1); 74 100 delay(0.05); … … 81 107 begin 82 108 83 itest; 109 -- itest; 110 NULL; 84 111 85 112 end Interrupt_pkg; -
irq_test/interrupt_pkg.ads
r2059da6 r14f44a3 1 -- 2 -- The license and distribution terms for this file may be 3 -- found in the file LICENSE in this distribution or at 4 -- http://www.rtems.com/license/LICENSE. 5 -- 6 -- $Id$ 7 -- 8 1 9 package Interrupt_pkg is 2 10 procedure itest; -
irq_test/irqforce.c
r2059da6 r14f44a3 1 /* 2 * The license and distribution terms for this file may be 3 * found in the file LICENSE in this distribution or at 4 * http://www.rtems.com/license/LICENSE. 5 * 6 * $Id$ 7 */ 8 1 9 #include <bsp.h> 2 10 3 irqforce(int irq)11 void irqforce(int irq) 4 12 { 5 13 ERC32_Unmask_interrupt(irq); -
irq_test/irqtest.adb
r2059da6 r14f44a3 1 -- 2 -- The license and distribution terms for this file may be 3 -- found in the file LICENSE in this distribution or at 4 -- http://www.rtems.com/license/LICENSE. 5 -- 6 -- $Id$ 7 -- 8 1 9 with Interrupt_pkg; 2 10 3 11 procedure irqtest is 4 12 begin 5 null;13 Interrupt_pkg.itest; 6 14 end irqtest; 7 15
Note: See TracChangeset
for help on using the changeset viewer.