Manish Pandey | d648077 | 2023-02-27 13:23:06 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 12 | static exception_handler_t custom_serror_handler; |
| 13 | |
| 14 | void register_custom_serror_handler(exception_handler_t handler) |
| 15 | { |
| 16 | custom_serror_handler = handler; |
| 17 | } |
| 18 | |
| 19 | void unregister_custom_serror_handler(void) |
| 20 | { |
| 21 | custom_serror_handler = NULL; |
| 22 | } |
| 23 | |
| 24 | bool tftf_serror_handler(void) |
| 25 | { |
| 26 | if (custom_serror_handler == NULL) { |
| 27 | return false; |
| 28 | } |
| 29 | |
| 30 | return custom_serror_handler(); |
| 31 | } |