Changeset 14f44a3 in ada-examples for irq_test


Ignore:
Timestamp:
10/17/07 20:55:06 (16 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
ada-examples-4-10-branch, ada-examples-4-9-branch, master
Children:
36fcd41
Parents:
2059da6
Message:

2007-10-17 Joel Sherrill <joel.sherrill@…>

  • Makefile, Makefile.shared, rtems_init.c, irq_test/interrupt_pkg.adb, irq_test/interrupt_pkg.ads, irq_test/irqforce.c, irq_test/irqtest.adb, rootfs/etc/hosts: Adding new tests as improvements are made to the RTEMS port of the GNAT run-time.
  • empty/Makefile, empty/README, empty/empty.adb, hello_via_task/.cvsignore, hello_via_task/Makefile, hello_via_task/hello.adb, irq_test/.cvsignore, irq_test/Makefile, irq_test/README, irq_test_c/.cvsignore, irq_test_c/Makefile, irq_test_c/README, irq_test_c/init.c, irq_test_c/irqforce.c: New files.
Location:
irq_test
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • irq_test/interrupt_pkg.adb

    r2059da6 r14f44a3  
    1313--  European Space Agency, 1999.
    1414--
     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
    1522
    1623
     
    1825with System;
    1926with Ada.Text_IO;
     27with Ada.Real_Time; use Ada.Real_Time;
    2028
    2129package body Interrupt_pkg is
     
    2533   Protected_Priority : constant System.Interrupt_Priority :=
    2634     System.Interrupt_Priority'First;
     35
     36   Start_Time       : Ada.Real_Time.Time;
     37   Stop_Time        : Ada.Real_Time.Time;
    2738
    2839-- Protected object, including interrupt handler (Signal) and conditional entry.
     
    4253         BARRIER := LOW;
    4354      end Signal;
     55
    4456      entry Wait when (BARRIER = LOW) is
     57         Took : Time_Span;
    4558      begin
     59         Stop_Time := Ada.Real_Time.Clock;       
    4660         BARRIER := HIGH;
     61
     62         Took := Stop_Time - Start_Time;
     63         
     64         Ada.Text_IO.Put_line ( "Interrupt took: " &
     65          Duration'Image(To_Duration(Took)));
    4766      end Wait;
    4867   end Handler;
     
    5170
    5271   task sporadic is
    53       pragma Priority (8);
     72      pragma Priority (100);
    5473   end sporadic;
    5574
    5675   task body sporadic is
    57       Message : constant STRING :=
    58         "sporadic activated";
     76      Message : constant STRING := "sporadic activated";
    5977   begin
    6078      loop
    6179         Handler.Wait;
    62          Ada.Text_IO.Put_line (Message);
     80
    6381      end loop;
    6482   end sporadic;
     
    7088      pragma Import (C, irqforce, "irqforce");
    7189   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
    7297     for i in 1..10 loop
     98       Start_Time := Ada.Real_Time.Clock;       
    7399       irqforce(1);
    74100       delay(0.05);
     
    81107begin
    82108
    83   itest;
     109  --  itest;
     110  NULL;
    84111
    85112end 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
    19package Interrupt_pkg is
    210  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
    19#include <bsp.h>
    210
    3 irqforce(int irq)
     11void irqforce(int irq)
    412{
    513  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
    19with Interrupt_pkg;
    210
    311procedure irqtest is
    412begin
    5   null;
     13  Interrupt_pkg.itest;
    614end irqtest;
    715
Note: See TracChangeset for help on using the changeset viewer.