Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Apr 1998 00:11:45 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        sbabkin@dcn.att.com
Cc:        karpen@ocean.campus.luth.se, nate@mt.sri.com, marquard@zilker.net, freebsd-hackers@FreeBSD.ORG
Subject:   Re: bcopy implementation
Message-ID:  <199804040011.RAA12763@usr06.primenet.com>
In-Reply-To: <C50B6FBA632FD111AF0F0000C0AD71EEACDE91@dcn71.dcn.att.com> from "sbabkin@dcn.att.com" at Apr 3, 98 11:27:37 am

next in thread | previous in thread | raw e-mail | index | archive | help
> > People seem to be forgetting that since bcopy isn't a system call,
> > it's
> > possible to royally screw yourself up with it, since it uses the FP
> > registers.
> > 
> > So, one program could be in the middle of doing a bcopy, and a second
> > program could interrupt it, and spam the registers of the previous
> > program, so that when the first was resume it's results are totally
> > bogus.
> > 
> Huh ? The floating point registers must be saved as part of
> context or else no program using them will work properly.

However, they need not be switched at context switch time.

Specifically, the reason for saving FP context is for exception
signalling.

You can "lasy bind" the FP context, such that you only unload the
registers if another guy wants to use them.  This is, in fact,
what FreeBSD does.

This saves overhead on context switches.  Only those apps using
the registers have to take the hit.

Signals do not save FP registers at all.

You should also look at the setjmp/longjmp manual pages; there are
FP saving equivalents.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804040011.RAA12763>