blob: 06fc81151600f64967a26706aa1bad5b8a4bda9f [file] [log] [blame]
Soby Mathewa28d46e2023-01-17 02:40:22 +00001/*
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
9COMPILER_ASSERT(sizeof(struct rmi_realm_params) == 0x1000);
AlexeiFedorov18002922023-04-06 10:19:51 +010010COMPILER_ASSERT(offsetof(struct rmi_realm_params, flags) == 0);
11COMPILER_ASSERT(offsetof(struct rmi_realm_params, s2sz) == 0x8);
12COMPILER_ASSERT(offsetof(struct rmi_realm_params, sve_vl) == 0x10);
13COMPILER_ASSERT(offsetof(struct rmi_realm_params, num_bps) == 0x18);
14COMPILER_ASSERT(offsetof(struct rmi_realm_params, num_wps) == 0x20);
15COMPILER_ASSERT(offsetof(struct rmi_realm_params, pmu_num_ctrs) == 0x28);
16COMPILER_ASSERT(offsetof(struct rmi_realm_params, hash_algo) == 0x30);
Soby Mathewa28d46e2023-01-17 02:40:22 +000017COMPILER_ASSERT(offsetof(struct rmi_realm_params, rpv) == 0x400);
18COMPILER_ASSERT(offsetof(struct rmi_realm_params, vmid) == 0x800);
19COMPILER_ASSERT(offsetof(struct rmi_realm_params, rtt_base) == 0x808);
20COMPILER_ASSERT(offsetof(struct rmi_realm_params, rtt_level_start) == 0x810);
21COMPILER_ASSERT(offsetof(struct rmi_realm_params, rtt_num_start) == 0x818);
22
Soby Mathewa28d46e2023-01-17 02:40:22 +000023COMPILER_ASSERT(sizeof(struct rmi_rec_params) == 0x1000);
24COMPILER_ASSERT(offsetof(struct rmi_rec_params, flags) == 0);
25COMPILER_ASSERT(offsetof(struct rmi_rec_params, mpidr) == 0x100);
26COMPILER_ASSERT(offsetof(struct rmi_rec_params, pc) == 0x200);
27COMPILER_ASSERT(offsetof(struct rmi_rec_params, gprs) == 0x300);
28COMPILER_ASSERT(offsetof(struct rmi_rec_params, num_aux) == 0x800);
29COMPILER_ASSERT(offsetof(struct rmi_rec_params, aux) == 0x808);
30
31COMPILER_ASSERT(sizeof(struct rmi_rec_entry) == 0x800);
32COMPILER_ASSERT(offsetof(struct rmi_rec_entry, flags) == 0);
33COMPILER_ASSERT(offsetof(struct rmi_rec_entry, gprs) == 0x200);
34COMPILER_ASSERT(offsetof(struct rmi_rec_entry, gicv3_hcr) == 0x300);
35COMPILER_ASSERT(offsetof(struct rmi_rec_entry, gicv3_lrs) == 0x308);
36
37
38COMPILER_ASSERT(offsetof(struct rmi_rec_exit, exit_reason) == 0);
39COMPILER_ASSERT(offsetof(struct rmi_rec_exit, esr) == 0x100);
40COMPILER_ASSERT(offsetof(struct rmi_rec_exit, far) == 0x108);
41COMPILER_ASSERT(offsetof(struct rmi_rec_exit, hpfar) == 0x110);
42COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gprs) == 0x200);
43COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_hcr) == 0x300);
44COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_lrs) == 0x308);
45COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_misr) == 0x388);
46COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_vmcr) == 0x390);
47COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntp_ctl) == 0x400);
48COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntp_cval) == 0x408);
49COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntv_ctl) == 0x410);
50COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntv_cval) == 0x418);
51COMPILER_ASSERT(offsetof(struct rmi_rec_exit, ripas_base) == 0x500);
AlexeiFedorovccce3ad2023-04-28 18:29:47 +010052COMPILER_ASSERT(offsetof(struct rmi_rec_exit, ripas_top) == 0x508);
Soby Mathewa28d46e2023-01-17 02:40:22 +000053COMPILER_ASSERT(offsetof(struct rmi_rec_exit, ripas_value) == 0x510);
54COMPILER_ASSERT(offsetof(struct rmi_rec_exit, imm) == 0x600);
AlexeiFedoroveaec0c42023-02-01 18:13:32 +000055COMPILER_ASSERT(offsetof(struct rmi_rec_exit, pmu_ovf) == 0x700);
56COMPILER_ASSERT(offsetof(struct rmi_rec_exit, pmu_intr_en) == 0x708);
57COMPILER_ASSERT(offsetof(struct rmi_rec_exit, pmu_cntr_en) == 0x710);
Soby Mathewa28d46e2023-01-17 02:40:22 +000058
59COMPILER_ASSERT(sizeof(struct rmi_rec_run) <= GRANULE_SIZE);
60COMPILER_ASSERT(offsetof(struct rmi_rec_run, entry) == 0);
61COMPILER_ASSERT(offsetof(struct rmi_rec_run, exit) == 0x800);