Package: Interfaces.VxWorks

Dependencies

with Interfaces.C;
with System;

Description

This package provides a limited binding to the VxWorks API In particular, it interfaces with the VxWorks hardware interrupt facilities For a complete documentation on these operations, please consult your VxWorks Reference Manual.

Header

package Interfaces.VxWorks is
 
pragma Preelaborate (VxWorks);

Here is a complete example that shows how to handle the Interrupt 18 in Ada using this package:

Type Summary

Exception_Vector derived from Address
Inherited Operations:  "<", "<=", "=", ">", ">="
Interrupt_Vector derived from Address
New Operations:  intConnect, INUM_TO_IVEC, sysBusIntGen
Inherited Operations:  "<", "<=", "=", ">", ">="
STATUS derived from int
VOIDFUNCPTR

Constants and Named Numbers

ERROR : constant STATUS := -1;
OK : constant STATUS := 0;

Other Items:

package IC renames Interfaces.C;

subtype int is IC.int;

type STATUS is new int;
Equivalent of the C type STATUS

type VOIDFUNCPTR is access procedure (parameter : System.Address);

type Interrupt_Vector is new System.Address;

type Exception_Vector is new System.Address;

function intConnect
  (vector    : Interrupt_Vector;
   handler   : VOIDFUNCPTR;
   parameter : System.Address := System.Null_Address) return STATUS;
Binding to the C routine intConnect.

function INUM_TO_IVEC (intNum : int) return Interrupt_Vector;
Equivalent to the C macro INUM_TO_IVEC used to convert an interrupt number to an interrupt vector

function sysIntEnable (intLevel : int) return STATUS;
Binding to the C routine sysIntEnable

function sysIntDisable (intLevel : int) return STATUS;
Binding to the C routine sysIntDisable

function sysBusIntAck (intLevel : int) return STATUS;
Binding to the C routine sysBusIntAck

function sysBusIntGen (intLevel : int; vector : Interrupt_Vector)
  return STATUS;
Binding to the C routine sysBusIntGen

procedure logMsg
  (fmt : String; arg1, arg2, arg3, arg4, arg5, arg6 : int := 0);
Binding to the C routine logMsg. Note that it is the caller responsibility to ensure that fmt is a null terminated string (e.g logMsg ("Interrupt" & ASCII.Nul))

private

   --  Implementation-defined ...
end Interfaces.VxWorks;