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