From 3ff4a2e1279ba14443c4f2585bd170b95d9bf90a Mon Sep 17 00:00:00 2001 From: Daniel King Date: Tue, 8 Oct 2024 13:56:20 +0100 Subject: [PATCH] Update references to CHERI exceptions Issue: eng/toolchain/gnat#1082 --- aarch64/morello/README | 16 ++++++++-------- src/s-bbcppr__morello.adb | 1 + support/rts_sources/sources.py | 6 +++++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/aarch64/morello/README b/aarch64/morello/README index e9ec134c..1252a9a0 100644 --- a/aarch64/morello/README +++ b/aarch64/morello/README @@ -277,14 +277,14 @@ processor exceptions when a run-time check fails. The Morello runtimes handle these exceptions and raise one of the following Ada exceptions in response at the source location where the exception occurred: -* `Interfaces.CHERI.Capability_Bound_Error` is raised when an out-of-bounds - access was attempted. -* `Interfaces.CHERI.Capability_Permission_Error` is raised when an attempted - access exceeds the permissions granted by a capability. -* `Interfaces.CHERI.Capability_Sealed_Error` is raised when a sealed capability - was dereferenced. -* `Interfaces.CHERI.Capability_Tag_Error` is raised when an invalid capability - was dereferenced. +* `Interfaces.CHERI.Exceptions.Capability_Bound_Error` is raised when an + out-of-bounds access was attempted. +* `Interfaces.CHERI.Exceptions.Capability_Permission_Error` is raised when an + attempted access exceeds the permissions granted by a capability. +* `Interfaces.CHERI.Exceptions.Capability_Sealed_Error` is raised when a sealed + capability was dereferenced. +* `Interfaces.CHERI.Exceptions.Capability_Tag_Error` is raised when an invalid + capability was dereferenced. The embedded runtimes support exception propagation and allow these exceptions to be caught and handled like regular Ada exceptions. The light and diff --git a/src/s-bbcppr__morello.adb b/src/s-bbcppr__morello.adb index 1f55ad97..48c599e6 100644 --- a/src/s-bbcppr__morello.adb +++ b/src/s-bbcppr__morello.adb @@ -46,6 +46,7 @@ with System.BB.Board_Support; with Interfaces; with Interfaces.AArch64; use Interfaces.AArch64; with Interfaces.CHERI; use Interfaces.CHERI; +with Interfaces.CHERI.Exceptions; use Interfaces.CHERI.Exceptions; package body System.BB.CPU_Primitives is use System.BB.Threads; diff --git a/support/rts_sources/sources.py b/support/rts_sources/sources.py index d231d58a..d96afcaf 100644 --- a/support/rts_sources/sources.py +++ b/support/rts_sources/sources.py @@ -348,7 +348,11 @@ }, "common/cheri": { "conditions": ["Has_CHERI:yes"], - "srcs": ["libgnat/i-cheri.ads", "libgnat/i-cheri.adb"], + "srcs": [ + "libgnat/i-cheri.ads", + "libgnat/i-cheri.adb", + "libgnat/i-cheri-exceptions.ads", + ], }, "light": { "conditions": ["RTS_Profile:light,light-tasking,cert"],