xref: /illumos-gate/usr/src/test/bhyve-tests/tests/common/payload_utils.h (revision 7a6d80f1660abd4755c68cbd094d4a914681d26e)
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_UTILS_H_
17 #define	_PAYLOAD_UTILS_H_
18 
19 #include <sys/types.h>
20 #include <stdbool.h>
21 
22 void outb(uint16_t, uint8_t);
23 void outw(uint16_t, uint16_t);
24 void outl(uint16_t, uint32_t);
25 uint8_t inb(uint16_t);
26 uint16_t inw(uint16_t);
27 uint32_t inl(uint16_t);
28 uint64_t rdmsr(uint32_t);
29 void wrmsr(uint32_t, uint64_t);
30 void cpuid(uint32_t, uint32_t, uint32_t *);
31 
32 #endif /* _PAYLOAD_UTILS_H_ */
33