blob: 964ddf7f6aff3c71bc1405df0e548a80f5c47710 [file] [log] [blame]
Summer Qin9c1fba12020-08-12 15:49:12 +08001/*
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 */
18typedef void (*nsfptr_t) (void) __attribute__((cmse_nonsecure_call));
19
20extern nsfptr_t ns_entry;
21
22/**
23 * \brief Jump to non-secure code.
24 */
25void jump_to_ns_code(void);
26
27#endif /* __ARCH_H__ */