This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Fix ACATS cxc3001 on VxWorks


Manually tested on vxworks,
Tested on i686-linux, committed on trunk

On VxWorks, interrupts can't be deconnected (ie there is no counter part to
intConnect).  Thus we connect our internal handler only once and make it
a no-op if the Ada handler is detached.

See cxc3001 for a testcase.

Also fix handling of interrupt handlers when using the Ravenscar profile:
When using the regular run times and the Ravenscar profile restrictions,
expansion of protected handlers generated a call to Install_Handlers with
a wrong parameters list.

This patch avoids this problem by using a simpler run-time subprogram to
install handlers when the Ravenscar restrictions are in effect. This new
subprogram does not need to store previously installed handlers since only
library-level protected handlers are allowed in Ravenscar, and these are
installed at initialization and never be replaced. The following spec must
compile without errors (on platforms where SIGTERM exists):

pragma Profile (Ravenscar);
with Ada.Interrupts.Names;
package Handler is
   protected PO is
      procedure P;
      pragma Attach_Handler (P, Ada.Interrupts.Names.SIGTERM);
      entry E;
   private
      Barrier : Boolean := False;
   end PO;
end Handler;

2008-04-08  Jose Ruiz  <ruiz@adacore.com>
	    Tristan Gingold  <gingold@adacore.com>

	* s-interr-dummy.adb, s-interr-vms.adb, s-interr-sigaction.adb
	(Install_Restricted_Handlers): New procedure
	which is a simplified version of Install_Handlers that does not store
	previously installed.

	* s-interr-vxworks.adb: Fix ACATS cxc3001
	On VxWorks interrupts can't be detached.
	(Install_Restricted_Handlers): New procedure.

	* s-interr.ads, s-interr.adb (Install_Restricted_Handlers): New
	procedure.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]