[COMMITTED] ada: Define CHERI exception types
Checks
Commit Message
From: Daniel King <dmking@adacore.com>
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.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/libgnat/i-cheri.ads | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
@@ -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;