Subject: Re: new sysctl(KERN_PROC, ...) interface (was: sysinfo(2))
To: Eduardo Horvath <>
From: Simon Burge <>
List: tech-kern
Date: 04/18/2000 12:57:22
Eduardo Horvath wrote:

> On Tue, 18 Apr 2000, Simon Burge wrote:
> > So for these platforms at least we can cast any long to any int64 and
> > get away with it.  Can you (or Eric) provide results on sparc, sparc64
> > and sparc64/compat32?
> I don't think that this will demonstrate much but here goes:

I just wanted to see if some combination of sparc{32,64,compat32} did
something completely off the planet, but it didn't appear to.  Good :-)

> The problem is when you take a real 32-bit address, extend it to 64-bits,
> then pass it to a 64-bit application to dereference.
> A valid address of 0xf100000 (which is the current stack base) needs to be
> referenced as 0x00000000f1000000 from a 64-bit application on sparc64
> cause that's how the hardware works.  0xfffffffff1000000, while a valid
> 32-bit address, is not the one that the hardware generates in 32-bit mode.

In this case then, doesn't "(u_int64_t)(uintptr_t)" always get things right,
because there's no sign extension?