Anton Komlev | c0ad604 | 2023-08-29 18:23:26 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2023, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * This is a stub functoins for TF-M shim layer of TZ APIs |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | #include "tz_context.h" |
| 14 | /* |
| 15 | * TF-M shim layer of the CMSIS TZ RTOS thread context management API |
| 16 | */ |
| 17 | |
| 18 | /* |
| 19 | * Initialize token-nsid map table in tfm nsid manager |
| 20 | * Return execution status (1: success, 0: error) |
| 21 | */ |
| 22 | uint32_t TZ_InitContextSystem_S(void) |
| 23 | { |
| 24 | return 1U; /* Success */ |
| 25 | } |
| 26 | |
| 27 | /* |
| 28 | * Allocate context memory from Secure side |
| 29 | * Param: TZ_ModuleId_t (NSID if TFM_NS_MANAGE_NSID is enabled) |
| 30 | * Return token if TFM_NS_MANAGE_NSID is enabled |
| 31 | * Return 0 if no memory available or internal error |
| 32 | */ |
| 33 | TZ_MemoryId_t TZ_AllocModuleContext_S(TZ_ModuleId_t module) |
| 34 | { |
| 35 | return 1U; /* Success */ |
| 36 | } |
| 37 | |
| 38 | /* |
| 39 | * Free context memory that was previously allocated with TZ_AllocModuleContext_S |
| 40 | * Param: TZ_MemoryId_t (token if TFM_NS_MANAGE_NSID is enabled) |
| 41 | * Return execution status (1: success, 0: error) |
| 42 | */ |
| 43 | uint32_t TZ_FreeModuleContext_S(TZ_MemoryId_t id) |
| 44 | { |
| 45 | return 1U; /* Success */ |
| 46 | } |
| 47 | |
| 48 | /* |
| 49 | * Load secure context (called on RTOS thread context switch) |
| 50 | * Param: TZ_MemoryId_t (token if TFM_NS_MANAGE_NSID is enabled) |
| 51 | * Return execution status (1: success, 0: error) |
| 52 | */ |
| 53 | uint32_t TZ_LoadContext_S(TZ_MemoryId_t id) |
| 54 | { |
| 55 | return 1U; /* Success */ |
| 56 | } |
| 57 | |
| 58 | /* |
| 59 | * Store secure context (called on RTOS thread context switch) |
| 60 | * Param: TZ_MemoryId_t (token if TFM_NS_MANAGE_NSID is enabled) |
| 61 | * Return execution status (1: success, 0: error) |
| 62 | */ |
| 63 | uint32_t TZ_StoreContext_S(TZ_MemoryId_t id) |
| 64 | { |
| 65 | return 1U; /* Success */ |
| 66 | } |