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:
Fri Apr 20 11:08:29 2018 +0100
Revision:
166:5aab5a7997ee
Parent:
157:e7ca05fa8600
Child:
169:a7c7b631e539
Updating mbed 2 version number

Who changed what in which revision?

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