Summer Qin | d0f42b1 | 2020-06-24 16:19:23 +0800 | [diff] [blame] | 1 | /* |
Kevin Peng | fc7b771 | 2021-05-08 13:42:56 +0800 | [diff] [blame] | 2 | * Copyright (c) 2020-2021, 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 */ |
Summer Qin | d0f42b1 | 2020-06-24 16:19:23 +0800 | [diff] [blame] | 16 | |
| 17 | __attribute__((naked)) |
| 18 | int32_t tfm_core_get_boot_data(uint8_t major_type, |
| 19 | struct tfm_boot_data *boot_status, |
| 20 | uint32_t len) |
| 21 | { |
| 22 | __ASM volatile( |
| 23 | "SVC %0\n" |
| 24 | "BX lr\n" |
| 25 | : : "I" (TFM_SVC_GET_BOOT_DATA)); |
| 26 | } |
Kevin Peng | eca45b9 | 2021-02-09 14:46:50 +0800 | [diff] [blame^] | 27 | |
| 28 | #ifdef TFM_PSA_API |
| 29 | /* Entry point when Partition FLIH functions return */ |
| 30 | __attribute__((naked)) |
| 31 | void tfm_flih_func_return(psa_flih_result_t result) |
| 32 | { |
| 33 | __ASM volatile("SVC %0 \n" |
| 34 | "BX r0 \n" |
| 35 | : : "I" (TFM_SVC_FLIH_FUNC_RETURN)); |
| 36 | } |
| 37 | #endif /* TFM_PSA_API */ |