From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 1 14:40:53 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 04C1516A4CE for ; Sat, 1 Nov 2003 14:40:53 -0800 (PST) Received: from orngca-mls03.socal.rr.com (mls03.hawaii.rr.com [66.75.160.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B81243F3F for ; Sat, 1 Nov 2003 14:40:52 -0800 (PST) (envelope-from sean@mcneil.com) Received: from blue.mcneil.com (cpe-66-75-176-109.socal.rr.com [66.75.176.109])hA1MepU01525 for ; Sat, 1 Nov 2003 14:40:51 -0800 (PST) Received: from [66.75.176.109] (mcneil.com [66.75.176.109]) by blue.mcneil.com (8.12.9p2/8.12.9) with ESMTP id hA1Meogh065602 for ; Sat, 1 Nov 2003 14:40:51 -0800 (PST) (envelope-from sean@mcneil.com) From: Sean McNeil To: freebsd-hackers@freebsd.org Content-Type: text/plain Organization: Sean McNeil Consulting Message-Id: <1067726450.65578.6.camel@blue.mcneil.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 01 Nov 2003 14:40:50 -0800 Content-Transfer-Encoding: 7bit X-DCC-NIET-Metrics: blue.mcneil.com 1080; Body=1 Fuz1=1 Fuz2=1 Subject: question about user space addressed, mmap, and getting phys address X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2003 22:40:53 -0000 Hi everyone, Sorry I am not on the list, but I was hoping someone here might be able to help me. I have a design that I cannot change that does the following: 1) Calls mmap on a chunk of memory that the device driver uses to DMA to a video decoder. 2) This chunk of memory is treated as several DMA buffers. There is an ioctl setup to indicate when a section of that memory is being used and when it is freed (usage count). I need to take the address from the mmap, add an offset, send it through an ioctl, and then relate it back to the physical address that it was originally mapped from. Unfortunately, the address I get from the ioctl is a user-space address and when I use vtophys I get back 0. Is there some other mechanism to convert a user-space address to a physical address? Any and all help will be greatly appreciated. Thanks in advance, Sean