Summer Qin | 9c1fba1 | 2020-08-12 15:49:12 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2020, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __ARCH_H__ |
| 9 | #define __ARCH_H__ |
| 10 | |
| 11 | /* |
| 12 | * This function pointer is meant to only hold non secure function pointers. |
| 13 | * It will be turned into a non-secure one (LSB cleared) before being called |
| 14 | * whatever happens anyway (unless cast to another function pointer type). |
| 15 | * Registers will be cleared before branching so that no information leaks |
| 16 | * from secure to non-secure world. |
| 17 | */ |
| 18 | typedef void (*nsfptr_t) (void) __attribute__((cmse_nonsecure_call)); |
| 19 | |
| 20 | extern nsfptr_t ns_entry; |
| 21 | |
| 22 | /** |
| 23 | * \brief Jump to non-secure code. |
| 24 | */ |
| 25 | void jump_to_ns_code(void); |
| 26 | |
| 27 | #endif /* __ARCH_H__ */ |