xref: /illumos-gate/usr/src/test/os-tests/tests/imc/imc_test.h (revision a92282e44f968185a6bba094d1e5fece2da819cf)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2019 Joyent, Inc.
14  */
15 
16 #ifndef _IMC_TEST_H
17 #define	_IMC_TEST_H
18 
19 #include <stdint.h>
20 #include <inttypes.h>
21 
22 #include "imc.h"
23 
24 /*
25  * Standard interfaces for the IMC test files.
26  */
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 typedef struct imc_test_case {
33 	const char		*itc_desc;
34 	uint64_t		itc_pa;
35 	const imc_t		*itc_imc;
36 	boolean_t		itc_pass;
37 	imc_decode_failure_t	itc_fail;
38 	/*
39 	 * These will all be checked on the success case unless set to the
40 	 * respective UINTXX_MAX value.
41 	 */
42 	uint32_t		itc_nodeid;
43 	uint32_t		itc_tadid;
44 	uint32_t		itc_channelid;
45 	uint64_t		itc_chanaddr;
46 	uint32_t		itc_dimmid;
47 	uint32_t		itc_rankid;
48 	uint64_t		itc_rankaddr;
49 } imc_test_case_t;
50 
51 /*
52  * Arrays of tests cases that exist. They are terminated with a NULL itc_desc
53  * member.
54  */
55 extern const imc_test_case_t imc_test_basics[];
56 extern const imc_test_case_t imc_test_badaddr[];
57 extern const imc_test_case_t imc_test_fail[];
58 extern const imc_test_case_t imc_test_rir[];
59 extern const imc_test_case_t imc_test_sad[];
60 extern const imc_test_case_t imc_test_skx_loop[];
61 extern const imc_test_case_t imc_test_tad[];
62 
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif /* _IMC_TEST_H */
69