summaryrefslogtreecommitdiff
path: root/usr/src/test/bhyve-tests/tests/common/payload_common.h
blob: 826927f884935c47c8aa60544a7a89b0a66fdd32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * This file and its contents are supplied under the terms of the
 * Common Development and Distribution License ("CDDL"), version 1.0.
 * You may only use this file in accordance with the terms of version
 * 1.0 of the CDDL.
 *
 * A full copy of the text of the CDDL should have accompanied this
 * source.  A copy of the CDDL is also available via the Internet at
 * http://www.illumos.org/license/CDDL.
 */

/*
 * Copyright 2022 Oxide Computer Company
 */

#ifndef _PAYLOAD_COMMON_H_
#define	_PAYLOAD_COMMON_H_

#define	MEM_TOTAL_SZ	(64 * 1024 * 1024)

/* 2MiB-page entries for identity-mapped table at 2MiB */
#define	MEM_LOC_PAGE_TABLE_2M	0x200000
#define	MEM_LOC_PAGE_TABLE_1G	0x204000
#define	MEM_LOC_PAGE_TABLE_512G	0x205000
#define	MEM_LOC_GDT		0x206000
#define	MEM_LOC_TSS		0x206200
#define	MEM_LOC_IDT		0x207000
#define	MEM_LOC_STACK		0x400000
#define	MEM_LOC_PAYLOAD		0x800000
#define	MEM_LOC_ROM		0xffff000

/* IO port set aside for emitting test result */
#define	IOP_TEST_RESULT		0xef00U

/* IO port set aside for emitting test value */
#define	IOP_TEST_VALUE		0xef10U

/* IO port set aside for inputting test param(s) */
#define	IOP_TEST_PARAM		IOP_TEST_PARAM0
#define	IOP_TEST_PARAM0		0xef20U
#define	IOP_TEST_PARAM1		0xef21U
#define	IOP_TEST_PARAM2		0xef22U
#define	IOP_TEST_PARAM3		0xef23U

/* Expected values emitted through IOP_TEST_RESULT */
#define	TEST_RESULT_PASS	0
#define	TEST_RESULT_FAIL	1

#endif /* _PAYLOAD_COMMON_H_ */