David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 1 | /* |
Xinyu Zhang | 2bc4d57 | 2021-12-27 16:37:46 +0800 | [diff] [blame] | 2 | * Copyright (c) 2019-2022, Arm Limited. All rights reserved. |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
Mingyang Sun | 133a792 | 2021-07-08 16:01:26 +0800 | [diff] [blame] | 8 | #ifndef __PSA_API_H__ |
| 9 | #define __PSA_API_H__ |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 10 | |
| 11 | #include <stdint.h> |
Mingyang Sun | 7397b4f | 2020-06-17 15:07:45 +0800 | [diff] [blame] | 12 | #include <stdbool.h> |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 13 | #include "psa/client.h" |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 14 | #include "psa/service.h" |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 15 | |
Xinyu Zhang | b287ef8 | 2021-11-03 18:38:50 +0800 | [diff] [blame] | 16 | /** |
| 17 | * \brief This function handles the specific programmer error cases. |
| 18 | * |
| 19 | * \param[in] status Standard error codes for the SPM. |
| 20 | * |
| 21 | * \retval void Status will not cause SPM panic |
| 22 | * \retval "SPM panic" Following programmer errors are triggered by SP: |
| 23 | * \arg PSA_ERROR_PROGRAMMER_ERROR |
| 24 | * \arg PSA_ERROR_CONNECTION_REFUSED |
| 25 | * \arg PSA_ERROR_CONNECTION_BUSY |
| 26 | */ |
| 27 | void spm_handle_programmer_errors(psa_status_t status); |
Shawn Shan | b222d89 | 2021-01-04 17:41:48 +0800 | [diff] [blame] | 28 | |
Mingyang Sun | eeca465 | 2021-07-15 15:19:16 +0800 | [diff] [blame] | 29 | /** |
| 30 | * \brief This function get the current PSA RoT lifecycle state. |
| 31 | * |
| 32 | * \return state The current security lifecycle state of the PSA |
| 33 | * RoT. The PSA state and implementation state are |
| 34 | * encoded as follows: |
| 35 | * \arg state[15:8] – PSA lifecycle state |
| 36 | * \arg state[7:0] – IMPLEMENTATION DEFINED state |
| 37 | */ |
| 38 | uint32_t tfm_spm_get_lifecycle_state(void); |
| 39 | |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 40 | /* PSA Client API function body, for privileged use only. */ |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 41 | |
| 42 | /** |
| 43 | * \brief handler for \ref psa_framework_version. |
| 44 | * |
| 45 | * \return version The version of the PSA Framework implementation |
| 46 | * that is providing the runtime services. |
| 47 | */ |
Mingyang Sun | d44522a | 2020-01-16 16:48:37 +0800 | [diff] [blame] | 48 | uint32_t tfm_spm_client_psa_framework_version(void); |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 49 | |
| 50 | /** |
| 51 | * \brief handler for \ref psa_version. |
| 52 | * |
| 53 | * \param[in] sid RoT Service identity. |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 54 | * |
| 55 | * \retval PSA_VERSION_NONE The RoT Service is not implemented, or the |
| 56 | * caller is not permitted to access the service. |
Jaykumar Pitambarbhai Patel | 3a98602 | 2019-10-08 17:37:15 +0530 | [diff] [blame] | 57 | * \retval > 0 The version of the implemented RoT Service. |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 58 | */ |
Mingyang Sun | 22a3faf | 2021-07-09 15:32:47 +0800 | [diff] [blame] | 59 | uint32_t tfm_spm_client_psa_version(uint32_t sid); |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 60 | |
| 61 | /** |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 62 | * \brief handler for \ref psa_call. |
| 63 | * |
| 64 | * \param[in] handle Service handle to the established connection, |
| 65 | * \ref psa_handle_t |
Mingyang Sun | eeca465 | 2021-07-15 15:19:16 +0800 | [diff] [blame] | 66 | * \param[in] ctrl_param Parameters combined in uint32_t, |
| 67 | * includes request type, in_num and out_num. |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 68 | * \param[in] inptr Array of input psa_invec structures. |
| 69 | * \ref psa_invec |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 70 | * \param[in] outptr Array of output psa_outvec structures. |
| 71 | * \ref psa_outvec |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 72 | * |
| 73 | * \retval PSA_SUCCESS Success. |
| 74 | * \retval "Does not return" The call is invalid, one or more of the |
| 75 | * following are true: |
| 76 | * \arg An invalid handle was passed. |
| 77 | * \arg The connection is already handling a request. |
| 78 | * \arg An invalid memory reference was provided. |
| 79 | * \arg in_num + out_num > PSA_MAX_IOVEC. |
| 80 | * \arg The message is unrecognized by the RoT |
| 81 | * Service or incorrectly formatted. |
| 82 | */ |
Mingyang Sun | eeca465 | 2021-07-15 15:19:16 +0800 | [diff] [blame] | 83 | psa_status_t tfm_spm_client_psa_call(psa_handle_t handle, |
| 84 | uint32_t ctrl_param, |
| 85 | const psa_invec *inptr, |
| 86 | psa_outvec *outptr); |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 87 | |
Xinyu Zhang | 2bc4d57 | 2021-12-27 16:37:46 +0800 | [diff] [blame] | 88 | /* Following PSA APIs are only needed by connection-based services */ |
| 89 | #if CONFIG_TFM_CONNECTION_BASED_SERVICE_API == 1 |
| 90 | |
| 91 | /** |
| 92 | * \brief handler for \ref psa_connect. |
| 93 | * |
| 94 | * \param[in] sid RoT Service identity. |
| 95 | * \param[in] version The version of the RoT Service. |
| 96 | * |
| 97 | * \retval PSA_SUCCESS Success. |
| 98 | * \retval PSA_ERROR_CONNECTION_REFUSED The SPM or RoT Service has refused the |
| 99 | * connection. |
| 100 | * \retval PSA_ERROR_CONNECTION_BUSY The SPM or RoT Service cannot make the |
| 101 | * connection at the moment. |
| 102 | * \retval "Does not return" The RoT Service ID and version are not |
| 103 | * supported, or the caller is not permitted to |
| 104 | * access the service. |
| 105 | */ |
| 106 | psa_status_t tfm_spm_client_psa_connect(uint32_t sid, uint32_t version); |
| 107 | |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 108 | /** |
| 109 | * \brief handler for \ref psa_close. |
| 110 | * |
| 111 | * \param[in] handle Service handle to the connection to be closed, |
| 112 | * \ref psa_handle_t |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 113 | * |
Xinyu Zhang | b287ef8 | 2021-11-03 18:38:50 +0800 | [diff] [blame] | 114 | * \retval PSA_SUCCESS Success. |
| 115 | * \retval PSA_ERROR_PROGRAMMER_ERROR The call is invalid, one or more of the |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 116 | * following are true: |
Xinyu Zhang | b287ef8 | 2021-11-03 18:38:50 +0800 | [diff] [blame] | 117 | * \arg Called with a stateless handle. |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 118 | * \arg An invalid handle was provided that is not |
| 119 | * the null handle. |
| 120 | * \arg The connection is handling a request. |
| 121 | */ |
Xinyu Zhang | b287ef8 | 2021-11-03 18:38:50 +0800 | [diff] [blame] | 122 | psa_status_t tfm_spm_client_psa_close(psa_handle_t handle); |
David Hu | 733d8f9 | 2019-09-23 15:32:40 +0800 | [diff] [blame] | 123 | |
Xinyu Zhang | 2bc4d57 | 2021-12-27 16:37:46 +0800 | [diff] [blame] | 124 | #endif /* CONFIG_TFM_CONNECTION_BASED_SERVICE_API */ |
| 125 | |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 126 | /* PSA Partition API function body, for privileged use only. */ |
| 127 | |
Kevin Peng | def92de | 2021-11-10 16:14:48 +0800 | [diff] [blame] | 128 | #if CONFIG_TFM_SPM_BACKEND_IPC == 1 \ |
| 129 | || CONFIG_TFM_FLIH_API == 1 || CONFIG_TFM_SLIH_API == 1 |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 130 | /** |
| 131 | * \brief Function body of \ref psa_wait. |
| 132 | * |
| 133 | * \param[in] signal_mask A set of signals to query. Signals that are not |
| 134 | * in this set will be ignored. |
| 135 | * \param[in] timeout Specify either blocking \ref PSA_BLOCK or |
| 136 | * polling \ref PSA_POLL operation. |
| 137 | * |
| 138 | * \retval >0 At least one signal is asserted. |
| 139 | * \retval 0 No signals are asserted. This is only seen when |
| 140 | * a polling timeout is used. |
| 141 | */ |
| 142 | psa_signal_t tfm_spm_partition_psa_wait(psa_signal_t signal_mask, |
| 143 | uint32_t timeout); |
Kevin Peng | def92de | 2021-11-10 16:14:48 +0800 | [diff] [blame] | 144 | #endif |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 145 | |
Kevin Peng | def92de | 2021-11-10 16:14:48 +0800 | [diff] [blame] | 146 | /* This API is only used in IPC backend. */ |
| 147 | #if CONFIG_TFM_SPM_BACKEND_IPC == 1 |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 148 | /** |
| 149 | * \brief Function body of \ref psa_get. |
| 150 | * |
| 151 | * \param[in] signal The signal value for an asserted RoT Service. |
| 152 | * \param[out] msg Pointer to \ref psa_msg_t object for receiving |
| 153 | * the message. |
| 154 | * |
| 155 | * \retval PSA_SUCCESS Success, *msg will contain the delivered |
| 156 | * message. |
| 157 | * \retval PSA_ERROR_DOES_NOT_EXIST Message could not be delivered. |
| 158 | * \retval "PROGRAMMER ERROR" The call is invalid because one or more of the |
| 159 | * following are true: |
| 160 | * \arg signal has more than a single bit set. |
| 161 | * \arg signal does not correspond to an RoT Service. |
| 162 | * \arg The RoT Service signal is not currently |
| 163 | * asserted. |
| 164 | * \arg The msg pointer provided is not a valid memory |
| 165 | * reference. |
| 166 | */ |
| 167 | psa_status_t tfm_spm_partition_psa_get(psa_signal_t signal, psa_msg_t *msg); |
Kevin Peng | 613b417 | 2022-02-15 14:41:44 +0800 | [diff] [blame] | 168 | #endif /* CONFIG_TFM_SPM_BACKEND_IPC == 1 */ |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 169 | |
| 170 | /** |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 171 | * \brief Function body of \ref psa_read. |
| 172 | * |
| 173 | * \param[in] msg_handle Handle for the client's message. |
| 174 | * \param[in] invec_idx Index of the input vector to read from. Must be |
| 175 | * less than \ref PSA_MAX_IOVEC. |
| 176 | * \param[out] buffer Buffer in the Secure Partition to copy the |
| 177 | * requested data to. |
| 178 | * \param[in] num_bytes Maximum number of bytes to be read from the |
| 179 | * client input vector. |
| 180 | * |
| 181 | * \retval >0 Number of bytes copied. |
| 182 | * \retval 0 There was no remaining data in this input |
| 183 | * vector. |
| 184 | * \retval "PROGRAMMER ERROR" The call is invalid, one or more of the |
| 185 | * following are true: |
| 186 | * \arg msg_handle is invalid. |
| 187 | * \arg msg_handle does not refer to a |
| 188 | * \ref PSA_IPC_CALL message. |
| 189 | * \arg invec_idx is equal to or greater than |
| 190 | * \ref PSA_MAX_IOVEC. |
| 191 | * \arg the memory reference for buffer is invalid or |
| 192 | * not writable. |
| 193 | */ |
| 194 | size_t tfm_spm_partition_psa_read(psa_handle_t msg_handle, uint32_t invec_idx, |
| 195 | void *buffer, size_t num_bytes); |
| 196 | |
| 197 | /** |
| 198 | * \brief Function body of psa_skip. |
| 199 | * |
| 200 | * \param[in] msg_handle Handle for the client's message. |
| 201 | * \param[in] invec_idx Index of input vector to skip from. Must be |
| 202 | * less than \ref PSA_MAX_IOVEC. |
| 203 | * \param[in] num_bytes Maximum number of bytes to skip in the client |
| 204 | * input vector. |
| 205 | * |
| 206 | * \retval >0 Number of bytes skipped. |
| 207 | * \retval 0 There was no remaining data in this input |
| 208 | * vector. |
| 209 | * \retval "PROGRAMMER ERROR" The call is invalid, one or more of the |
| 210 | * following are true: |
| 211 | * \arg msg_handle is invalid. |
| 212 | * \arg msg_handle does not refer to a request |
| 213 | * message. |
| 214 | * \arg invec_idx is equal to or greater than |
| 215 | * \ref PSA_MAX_IOVEC. |
| 216 | */ |
| 217 | size_t tfm_spm_partition_psa_skip(psa_handle_t msg_handle, uint32_t invec_idx, |
| 218 | size_t num_bytes); |
| 219 | |
| 220 | /** |
| 221 | * \brief Function body of \ref psa_write. |
| 222 | * |
| 223 | * \param[in] msg_handle Handle for the client's message. |
| 224 | * \param[out] outvec_idx Index of output vector in message to write to. |
| 225 | * Must be less than \ref PSA_MAX_IOVEC. |
| 226 | * \param[in] buffer Buffer with the data to write. |
| 227 | * \param[in] num_bytes Number of bytes to write to the client output |
| 228 | * vector. |
| 229 | * |
| 230 | * \retval void Success |
| 231 | * \retval "PROGRAMMER ERROR" The call is invalid, one or more of the |
| 232 | * following are true: |
| 233 | * \arg msg_handle is invalid. |
| 234 | * \arg msg_handle does not refer to a request |
| 235 | * message. |
| 236 | * \arg outvec_idx is equal to or greater than |
| 237 | * \ref PSA_MAX_IOVEC. |
| 238 | * \arg The memory reference for buffer is invalid. |
| 239 | * \arg The call attempts to write data past the end |
| 240 | * of the client output vector. |
| 241 | */ |
| 242 | void tfm_spm_partition_psa_write(psa_handle_t msg_handle, uint32_t outvec_idx, |
| 243 | const void *buffer, size_t num_bytes); |
| 244 | |
| 245 | /** |
| 246 | * \brief Function body of \ref psa_reply. |
| 247 | * |
| 248 | * \param[in] msg_handle Handle for the client's message. |
| 249 | * \param[in] status Message result value to be reported to the |
| 250 | * client. |
| 251 | * |
Ken Liu | f39d8eb | 2021-10-07 12:55:33 +0800 | [diff] [blame] | 252 | * \retval Positive integer Success, the connection handle. |
| 253 | * \retval PSA_SUCCESS Success |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 254 | * \retval "PROGRAMMER ERROR" The call is invalid, one or more of the |
| 255 | * following are true: |
| 256 | * \arg msg_handle is invalid. |
| 257 | * \arg An invalid status code is specified for the |
| 258 | * type of message. |
| 259 | */ |
Ken Liu | f39d8eb | 2021-10-07 12:55:33 +0800 | [diff] [blame] | 260 | int32_t tfm_spm_partition_psa_reply(psa_handle_t msg_handle, |
| 261 | psa_status_t status); |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 262 | |
Kevin Peng | 613b417 | 2022-02-15 14:41:44 +0800 | [diff] [blame] | 263 | #if CONFIG_TFM_DOORBELL_API == 1 |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 264 | /** |
| 265 | * \brief Function body of \ref psa_norify. |
| 266 | * |
| 267 | * \param[in] partition_id Secure Partition ID of the target partition. |
| 268 | * |
| 269 | * \retval void Success. |
| 270 | * \retval "PROGRAMMER ERROR" partition_id does not correspond to a Secure |
| 271 | * Partition. |
| 272 | */ |
| 273 | void tfm_spm_partition_psa_notify(int32_t partition_id); |
| 274 | |
| 275 | /** |
| 276 | * \brief Function body of \ref psa_clear. |
| 277 | * |
| 278 | * \retval void Success. |
| 279 | * \retval "PROGRAMMER ERROR" The Secure Partition's doorbell signal is not |
| 280 | * currently asserted. |
| 281 | */ |
| 282 | void tfm_spm_partition_psa_clear(void); |
Kevin Peng | 613b417 | 2022-02-15 14:41:44 +0800 | [diff] [blame] | 283 | #endif /* CONFIG_TFM_DOORBELL_API == 1 */ |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 284 | |
| 285 | /** |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 286 | * \brief Function body of \ref psa_panic. |
| 287 | * |
| 288 | * \retval "Does not return" |
| 289 | */ |
| 290 | void tfm_spm_partition_psa_panic(void); |
| 291 | |
Mingyang Sun | ed5fe7b | 2022-02-10 17:33:21 +0800 | [diff] [blame] | 292 | /* psa_set_rhandle is only needed by connection-based services */ |
| 293 | #if CONFIG_TFM_CONNECTION_BASED_SERVICE_API == 1 |
| 294 | |
| 295 | /** |
| 296 | * \brief Function body of \ref psa_set_rhandle. |
| 297 | * |
| 298 | * \param[in] msg_handle Handle for the client's message. |
| 299 | * \param[in] rhandle Reverse handle allocated by the RoT Service. |
| 300 | * |
| 301 | * \retval void Success, rhandle will be provided with all |
| 302 | * subsequent messages delivered on this |
| 303 | * connection. |
| 304 | * \retval "PROGRAMMER ERROR" msg_handle is invalid. |
| 305 | */ |
| 306 | void tfm_spm_partition_psa_set_rhandle(psa_handle_t msg_handle, void *rhandle); |
| 307 | |
| 308 | #endif /* CONFIG_TFM_CONNECTION_BASED_SERVICE_API */ |
| 309 | |
| 310 | #if CONFIG_TFM_FLIH_API == 1 || CONFIG_TFM_SLIH_API == 1 |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 311 | /** |
| 312 | * \brief Function body of \ref psa_irq_enable. |
| 313 | * |
| 314 | * \param[in] irq_signal The signal for the interrupt to be enabled. |
| 315 | * This must have a single bit set, which must be the |
| 316 | * signal value for an interrupt in the calling Secure |
| 317 | * Partition. |
| 318 | * |
| 319 | * \retval void |
| 320 | * \retval "PROGRAMMER ERROR" If one or more of the following are true: |
| 321 | * \arg \a irq_signal is not an interrupt signal. |
| 322 | * \arg \a irq_signal indicates more than one signal. |
| 323 | */ |
Kevin Peng | 67a89fd | 2021-11-25 11:22:02 +0800 | [diff] [blame] | 324 | void tfm_spm_partition_psa_irq_enable(psa_signal_t irq_signal); |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 325 | |
| 326 | /** |
| 327 | * \brief Function body of psa_irq_disable. |
| 328 | * |
| 329 | * \param[in] irq_signal The signal for the interrupt to be disabled. |
| 330 | * This must have a single bit set, which must be the |
| 331 | * signal value for an interrupt in the calling Secure |
| 332 | * Partition. |
| 333 | * |
| 334 | * \retval 0 The interrupt was disabled prior to this call. |
| 335 | * 1 The interrupt was enabled prior to this call. |
| 336 | * \retval "PROGRAMMER ERROR" If one or more of the following are true: |
| 337 | * \arg \a irq_signal is not an interrupt signal. |
| 338 | * \arg \a irq_signal indicates more than one signal. |
| 339 | * |
| 340 | * \note The current implementation always return 1. Do not use the return. |
| 341 | */ |
Kevin Peng | 67a89fd | 2021-11-25 11:22:02 +0800 | [diff] [blame] | 342 | psa_irq_status_t tfm_spm_partition_psa_irq_disable(psa_signal_t irq_signal); |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 343 | |
Mingyang Sun | ed5fe7b | 2022-02-10 17:33:21 +0800 | [diff] [blame] | 344 | /* This API is only used for FLIH. */ |
| 345 | #if CONFIG_TFM_FLIH_API == 1 |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 346 | /** |
| 347 | * \brief Function body of \ref psa_reset_signal. |
| 348 | * |
| 349 | * \param[in] irq_signal The interrupt signal to be reset. |
| 350 | * This must have a single bit set, corresponding to a |
| 351 | * currently asserted signal for an interrupt that is |
| 352 | * defined to use FLIH handling. |
| 353 | * |
| 354 | * \retval void |
| 355 | * \retval "Programmer Error" if one or more of the following are true: |
| 356 | * \arg \a irq_signal is not a signal for an interrupt |
| 357 | * that is specified with FLIH handling in the Secure |
| 358 | * Partition manifest. |
| 359 | * \arg \a irq_signal indicates more than one signal. |
| 360 | * \arg \a irq_signal is not currently asserted. |
| 361 | */ |
| 362 | void tfm_spm_partition_psa_reset_signal(psa_signal_t irq_signal); |
Mingyang Sun | ed5fe7b | 2022-02-10 17:33:21 +0800 | [diff] [blame] | 363 | #endif |
Mingyang Sun | b26b280 | 2021-07-07 11:25:00 +0800 | [diff] [blame] | 364 | |
Mingyang Sun | ed5fe7b | 2022-02-10 17:33:21 +0800 | [diff] [blame] | 365 | /* This API is only used for SLIH. */ |
| 366 | #if CONFIG_TFM_SLIH_API == 1 |
Xinyu Zhang | 2bc4d57 | 2021-12-27 16:37:46 +0800 | [diff] [blame] | 367 | /** |
Mingyang Sun | ed5fe7b | 2022-02-10 17:33:21 +0800 | [diff] [blame] | 368 | * \brief Function body of \ref psa_eoi. |
Xinyu Zhang | 2bc4d57 | 2021-12-27 16:37:46 +0800 | [diff] [blame] | 369 | * |
Mingyang Sun | ed5fe7b | 2022-02-10 17:33:21 +0800 | [diff] [blame] | 370 | * \param[in] irq_signal The interrupt signal that has been processed. |
Xinyu Zhang | 2bc4d57 | 2021-12-27 16:37:46 +0800 | [diff] [blame] | 371 | * |
Mingyang Sun | ed5fe7b | 2022-02-10 17:33:21 +0800 | [diff] [blame] | 372 | * \retval void Success. |
| 373 | * \retval "PROGRAMMER ERROR" The call is invalid, one or more of the |
| 374 | * following are true: |
| 375 | * \arg irq_signal is not an interrupt signal. |
| 376 | * \arg irq_signal indicates more than one signal. |
| 377 | * \arg irq_signal is not currently asserted. |
| 378 | * \arg The interrupt is not using SLIH. |
Xinyu Zhang | 2bc4d57 | 2021-12-27 16:37:46 +0800 | [diff] [blame] | 379 | */ |
Mingyang Sun | ed5fe7b | 2022-02-10 17:33:21 +0800 | [diff] [blame] | 380 | void tfm_spm_partition_psa_eoi(psa_signal_t irq_signal); |
| 381 | #endif |
| 382 | #endif /* CONFIG_TFM_FLIH_API == 1 || CONFIG_TFM_SLIH_API == 1 */ |
Xinyu Zhang | 2bc4d57 | 2021-12-27 16:37:46 +0800 | [diff] [blame] | 383 | |
Shawn Shan | 038348e | 2021-09-08 17:11:04 +0800 | [diff] [blame] | 384 | #if PSA_FRAMEWORK_HAS_MM_IOVEC |
| 385 | |
| 386 | /** |
| 387 | * \brief Function body of psa_map_invec. |
| 388 | */ |
| 389 | const void *tfm_spm_partition_psa_map_invec(psa_handle_t msg_handle, |
| 390 | uint32_t invec_idx); |
| 391 | |
| 392 | /** |
| 393 | * \brief Function body of psa_unmap_invec. |
| 394 | */ |
| 395 | void tfm_spm_partition_psa_unmap_invec(psa_handle_t msg_handle, |
| 396 | uint32_t invec_idx); |
| 397 | |
| 398 | /** |
| 399 | * \brief Function body of psa_map_outvet. |
| 400 | */ |
| 401 | void *tfm_spm_partition_psa_map_outvec(psa_handle_t msg_handle, |
| 402 | uint32_t outvec_idx); |
| 403 | |
| 404 | /** |
| 405 | * \brief Function body of psa_unmap_outvec. |
| 406 | */ |
| 407 | void tfm_spm_partition_psa_unmap_outvec(psa_handle_t msg_handle, |
| 408 | uint32_t outvec_idx, size_t len); |
| 409 | |
| 410 | #endif /* PSA_FRAMEWORK_HAS_MM_IOVEC */ |
| 411 | |
Mingyang Sun | 133a792 | 2021-07-08 16:01:26 +0800 | [diff] [blame] | 412 | #endif /* __PSA_API_H__ */ |