Summer Qin | d0f42b1 | 2020-06-24 16:19:23 +0800 | [diff] [blame] | 1 | /* |
Sherry Zhang | 9714d96 | 2022-03-02 10:52:46 +0800 | [diff] [blame^] | 2 | * Copyright (c) 2020-2022, Arm Limited. All rights reserved. |
Summer Qin | d0f42b1 | 2020-06-24 16:19:23 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include "cmsis_compiler.h" |
| 9 | #include "service_api.h" |
Kevin Peng | fc7b771 | 2021-05-08 13:42:56 +0800 | [diff] [blame] | 10 | #ifdef TFM_PSA_API |
Kevin Peng | eca45b9 | 2021-02-09 14:46:50 +0800 | [diff] [blame] | 11 | #include "psa/service.h" |
Kevin Peng | fc7b771 | 2021-05-08 13:42:56 +0800 | [diff] [blame] | 12 | #include "svc_num.h" |
| 13 | #else |
| 14 | #include "tfm_core_svc.h" |
| 15 | #endif /* TFM_PSA_API */ |
Sherry Zhang | 9714d96 | 2022-03-02 10:52:46 +0800 | [diff] [blame^] | 16 | #include "utilities.h" |
Summer Qin | d0f42b1 | 2020-06-24 16:19:23 +0800 | [diff] [blame] | 17 | |
| 18 | __attribute__((naked)) |
| 19 | int32_t tfm_core_get_boot_data(uint8_t major_type, |
| 20 | struct tfm_boot_data *boot_status, |
| 21 | uint32_t len) |
| 22 | { |
| 23 | __ASM volatile( |
Sherry Zhang | 9714d96 | 2022-03-02 10:52:46 +0800 | [diff] [blame^] | 24 | "SVC "M2S(TFM_SVC_GET_BOOT_DATA)" \n" |
| 25 | "BX lr \n" |
| 26 | ); |
Summer Qin | d0f42b1 | 2020-06-24 16:19:23 +0800 | [diff] [blame] | 27 | } |
Kevin Peng | eca45b9 | 2021-02-09 14:46:50 +0800 | [diff] [blame] | 28 | |
| 29 | #ifdef TFM_PSA_API |
| 30 | /* Entry point when Partition FLIH functions return */ |
| 31 | __attribute__((naked)) |
| 32 | void tfm_flih_func_return(psa_flih_result_t result) |
| 33 | { |
Sherry Zhang | 9714d96 | 2022-03-02 10:52:46 +0800 | [diff] [blame^] | 34 | __ASM volatile("SVC "M2S(TFM_SVC_FLIH_FUNC_RETURN)" \n" |
| 35 | "BX r0 \n" |
| 36 | ); |
Kevin Peng | eca45b9 | 2021-02-09 14:46:50 +0800 | [diff] [blame] | 37 | } |
| 38 | #endif /* TFM_PSA_API */ |