Mistake on this page?
Report an issue in GitHub or email us
tfm_internal.h
1 /*
2  * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #include "secure_utilities.h"
9 
10 #ifndef __TFM_INTERNAL_H__
11 #define __TFM_INTERNAL_H__
12 
13 /*
14  * This function pointer is meant to only hold non secure function pointers.
15  * It will be turned into a non-secure one (LSB cleared) before being called
16  * whatever happens anyway (unless cast to another function pointer type).
17  * Registers will be cleared before branching so that no information leaks
18  * from secure to non-secure world.
19  */
20 typedef void __attribute__((cmse_nonsecure_call)) (*nsfptr_t) (void);
21 
22 extern nsfptr_t ns_entry;
23 
24 /**
25  * \brief Signal that secure partition initialisation is finished
26  */
27 void tfm_secure_api_init_done(void);
28 
29 /**
30  * \brief Jumps to non-secure code.
31  */
32 void jump_to_ns_code(void);
33 
34 /**
35  * \brief Called if veneer is running in thread mode
36  */
37 uint32_t tfm_core_partition_request_svc_handler(
38  const uint32_t *svc_args, uint32_t lr);
39 
40 /**
41  * \brief Called when secure service returns
42  */
43 uint32_t tfm_core_partition_return_handler(uint32_t lr);
44 
45 /**
46  * \brief Called by secure service to check if client is secure
47  */
48 void tfm_core_validate_secure_caller_handler(const uint32_t svc_args[]);
49 
50 /**
51  * \brief Stores caller's client id in state context
52  */
53 void tfm_core_get_caller_client_id_handler(const uint32_t svc_args[]);
54 
55 /**
56  * \brief Checks if a secure service's access to a memory location is permitted
57  */
58 void tfm_core_memory_permission_check_handler(const uint32_t svc_args[]);
59 
60 /**
61  * \brief Handle an SPM request by a secure service
62  */
63 void tfm_core_spm_request_handler(const struct tfm_exc_stack_t *svc_ctx);
64 
65 /**
66  * \brief Check whether a buffer is ok for writing to by the privileged API
67  * function.
68  *
69  * This function checks whether the caller partition owns the buffer, can write
70  * to it, and the buffer has proper alignment.
71  *
72  * \param[in] partition_idx Partition index
73  * \param[in] start_addr The start address of the buffer
74  * \param[in] len The length of the buffer
75  * \param[in] alignment The expected alignment (in bits)
76  *
77  * \return 1 if the check passes, 0 otherwise.
78  *
79  * \note For a 0 long buffer the check fails.
80  */
81 int32_t tfm_core_check_buffer_access(uint32_t partition_idx,
82  void *start_addr,
83  size_t len,
84  uint32_t alignment);
85 
86 /**
87  * \brief Retrieve secure partition related data from shared memory area, which
88  * stores shared data between bootloader and runtime firmware.
89  *
90  * \param[in] args Pointer to stack frame, which carries input parameters.
91  */
92 void tfm_core_get_boot_data_handler(uint32_t args[]);
93 
94 /**
95  * \brief Validate the content of shared memory area, which stores the shared
96  * data between bootloader and runtime firmware.
97  */
98 void tfm_core_validate_boot_data(void);
99 
100 #endif /* __TFM_INTERNAL_H__ */
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.