diff options
| author | dsl <dsl@NetBSD.org> | 2014-02-15 22:20:41 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2014-02-15 22:20:41 +0000 |
| commit | 7cf3d973bd0b7e7f4e55e85fff42e9cf6a793943 (patch) | |
| tree | d488b402c443d70da8f4f282bcd75e5bd36ef18a /sys/arch/amd64/include | |
| parent | c41afb7d27c2754499fec13bbf805298b8c9007c (diff) | |
Load and save the fpu registers (for copies to/from userspace) using
helper functions in arch/x86/x86/fpu.c
They (hopefully) ensure that we write to the entire buffer and don't load
values that might cause faults in kernel.
Also zero out the 'pad' field of the i386 mcontext fp area that I think
once contained the registers of any Weitek fpu.
Dunno why it wasn't pasrt of the union.
Some of these copies could be removed if the code directly copied the save
area to/from userspace addresses.
Diffstat (limited to 'sys/arch/amd64/include')
| -rw-r--r-- | sys/arch/amd64/include/mcontext.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/arch/amd64/include/mcontext.h b/sys/arch/amd64/include/mcontext.h index e58ebf60523..113f4a67b91 100644 --- a/sys/arch/amd64/include/mcontext.h +++ b/sys/arch/amd64/include/mcontext.h @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.16 2012/12/15 22:39:04 dsl Exp $ */ +/* $NetBSD: mcontext.h,v 1.17 2014/02/15 22:20:41 dsl Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -131,18 +131,12 @@ typedef struct { union { struct { int __fp_state[27]; /* Environment and registers */ - int __fp_status; /* Software status word */ } __fpchip_state; struct { - char __fp_emul[246]; - char __fp_epad[2]; - } __fp_emul_space; - struct { char __fp_xmm[512]; } __fp_xmm_state; - int __fp_fpregs[128]; } __fp_reg_set; - int __fp_wregs[33]; /* Weitek? */ + int __fp_pad[33]; /* Historic padding */ } __fpregset32_t; typedef struct { @@ -151,6 +145,8 @@ typedef struct { uint32_t _mc_tlsbase; } mcontext32_t; +#define _UC_FXSAVE 0x20 /* FP state is in FXSAVE format in XMM space */ + #define _UC_MACHINE32_PAD 4 #define __UCONTEXT32_SIZE 776 |
