Converting pointer to vm_offset_t
Garrett Cooper
yanefbsd at gmail.com
Fri May 7 07:29:01 UTC 2010
2010/5/6 Fernando Apesteguía <fernando.apesteguia at gmail.com>:
> 2010/5/7 Garrett Cooper <yanefbsd at gmail.com>:
>> 2010/5/5 Fernando Apesteguía <fernando.apesteguia at gmail.com>:
>>> Hi all,
>>>
>>> Is there a way to convert a (char *) pointer (or in general any
>>> pointer) to a vm_offset_t type?
>>
>> Be wary that char * is not compat layer friendly though :(...
>
> Ummm... I'm asking this because I want to access an array of strings
> that resides in user space. If I'm not wrong, I need to copy in with
> proc_rwmem the array itself and then, every one of the strings,
> right?. I can easily locate the array through the
> proc->p_sysent->sv_psstrings (that is actually a vm_offset_t), but how
> can I specify the offset for the strings?
void* is the preferred method I'm told for direct address
translation (32-bit to 32-bit or 64-bit to 64-bit). Not sure about the
compatibility types (kind of why I was waiting for a reply from
someone more knowledgeable). I know the equivalent for Linux, not
FreeBSD [yet].
Thanks,
-Garrett
More information about the freebsd-hackers
mailing list