xref: /illumos-gate/usr/src/test/bhyve-tests/tests/common/payload_common.h (revision e00bdde3c6d406f40f53f3025defadc22f7ec31a)
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 2023 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_HEAP		0x400000
29 #define	MEM_LOC_STACK		0x7fff00
30 #define	MEM_LOC_PAYLOAD		0x800000
31 #define	MEM_LOC_ROM		0xffff000
32 
33 /* IO port set aside for emitting test result */
34 #define	IOP_TEST_RESULT		0xef00U
35 
36 /* IO port set aside for emitting test message strings */
37 #define	IOP_TEST_MSG		0xef08U
38 
39 /* IO port set aside for emitting test value */
40 #define	IOP_TEST_VALUE		0xef10U
41 
42 /* IO port set aside for inputting test param(s) */
43 #define	IOP_TEST_PARAM		IOP_TEST_PARAM0
44 #define	IOP_TEST_PARAM0		0xef20U
45 #define	IOP_TEST_PARAM1		0xef21U
46 #define	IOP_TEST_PARAM2		0xef22U
47 #define	IOP_TEST_PARAM3		0xef23U
48 
49 /* Expected values emitted through IOP_TEST_RESULT */
50 #define	TEST_RESULT_PASS	0
51 #define	TEST_RESULT_FAIL	1
52 
53 #endif /* _PAYLOAD_COMMON_H_ */
54