Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/cmsis-core/tz_context.h@0:01f31e923fe2, 2020-04-07 (annotated)
- Committer:
- Pawel Zarembski
- Date:
- Tue Apr 07 12:55:42 2020 +0200
- Revision:
- 0:01f31e923fe2
hani: DAPLink with reset workaround
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pawel Zarembski |
0:01f31e923fe2 | 1 | /****************************************************************************** |
Pawel Zarembski |
0:01f31e923fe2 | 2 | * @file tz_context.h |
Pawel Zarembski |
0:01f31e923fe2 | 3 | * @brief Context Management for Armv8-M TrustZone |
Pawel Zarembski |
0:01f31e923fe2 | 4 | * @version V1.0.1 |
Pawel Zarembski |
0:01f31e923fe2 | 5 | * @date 10. January 2018 |
Pawel Zarembski |
0:01f31e923fe2 | 6 | ******************************************************************************/ |
Pawel Zarembski |
0:01f31e923fe2 | 7 | /* |
Pawel Zarembski |
0:01f31e923fe2 | 8 | * Copyright (c) 2017-2018 Arm Limited. All rights reserved. |
Pawel Zarembski |
0:01f31e923fe2 | 9 | * |
Pawel Zarembski |
0:01f31e923fe2 | 10 | * SPDX-License-Identifier: Apache-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 11 | * |
Pawel Zarembski |
0:01f31e923fe2 | 12 | * Licensed under the Apache License, Version 2.0 (the License); you may |
Pawel Zarembski |
0:01f31e923fe2 | 13 | * not use this file except in compliance with the License. |
Pawel Zarembski |
0:01f31e923fe2 | 14 | * You may obtain a copy of the License at |
Pawel Zarembski |
0:01f31e923fe2 | 15 | * |
Pawel Zarembski |
0:01f31e923fe2 | 16 | * www.apache.org/licenses/LICENSE-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 17 | * |
Pawel Zarembski |
0:01f31e923fe2 | 18 | * Unless required by applicable law or agreed to in writing, software |
Pawel Zarembski |
0:01f31e923fe2 | 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
Pawel Zarembski |
0:01f31e923fe2 | 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Pawel Zarembski |
0:01f31e923fe2 | 21 | * See the License for the specific language governing permissions and |
Pawel Zarembski |
0:01f31e923fe2 | 22 | * limitations under the License. |
Pawel Zarembski |
0:01f31e923fe2 | 23 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 24 | |
Pawel Zarembski |
0:01f31e923fe2 | 25 | #if defined ( __ICCARM__ ) |
Pawel Zarembski |
0:01f31e923fe2 | 26 | #pragma system_include /* treat file as system include file for MISRA check */ |
Pawel Zarembski |
0:01f31e923fe2 | 27 | #elif defined (__clang__) |
Pawel Zarembski |
0:01f31e923fe2 | 28 | #pragma clang system_header /* treat file as system include file */ |
Pawel Zarembski |
0:01f31e923fe2 | 29 | #endif |
Pawel Zarembski |
0:01f31e923fe2 | 30 | |
Pawel Zarembski |
0:01f31e923fe2 | 31 | #ifndef TZ_CONTEXT_H |
Pawel Zarembski |
0:01f31e923fe2 | 32 | #define TZ_CONTEXT_H |
Pawel Zarembski |
0:01f31e923fe2 | 33 | |
Pawel Zarembski |
0:01f31e923fe2 | 34 | #include <stdint.h> |
Pawel Zarembski |
0:01f31e923fe2 | 35 | |
Pawel Zarembski |
0:01f31e923fe2 | 36 | #ifndef TZ_MODULEID_T |
Pawel Zarembski |
0:01f31e923fe2 | 37 | #define TZ_MODULEID_T |
Pawel Zarembski |
0:01f31e923fe2 | 38 | /// \details Data type that identifies secure software modules called by a process. |
Pawel Zarembski |
0:01f31e923fe2 | 39 | typedef uint32_t TZ_ModuleId_t; |
Pawel Zarembski |
0:01f31e923fe2 | 40 | #endif |
Pawel Zarembski |
0:01f31e923fe2 | 41 | |
Pawel Zarembski |
0:01f31e923fe2 | 42 | /// \details TZ Memory ID identifies an allocated memory slot. |
Pawel Zarembski |
0:01f31e923fe2 | 43 | typedef uint32_t TZ_MemoryId_t; |
Pawel Zarembski |
0:01f31e923fe2 | 44 | |
Pawel Zarembski |
0:01f31e923fe2 | 45 | /// Initialize secure context memory system |
Pawel Zarembski |
0:01f31e923fe2 | 46 | /// \return execution status (1: success, 0: error) |
Pawel Zarembski |
0:01f31e923fe2 | 47 | uint32_t TZ_InitContextSystem_S (void); |
Pawel Zarembski |
0:01f31e923fe2 | 48 | |
Pawel Zarembski |
0:01f31e923fe2 | 49 | /// Allocate context memory for calling secure software modules in TrustZone |
Pawel Zarembski |
0:01f31e923fe2 | 50 | /// \param[in] module identifies software modules called from non-secure mode |
Pawel Zarembski |
0:01f31e923fe2 | 51 | /// \return value != 0 id TrustZone memory slot identifier |
Pawel Zarembski |
0:01f31e923fe2 | 52 | /// \return value 0 no memory available or internal error |
Pawel Zarembski |
0:01f31e923fe2 | 53 | TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); |
Pawel Zarembski |
0:01f31e923fe2 | 54 | |
Pawel Zarembski |
0:01f31e923fe2 | 55 | /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S |
Pawel Zarembski |
0:01f31e923fe2 | 56 | /// \param[in] id TrustZone memory slot identifier |
Pawel Zarembski |
0:01f31e923fe2 | 57 | /// \return execution status (1: success, 0: error) |
Pawel Zarembski |
0:01f31e923fe2 | 58 | uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); |
Pawel Zarembski |
0:01f31e923fe2 | 59 | |
Pawel Zarembski |
0:01f31e923fe2 | 60 | /// Load secure context (called on RTOS thread context switch) |
Pawel Zarembski |
0:01f31e923fe2 | 61 | /// \param[in] id TrustZone memory slot identifier |
Pawel Zarembski |
0:01f31e923fe2 | 62 | /// \return execution status (1: success, 0: error) |
Pawel Zarembski |
0:01f31e923fe2 | 63 | uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); |
Pawel Zarembski |
0:01f31e923fe2 | 64 | |
Pawel Zarembski |
0:01f31e923fe2 | 65 | /// Store secure context (called on RTOS thread context switch) |
Pawel Zarembski |
0:01f31e923fe2 | 66 | /// \param[in] id TrustZone memory slot identifier |
Pawel Zarembski |
0:01f31e923fe2 | 67 | /// \return execution status (1: success, 0: error) |
Pawel Zarembski |
0:01f31e923fe2 | 68 | uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); |
Pawel Zarembski |
0:01f31e923fe2 | 69 | |
Pawel Zarembski |
0:01f31e923fe2 | 70 | #endif // TZ_CONTEXT_H |