From: Daniel King Date: Tue, 12 Sep 2023 09:25:28 +0000 (+0100) Subject: ada: Define CHERI exception types X-Git-Tag: basepoints/gcc-15~5871 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08ba004510a8f110316b2aa4f43c848ea85ee908;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/ada/libgnat/i-cheri.ads b/gcc/ada/libgnat/i-cheri.ads index 547b033dbaf4..80985212589d 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;