inport from local

Dependents:   Hobbyking_Cheetah_0511

Committer:
NYX
Date:
Mon Mar 16 06:35:48 2020 +0000
Revision:
0:85b3fd62ea1a
reinport to mbed;

Who changed what in which revision?

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