xref: /linux/drivers/gpu/drm/imagination/pvr_rogue_mips_check.h (revision 4b911a9690d72641879ea6d13cce1de31d346d79)
1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
2 /* Copyright (c) 2023 Imagination Technologies Ltd. */
3 
4 #ifndef PVR_ROGUE_MIPS_CHECK_H
5 #define PVR_ROGUE_MIPS_CHECK_H
6 
7 #include <linux/build_bug.h>
8 
9 static_assert(offsetof(struct rogue_mips_tlb_entry, tlb_page_mask) == 0,
10 	      "offsetof(struct rogue_mips_tlb_entry, tlb_page_mask) incorrect");
11 static_assert(offsetof(struct rogue_mips_tlb_entry, tlb_hi) == 4,
12 	      "offsetof(struct rogue_mips_tlb_entry, tlb_hi) incorrect");
13 static_assert(offsetof(struct rogue_mips_tlb_entry, tlb_lo0) == 8,
14 	      "offsetof(struct rogue_mips_tlb_entry, tlb_lo0) incorrect");
15 static_assert(offsetof(struct rogue_mips_tlb_entry, tlb_lo1) == 12,
16 	      "offsetof(struct rogue_mips_tlb_entry, tlb_lo1) incorrect");
17 static_assert(sizeof(struct rogue_mips_tlb_entry) == 16,
18 	      "struct rogue_mips_tlb_entry is incorrect size");
19 
20 static_assert(offsetof(struct rogue_mips_remap_entry, remap_addr_in) == 0,
21 	      "offsetof(struct rogue_mips_remap_entry, remap_addr_in) incorrect");
22 static_assert(offsetof(struct rogue_mips_remap_entry, remap_addr_out) == 4,
23 	      "offsetof(struct rogue_mips_remap_entry, remap_addr_out) incorrect");
24 static_assert(offsetof(struct rogue_mips_remap_entry, remap_region_size) == 8,
25 	      "offsetof(struct rogue_mips_remap_entry, remap_region_size) incorrect");
26 static_assert(sizeof(struct rogue_mips_remap_entry) == 12,
27 	      "struct rogue_mips_remap_entry is incorrect size");
28 
29 static_assert(offsetof(struct rogue_mips_state, error_state) == 0,
30 	      "offsetof(struct rogue_mips_state, error_state) incorrect");
31 static_assert(offsetof(struct rogue_mips_state, error_epc) == 4,
32 	      "offsetof(struct rogue_mips_state, error_epc) incorrect");
33 static_assert(offsetof(struct rogue_mips_state, status_register) == 8,
34 	      "offsetof(struct rogue_mips_state, status_register) incorrect");
35 static_assert(offsetof(struct rogue_mips_state, cause_register) == 12,
36 	      "offsetof(struct rogue_mips_state, cause_register) incorrect");
37 static_assert(offsetof(struct rogue_mips_state, bad_register) == 16,
38 	      "offsetof(struct rogue_mips_state, bad_register) incorrect");
39 static_assert(offsetof(struct rogue_mips_state, epc) == 20,
40 	      "offsetof(struct rogue_mips_state, epc) incorrect");
41 static_assert(offsetof(struct rogue_mips_state, sp) == 24,
42 	      "offsetof(struct rogue_mips_state, sp) incorrect");
43 static_assert(offsetof(struct rogue_mips_state, debug) == 28,
44 	      "offsetof(struct rogue_mips_state, debug) incorrect");
45 static_assert(offsetof(struct rogue_mips_state, depc) == 32,
46 	      "offsetof(struct rogue_mips_state, depc) incorrect");
47 static_assert(offsetof(struct rogue_mips_state, bad_instr) == 36,
48 	      "offsetof(struct rogue_mips_state, bad_instr) incorrect");
49 static_assert(offsetof(struct rogue_mips_state, unmapped_address) == 40,
50 	      "offsetof(struct rogue_mips_state, unmapped_address) incorrect");
51 static_assert(offsetof(struct rogue_mips_state, tlb) == 44,
52 	      "offsetof(struct rogue_mips_state, tlb) incorrect");
53 static_assert(offsetof(struct rogue_mips_state, remap) == 300,
54 	      "offsetof(struct rogue_mips_state, remap) incorrect");
55 static_assert(sizeof(struct rogue_mips_state) == 684,
56 	      "struct rogue_mips_state is incorrect size");
57 
58 #endif /* PVR_ROGUE_MIPS_CHECK_H */
59