Move ros/vmx.h to an arch-specific location (XCC)
[akaros.git] / kern / include / ros / vmm.h
1 /* Copyright (c) 2015 Google Inc.
2  * Barret Rhoden <brho@cs.berkeley.edu>
3  * See LICENSE for details.
4  *
5  * Arch-independent VMM kernel headers */
6
7 #ifndef ROS_INC_VMM_H
8 #define ROS_INC_VMM_H
9
10 #include <ros/arch/vmm.h>
11
12 #define VMM_VMCALL_PRINTF       0x1     /* Enable VMCALL output console hack */
13
14 #define VMM_ALL_FLAGS   (VMM_VMCALL_PRINTF)
15
16 enum {
17         RESUME,
18         REG_RSP_RIP_CR3,
19         REG_RIP,
20         REG_ALL,
21 };
22
23 /* eventually, this is a system call. For now, it's #c/vmctl.
24  * You fill in the blanks, and write the struct to #c/vmctl.
25  * On return, i.e. vmexit, it's updated with the new values.
26  */
27 struct vmctl {
28         uint64_t command;
29         uint64_t cr3;
30         uint64_t gva;
31         uint64_t gpa;
32         uint64_t exit_qual;
33         uint64_t shutdown;
34         uint64_t ret_code;
35         uint64_t core;
36         uint32_t interrupt;
37         uint32_t intrinfo1;
38         uint32_t intrinfo2;
39         // These two page-sized entities must be page-aligned
40         uint64_t pir;
41         uint64_t vapic;
42         struct hw_trapframe regs;
43 };
44
45 #endif /* ROS_INC_VMM_H */