Soby Mathew | a28d46e | 2023-01-17 02:40:22 +0000 | [diff] [blame] | 1 | /* |
| 2 | * SPDX-License-Identifier: BSD-3-Clause |
| 3 | * SPDX-FileCopyrightText: Copyright TF-RMM Contributors. |
| 4 | */ |
| 5 | |
| 6 | #include <smc-rmi.h> |
| 7 | #include <stddef.h> |
| 8 | |
| 9 | COMPILER_ASSERT(sizeof(struct rmi_realm_params) == 0x1000); |
AlexeiFedorov | 1800292 | 2023-04-06 10:19:51 +0100 | [diff] [blame] | 10 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, flags) == 0); |
| 11 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, s2sz) == 0x8); |
| 12 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, sve_vl) == 0x10); |
| 13 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, num_bps) == 0x18); |
| 14 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, num_wps) == 0x20); |
| 15 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, pmu_num_ctrs) == 0x28); |
| 16 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, hash_algo) == 0x30); |
Soby Mathew | a28d46e | 2023-01-17 02:40:22 +0000 | [diff] [blame] | 17 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, rpv) == 0x400); |
| 18 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, vmid) == 0x800); |
| 19 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, rtt_base) == 0x808); |
| 20 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, rtt_level_start) == 0x810); |
| 21 | COMPILER_ASSERT(offsetof(struct rmi_realm_params, rtt_num_start) == 0x818); |
| 22 | |
Soby Mathew | a28d46e | 2023-01-17 02:40:22 +0000 | [diff] [blame] | 23 | COMPILER_ASSERT(sizeof(struct rmi_rec_params) == 0x1000); |
| 24 | COMPILER_ASSERT(offsetof(struct rmi_rec_params, flags) == 0); |
| 25 | COMPILER_ASSERT(offsetof(struct rmi_rec_params, mpidr) == 0x100); |
| 26 | COMPILER_ASSERT(offsetof(struct rmi_rec_params, pc) == 0x200); |
| 27 | COMPILER_ASSERT(offsetof(struct rmi_rec_params, gprs) == 0x300); |
| 28 | COMPILER_ASSERT(offsetof(struct rmi_rec_params, num_aux) == 0x800); |
| 29 | COMPILER_ASSERT(offsetof(struct rmi_rec_params, aux) == 0x808); |
| 30 | |
| 31 | COMPILER_ASSERT(sizeof(struct rmi_rec_entry) == 0x800); |
| 32 | COMPILER_ASSERT(offsetof(struct rmi_rec_entry, flags) == 0); |
| 33 | COMPILER_ASSERT(offsetof(struct rmi_rec_entry, gprs) == 0x200); |
| 34 | COMPILER_ASSERT(offsetof(struct rmi_rec_entry, gicv3_hcr) == 0x300); |
| 35 | COMPILER_ASSERT(offsetof(struct rmi_rec_entry, gicv3_lrs) == 0x308); |
| 36 | |
| 37 | |
| 38 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, exit_reason) == 0); |
| 39 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, esr) == 0x100); |
| 40 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, far) == 0x108); |
| 41 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, hpfar) == 0x110); |
| 42 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gprs) == 0x200); |
| 43 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_hcr) == 0x300); |
| 44 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_lrs) == 0x308); |
| 45 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_misr) == 0x388); |
| 46 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_vmcr) == 0x390); |
| 47 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntp_ctl) == 0x400); |
| 48 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntp_cval) == 0x408); |
| 49 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntv_ctl) == 0x410); |
| 50 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntv_cval) == 0x418); |
| 51 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, ripas_base) == 0x500); |
AlexeiFedorov | ccce3ad | 2023-04-28 18:29:47 +0100 | [diff] [blame^] | 52 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, ripas_top) == 0x508); |
Soby Mathew | a28d46e | 2023-01-17 02:40:22 +0000 | [diff] [blame] | 53 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, ripas_value) == 0x510); |
| 54 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, imm) == 0x600); |
AlexeiFedorov | eaec0c4 | 2023-02-01 18:13:32 +0000 | [diff] [blame] | 55 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, pmu_ovf) == 0x700); |
| 56 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, pmu_intr_en) == 0x708); |
| 57 | COMPILER_ASSERT(offsetof(struct rmi_rec_exit, pmu_cntr_en) == 0x710); |
Soby Mathew | a28d46e | 2023-01-17 02:40:22 +0000 | [diff] [blame] | 58 | |
| 59 | COMPILER_ASSERT(sizeof(struct rmi_rec_run) <= GRANULE_SIZE); |
| 60 | COMPILER_ASSERT(offsetof(struct rmi_rec_run, entry) == 0); |
| 61 | COMPILER_ASSERT(offsetof(struct rmi_rec_run, exit) == 0x800); |