Interrupt framework
[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  * 64 bit KPT helpers */
6
7 #ifndef ROS_INC_VMM_H
8 #define ROS_INC_VMM_H
9
10 #define VMM_VMCALL_PRINTF       0x1     /* Enable VMCALL output console hack */
11
12 #define VMM_ALL_FLAGS   (VMM_VMCALL_PRINTF)
13
14 enum {
15         RESUME,
16         REG_RSP_RIP_CR3,
17         REG_RIP,
18         REG_ALL,
19 };
20
21 /* eventually, this is a system call. For now, it's #c/vmctl.
22  * You fill in the blanks, and write the struct to #c/vmctl.
23  * On return, i.e. vmexit, it's updated with the new values.
24  */
25 struct vmctl {
26         uint64_t command;
27         uint64_t cr3;
28         uint64_t gva;
29         uint64_t gpa;
30         uint64_t exit_qual;
31         uint64_t shutdown;
32         uint64_t ret_code;
33         uint64_t core;
34         uint32_t interrupt;
35         uint32_t intrinfo1;
36         uint32_t intrinfo2;
37         struct hw_trapframe regs;
38 };
39
40 #endif /* ROS_INC_VMM_H */