+/*
+ * thread state format for task running in 64bit long mode
+ * in long mode, the same hardware frame is always pushed regardless
+ * of whether there was a change in privlege level... therefore, there
+ * is no need for an x86_saved_state64_from_kernel variant
+ */
+struct x86_saved_state64 {
+ /*
+ * saved state organized to reflect the
+ * system call ABI register convention
+ * so that we can just pass a pointer
+ * to the saved state when calling through
+ * to the actual system call functions
+ * the ABI limits us to 6 args passed in
+ * registers... I've add v_arg6 - v_arg8
+ * to accomodate our most 'greedy' system
+ * calls (both BSD and MACH)... the individual
+ * system call handlers will fill these in
+ * via copyin if needed...
+ */
+ uint64_t rdi; /* arg0 for system call */
+ uint64_t rsi;
+ uint64_t rdx;
+ uint64_t r10;
+ uint64_t r8;
+ uint64_t r9; /* arg5 for system call */
+ uint64_t v_arg6;
+ uint64_t v_arg7;
+ uint64_t v_arg8;
+
+ uint64_t cr2;
+ uint64_t r15;
+ uint64_t r14;
+ uint64_t r13;
+ uint64_t r12;
+ uint64_t r11;
+ uint64_t rbp;
+ uint64_t rbx;
+ uint64_t rcx;
+ uint64_t rax;
+
+ uint32_t gs;
+ uint32_t fs;
+
+ uint32_t _pad_for_tagged_alignment[3];
+
+ struct x86_64_intr_stack_frame isf;
+};
+typedef struct x86_saved_state64 x86_saved_state64_t;
+#define x86_SAVED_STATE64_COUNT ((mach_msg_type_number_t) \
+ (sizeof (struct x86_saved_state64)/sizeof(unsigned int)))
+
+struct x86_saved_state64_tagged {
+ uint32_t tag;
+ x86_saved_state64_t state;
+};
+typedef struct x86_saved_state64_tagged x86_saved_state64_tagged_t;
+
+struct x86_sframe64 {
+ uint64_t _register_save_slot[2];
+ struct x86_64_intr_stack_frame slf;
+ x86_saved_state64_tagged_t ssf;
+};
+typedef struct x86_sframe64 x86_sframe64_t;
+/* Note: sizeof(x86_sframe64_t) is a multiple of 16 bytes */
+
+extern uint32_t get_eflags_exportmask(void);