Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 1 | /* |
Jayanth Dodderi Chidanand | 118b335 | 2024-06-18 15:22:54 +0100 | [diff] [blame] | 2 | * Copyright (c) 2021-2024, Arm Limited. All rights reserved. |
Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef TRF_H |
| 8 | #define TRF_H |
| 9 | |
Jayanth Dodderi Chidanand | 118b335 | 2024-06-18 15:22:54 +0100 | [diff] [blame] | 10 | #include <context.h> |
| 11 | |
Jayanth Dodderi Chidanand | 77b8b87 | 2023-03-01 15:35:28 +0000 | [diff] [blame] | 12 | #if ENABLE_TRF_FOR_NS |
Jayanth Dodderi Chidanand | 118b335 | 2024-06-18 15:22:54 +0100 | [diff] [blame] | 13 | |
| 14 | #if __aarch64__ |
| 15 | void trf_enable(cpu_context_t *ctx); |
Boyan Karatotev | 6468d4a | 2023-02-16 15:12:45 +0000 | [diff] [blame] | 16 | void trf_init_el2_unused(void); |
Jayanth Dodderi Chidanand | 118b335 | 2024-06-18 15:22:54 +0100 | [diff] [blame] | 17 | #else /* !__aarch64 */ |
| 18 | void trf_init_el3(void); |
| 19 | #endif /* __aarch64__ */ |
| 20 | |
| 21 | #else /* ENABLE_TRF_FOR_NS=0 */ |
| 22 | |
| 23 | #if __aarch64__ |
| 24 | static inline void trf_enable(cpu_context_t *ctx) |
Boyan Karatotev | 6468d4a | 2023-02-16 15:12:45 +0000 | [diff] [blame] | 25 | { |
| 26 | } |
| 27 | static inline void trf_init_el2_unused(void) |
Jayanth Dodderi Chidanand | 77b8b87 | 2023-03-01 15:35:28 +0000 | [diff] [blame] | 28 | { |
| 29 | } |
Jayanth Dodderi Chidanand | 118b335 | 2024-06-18 15:22:54 +0100 | [diff] [blame] | 30 | #else /* !__aarch64 */ |
| 31 | static inline void trf_init_el3(void) |
| 32 | { |
| 33 | } |
| 34 | #endif /* __aarch64__*/ |
| 35 | |
Jayanth Dodderi Chidanand | 77b8b87 | 2023-03-01 15:35:28 +0000 | [diff] [blame] | 36 | #endif /* ENABLE_TRF_FOR_NS */ |
Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 37 | |
| 38 | #endif /* TRF_H */ |