xref: /illumos-gate/usr/src/test/bhyve-tests/tests/common/payload_common.h (revision ddb365bfc9e868ad24ccdcb0dc91af18b10df082)
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 2022 Oxide Computer Company
14  */
15 
16 #ifndef _PAYLOAD_COMMON_H_
17 #define	_PAYLOAD_COMMON_H_
18 
19 #define	MEM_TOTAL_SZ	(64 * 1024 * 1024)
20 
21 /* 2MiB-page entries for identity-mapped table at 2MiB */
22 #define	MEM_LOC_PAGE_TABLE_2M	0x200000
23 #define	MEM_LOC_PAGE_TABLE_1G	0x204000
24 #define	MEM_LOC_PAGE_TABLE_512G	0x205000
25 #define	MEM_LOC_GDT		0x206000
26 #define	MEM_LOC_TSS		0x206200
27 #define	MEM_LOC_IDT		0x207000
28 #define	MEM_LOC_STACK		0x400000
29 #define	MEM_LOC_PAYLOAD		0x800000
30 #define	MEM_LOC_ROM		0xffff000
31 
32 /* IO port set aside for emitting test result */
33 #define	IOP_TEST_RESULT		0xef00U
34 
35 /* IO port set aside for emitting test value */
36 #define	IOP_TEST_VALUE		0xef10U
37 
38 /* IO port set aside for inputting test param(s) */
39 #define	IOP_TEST_PARAM		IOP_TEST_PARAM0
40 #define	IOP_TEST_PARAM0		0xef20U
41 #define	IOP_TEST_PARAM1		0xef21U
42 #define	IOP_TEST_PARAM2		0xef22U
43 #define	IOP_TEST_PARAM3		0xef23U
44 
45 /* Expected values emitted through IOP_TEST_RESULT */
46 #define	TEST_RESULT_PASS	0
47 #define	TEST_RESULT_FAIL	1
48 
49 #endif /* _PAYLOAD_COMMON_H_ */
50