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.

Committer:
Anna Bridge
Date:
Wed Jan 17 16:13:02 2018 +0000
Revision:
160:5571c4ff569f
Parent:
158:1c57384330a6
Child:
169:a7c7b631e539
mbed library. Release version 158

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 158:1c57384330a6 1 /*
AnnaBridge 158:1c57384330a6 2 * Copyright (c) 2015-2016 ARM Limited. All rights reserved.
AnnaBridge 158:1c57384330a6 3 *
AnnaBridge 158:1c57384330a6 4 * SPDX-License-Identifier: Apache-2.0
AnnaBridge 158:1c57384330a6 5 *
AnnaBridge 158:1c57384330a6 6 * Licensed under the Apache License, Version 2.0 (the License); you may
AnnaBridge 158:1c57384330a6 7 * not use this file except in compliance with the License.
AnnaBridge 158:1c57384330a6 8 * You may obtain a copy of the License at
AnnaBridge 158:1c57384330a6 9 *
AnnaBridge 158:1c57384330a6 10 * www.apache.org/licenses/LICENSE-2.0
AnnaBridge 158:1c57384330a6 11 *
AnnaBridge 158:1c57384330a6 12 * Unless required by applicable law or agreed to in writing, software
AnnaBridge 158:1c57384330a6 13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
AnnaBridge 158:1c57384330a6 14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AnnaBridge 158:1c57384330a6 15 * See the License for the specific language governing permissions and
AnnaBridge 158:1c57384330a6 16 * limitations under the License.
AnnaBridge 158:1c57384330a6 17 *
AnnaBridge 158:1c57384330a6 18 * ----------------------------------------------------------------------------
AnnaBridge 158:1c57384330a6 19 *
AnnaBridge 158:1c57384330a6 20 * $Date: 21. September 2016
AnnaBridge 158:1c57384330a6 21 * $Revision: V1.0
AnnaBridge 158:1c57384330a6 22 *
AnnaBridge 158:1c57384330a6 23 * Project: TrustZone for ARMv8-M
AnnaBridge 158:1c57384330a6 24 * Title: Context Management for ARMv8-M TrustZone
AnnaBridge 158:1c57384330a6 25 *
AnnaBridge 158:1c57384330a6 26 * Version 1.0
AnnaBridge 158:1c57384330a6 27 * Initial Release
AnnaBridge 158:1c57384330a6 28 *---------------------------------------------------------------------------*/
AnnaBridge 158:1c57384330a6 29
AnnaBridge 158:1c57384330a6 30 #ifndef TZ_CONTEXT_H
AnnaBridge 158:1c57384330a6 31 #define TZ_CONTEXT_H
AnnaBridge 158:1c57384330a6 32
AnnaBridge 158:1c57384330a6 33 #include <stdint.h>
AnnaBridge 158:1c57384330a6 34
AnnaBridge 158:1c57384330a6 35 #ifndef TZ_MODULEID_T
AnnaBridge 158:1c57384330a6 36 #define TZ_MODULEID_T
AnnaBridge 158:1c57384330a6 37 /// \details Data type that identifies secure software modules called by a process.
AnnaBridge 158:1c57384330a6 38 typedef uint32_t TZ_ModuleId_t;
AnnaBridge 158:1c57384330a6 39 #endif
AnnaBridge 158:1c57384330a6 40
AnnaBridge 158:1c57384330a6 41 /// \details TZ Memory ID identifies an allocated memory slot.
AnnaBridge 158:1c57384330a6 42 typedef uint32_t TZ_MemoryId_t;
AnnaBridge 158:1c57384330a6 43
AnnaBridge 158:1c57384330a6 44 /// Initialize secure context memory system
AnnaBridge 158:1c57384330a6 45 /// \return execution status (1: success, 0: error)
AnnaBridge 158:1c57384330a6 46 uint32_t TZ_InitContextSystem_S (void);
AnnaBridge 158:1c57384330a6 47
AnnaBridge 158:1c57384330a6 48 /// Allocate context memory for calling secure software modules in TrustZone
AnnaBridge 158:1c57384330a6 49 /// \param[in] module identifies software modules called from non-secure mode
AnnaBridge 158:1c57384330a6 50 /// \return value != 0 id TrustZone memory slot identifier
AnnaBridge 158:1c57384330a6 51 /// \return value 0 no memory available or internal error
AnnaBridge 158:1c57384330a6 52 TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);
AnnaBridge 158:1c57384330a6 53
AnnaBridge 158:1c57384330a6 54 /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
AnnaBridge 158:1c57384330a6 55 /// \param[in] id TrustZone memory slot identifier
AnnaBridge 158:1c57384330a6 56 /// \return execution status (1: success, 0: error)
AnnaBridge 158:1c57384330a6 57 uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);
AnnaBridge 158:1c57384330a6 58
AnnaBridge 158:1c57384330a6 59 /// Load secure context (called on RTOS thread context switch)
AnnaBridge 158:1c57384330a6 60 /// \param[in] id TrustZone memory slot identifier
AnnaBridge 158:1c57384330a6 61 /// \return execution status (1: success, 0: error)
AnnaBridge 158:1c57384330a6 62 uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);
AnnaBridge 158:1c57384330a6 63
AnnaBridge 158:1c57384330a6 64 /// Store secure context (called on RTOS thread context switch)
AnnaBridge 158:1c57384330a6 65 /// \param[in] id TrustZone memory slot identifier
AnnaBridge 158:1c57384330a6 66 /// \return execution status (1: success, 0: error)
AnnaBridge 158:1c57384330a6 67 uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);
AnnaBridge 158:1c57384330a6 68
AnnaBridge 158:1c57384330a6 69 #endif // TZ_CONTEXT_H