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 Jun 22 15:38:59 2018 +0100
Revision:
169:a7c7b631e539
Parent:
153:b484a57bc302
mbed library. Release version 162

Who changed what in which revision?

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