Harrison Mutai | e0bc2c8 | 2025-05-08 15:36:08 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright The Transfer List Library Contributors |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT OR GPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef EP_INFO_H |
| 8 | #define EP_INFO_H |
| 9 | |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | struct param_header { |
| 13 | uint8_t type; /* type of the structure */ |
| 14 | uint8_t version; /* version of this structure */ |
| 15 | uint16_t size; /* size of this structure in bytes */ |
| 16 | uint32_t attr; /* attributes: unused bits SBZ */ |
| 17 | }; |
| 18 | |
| 19 | struct aapcs_params { |
| 20 | #ifdef __aarch64__ |
| 21 | uint64_t arg0; |
| 22 | uint64_t arg1; |
| 23 | uint64_t arg2; |
| 24 | uint64_t arg3; |
| 25 | uint64_t arg4; |
| 26 | uint64_t arg5; |
| 27 | uint64_t arg6; |
| 28 | uint64_t arg7; |
| 29 | #else |
| 30 | uint32_t arg0; |
| 31 | uint32_t arg1; |
| 32 | uint32_t arg2; |
| 33 | uint32_t arg3; |
| 34 | #endif |
| 35 | }; |
| 36 | |
| 37 | struct entry_point_info { |
| 38 | struct param_header h; |
| 39 | uintptr_t pc; |
| 40 | uint32_t spsr; |
| 41 | #ifndef __aarch64__ |
| 42 | uintptr_t lr_svc; |
| 43 | #endif |
| 44 | struct aapcs_params args; |
| 45 | }; |
| 46 | |
| 47 | #define GET_SPSR_RW(mode) (((mode) >> 0x4U) & 0x1U) |
| 48 | |
| 49 | #endif |