The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_SAKURAIO_EVB_01/tz_context.h@160:5571c4ff569f, 2018-01-17 (annotated)
- Committer:
- Anna Bridge
- Date:
- Wed Jan 17 16:13:02 2018 +0000
- Revision:
- 160:5571c4ff569f
- Child:
- 169:a7c7b631e539
mbed library. Release version 158
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Anna Bridge |
160:5571c4ff569f | 1 | /* |
Anna Bridge |
160:5571c4ff569f | 2 | * Copyright (c) 2015-2016 ARM Limited. All rights reserved. |
Anna Bridge |
160:5571c4ff569f | 3 | * |
Anna Bridge |
160:5571c4ff569f | 4 | * SPDX-License-Identifier: Apache-2.0 |
Anna Bridge |
160:5571c4ff569f | 5 | * |
Anna Bridge |
160:5571c4ff569f | 6 | * Licensed under the Apache License, Version 2.0 (the License); you may |
Anna Bridge |
160:5571c4ff569f | 7 | * not use this file except in compliance with the License. |
Anna Bridge |
160:5571c4ff569f | 8 | * You may obtain a copy of the License at |
Anna Bridge |
160:5571c4ff569f | 9 | * |
Anna Bridge |
160:5571c4ff569f | 10 | * www.apache.org/licenses/LICENSE-2.0 |
Anna Bridge |
160:5571c4ff569f | 11 | * |
Anna Bridge |
160:5571c4ff569f | 12 | * Unless required by applicable law or agreed to in writing, software |
Anna Bridge |
160:5571c4ff569f | 13 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
Anna Bridge |
160:5571c4ff569f | 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Anna Bridge |
160:5571c4ff569f | 15 | * See the License for the specific language governing permissions and |
Anna Bridge |
160:5571c4ff569f | 16 | * limitations under the License. |
Anna Bridge |
160:5571c4ff569f | 17 | * |
Anna Bridge |
160:5571c4ff569f | 18 | * ---------------------------------------------------------------------------- |
Anna Bridge |
160:5571c4ff569f | 19 | * |
Anna Bridge |
160:5571c4ff569f | 20 | * $Date: 21. September 2016 |
Anna Bridge |
160:5571c4ff569f | 21 | * $Revision: V1.0 |
Anna Bridge |
160:5571c4ff569f | 22 | * |
Anna Bridge |
160:5571c4ff569f | 23 | * Project: TrustZone for ARMv8-M |
Anna Bridge |
160:5571c4ff569f | 24 | * Title: Context Management for ARMv8-M TrustZone |
Anna Bridge |
160:5571c4ff569f | 25 | * |
Anna Bridge |
160:5571c4ff569f | 26 | * Version 1.0 |
Anna Bridge |
160:5571c4ff569f | 27 | * Initial Release |
Anna Bridge |
160:5571c4ff569f | 28 | *---------------------------------------------------------------------------*/ |
Anna Bridge |
160:5571c4ff569f | 29 | |
Anna Bridge |
160:5571c4ff569f | 30 | #ifndef TZ_CONTEXT_H |
Anna Bridge |
160:5571c4ff569f | 31 | #define TZ_CONTEXT_H |
Anna Bridge |
160:5571c4ff569f | 32 | |
Anna Bridge |
160:5571c4ff569f | 33 | #include <stdint.h> |
Anna Bridge |
160:5571c4ff569f | 34 | |
Anna Bridge |
160:5571c4ff569f | 35 | #ifndef TZ_MODULEID_T |
Anna Bridge |
160:5571c4ff569f | 36 | #define TZ_MODULEID_T |
Anna Bridge |
160:5571c4ff569f | 37 | /// \details Data type that identifies secure software modules called by a process. |
Anna Bridge |
160:5571c4ff569f | 38 | typedef uint32_t TZ_ModuleId_t; |
Anna Bridge |
160:5571c4ff569f | 39 | #endif |
Anna Bridge |
160:5571c4ff569f | 40 | |
Anna Bridge |
160:5571c4ff569f | 41 | /// \details TZ Memory ID identifies an allocated memory slot. |
Anna Bridge |
160:5571c4ff569f | 42 | typedef uint32_t TZ_MemoryId_t; |
Anna Bridge |
160:5571c4ff569f | 43 | |
Anna Bridge |
160:5571c4ff569f | 44 | /// Initialize secure context memory system |
Anna Bridge |
160:5571c4ff569f | 45 | /// \return execution status (1: success, 0: error) |
Anna Bridge |
160:5571c4ff569f | 46 | uint32_t TZ_InitContextSystem_S (void); |
Anna Bridge |
160:5571c4ff569f | 47 | |
Anna Bridge |
160:5571c4ff569f | 48 | /// Allocate context memory for calling secure software modules in TrustZone |
Anna Bridge |
160:5571c4ff569f | 49 | /// \param[in] module identifies software modules called from non-secure mode |
Anna Bridge |
160:5571c4ff569f | 50 | /// \return value != 0 id TrustZone memory slot identifier |
Anna Bridge |
160:5571c4ff569f | 51 | /// \return value 0 no memory available or internal error |
Anna Bridge |
160:5571c4ff569f | 52 | TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); |
Anna Bridge |
160:5571c4ff569f | 53 | |
Anna Bridge |
160:5571c4ff569f | 54 | /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S |
Anna Bridge |
160:5571c4ff569f | 55 | /// \param[in] id TrustZone memory slot identifier |
Anna Bridge |
160:5571c4ff569f | 56 | /// \return execution status (1: success, 0: error) |
Anna Bridge |
160:5571c4ff569f | 57 | uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); |
Anna Bridge |
160:5571c4ff569f | 58 | |
Anna Bridge |
160:5571c4ff569f | 59 | /// Load secure context (called on RTOS thread context switch) |
Anna Bridge |
160:5571c4ff569f | 60 | /// \param[in] id TrustZone memory slot identifier |
Anna Bridge |
160:5571c4ff569f | 61 | /// \return execution status (1: success, 0: error) |
Anna Bridge |
160:5571c4ff569f | 62 | uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); |
Anna Bridge |
160:5571c4ff569f | 63 | |
Anna Bridge |
160:5571c4ff569f | 64 | /// Store secure context (called on RTOS thread context switch) |
Anna Bridge |
160:5571c4ff569f | 65 | /// \param[in] id TrustZone memory slot identifier |
Anna Bridge |
160:5571c4ff569f | 66 | /// \return execution status (1: success, 0: error) |
Anna Bridge |
160:5571c4ff569f | 67 | uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); |
Anna Bridge |
160:5571c4ff569f | 68 | |
Anna Bridge |
160:5571c4ff569f | 69 | #endif // TZ_CONTEXT_H |