BA / SerialCom

Fork of OmniWheels by Gustav Atmel

Committer:
gustavatmel
Date:
Tue May 01 15:47:08 2018 +0000
Revision:
1:9c5af431a1f1
sdf

Who changed what in which revision?

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