Sanitize vcoreid from untrusted sources
[akaros.git] / kern / include / ros / vmm.h
index 309e9f8..fc0ac44 100644 (file)
@@ -2,12 +2,27 @@
  * Barret Rhoden <brho@cs.berkeley.edu>
  * See LICENSE for details.
  *
- * 64 bit KPT helpers */
+ * Arch-independent VMM kernel headers */
 
-#ifndef ROS_INC_VMM_H
-#define ROS_INC_VMM_H
+#pragma once
 
-#define        VMM_VMCALL_PRINTF       0x1     /* Enable VMCALL output console hack */
+#include <ros/arch/vmm.h>
 
-#define VMM_ALL_FLAGS  (VMM_VMCALL_PRINTF)
-#endif /* ROS_INC_VMM_H */
+/* VMCALL FUNCTION NUMBERS */
+#define VMCALL_PRINTC          0x1
+#define VMCALL_SMPBOOT         0x2
+#define VMCALL_GET_TSCFREQ     0x3
+#define VMCALL_TRACE_TF                0x4
+
+#define VMM_CTL_GET_EXITS              1
+#define VMM_CTL_SET_EXITS              2
+#define VMM_CTL_GET_FLAGS              3
+#define VMM_CTL_SET_FLAGS              4
+
+#define VMM_CTL_EXIT_HALT              (1 << 0)
+#define VMM_CTL_EXIT_PAUSE             (1 << 1)
+#define VMM_CTL_EXIT_MWAIT             (1 << 2)
+#define VMM_CTL_ALL_EXITS              ((1 << 3) - 1)
+
+#define VMM_CTL_FL_KERN_PRINTC         (1 << 0)
+#define VMM_CTL_ALL_FLAGS              (VMM_CTL_FL_KERN_PRINTC)