xref: /illumos-kvm/kvm_types.h (revision 2a9ff8dc)
1 /*
2  * GPL HEADER START
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16  *
17  * GPL HEADER END
18  *
19  * Copyright 2011 various Linux Kernel contributors.
20  * Copyright 2011 Joyent, Inc. All Rights Reserved.
21  */
22 
23 #ifndef __KVM_TYPES_H__
24 #define	__KVM_TYPES_H__
25 
26 #include <sys/stdint.h>
27 
28 /*
29  * Address types:
30  *
31  *  gva - guest virtual address
32  *  gpa - guest physical address
33  *  gfn - guest frame number
34  *  hva - host virtual address
35  *  hpa - host physical address
36  *  hfn - host frame number
37  */
38 
39 typedef unsigned long	gva_t;
40 typedef uint64_t	gpa_t;
41 typedef unsigned long	gfn_t;
42 
43 typedef unsigned long	hva_t;
44 typedef uint64_t	hpa_t;
45 typedef unsigned long	hfn_t;
46 
47 union kvm_ioapic_redirect_entry {
48 	uint64_t bits;
49 	struct {
50 		uint8_t vector;
51 		uint8_t delivery_mode:3;
52 		uint8_t dest_mode:1;
53 		uint8_t delivery_status:1;
54 		uint8_t polarity:1;
55 		uint8_t remote_irr:1;
56 		uint8_t trig_mode:1;
57 		uint8_t mask:1;
58 		uint8_t reserve:7;
59 		uint8_t reserved[4];
60 		uint8_t dest_id;
61 	} fields;
62 };
63 
64 typedef struct kvm_lapic_irq {
65 	uint32_t vector;
66 	uint32_t delivery_mode;
67 	uint32_t dest_mode;
68 	uint32_t level;
69 	uint32_t trig_mode;
70 	uint32_t shorthand;
71 	uint32_t dest_id;
72 } kvm_lapic_irq_t;
73 
74 #endif /* __KVM_TYPES_H__ */
75