From owner-freebsd-hackers@FreeBSD.ORG Fri May 7 07:29:01 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9082B106566B for ; Fri, 7 May 2010 07:29:01 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 479078FC08 for ; Fri, 7 May 2010 07:29:00 +0000 (UTC) Received: by qyk11 with SMTP id 11so1228545qyk.13 for ; Fri, 07 May 2010 00:28:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7uBXkoORGAOOb+H+IJtT9W0uWxRYCR4/oxBe98TBdMU=; b=ZzOV8EnM7RVTMCUNlD6qbNd2YBcMbjXdiC92smbUYsE1NycXnjZEjQkOFAemf1hzz1 y5hmAXfA/w9Zy+lZegD61d7OOoioYugVoJHYgPbasbX+/Bq1AWnxfLmdcME9nfVTQ/Hs Wsc1ucwQ1rV1hiYY0XvQ8wi/WQnjXAM37orFY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=M9dqOqRB8OrbM6Qs6bqAj2lBCQMIdEWyjXoEBVw3Jn/fI4fRUIh5MAgPYCo1LkZ5ho 36xXFGWX6J0NJFCM3fREIvNpFqDQxCf6QtAeDel1ZiQUOWrokdFQK0YgJilkf6/sBleL vG8MvIhJtQNhra0e1jjXVI5eAbk6UtBkgXVCk= MIME-Version: 1.0 Received: by 10.229.225.72 with SMTP id ir8mr5997590qcb.73.1273217336679; Fri, 07 May 2010 00:28:56 -0700 (PDT) Received: by 10.229.193.14 with HTTP; Fri, 7 May 2010 00:28:56 -0700 (PDT) In-Reply-To: References: Date: Fri, 7 May 2010 00:28:56 -0700 Message-ID: From: Garrett Cooper To: =?ISO-8859-1?Q?Fernando_Apestegu=EDa?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD-Hackers Subject: Re: Converting pointer to vm_offset_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2010 07:29:01 -0000 2010/5/6 Fernando Apestegu=EDa : > 2010/5/7 Garrett Cooper : >> 2010/5/5 Fernando Apestegu=EDa : >>> 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