npx.c (138129) | npx.c (143063) |
---|---|
1/*- 2 * Copyright (c) 1990 William Jolitz. 3 * Copyright (c) 1991 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1990 William Jolitz. 3 * Copyright (c) 1991 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/i386/isa/npx.c 138129 2004-11-27 06:51:39Z das $"); | 34__FBSDID("$FreeBSD: head/sys/i386/isa/npx.c 143063 2005-03-02 21:33:29Z joerg $"); |
35 36#include "opt_cpu.h" 37#include "opt_debug_npx.h" 38#include "opt_isa.h" 39#include "opt_npx.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> --- 47 unchanged lines hidden (view full) --- 90 * 387 and 287 Numeric Coprocessor Extension (NPX) Driver. 91 */ 92 93/* Configuration flags. */ 94#define NPX_DISABLE_I586_OPTIMIZED_BCOPY (1 << 0) 95#define NPX_DISABLE_I586_OPTIMIZED_BZERO (1 << 1) 96#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2) 97 | 35 36#include "opt_cpu.h" 37#include "opt_debug_npx.h" 38#include "opt_isa.h" 39#include "opt_npx.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> --- 47 unchanged lines hidden (view full) --- 90 * 387 and 287 Numeric Coprocessor Extension (NPX) Driver. 91 */ 92 93/* Configuration flags. */ 94#define NPX_DISABLE_I586_OPTIMIZED_BCOPY (1 << 0) 95#define NPX_DISABLE_I586_OPTIMIZED_BZERO (1 << 1) 96#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2) 97 |
98#if (defined(__GNUC__) && !defined(lint)) || defined(__INTEL_COMPILER) | 98#if defined(__GNUCLIKE_ASM) && !defined(lint) |
99 100#define fldcw(addr) __asm("fldcw %0" : : "m" (*(addr))) 101#define fnclex() __asm("fnclex") 102#define fninit() __asm("fninit") 103#define fnsave(addr) __asm __volatile("fnsave %0" : "=m" (*(addr))) 104#define fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr))) 105#define fnstsw(addr) __asm __volatile("fnstsw %0" : "=m" (*(addr))) 106#define fp_divide_by_0() __asm("fldz; fld1; fdiv %st,%st(1); fnop") 107#define frstor(addr) __asm("frstor %0" : : "m" (*(addr))) 108#ifdef CPU_ENABLE_SSE 109#define fxrstor(addr) __asm("fxrstor %0" : : "m" (*(addr))) 110#define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) 111#endif 112#define start_emulating() __asm("smsw %%ax; orb %0,%%al; lmsw %%ax" \ 113 : : "n" (CR0_TS) : "ax") 114#define stop_emulating() __asm("clts") 115 | 99 100#define fldcw(addr) __asm("fldcw %0" : : "m" (*(addr))) 101#define fnclex() __asm("fnclex") 102#define fninit() __asm("fninit") 103#define fnsave(addr) __asm __volatile("fnsave %0" : "=m" (*(addr))) 104#define fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr))) 105#define fnstsw(addr) __asm __volatile("fnstsw %0" : "=m" (*(addr))) 106#define fp_divide_by_0() __asm("fldz; fld1; fdiv %st,%st(1); fnop") 107#define frstor(addr) __asm("frstor %0" : : "m" (*(addr))) 108#ifdef CPU_ENABLE_SSE 109#define fxrstor(addr) __asm("fxrstor %0" : : "m" (*(addr))) 110#define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) 111#endif 112#define start_emulating() __asm("smsw %%ax; orb %0,%%al; lmsw %%ax" \ 113 : : "n" (CR0_TS) : "ax") 114#define stop_emulating() __asm("clts") 115 |
116#else /* !((__GNUC__ && !lint ) || __INTEL_COMPILER) */ | 116#else /* !(__GNUCLIKE_ASM && !lint) */ |
117 118void fldcw(caddr_t addr); 119void fnclex(void); 120void fninit(void); 121void fnsave(caddr_t addr); 122void fnstcw(caddr_t addr); 123void fnstsw(caddr_t addr); 124void fp_divide_by_0(void); 125void frstor(caddr_t addr); 126#ifdef CPU_ENABLE_SSE 127void fxsave(caddr_t addr); 128void fxrstor(caddr_t addr); 129#endif 130void start_emulating(void); 131void stop_emulating(void); 132 | 117 118void fldcw(caddr_t addr); 119void fnclex(void); 120void fninit(void); 121void fnsave(caddr_t addr); 122void fnstcw(caddr_t addr); 123void fnstsw(caddr_t addr); 124void fp_divide_by_0(void); 125void frstor(caddr_t addr); 126#ifdef CPU_ENABLE_SSE 127void fxsave(caddr_t addr); 128void fxrstor(caddr_t addr); 129#endif 130void start_emulating(void); 131void stop_emulating(void); 132 |
133#endif /* (__GNUC__ && !lint ) || __INTEL_COMPILER */ | 133#endif /* __GNUCLIKE_ASM && !lint */ |
134 135#ifdef CPU_ENABLE_SSE 136#define GET_FPU_CW(thread) \ 137 (cpu_fxsr ? \ 138 (thread)->td_pcb->pcb_save.sv_xmm.sv_env.en_cw : \ 139 (thread)->td_pcb->pcb_save.sv_87.sv_env.en_cw) 140#define GET_FPU_SW(thread) \ 141 (cpu_fxsr ? \ --- 946 unchanged lines hidden --- | 134 135#ifdef CPU_ENABLE_SSE 136#define GET_FPU_CW(thread) \ 137 (cpu_fxsr ? \ 138 (thread)->td_pcb->pcb_save.sv_xmm.sv_env.en_cw : \ 139 (thread)->td_pcb->pcb_save.sv_87.sv_env.en_cw) 140#define GET_FPU_SW(thread) \ 141 (cpu_fxsr ? \ --- 946 unchanged lines hidden --- |