]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: New pragma to default all interrupts to system.
authorDoug Rupp <rupp@adacore.com>
Sat, 3 Feb 2024 12:18:51 +0000 (04:18 -0800)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 20 Jun 2024 08:50:56 +0000 (10:50 +0200)
commit980fddd8d90c97d44074021c6121a8d134e6c88c
treefd29c4707f79cc1267d0210bb5f060a9656b9ea2
parent3a16f19777f882f98b6d901a81157779e898f636
ada: New pragma to default all interrupts to system.

New pragma Interrupts_System_By_Default defaults all interrupts/signals
to system (which will inhibit the installation of default signal handlers).
Note this changes the ALI format: it optionally adds an identifier to
the 'P' line (similar to pragma Unreserve_All_Interrupts). As per comment
in lib-writ spec regarding new modifiers, adding modifiers to the P line
is always safe. Also note this does not introduce a bootstrap problem
because the compiler and binder do not set the underlying _gl global nor
do they use this pragma.

gcc/ada/

* ali.ads (Interrupts_Default_To_System): New boolean.
(Interrupts_Default_To_System_Specified): New boolean.
* ali.adb (Interrupts_Default_To_System_Specified): Initialize.
(Interrupts_Default_To_System): Initialize.
(Scan_ALI): Processing for "ID".
* bindgen.adb: Coallesce comments on interrupt settings to ...
(Gen_Adainit): Import Interrupts_Default_To_System flag and set if
pragma specified.
(Gen_Output_File_Ada): Generate Local_Interrupt_States according
to pragma.
* init.c: ... here.
[vxworks] (__gnat_install_handler): Test for interrupt_state.
(__gl_interrupts_default_to_system): New global flag.
(__gnat_get_interrupt_State): return interrupt state according to
new global flag.
* lib-writ.ads: Document "ID".
* lib-writ.adb: Write out "ID".
* opt.ads (Interrupts_System_By_Default): New boolean, defaulted
to False.
* par-prag.adb (Pragma_Interrupts_System_By_Default): New.
* sem_prag.adb (Pragma_Interrupts_System_By_Default): Handle it.
(Pragma_Interrupts_System_By_Default): Default it.
* snames.ads-tmpl (Name_Interrupts_System_By_Default): New name.
(Pragma_Interrupts_System_By_Default): New
* libgnarl/s-intman__posix.adb (Initialize): Ensure the
Keep_Unmasked signal is sigset-able.
* doc/gnat_rm/implementation_defined_pragmas.rst: Document pragma
Interrupts_System_By_Default.
* doc/gnat_ugn/the_gnat_compilation_model.rst (Configuration
pragmas): Add Interrupts_System_By_Default. (Partition-Wide
Settings): Mention pragma Interrupts_System_By_Default.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
15 files changed:
gcc/ada/ali.adb
gcc/ada/ali.ads
gcc/ada/bindgen.adb
gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst
gcc/ada/gnat_rm.texi
gcc/ada/gnat_ugn.texi
gcc/ada/init.c
gcc/ada/lib-writ.adb
gcc/ada/lib-writ.ads
gcc/ada/libgnarl/s-intman__posix.adb
gcc/ada/opt.ads
gcc/ada/par-prag.adb
gcc/ada/sem_prag.adb
gcc/ada/snames.ads-tmpl