ia32_reg.c (216634) | ia32_reg.c (230426) |
---|---|
1/*- 2 * Copyright (c) 2005 Peter Wemm 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2005 Peter Wemm 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/amd64/ia32/ia32_reg.c 216634 2010-12-22 00:18:42Z jkim $ | 26 * $FreeBSD: head/sys/amd64/ia32/ia32_reg.c 230426 2012-01-21 17:45:27Z kib $ |
27 */ 28 29#include <sys/cdefs.h> | 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/amd64/ia32/ia32_reg.c 216634 2010-12-22 00:18:42Z jkim $"); | 30__FBSDID("$FreeBSD: head/sys/amd64/ia32/ia32_reg.c 230426 2012-01-21 17:45:27Z kib $"); |
31 32#include "opt_compat.h" 33 34#include <sys/param.h> 35#include <sys/exec.h> 36#include <sys/fcntl.h> 37#include <sys/imgact.h> 38#include <sys/kernel.h> --- 111 unchanged lines hidden (view full) --- 150 struct env87 *penv_87; 151 struct envxmm *penv_xmm; 152 int i; 153 154 bzero(regs, sizeof(*regs)); 155 sv_87 = (struct save87 *)regs; 156 penv_87 = &sv_87->sv_env; 157 fpugetregs(td); | 31 32#include "opt_compat.h" 33 34#include <sys/param.h> 35#include <sys/exec.h> 36#include <sys/fcntl.h> 37#include <sys/imgact.h> 38#include <sys/kernel.h> --- 111 unchanged lines hidden (view full) --- 150 struct env87 *penv_87; 151 struct envxmm *penv_xmm; 152 int i; 153 154 bzero(regs, sizeof(*regs)); 155 sv_87 = (struct save87 *)regs; 156 penv_87 = &sv_87->sv_env; 157 fpugetregs(td); |
158 sv_fpu = &td->td_pcb->pcb_user_save; | 158 sv_fpu = get_pcb_user_save_td(td); |
159 penv_xmm = &sv_fpu->sv_env; 160 161 /* FPU control/status */ 162 penv_87->en_cw = penv_xmm->en_cw; 163 penv_87->en_sw = penv_xmm->en_sw; 164 penv_87->en_tw = penv_xmm->en_tw; 165 /* 166 * XXX for en_fip/fcs/foo/fos, check if the fxsave format --- 15 unchanged lines hidden (view full) --- 182 return (0); 183} 184 185int 186set_fpregs32(struct thread *td, struct fpreg32 *regs) 187{ 188 struct save87 *sv_87 = (struct save87 *)regs; 189 struct env87 *penv_87 = &sv_87->sv_env; | 159 penv_xmm = &sv_fpu->sv_env; 160 161 /* FPU control/status */ 162 penv_87->en_cw = penv_xmm->en_cw; 163 penv_87->en_sw = penv_xmm->en_sw; 164 penv_87->en_tw = penv_xmm->en_tw; 165 /* 166 * XXX for en_fip/fcs/foo/fos, check if the fxsave format --- 15 unchanged lines hidden (view full) --- 182 return (0); 183} 184 185int 186set_fpregs32(struct thread *td, struct fpreg32 *regs) 187{ 188 struct save87 *sv_87 = (struct save87 *)regs; 189 struct env87 *penv_87 = &sv_87->sv_env; |
190 struct savefpu *sv_fpu = &td->td_pcb->pcb_user_save; | 190 struct savefpu *sv_fpu = get_pcb_user_save_td(td); |
191 struct envxmm *penv_xmm = &sv_fpu->sv_env; 192 int i; 193 194 /* FPU control/status */ 195 penv_xmm->en_cw = penv_87->en_cw; 196 penv_xmm->en_sw = penv_87->en_sw; 197 penv_xmm->en_tw = penv_87->en_tw; 198 penv_xmm->en_rip = penv_87->en_fip; --- 38 unchanged lines hidden --- | 191 struct envxmm *penv_xmm = &sv_fpu->sv_env; 192 int i; 193 194 /* FPU control/status */ 195 penv_xmm->en_cw = penv_87->en_cw; 196 penv_xmm->en_sw = penv_87->en_sw; 197 penv_xmm->en_tw = penv_87->en_tw; 198 penv_xmm->en_rip = penv_87->en_fip; --- 38 unchanged lines hidden --- |