PowerAda 137

From OC Systems Wiki!
Jump to: navigation, search

(137) Interrupts to which a task entry may be attached.

See J.7.1(12).

PowerAda supports interrupt task entries. In AIX, signals are equivalent to interrupts. A task entry may be associated with a single AIX signal, by providing an address clause for the entry. The proper interrupt entry addresses for each POSIX signal is provided in the package Ada.Interrupts.Names as follows:

Ada.Interrupts.Names

PACKAGE Ada.Interrupts.Names IS
  SIGHUP  : CONSTANT Interrupt_ID := 01;
  SIGINT  : CONSTANT Interrupt_ID := 02;
  SIGQUIT : CONSTANT Interrupt_ID := 03;
  SIGILL  : CONSTANT Interrupt_ID := 04;  
        -- reserved by Ada runtime
  SIGTRAP : CONSTANT Interrupt_ID := 05;  
        -- reserved by Ada runtime
  SIGABRT : CONSTANT Interrupt_ID := 06;
  SIGEMT  : CONSTANT Interrupt_ID := 07;  
        -- reserved by Ada runtime
  SIGFPE  : CONSTANT Interrupt_ID := 08;  
        -- reserved by Ada runtime
  SIGKILL : CONSTANT Interrupt_ID := 09;  -- cannot attach
  SIGBUS  : CONSTANT Interrupt_ID := 10;  
        -- reserved by Ada runtime
  SIGSEGV : CONSTANT Interrupt_ID := 11;  
        -- reserved by Ada runtime
  SIGSYS  : CONSTANT Interrupt_ID := 12;
  SIGPIPE : CONSTANT Interrupt_ID := 13;
  SIGALRM : CONSTANT Interrupt_ID := 14;  
        -- reserved by Ada runtime
  SIGTERM : CONSTANT Interrupt_ID := 15;
  SIGURG  : CONSTANT Interrupt_ID := 16;
  SIGSTOP : CONSTANT Interrupt_ID := 17;  -- cannot attach
  SIGTSTP : CONSTANT Interrupt_ID := 18;
  SIGCONT : CONSTANT Interrupt_ID := 19;  -- cannot be blocked
  SIGCHLD : CONSTANT Interrupt_ID := 20;
  SIGTTIN : CONSTANT Interrupt_ID := 21;
  SIGTTOU : CONSTANT Interrupt_ID := 22;
  SIGIO: CONSTANT Interrupt_ID := 23;
  SIGXCPU : CONSTANT Interrupt_ID := 24;
  SIGXFSZ : CONSTANT Interrupt_ID := 25;
  SIGMSG  : CONSTANT Interrupt_ID := 27;
  SIGWINCH: CONSTANT Interrupt_ID := 28;
  SIGPWR  : CONSTANT Interrupt_ID := 29;
  SIGUSR1 : CONSTANT Interrupt_ID := 30;
  SIGUSR2 : CONSTANT Interrupt_ID := 31;
  SIGPROF : CONSTANT Interrupt_ID := 32;
  SIGDANGER  : CONSTANT Interrupt_ID := 33;
  SIGVTALRM  : CONSTANT Interrupt_ID := 34;
  SIGMIGRATE : CONSTANT Interrupt_ID := 35;
  SIGPRE  : CONSTANT Interrupt_ID := 36;
  SIGVIRT : CONSTANT Interrupt_ID := 37;
  SIGALRM1: CONSTANT Interrupt_ID := 38;
  SIGWAITING : CONSTANT Interrupt_ID := 39;
  SIGKAP  : CONSTANT Interrupt_ID := 60;
  SIGGRANT: CONSTANT Interrupt_ID := SIGKAP;
  SIGRETRACT : CONSTANT Interrupt_ID := 61;
  SIGSOUND: CONSTANT Interrupt_ID := 62;
  SIGSAK  : CONSTANT Interrupt_ID := 63;
END Ada.Interrupts.Names;

The subprogram Ada.Interrupts.Reference can be used to convert the Interrupt_Id to a System.Address for use in an interrupt entry address clause. For example, to declare an interrupt entry to handle the SIGINT interrupt signal:

entry HANDLE_INTERRUPT_REQUEST;
        for HANDLE_INTERRUPT_REQUEST use at 
        ADA.INTERRUPTS.REFERENCE(ADA.INTERRUPTS.NAMES.SIGINT);