blob: 9c35712970b5fec2d953f5d404569ac361a4fd87 [file] [log] [blame]
Manish Pandeyd6480772023-02-27 13:23:06 +00001/*
2 * Copyright (c) 2023, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6#include <stdbool.h>
7
8#include <arch_helpers.h>
9#include <debug.h>
10#include <serror.h>
11
12static exception_handler_t custom_serror_handler;
13
14void register_custom_serror_handler(exception_handler_t handler)
15{
16 custom_serror_handler = handler;
17}
18
19void unregister_custom_serror_handler(void)
20{
21 custom_serror_handler = NULL;
22}
23
24bool tftf_serror_handler(void)
25{
26 if (custom_serror_handler == NULL) {
27 return false;
28 }
29
30 return custom_serror_handler();
31}