Module Name:    src
Committed By:   dsl
Date:           Sun Feb  9 14:44:42 UTC 2014

Modified Files:
        src/sys/arch/x86/include: cpu_extended_state.h

Log Message:
Add compatibility for some userspace code (eg firefox) that seems to look
  inside the ucontext structure passed to signal handlers to modify the
  xmm registers.
This should make the code compile - I'm not at all sure it works as expected,
  the interactions between FP and signal handlers aren't at all clear.
AFAICT the FP state is saved on the user stack when the handler is called,
  however the FP trap code can already done odd things to the FPU....


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x86/include/cpu_extended_state.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/include/cpu_extended_state.h
diff -u src/sys/arch/x86/include/cpu_extended_state.h:1.3 src/sys/arch/x86/include/cpu_extended_state.h:1.4
--- src/sys/arch/x86/include/cpu_extended_state.h:1.3	Sat Feb  8 22:36:50 2014
+++ src/sys/arch/x86/include/cpu_extended_state.h	Sun Feb  9 14:44:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_extended_state.h,v 1.3 2014/02/08 22:36:50 dsl Exp $	*/
+/*	$NetBSD: cpu_extended_state.h,v 1.4 2014/02/09 14:44:42 dsl Exp $	*/
 
 #ifndef _X86_CPU_EXTENDED_STATE_H_
 #define _X86_CPU_EXTENDED_STATE_H_
@@ -110,12 +110,17 @@ struct fxsave {
 	uint32_t	fx_mxcsr;	/* MXCSR Register State */
 	uint32_t	fx_mxcsr_mask;
 	struct fpaccfx	fx_87_ac[8];	/* 8 x87 registers */
-	struct xmmreg	fx_xmmregs[16];	/* XMM regs (8 in 32bit modes) */
+	struct xmmreg	fx_xmm[16];	/* XMM regs (8 in 32bit modes) */
 	uint8_t		fx_rsvd[48];
 	uint8_t		fx_kernel[48];	/* Not written by the hardware */
 } __aligned(16);
 __CTASSERT_NOLINT(sizeof (struct fxsave) == 512);
 
+#ifndef _KERNEL
+/* Backwards compatibility for firefox (looks at fx_xmm) */
+#define fxsave64 fxsave
+#endif
+
 /* The end of the fsave buffer can be used by the operating system */
 struct fxsave_os {
 	uint8_t	fxo_fxsave[512 - 48];

Reply via email to