aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorDaniel King <dmking@adacore.com>2023-09-12 10:25:28 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-09-26 13:43:17 +0200
commit08ba004510a8f110316b2aa4f43c848ea85ee908 (patch)
treea7ccb1d73d1e7d4066915d3e3ae42585445095fa /gcc/ada
parent4a91264af429ed84f0e06d6766a316ef29420521 (diff)
downloadgcc-08ba004510a8f110316b2aa4f43c848ea85ee908.zip
gcc-08ba004510a8f110316b2aa4f43c848ea85ee908.tar.gz
gcc-08ba004510a8f110316b2aa4f43c848ea85ee908.tar.bz2
ada: Define CHERI exception types
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.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/libgnat/i-cheri.ads16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/libgnat/i-cheri.ads b/gcc/ada/libgnat/i-cheri.ads
index 547b033..8098521 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;