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