feat: introduce SError exception handler
Introduce SError exception handler along with support to register a
custom handler. The default behaviour is same as before if no handler
is registered.
This patch will allow tests to do a graceful exit after handling an
SError.
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Idbe37d3690e3a8e08fa3b0dff496d18d3022a8fc
diff --git a/include/lib/aarch64/serror.h b/include/lib/aarch64/serror.h
new file mode 100644
index 0000000..ac25f87
--- /dev/null
+++ b/include/lib/aarch64/serror.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2023, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef __SERROR_H__
+#define __SERROR_H__
+
+typedef bool (*exception_handler_t)(void);
+void register_custom_serror_handler(exception_handler_t handler);
+void unregister_custom_serror_handler(void);
+
+#endif /* __SERROR_H__ */