From 870ce4d51bfe22b2c86fd5ee9fa2e5f4642cd572 Mon Sep 17 00:00:00 2001 From: Ed Falis Date: Thu, 13 Oct 2016 12:57:16 +0000 Subject: [PATCH] * i-vxinco.adb, i-vxinco.ads: New files. From-SVN: r241114 --- gcc/ada/ChangeLog | 1 + gcc/ada/i-vxinco.adb | 48 +++++++++++++++++++++++++++++++++++++ gcc/ada/i-vxinco.ads | 56 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 gcc/ada/i-vxinco.adb create mode 100644 gcc/ada/i-vxinco.ads diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2b70994eb38..7ea6b94515f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -16,6 +16,7 @@ 2016-10-13 Ed Falis + * i-vxinco.adb, i-vxinco.ads: New files. * impunit.adb: add i-vxinco.ads. * s-interr-vxworks.adb: add hook for user interrupt connection routine. diff --git a/gcc/ada/i-vxinco.adb b/gcc/ada/i-vxinco.adb new file mode 100644 index 00000000000..6418af13cd4 --- /dev/null +++ b/gcc/ada/i-vxinco.adb @@ -0,0 +1,48 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- +-- -- +-- I N T E R F A C E S . V X W O R K S . I N T _ C O N N E C T I O N -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2016, AdaCore +-- -- +-- GNARL is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- +-- -- +-- GNARL was developed by the GNARL team at Florida State University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +package body Interfaces.VxWorks.Int_Connection is + + Connection_Routine : Interrupt_Connector; + pragma Import (C, Connection_Routine, "__gnat_user_int_connect"); + -- Declared in System.Interrupts. Defaults to the standard OS connector in + -- System.OS_Interface (or Interfaces.VxWorks for restricted runtimes). + + ------------- + -- Connect -- + ------------- + + procedure Connect (Connector : Interrupt_Connector) is + begin + Connection_Routine := Connector; + end Connect; + +end Interfaces.VxWorks.Int_Connection; diff --git a/gcc/ada/i-vxinco.ads b/gcc/ada/i-vxinco.ads new file mode 100644 index 00000000000..04ae6cfe0a4 --- /dev/null +++ b/gcc/ada/i-vxinco.ads @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- +-- -- +-- I N T E R F A C E S . V X W O R K S . I N T _ C O N N E C T I O N -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2016, AdaCore +-- -- +-- GNARL is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- +-- -- +-- GNARL was developed by the GNARL team at Florida State University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package provides users with the ability to use a custom routine for +-- connecting hardware interrupts for VxWorks environments that support the +-- capability to handle them. The custom routine must have the same profile +-- as the VxWorks intConnect() routine. + +with System; + +package Interfaces.VxWorks.Int_Connection is + + type Interrupt_Connector is access function + (Vector : Interrupt_Vector; + Handler : VOIDFUNCPTR; + Parameter : System.Address := System.Null_Address) return STATUS; + pragma Convention (C, Interrupt_Connector); + -- Convention C for compatibility with intConnect(). User alternatives are + -- likely to be imports of C routines anyway. + + procedure Connect (Connector : Interrupt_Connector); + -- Set user-defined interrupt connection routine. Must precede calls to + -- Ada.Interrupts.Attach_Handler, or the default connector from + -- System.OS_Interface (or Interfaces.VxWorks for Ravenscar Cert) will be + -- used. Can be called multiple times to change the connection routine for + -- subsequent calls to Attach_Handler. + +end Interfaces.VxWorks.Int_Connection; -- 2.30.2