npx.c (267767) | npx.c (270850) |
---|---|
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 267767 2014-06-23 07:37:54Z kib $"); | 34__FBSDID("$FreeBSD: head/sys/i386/isa/npx.c 270850 2014-08-30 17:48:38Z jhb $"); |
35 36#include "opt_cpu.h" 37#include "opt_isa.h" 38#include "opt_npx.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/bus.h> --- 713 unchanged lines hidden (view full) --- 756 757 stop_emulating(); 758 fpusave(addr); 759 760 start_emulating(); 761 PCPU_SET(fpcurthread, NULL); 762} 763 | 35 36#include "opt_cpu.h" 37#include "opt_isa.h" 38#include "opt_npx.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/bus.h> --- 713 unchanged lines hidden (view full) --- 756 757 stop_emulating(); 758 fpusave(addr); 759 760 start_emulating(); 761 PCPU_SET(fpcurthread, NULL); 762} 763 |
764/* 765 * Unconditionally save the current co-processor state across suspend and 766 * resume. 767 */ |
|
764void | 768void |
769npxsuspend(union savefpu *addr) 770{ 771 register_t cr0; 772 773 if (!hw_float) 774 return; 775 if (PCPU_GET(fpcurthread) == NULL) { 776 *addr = npx_initialstate; 777 return; 778 } 779 cr0 = rcr0(); 780 clts(); 781 fpusave(addr); 782 load_cr0(cr0); 783} 784 785void 786npxresume(union savefpu *addr) 787{ 788 register_t cr0; 789 790 if (!hw_float) 791 return; 792 793 cr0 = rcr0(); 794 clts(); 795 npxinit(); 796 stop_emulating(); 797 fpurstor(addr); 798 load_cr0(cr0); 799} 800 801void |
|
765npxdrop() 766{ 767 struct thread *td; 768 769 /* 770 * Discard pending exceptions in the !cpu_fxsr case so that unmasked 771 * ones don't cause a panic on the next frstor. 772 */ --- 353 unchanged lines hidden --- | 802npxdrop() 803{ 804 struct thread *td; 805 806 /* 807 * Discard pending exceptions in the !cpu_fxsr case so that unmasked 808 * ones don't cause a panic on the next frstor. 809 */ --- 353 unchanged lines hidden --- |