Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Jun 2002 09:44:33 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        Jake Burkholder <jake@locore.ca>, Julian Elischer <julian@freebsd.org>, Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 12179 for review 
Message-ID:  <20020601164433.39F2D380A@overcee.wemm.org>
In-Reply-To: <Pine.BSF.4.21.0205311013490.28852-100000@InterJet.elischer.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer wrote:
> 
> 
> On Fri, 31 May 2002, Jake Burkholder wrote:
> 
> > Apparently, On Thu, May 30, 2002 at 10:57:02PM -0700,
> > 	Julian Elischer said words to the effect of;
> > 
> > > http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12179
> > > 
> > > Change 12179 by julian@julian_ref on 2002/05/30 22:56:19
> > > 
> > > 	Use fuword and suword instead of copyin/copyout
> > > 	when setting up thread completion mailboxes.
> > > 	needs fptr and sptr, which I will add soon.
> > 
> > Please do not add these without discussing it first.  fuword and
> > suword take a long as their argument/return value, which works
> > fine.
> 
> except that you have to cast the results..
> It'd be nice if there was one guaranteed to return a (void *)
> preferably at a second argument so that a success value can be given as
> well.
> (I decided not to add it myself unilaterally but rather to lobby for it
> amongst types such as yourself..)
> 
> There is no guarantee that on every imaginable architecture
> that the same long<->pointer conversion is correct, and anyhow the casting 
> is wrong.. it wouldn't take much to make a retval = fptr(addr, &target)
> call.

It breaks on x86 where you can configure long to be 64 bit but pointers
are 32 bit still.  suword() would trash stuff in that case.

dfr has added suword32/64 and friends.  I'd like suptr/fuptr or something
like that as well.  The *ptr version would accept/return a void *.

Cheers,
-Peter
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5


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




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