Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Feb 1999 09:12:12 +0000 (GMT)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        mjacob@feral.com, wollman@khavrinen.lcs.mit.edu, cvs-commiters@FreeBSD.ORG
Subject:   Re: sizeof (ptr) != sizeof (unsigned)
Message-ID:  <Pine.BSF.4.01.9902020909020.10768-100000@herring.nlsystems.com>
In-Reply-To: <199902020535.QAA19993@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2 Feb 1999, Bruce Evans wrote:

> >> >       bcopy(&p1->p_procsig->ps_begincopy, &p2->p_procsig->ps_begincopy,
> >> >                         (unsigned)&p1->p_procsig->ps_endcopy -
> >> >                         (unsigned)&p1->p_procsig->ps_begincopy);
> >> 
> >> > What's this for?
> >> 
> >> This copies just the part of the proc struct that's supposed to be
> >> copied.  It would be cleaner if the operands were cast to `char *',
> >> but it should work either way on any processor architecture the kernel
> >
> >
> >Not if the cast to unsigned truncates the top 32 bits on an alpha
> 
> I initially thought that this isn't a problem.  It is a problem if the
> address range crosses a 4G boundary.  I guess it still isn't a problem
> even if the alpha kernel covers more than 4G virtual, since proc structs
> are malloc()ed so they don't even cross a page boundary if they are no
> larger than 1 page.

It isn't likely to be a problem since it is just working out the
difference between the pointers.  Why not cast to u_intptr_t instead since
that is supposed to be an int of the right width.

The kernel does have more than 4G available for kernel virtual addresses
but if the proc struct doesn't cross a page boundary, that shouldn't be a
problem.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 442 9037



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.01.9902020909020.10768-100000>