Subject: Re: PTRTOINT64() / INT64TOPTR()
To: Simon Burge <simonb@wasabisystems.com>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 02/17/2004 21:32:18
>> 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 wonder if <sys/sysctl.h> is the right place - the macro isn't
>sysctl-specific.  That said, I'm not sure where else.  <sys/param.h>
>seems like overkill.

no, it's not sysctl specific per se, but that's the only place it's
being used.  unless you count the NETBSD32PTR64() stuff, which looks
sort of vaguely similar, though it can't do the same job.

>> i also find it vaguely curious that there's no INT64TOPTR() macro
>> anywhere...
>
>At least for the sysctl users, it's mainly a value that is printed out.
>I guess if there was a need for it it would have sprung up somewhere...

i spose.  :)

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."