]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_Keil_STM32Cube/ST_Code/Drivers/CMSIS/Include/tz_context.h
Make vSetupTimerInterrupt weak in the RVDS M4 MPU port to give the
[freertos] / FreeRTOS / Demo / CORTEX_MPU_STM32L4_Discovery_Keil_STM32Cube / ST_Code / Drivers / CMSIS / Include / tz_context.h
1 /******************************************************************************\r
2  * @file     tz_context.h\r
3  * @brief    Context Management for Armv8-M TrustZone\r
4  * @version  V1.0.1\r
5  * @date     10. January 2018\r
6  ******************************************************************************/\r
7 /*\r
8  * Copyright (c) 2017-2018 Arm Limited. All rights reserved.\r
9  *\r
10  * SPDX-License-Identifier: Apache-2.0\r
11  *\r
12  * Licensed under the Apache License, Version 2.0 (the License); you may\r
13  * not use this file except in compliance with the License.\r
14  * You may obtain a copy of the License at\r
15  *\r
16  * www.apache.org/licenses/LICENSE-2.0\r
17  *\r
18  * Unless required by applicable law or agreed to in writing, software\r
19  * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r
20  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
21  * See the License for the specific language governing permissions and\r
22  * limitations under the License.\r
23  */\r
24 \r
25 #if   defined ( __ICCARM__ )\r
26   #pragma system_include         /* treat file as system include file for MISRA check */\r
27 #elif defined (__clang__)\r
28   #pragma clang system_header   /* treat file as system include file */\r
29 #endif\r
30 \r
31 #ifndef TZ_CONTEXT_H\r
32 #define TZ_CONTEXT_H\r
33  \r
34 #include <stdint.h>\r
35  \r
36 #ifndef TZ_MODULEID_T\r
37 #define TZ_MODULEID_T\r
38 /// \details Data type that identifies secure software modules called by a process.\r
39 typedef uint32_t TZ_ModuleId_t;\r
40 #endif\r
41  \r
42 /// \details TZ Memory ID identifies an allocated memory slot.\r
43 typedef uint32_t TZ_MemoryId_t;\r
44   \r
45 /// Initialize secure context memory system\r
46 /// \return execution status (1: success, 0: error)\r
47 uint32_t TZ_InitContextSystem_S (void);\r
48  \r
49 /// Allocate context memory for calling secure software modules in TrustZone\r
50 /// \param[in]  module   identifies software modules called from non-secure mode\r
51 /// \return value != 0 id TrustZone memory slot identifier\r
52 /// \return value 0    no memory available or internal error\r
53 TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);\r
54  \r
55 /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S\r
56 /// \param[in]  id  TrustZone memory slot identifier\r
57 /// \return execution status (1: success, 0: error)\r
58 uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);\r
59  \r
60 /// Load secure context (called on RTOS thread context switch)\r
61 /// \param[in]  id  TrustZone memory slot identifier\r
62 /// \return execution status (1: success, 0: error)\r
63 uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);\r
64  \r
65 /// Store secure context (called on RTOS thread context switch)\r
66 /// \param[in]  id  TrustZone memory slot identifier\r
67 /// \return execution status (1: success, 0: error)\r
68 uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);\r
69  \r
70 #endif  // TZ_CONTEXT_H\r