Skip to content

Commit b8969e0

Browse files
LDong-ArmPatater
authored andcommitted
Updated directory platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST
1 parent 68f8501 commit b8969e0

File tree

22 files changed

+1041
-706
lines changed

22 files changed

+1041
-706
lines changed

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/TARGET_TFM_V8M/src/tfm_ns_interface.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2019, Arm Limited. All rights reserved.
2+
* Copyright (c) 2017-2021, Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: BSD-3-Clause
55
*
@@ -25,16 +25,12 @@ int32_t tfm_ns_interface_dispatch(veneer_fn fn,
2525
int32_t result;
2626

2727
/* TFM request protected by NS lock */
28-
if (os_wrapper_mutex_acquire(ns_lock_handle, OS_WRAPPER_WAIT_FOREVER)
29-
!= OS_WRAPPER_SUCCESS) {
30-
return (int32_t)TFM_ERROR_GENERIC;
31-
}
28+
while (os_wrapper_mutex_acquire(ns_lock_handle, OS_WRAPPER_WAIT_FOREVER)
29+
!= OS_WRAPPER_SUCCESS);
3230

3331
result = fn(arg0, arg1, arg2, arg3);
3432

35-
if (os_wrapper_mutex_release(ns_lock_handle) != OS_WRAPPER_SUCCESS) {
36-
return (int32_t)TFM_ERROR_GENERIC;
37-
}
33+
while (os_wrapper_mutex_release(ns_lock_handle) != OS_WRAPPER_SUCCESS);
3834

3935
return result;
4036
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright (c) 2020-2021, Arm Limited. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*
6+
*/
7+
8+
#ifndef __OS_WRAPPER_MSG_QUEUE_H__
9+
#define __OS_WRAPPER_MSG_QUEUE_H__
10+
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
#include <stddef.h>
16+
17+
#include "common.h"
18+
19+
/**
20+
* \brief Create and initialize a message queue
21+
*
22+
* \param[in] msg_size The maximum message size in bytes
23+
* \param[in] msg_count The maximum number of messages in queue
24+
*
25+
* \return Returns handle of the message queue created, or NULL in case of error
26+
*/
27+
void *os_wrapper_msg_queue_create(size_t msg_size, uint8_t msg_count);
28+
29+
/**
30+
* \brief Send a message via message queue
31+
*
32+
* \param[in] mq_handle The handle of message queue
33+
* \param[in] msg_ptr The pointer to the message to be sent
34+
*
35+
* \return \ref OS_WRAPPER_SUCCESS if the message is successfully sent, or
36+
* \ref OS_WRAPPER_ERROR in case of error
37+
*
38+
* \note The message size must be the same as the value set in
39+
* \ref os_wrapper_msg_queue_create.
40+
*
41+
* \note Time out value is not specified here. Whether the function is blocked
42+
* or returns instantly depends on the actual implementation and usage
43+
* scenario.
44+
*/
45+
int32_t os_wrapper_msg_queue_send(void *mq_handle,
46+
const void *msg_ptr);
47+
48+
/**
49+
* \brief Receive a message from message queue
50+
*
51+
* \param[in] mq_handle The handle of message queue
52+
* \param[in] msg_ptr The pointer to buffer for message to be received
53+
*
54+
* \return \ref OS_WRAPPER_SUCCESS if the message is successfully received, or
55+
* \ref OS_WRAPPER_ERROR in case of error
56+
*
57+
* \note The message size is the same as the value set in
58+
* \ref os_wrapper_msg_queue_create.
59+
*
60+
* \note The function should be blocked until a message is received from message
61+
* queue, unless an error occurs.
62+
*/
63+
int32_t os_wrapper_msg_queue_receive(void *mq_handle,
64+
void *msg_ptr);
65+
66+
#ifdef __cplusplus
67+
}
68+
#endif
69+
70+
#endif /* __OS_WRAPPER_MSG_QUEUE_H__ */

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/include/psa/client.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2020, Arm Limited. All rights reserved.
2+
* Copyright (c) 2018-2021, Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: BSD-3-Clause
55
*
@@ -21,9 +21,10 @@ extern "C" {
2121

2222
/**
2323
* The version of the PSA Framework API that is being used to build the calling
24-
* firmware.
24+
* firmware. Only part of features of FF-M v1.1 have been implemented. FF-M v1.1
25+
* is compatible with v1.0.
2526
*/
26-
#define PSA_FRAMEWORK_VERSION (0x0100u)
27+
#define PSA_FRAMEWORK_VERSION (0x0101u)
2728

2829
/**
2930
* Return value from psa_version() if the requested RoT Service is not present
@@ -130,7 +131,7 @@ psa_handle_t psa_connect(uint32_t sid, uint32_t version);
130131
* Must be zero( \ref PSA_IPC_CALL) or positive.
131132
* \param[in] in_vec Array of input \ref psa_invec structures.
132133
* \param[in] in_len Number of input \ref psa_invec structures.
133-
* \param[in/out] out_vec Array of output \ref psa_outvec structures.
134+
* \param[in,out] out_vec Array of output \ref psa_outvec structures.
134135
* \param[in] out_len Number of output \ref psa_outvec structures.
135136
*
136137
* \retval >=0 RoT Service-specific status value.

0 commit comments

Comments
 (0)