public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] RTEMS: use hardware interrupts instead of signals for interrupt handling
@ 2021-10-11 13:39 Pierre-Marie de Rodat
  2021-11-26 13:59 ` Sebastian Huber
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre-Marie de Rodat @ 2021-10-11 13:39 UTC (permalink / raw)
  To: gcc-patches; +Cc: Patrick Bernardi

[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]

RTEMS supports attaching interrupt handlers to hardware interrupt
vectors, which is superior to the current approach of attaching handlers
to signals.  Direct attachment of handlers removes the execution
overhead of converting hardware interrupts to signals and their
subsequent propagation to the interrupt manager. It also removes the
limitation of the number of hardware interrupts that can be supported
under the signals model, as RTEMS is limited to 32 signals.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* Makefile.rtl (VxWorks): Rename s-inmaop__vxworks.adb to
	s-inmaop__hwint.adb.
	(RTEMS): Use s-inmaop__hwint.adb, s-intman__rtems.adb/s,
	s-taprop__rtems.adb.
	* libgnarl/a-intnam__rtems.ads: Remove signals definitions and
	replace with Hardware_Interrupts.
	* libgnarl/s-inmaop__vxworks.adb: Rename as...
	* libgnarl/s-inmaop__hwint.adb: ... this.
	* libgnarl/s-interr__hwint.adb: Remove unnecessary comments.
	* libgnarl/s-intman__rtems.ads, libgnarl/s-intman__rtems.adb:
	New files.
	* libgnarl/s-osinte__rtems.adb: Add RTEMS API bindings.
	(Binary_Semaphore_Create, Binary_Semaphore_Delete,
	Binary_Semaphore_Obtain, Binary_Semaphore_Release,
	Binary_Semaphore_Flush, Interrupt_Connect,
	Interrupt_Number_To_Vector): New functions.
	* libgnarl/s-osinte__rtems.ads (Num_HW_Interrupts, Signal):
	Removed.
	(NSIG, Interrupt_Range): New.
	(Binary_Semaphore_Create, Binary_Semaphore_Delete,
	Binary_Semaphore_Obtain, Binary_Semaphore_Release,
	Binary_Semaphore_Flush, Interrupt_Connect,
	Interrupt_Number_To_Vector): Remove Import pragma.
	* libgnarl/s-taprop__rtems.adb: New file.

[-- Attachment #2: patch.diff.gz --]
[-- Type: application/gzip, Size: 14626 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Ada] RTEMS: use hardware interrupts instead of signals for interrupt handling
  2021-10-11 13:39 [Ada] RTEMS: use hardware interrupts instead of signals for interrupt handling Pierre-Marie de Rodat
@ 2021-11-26 13:59 ` Sebastian Huber
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Huber @ 2021-11-26 13:59 UTC (permalink / raw)
  To: Pierre-Marie de Rodat, gcc-patches; +Cc: Patrick Bernardi

Hello Pierre-Marie,

On 11/10/2021 15:39, Pierre-Marie de Rodat via Gcc-patches wrote:
> RTEMS supports attaching interrupt handlers to hardware interrupt
> vectors, which is superior to the current approach of attaching handlers
> to signals.  Direct attachment of handlers removes the execution
> overhead of converting hardware interrupts to signals and their
> subsequent propagation to the interrupt manager. It also removes the
> limitation of the number of hardware interrupts that can be supported
> under the signals model, as RTEMS is limited to 32 signals.
> 
> Tested on x86_64-pc-linux-gnu, committed on trunk

for Newlib internal locks, the OpenMP library (libgomp), and the C++ 
standard library we use self-contained synchronization objects for RTEMS 
defined by <sys/_lock.h> which is provided by Newlib:

https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/sys/rtems/include/sys/lock.h;h=d6169025b1a0d10ded0e31982baff64453e69cae;hb=HEAD

Binary and counting semaphores are supported, for example:

void _Semaphore_Post_binary(struct _Semaphore_Control *);

Using this interface has the benefit that the storage for the 
synchronization objects is user-provided. So, there is no need to 
account for these objects in the configuration.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-26 14:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 13:39 [Ada] RTEMS: use hardware interrupts instead of signals for interrupt handling Pierre-Marie de Rodat
2021-11-26 13:59 ` Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).