]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/fpu.h
xnu-792.6.56.tar.gz
[apple/xnu.git] / osfmk / i386 / fpu.h
index ba87629029e797aa975b0736d9c4e1d17bfc0924..fb4516281098d82dae270c8c71ac15eff6bcf088 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
@@ -62,7 +60,6 @@
  * floating-point processor.
  */
 
-#include <cpus.h>
 #include <i386/proc_reg.h>
 #include <i386/thread.h>
 #include <kern/kern_types.h>
@@ -117,11 +114,10 @@ extern __inline__ unsigned short fnstsw(void)
  * NOTE: in order to provide backwards compatible support in the kernel. When saving SSE2 state, we also save the
  * FP state in it's old location. Otherwise fpu_get_state() and fpu_set_state() will stop working
  */
-#if    NCPUS > 1
 #define        fpu_save_context(thread) \
     { \
        register struct i386_fpsave_state *ifps; \
-       ifps = (thread)->top_act->mact.pcb->ims.ifps; \
+       ifps = (thread)->machine.pcb->ims.ifps; \
        if (ifps != 0 && !ifps->fp_valid) { \
            /* registers are in FPU - save to memory */ \
            ifps->fp_valid = TRUE; \
@@ -135,38 +131,31 @@ extern __inline__ unsigned short fnstsw(void)
        set_ts(); \
     }
            
-#else  /* NCPUS == 1 */
-#define        fpu_save_context(thread) \
-    { \
-           set_ts(); \
-    }
-
-#endif /* NCPUS == 1 */
 
 
 extern int     fp_kind;
 
 extern void            init_fpu(void);
 extern void            fpu_module_init(void);
-extern void            fp_free(
+extern void            fpu_free(
                                struct i386_fpsave_state        * fps);
 extern kern_return_t   fpu_set_state(
-                               thread_act_t                    thr_act,
+                               thread_t                        thr_act,
                                struct i386_float_state         * st);
 extern kern_return_t   fpu_get_state(
-                               thread_act_t                    thr_act,
+                               thread_t                        thr_act,
                                struct i386_float_state         * st);
-/* extern kern_return_t        fpu_set_fxstate(
-                               thread_act_t                    thr_act,
+extern kern_return_t   fpu_set_fxstate(
+                               thread_t                        thr_act,
                                struct i386_float_state         * st);
 extern kern_return_t   fpu_get_fxstate(
-                               thread_act_t                    thr_act,
-                               struct i386_float_state         * st); */
+                               thread_t                        thr_act,
+                               struct i386_float_state         * st);
 extern void            fpnoextflt(void);
 extern void            fpextovrflt(void);
 extern void            fpexterrflt(void);
 extern void            fp_state_alloc(void);
 extern void            fpintr(void);
-extern void            fpflush(thread_act_t);
+extern void            fpflush(thread_t);
 
 #endif /* _I386_FPU_H_ */