Tue Feb 18 18:39:11 2014 UTC ()
It seems that firefox includes machine/fpu.h on amd64.
Add the file back so that the firwfox source doesn't have to depend
on the version of netbsd it is being compiled for.
(The i386 version doesn't play the same games in its SIGFPE handler.)


(dsl)
diff -r0 -r1.14 src/sys/arch/amd64/include/fpu.h
diff -r1.7 -r1.8 src/sys/arch/x86/include/cpu_extended_state.h

File Added: src/sys/arch/amd64/include/fpu.h
#ifndef _AMD64_FPU_H_
#define _AMD64_FPU_H_

/*
 * This file is only present for backwards compatibility with
 * a few user programs, particularly firefox.
 */

#ifndef _KERNEL
#define fxsave64 fxsave
#include <x86/cpu_extended_state.h>
#endif

#endif

cvs diff -r1.7 -r1.8 src/sys/arch/x86/include/cpu_extended_state.h (expand / switch to unified diff)

--- src/sys/arch/x86/include/cpu_extended_state.h 2014/02/15 10:11:15 1.7
+++ src/sys/arch/x86/include/cpu_extended_state.h 2014/02/18 18:39:10 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu_extended_state.h,v 1.7 2014/02/15 10:11:15 dsl Exp $ */ 1/* $NetBSD: cpu_extended_state.h,v 1.8 2014/02/18 18:39:10 dsl Exp $ */
2 2
3#ifndef _X86_CPU_EXTENDED_STATE_H_ 3#ifndef _X86_CPU_EXTENDED_STATE_H_
4#define _X86_CPU_EXTENDED_STATE_H_ 4#define _X86_CPU_EXTENDED_STATE_H_
5 5
6/* 6/*
7 * This file contains definitions of structures that match the memory 7 * This file contains definitions of structures that match the memory
8 * layouts used x86 processors to save floating point registers and other 8 * layouts used x86 processors to save floating point registers and other
9 * extended cpu state. 9 * extended cpu state.
10 * This includes registers (etc) used by SSE/SSE2/SSE3/SSSE3/SSE4 and 10 * This includes registers (etc) used by SSE/SSE2/SSE3/SSSE3/SSE4 and
11 * the later AVX instructions. 11 * the later AVX instructions.
12 * The definitions are such that any future 'extended state' should 12 * The definitions are such that any future 'extended state' should
13 * be handled (provided the kernel doesn't need to know the actual contents. 13 * be handled (provided the kernel doesn't need to know the actual contents.
14 * 14 *
@@ -105,31 +105,26 @@ struct fxsave { @@ -105,31 +105,26 @@ struct fxsave {
105 uint8_t fx_tw; /* FPU Tag Word (abridged) */ 105 uint8_t fx_tw; /* FPU Tag Word (abridged) */
106 uint16_t fx_opcode; /* FPU Opcode */ 106 uint16_t fx_opcode; /* FPU Opcode */
107 union fp_addr fx_ip; /* FPU Instruction Pointer */ 107 union fp_addr fx_ip; /* FPU Instruction Pointer */
108/*16*/ union fp_addr fx_dp; /* FPU Data pointer */ 108/*16*/ union fp_addr fx_dp; /* FPU Data pointer */
109 uint32_t fx_mxcsr; /* MXCSR Register State */ 109 uint32_t fx_mxcsr; /* MXCSR Register State */
110 uint32_t fx_mxcsr_mask; 110 uint32_t fx_mxcsr_mask;
111 struct fpaccfx fx_87_ac[8]; /* 8 x87 registers */ 111 struct fpaccfx fx_87_ac[8]; /* 8 x87 registers */
112 struct xmmreg fx_xmm[16]; /* XMM regs (8 in 32bit modes) */ 112 struct xmmreg fx_xmm[16]; /* XMM regs (8 in 32bit modes) */
113 uint8_t fx_rsvd[48]; 113 uint8_t fx_rsvd[48];
114 uint8_t fx_kernel[48]; /* Not written by the hardware */ 114 uint8_t fx_kernel[48]; /* Not written by the hardware */
115} __aligned(16); 115} __aligned(16);
116__CTASSERT_NOLINT(sizeof (struct fxsave) == 512); 116__CTASSERT_NOLINT(sizeof (struct fxsave) == 512);
117 117
118#ifndef _KERNEL 
119/* Backwards compatibility for firefox (looks at fx_xmm) */ 
120#define fxsave64 fxsave 
121#endif 
122 
123/* The end of the fsave buffer can be used by the operating system */ 118/* The end of the fsave buffer can be used by the operating system */
124struct fxsave_os { 119struct fxsave_os {
125 uint8_t fxo_fxsave[512 - 48]; 120 uint8_t fxo_fxsave[512 - 48];
126 /* 48 bytes available, NB copied to/from userspace */ 121 /* 48 bytes available, NB copied to/from userspace */
127 uint16_t fxo_dflt_cw; /* Control word for signal handlers */ 122 uint16_t fxo_dflt_cw; /* Control word for signal handlers */
128}; 123};
129 124
130union savefpu { 125union savefpu {
131 struct save87 sv_87; 126 struct save87 sv_87;
132 struct fxsave sv_xmm; 127 struct fxsave sv_xmm;
133 struct fxsave_os sv_os; 128 struct fxsave_os sv_os;
134}; 129};
135 130