]> gcc.gnu.org Git - gcc.git/commitdiff
ada: Define CHERI exception types
authorDaniel King <dmking@adacore.com>
Tue, 12 Sep 2023 09:25:28 +0000 (10:25 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 26 Sep 2023 11:43:17 +0000 (13:43 +0200)
These exception types map to the CHERI hardware exceptions that are
triggered due to misuse of capabilities.

gcc/ada/

* libgnat/i-cheri.ads (Capability_Bound_Error)
(Capability_Permission_Error, Capability_Sealed_Error)
(Capability_Tag_Error): New, define CHERI exception types.

gcc/ada/libgnat/i-cheri.ads

index 547b033dbaf418ef32e196ebcaa6309e244f3b54..80985212589d413751fd849be49764684dcf2f83 100644 (file)
@@ -467,4 +467,20 @@ is
      External_Name => "__builtin_cheri_stack_get";
    --  Get the Capability Stack Pointer (CSP)
 
+   ---------------------------
+   -- Capability Exceptions --
+   ---------------------------
+
+   Capability_Bound_Error : exception;
+   --  An out-of-bounds access was attempted
+
+   Capability_Permission_Error : exception;
+   --  An attempted access exceeded the permissions granted by a capability
+
+   Capability_Sealed_Error : exception;
+   --  A sealed capability was dereferenced
+
+   Capability_Tag_Error : exception;
+   --  An invalid capability was dereferenced
+
 end Interfaces.CHERI;
This page took 0.060564 seconds and 5 git commands to generate.