mbed-os5 only for TYBLE16
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
components/TARGET_PSA/inc/psa/client.h@0:5b88d5760320, 2019-12-17 (annotated)
- Committer:
- kenjiArai
- Date:
- Tue Dec 17 23:23:45 2019 +0000
- Revision:
- 0:5b88d5760320
mbed-os5 only for TYBLE16
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kenjiArai | 0:5b88d5760320 | 1 | /* Copyright (c) 2017-2018 ARM Limited |
kenjiArai | 0:5b88d5760320 | 2 | * |
kenjiArai | 0:5b88d5760320 | 3 | * SPDX-License-Identifier: Apache-2.0 |
kenjiArai | 0:5b88d5760320 | 4 | * |
kenjiArai | 0:5b88d5760320 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kenjiArai | 0:5b88d5760320 | 6 | * you may not use this file except in compliance with the License. |
kenjiArai | 0:5b88d5760320 | 7 | * You may obtain a copy of the License at |
kenjiArai | 0:5b88d5760320 | 8 | * |
kenjiArai | 0:5b88d5760320 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
kenjiArai | 0:5b88d5760320 | 10 | * |
kenjiArai | 0:5b88d5760320 | 11 | * Unless required by applicable law or agreed to in writing, software |
kenjiArai | 0:5b88d5760320 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
kenjiArai | 0:5b88d5760320 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kenjiArai | 0:5b88d5760320 | 14 | * See the License for the specific language governing permissions and |
kenjiArai | 0:5b88d5760320 | 15 | * limitations under the License. |
kenjiArai | 0:5b88d5760320 | 16 | */ |
kenjiArai | 0:5b88d5760320 | 17 | |
kenjiArai | 0:5b88d5760320 | 18 | #if defined(TARGET_TFM) |
kenjiArai | 0:5b88d5760320 | 19 | #include "interface/include/psa_client.h" |
kenjiArai | 0:5b88d5760320 | 20 | #elif defined(TARGET_MBED_SPM) |
kenjiArai | 0:5b88d5760320 | 21 | #include "TARGET_MBED_SPM/psa_defs.h" |
kenjiArai | 0:5b88d5760320 | 22 | #include "TARGET_MBED_SPM/spm_client.h" |
kenjiArai | 0:5b88d5760320 | 23 | #else |
kenjiArai | 0:5b88d5760320 | 24 | |
kenjiArai | 0:5b88d5760320 | 25 | #ifndef __MBED_OS_DEFAULT_PSA_CLIENT_API_H__ |
kenjiArai | 0:5b88d5760320 | 26 | #define __MBED_OS_DEFAULT_PSA_CLIENT_API_H__ |
kenjiArai | 0:5b88d5760320 | 27 | |
kenjiArai | 0:5b88d5760320 | 28 | #include <stddef.h> |
kenjiArai | 0:5b88d5760320 | 29 | #include "psa/error.h" |
kenjiArai | 0:5b88d5760320 | 30 | |
kenjiArai | 0:5b88d5760320 | 31 | #if !defined(UINT32_MAX) |
kenjiArai | 0:5b88d5760320 | 32 | #define UINT32_MAX ((uint32_t)-1) |
kenjiArai | 0:5b88d5760320 | 33 | #endif |
kenjiArai | 0:5b88d5760320 | 34 | |
kenjiArai | 0:5b88d5760320 | 35 | #if !defined(INT32_MIN) |
kenjiArai | 0:5b88d5760320 | 36 | #define INT32_MIN (-0x7fffffff - 1) |
kenjiArai | 0:5b88d5760320 | 37 | #endif |
kenjiArai | 0:5b88d5760320 | 38 | |
kenjiArai | 0:5b88d5760320 | 39 | #define PSA_FRAMEWORK_VERSION (0x0100) /**< Version of the PSA Framework API. */ |
kenjiArai | 0:5b88d5760320 | 40 | #define PSA_VERSION_NONE (0L) /**< Identifier for an unimplemented Root of Trust (RoT) Service. */ |
kenjiArai | 0:5b88d5760320 | 41 | #define PSA_CONNECTION_REFUSED (INT32_MIN + 1) /**< The return value from psa_connect() if the RoT Service or SPM was unable to establish a connection.*/ |
kenjiArai | 0:5b88d5760320 | 42 | #define PSA_CONNECTION_BUSY (INT32_MIN + 2) /**< The return value from psa_connect() if the RoT Service rejects the connection for a transient reason.*/ |
kenjiArai | 0:5b88d5760320 | 43 | #define PSA_DROP_CONNECTION (INT32_MIN) /**< The result code in a call to psa_reply() to indicate a nonrecoverable error in the client.*/ |
kenjiArai | 0:5b88d5760320 | 44 | #define PSA_NULL_HANDLE ((psa_handle_t)0) /**< Denotes an invalid handle.*/ |
kenjiArai | 0:5b88d5760320 | 45 | |
kenjiArai | 0:5b88d5760320 | 46 | typedef int32_t psa_handle_t; |
kenjiArai | 0:5b88d5760320 | 47 | |
kenjiArai | 0:5b88d5760320 | 48 | typedef struct psa_invec { |
kenjiArai | 0:5b88d5760320 | 49 | const void *base; /**< Starting address of the buffer.*/ |
kenjiArai | 0:5b88d5760320 | 50 | size_t len; /**< Length in bytes of the buffer.*/ |
kenjiArai | 0:5b88d5760320 | 51 | } psa_invec; |
kenjiArai | 0:5b88d5760320 | 52 | |
kenjiArai | 0:5b88d5760320 | 53 | |
kenjiArai | 0:5b88d5760320 | 54 | typedef struct psa_outvec { |
kenjiArai | 0:5b88d5760320 | 55 | void *base; /**< Starting address of the buffer.*/ |
kenjiArai | 0:5b88d5760320 | 56 | size_t len; /**< Length in bytes of the buffer.*/ |
kenjiArai | 0:5b88d5760320 | 57 | } psa_outvec; |
kenjiArai | 0:5b88d5760320 | 58 | |
kenjiArai | 0:5b88d5760320 | 59 | #endif // __MBED_OS_DEFAULT_PSA_CLIENT_API_H__ |
kenjiArai | 0:5b88d5760320 | 60 | #endif |