Raef Coles | 237af69 | 2022-07-20 10:36:43 +0100 | [diff] [blame] | 1 | /* |
Sherry Zhang | 8faae45 | 2023-02-13 14:53:51 +0800 | [diff] [blame^] | 2 | * Copyright (c) 2020-2023, Arm Limited. All rights reserved. |
Raef Coles | 237af69 | 2022-07-20 10:36:43 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /* Interop between TF-M fih.h and mcuboot fault_injection_hardening.h, so that |
| 9 | * platform code can target fih.h and for bl2 this will be redirected to |
| 10 | * fault_injection_hardening.h |
| 11 | */ |
| 12 | |
| 13 | #ifndef __INTEROP_FIH_H__ |
| 14 | #define __INTEROP_FIH_H__ |
| 15 | |
| 16 | #ifdef __cplusplus |
| 17 | extern "C" { |
| 18 | #endif /* __cplusplus */ |
| 19 | |
| 20 | #include "stdint.h" |
| 21 | |
Raef Coles | 237af69 | 2022-07-20 10:36:43 +0100 | [diff] [blame] | 22 | /* |
Sherry Zhang | 8faae45 | 2023-02-13 14:53:51 +0800 | [diff] [blame^] | 23 | * FIH return type macro changes the function return types to fih_ret. |
Raef Coles | 237af69 | 2022-07-20 10:36:43 +0100 | [diff] [blame] | 24 | * All functions that need to be protected by FIH and called via FIH_CALL must |
Sherry Zhang | 8faae45 | 2023-02-13 14:53:51 +0800 | [diff] [blame^] | 25 | * return a fih_ret type. |
Raef Coles | 237af69 | 2022-07-20 10:36:43 +0100 | [diff] [blame] | 26 | */ |
Sherry Zhang | 8faae45 | 2023-02-13 14:53:51 +0800 | [diff] [blame^] | 27 | #define FIH_RET_TYPE(type) fih_ret |
Raef Coles | 237af69 | 2022-07-20 10:36:43 +0100 | [diff] [blame] | 28 | |
| 29 | #include "bootutil/fault_injection_hardening.h" |
| 30 | |
Raef Coles | 237af69 | 2022-07-20 10:36:43 +0100 | [diff] [blame] | 31 | #ifdef __cplusplus |
| 32 | } |
| 33 | #endif /* __cplusplus */ |
| 34 | |
| 35 | #endif /* __INTEROP_FIH_H__ */ |