xref: /illumos-kvm/linux/include/linux/kvm_types.h (revision 44f65dde)
1 #ifndef KVM_UNIFDEF_H
2 #define KVM_UNIFDEF_H
3 
4 #ifdef __i386__
5 #ifndef CONFIG_X86_32
6 #define CONFIG_X86_32 1
7 #endif
8 #endif
9 
10 #ifdef __x86_64__
11 #ifndef CONFIG_X86_64
12 #define CONFIG_X86_64 1
13 #endif
14 #endif
15 
16 #if defined(__i386__) || defined (__x86_64__)
17 #ifndef CONFIG_X86
18 #define CONFIG_X86 1
19 #endif
20 #endif
21 
22 #ifdef __ia64__
23 #ifndef CONFIG_IA64
24 #define CONFIG_IA64 1
25 #endif
26 #endif
27 
28 #ifdef __PPC__
29 #ifndef CONFIG_PPC
30 #define CONFIG_PPC 1
31 #endif
32 #endif
33 
34 #ifdef __s390__
35 #ifndef CONFIG_S390
36 #define CONFIG_S390 1
37 #endif
38 #endif
39 
40 #endif
41 /*
42  * This program is free software; you can redistribute it and/or modify
43  * it under the terms of the GNU General Public License as published by
44  * the Free Software Foundation; either version 2 of the License.
45  *
46  * This program is distributed in the hope that it will be useful,
47  * but WITHOUT ANY WARRANTY; without even the implied warranty of
48  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
49  * GNU General Public License for more details.
50  *
51  * You should have received a copy of the GNU General Public License
52  * along with this program; if not, write to the Free Software
53  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
54  *
55  */
56 
57 #ifndef __KVM_TYPES_H__
58 #define __KVM_TYPES_H__
59 
60 #include <asm/types.h>
61 
62 /*
63  * Address types:
64  *
65  *  gva - guest virtual address
66  *  gpa - guest physical address
67  *  gfn - guest frame number
68  *  hva - host virtual address
69  *  hpa - host physical address
70  *  hfn - host frame number
71  */
72 
73 typedef unsigned long  gva_t;
74 typedef u64            gpa_t;
75 typedef unsigned long  gfn_t;
76 
77 typedef unsigned long  hva_t;
78 typedef u64            hpa_t;
79 typedef unsigned long  hfn_t;
80 
81 typedef hfn_t pfn_t;
82 
83 union kvm_ioapic_redirect_entry {
84 	u64 bits;
85 	struct {
86 		u8 vector;
87 		u8 delivery_mode:3;
88 		u8 dest_mode:1;
89 		u8 delivery_status:1;
90 		u8 polarity:1;
91 		u8 remote_irr:1;
92 		u8 trig_mode:1;
93 		u8 mask:1;
94 		u8 reserve:7;
95 		u8 reserved[4];
96 		u8 dest_id;
97 	} fields;
98 };
99 
100 struct kvm_lapic_irq {
101 	u32 vector;
102 	u32 delivery_mode;
103 	u32 dest_mode;
104 	u32 level;
105 	u32 trig_mode;
106 	u32 shorthand;
107 	u32 dest_id;
108 };
109 
110 #endif /* __KVM_TYPES_H__ */
111