From owner-freebsd-current Fri Jan 3 03:19:56 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id DAA13727 for current-outgoing; Fri, 3 Jan 1997 03:19:56 -0800 (PST) Received: from scrooge.ee.swin.oz.au (scrooge.ee.swin.oz.au [136.186.4.20]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id DAA13722 for ; Fri, 3 Jan 1997 03:19:53 -0800 (PST) Received: (from dtc@localhost) by scrooge.ee.swin.oz.au (8.6.9/8.6.9) id WAA11316 for freebsd-current@freebsd.org; Fri, 3 Jan 1997 22:21:51 +1100 From: Douglas Thomas Crosher Message-Id: <199701031121.WAA11316@scrooge.ee.swin.oz.au> Subject: Re: i586-optimized copyin/out still broken To: freebsd-current@freebsd.org Date: Fri, 3 Jan 1997 22:21:50 +1100 (EST) In-Reply-To: <199701030215.NAA13793@godzilla.zeta.org.au> from "Bruce Evans" at Jan 3, 97 01:15:47 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > >>> Log: > >>> Disabled i586-optimized copyin and copyout again. The fault handler > >>> is still broken - it doesn't restore the floating point state. > > >Could this problem result in NaN being produced at wrong places. > > No, it causes kernel panics. > > >I filled a PR (2142) about it, maybe it could be closed then. > > That is much harder to fix. It is caused by the floating point state > not being preserved across signal handlers. There are few, if any, > valid and useful uses for floating point in signal handlers, because > an ANSI signal handler must not make any accesses to a global object > other than assignment to ones of type `volatile sig_atomic_t'. Thus > preserving the state would mainly slow down signal handlers. Will it solve the problem to add a FPU save/restore in the interrupt handler when needed? >From example using Martin's code example in PR 2142, the interrupt handler would become: void interrupt(int sig) { int n,i; static int wieviel=0; int fpu_state[27]; fpu_save(fpu_state); /* <<<<< */ setitimer(ITIMER_REAL,&timer1,&timerdummy); bsdsignal(SIGALRM,(void *)(interrupt)); n=(int)((double)counter/(double)max*(double)80); for (i=wieviel;i