Javier Almansa Sobrino | 4165e84 | 2022-04-25 17:18:15 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2022, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef TRP_HELPERS_H |
| 8 | #define TRP_HELPERS_H |
| 9 | |
| 10 | /* Definitions to help the assembler access the SMC/ERET args structure */ |
| 11 | #define TRP_ARGS_SIZE TRP_ARGS_END |
| 12 | #define TRP_ARG0 0x0 |
| 13 | #define TRP_ARG1 0x8 |
| 14 | #define TRP_ARG2 0x10 |
| 15 | #define TRP_ARG3 0x18 |
| 16 | #define TRP_ARG4 0x20 |
| 17 | #define TRP_ARG5 0x28 |
| 18 | #define TRP_ARG6 0x30 |
| 19 | #define TRP_ARG7 0x38 |
| 20 | #define TRP_ARGS_END 0x40 |
| 21 | |
| 22 | #ifndef __ASSEMBLER__ |
| 23 | |
| 24 | #include <platform_def.h> |
| 25 | |
| 26 | /* Data structure to hold SMC arguments */ |
| 27 | typedef struct trp_args { |
| 28 | uint64_t regs[TRP_ARGS_END >> 3]; |
| 29 | } __aligned(CACHE_WRITEBACK_GRANULE) trp_args_t; |
| 30 | |
| 31 | trp_args_t *set_smc_args(uint64_t arg0, |
| 32 | uint64_t arg1, |
| 33 | uint64_t arg2, |
| 34 | uint64_t arg3, |
| 35 | uint64_t arg4, |
| 36 | uint64_t arg5, |
| 37 | uint64_t arg6, |
| 38 | uint64_t arg7); |
| 39 | |
| 40 | __dead2 void trp_boot_abort(uint64_t err); |
| 41 | |
AlexeiFedorov | f9044ab | 2022-11-24 13:42:44 +0000 | [diff] [blame] | 42 | /* TRP SMC result registers X0-X4 */ |
| 43 | #define TRP_SMC_RESULT_REGS 5 |
| 44 | |
| 45 | struct trp_smc_result { |
| 46 | unsigned long long x[TRP_SMC_RESULT_REGS]; |
| 47 | }; |
| 48 | |
Javier Almansa Sobrino | 4165e84 | 2022-04-25 17:18:15 +0100 | [diff] [blame] | 49 | #endif /* __ASSEMBLER __ */ |
| 50 | #endif /* TRP_HELPERS_H */ |