* [COMMITTED] ada: Define CHERI exception types
@ 2023-09-26 11:46 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-09-26 11:46 UTC (permalink / raw)
To: gcc-patches; +Cc: Daniel King
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(+)
diff --git a/gcc/ada/libgnat/i-cheri.ads b/gcc/ada/libgnat/i-cheri.ads
index 547b033dbaf..80985212589 100644
--- a/gcc/ada/libgnat/i-cheri.ads
+++ b/gcc/ada/libgnat/i-cheri.ads
@@ -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;
--
2.42.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-09-26 11:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-26 11:46 [COMMITTED] ada: Define CHERI exception types Marc Poulhiès
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).