Subject: Re: PTRTOINT64() / INT64TOPTR()
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 02/17/2004 23:11:02
In article <20040217091740.A17834@noc.untraceable.net>,
Andrew Brown <atatat@atatdot.net> wrote:
>currently, the PTRTOINT64() macro is used in sys/kern/init_sysctl.c
>for packing the kinfo_proc2 and kinfo_lwp structures, and is defined
>independently in lib/libkvm/kvm_proc.c for some related usage.
>
>would anyone object to this macro being moved to sys/sysctl.h and the
>definition removed from the other two places, so that the definition
>can be kept in one place (and not in two or more), and other pieces of
>code may use it (kern.buf for one, proc and lwp stuff being shuffled
>around being another)?
>
>i also find it vaguely curious that there's no INT64TOPTR() macro
>anywhere...

I don't think this is implementable in ILP32 machines. How are you
planning to fit 64 bits in a 32 bit pointer? Zip it? Use more than
one pointer? Trash memory? :-)

christos