X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/4452a7af2eac33dbad800bcc91f2399d62c18f53..593a1d5fd87cdf5b46dd5fcb84467b432cea0f91:/osfmk/i386/fpu.h diff --git a/osfmk/i386/fpu.h b/osfmk/i386/fpu.h index 7979b66fa..cd0b78906 100644 --- a/osfmk/i386/fpu.h +++ b/osfmk/i386/fpu.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -54,9 +54,6 @@ * the rights to redistribute these changes. */ -/* - */ - #ifndef _I386_FPU_H_ #define _I386_FPU_H_ @@ -107,9 +104,8 @@ extern void fxrstor64(struct x86_fx_save *); #define fldcw(control) \ __asm__ volatile("fldcw %0" : : "m" (*(unsigned short *) &(control)) ) -extern unsigned short fnstsw(void); - -extern __inline__ unsigned short fnstsw(void) +static inline unsigned short +fnstsw(void) { unsigned short status; __asm__ volatile("fnstsw %0" : "=ma" (status)); @@ -158,6 +154,7 @@ static inline void fpu_save_context(thread_t thread) clear_ts(); /* registers are in FPU - save to memory */ ifps->fp_valid = TRUE; + if (!thread_is_64bit(thread) || is_saved_state32(thread->machine.pcb->iss)) { /* save the compatibility/legacy mode XMM+x87 state */ fxsave(&ifps->fx_save_state);