/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* Macro definitions for routines to manipulate the
* floating-point processor.
*/
-#include <kern/thread.h>
#include <kern/kern_types.h>
#include <mach/i386/kern_return.h>
#include <mach/i386/thread_status.h>
#include <i386/proc_reg.h>
-#include <i386/thread.h>
-extern int fp_kind;
+typedef enum {
+ FXSAVE32 = 1,
+ FXSAVE64 = 2,
+ XSAVE32 = 3,
+ XSAVE64 = 4,
+ FP_UNUSED = 5
+ } fp_save_layout_t;
+
+typedef enum {
+ UNDEFINED,
+ FP,
+ AVX,
+#if !defined(RC_HIDE_XNU_J137)
+ AVX512
+#endif
+} xstate_t;
extern void init_fpu(void);
extern void fpu_module_init(void);
extern void fpu_free(
- void * fps);
+ thread_t thr_act,
+ void *fps);
extern kern_return_t fpu_set_fxstate(
thread_t thr_act,
thread_state_t state,
extern void fpSSEexterrflt(void);
extern void fpflush(thread_t);
extern void fp_setvalid(boolean_t);
-#ifdef __i386__
-extern void fxsave64(struct x86_fx_thread_state *);
-extern void fxrstor64(struct x86_fx_thread_state *);
-#endif
-extern void clear_fpu(void);
-extern void fpu_save_context(thread_t thread);
+extern void clear_fpu(void);
+extern void fpu_switch_context(
+ thread_t old,
+ thread_t new);
+extern void fpu_switch_addrmode(
+ thread_t thread,
+ boolean_t is_64bit);
+
+extern xstate_t fpu_default;
+extern xstate_t current_xstate(void);
+extern void fpUDflt(user_addr_t rip);
#endif /* _I386_FPU_H_ */