]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/fpu.h
xnu-4570.61.1.tar.gz
[apple/xnu.git] / osfmk / i386 / fpu.h
index a606aab41376ecf269151ed954be16e8fe5c77ec..84a03460d7a300ed739aef6117470a83a5ac440e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -91,12 +105,17 @@ extern void                fpexterrflt(void);
 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_ */