From owner-cvs-all Mon Nov 15 2:10: 5 1999 Delivered-To: cvs-all@freebsd.org Received: from post.mail.nl.demon.net (post-11.mail.nl.demon.net [194.159.73.21]) by hub.freebsd.org (Postfix) with ESMTP id E214914C15; Mon, 15 Nov 1999 02:09:56 -0800 (PST) (envelope-from marcel@scc.nl) Received: from [212.238.132.94] (helo=scones.sup.scc.nl) by post.mail.nl.demon.net with esmtp (Exim 2.12 #1) id 11nJ5L-000NZx-00; Mon, 15 Nov 1999 10:10:07 +0000 Received: from scc.nl (scones.sup.scc.nl [192.168.2.4]) by scones.sup.scc.nl (8.9.3/8.9.3) with ESMTP id LAA09992; Mon, 15 Nov 1999 11:09:38 +0100 (CET) (envelope-from marcel@scc.nl) Message-ID: <382FDBE2.D075594@scc.nl> Date: Mon, 15 Nov 1999 11:09:38 +0100 From: Marcel Moolenaar Organization: SCC vof X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.5 i386) X-Accept-Language: en MIME-Version: 1.0 To: Martin Cracauer Cc: Bruce Evans , cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/i386/include signal.h References: <382E8A1B.B7D9B7F0@scc.nl> <19991115095729.A27507@cons.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Martin Cracauer wrote: > > Martin implemented saving it before you complicated things by changing > > the signal handling :-). I didn't like it because it moved the definitions > > of i386 FP structs to the wrong place (). It's not > > clear that there is a right place. > > The reasoning is like this: > > 0) If the state of the FPU is passed to a signal handler, it is > preferrable to do so in a struct with proper names, not just an > array of bytes. I disagree. Signal handlers don't use context information for (wild guess) 99.9% of the time. Bloating signalling definitions with details of the many different hardware configurations (even within a single architecture) is not the way to go. For every FP emulator with it's own state information, we are forced to have unions and the like. No, it's better to be vague in struct sigcontext and let the program use a cast when it wants to dig in the gory details of the machine state. > 1) Applications that use signal handlers with extended parameters > (SA_SIGINFO or old BSD-style three arguments) are supposed to > include , but nothing else. SUSv2 defines sa_sigaction as: void (*) (int, siginfo_t*, void*) sa_sigaction; Notice the `void*' where the `ucontext_t*' is supposed to be. SUSv2 simply says that the handler may cast the `void*' to get to the gory details and ucontext_t itself contains an abstract type (mcontext_t) that represents machine specific state. Point: You don't want low-level details embedded in high-level definitions. > struct save87 is now 176 bytes, Marcel currently reserves 180. struct > sigcontext without FPU state is 100 bytes, so we are at 276 bytes at > least. > > Would it be unreasonable to bump it to 512 bytes to be done with it > once and for all? Might have positive effects on cache behaviour as > well. In that case, make ucontext_t 512 bytes and scale struct sigcontext accordingly. > We may also need an way to tell an application at runtime how far the > struct is filled. You need exactly 1 bit to tell the application if the FPU state is valid or not, right? -- Marcel Moolenaar mailto:marcel@scc.nl SCC Internetworking & Databases http://www.scc.nl/ The FreeBSD project mailto:marcel@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message