From owner-freebsd-hackers@FreeBSD.ORG Mon May 25 13:46:44 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EA66994 for ; Mon, 25 May 2015 13:46:44 +0000 (UTC) (envelope-from ps06756@gmail.com) Received: from mail-vn0-x231.google.com (mail-vn0-x231.google.com [IPv6:2607:f8b0:400c:c0f::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8611F1 for ; Mon, 25 May 2015 13:46:44 +0000 (UTC) (envelope-from ps06756@gmail.com) Received: by vnbf62 with SMTP id f62so5216907vnb.7 for ; Mon, 25 May 2015 06:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=9qRvgxhwybA1lNPb1llSPjoW0qyq4aZiN5U3Z+HCgVI=; b=rJkhbYqV+2UYlMT/dZbjJrgTdQeC90jtnDiqtQuq8FcV/pttucRRnbb4FQhvt4rJ68 fWmQueXT7g+x3vPMuZVxMTKLIq3Iigjn/xP8KRJaMF+8IJBaLp6aHCbTve1fkFVrShia e926r4u4mwrDqfUMeNVXWL1ZU3efocEgSe3PSn51+CIpvGVecLWnIBnS4sTejuM4XgsH lzNwTlv1tehifcPlIDlTAVzc/rzTXPScaNXmEq5CiP7MAytGT+AgRV3uVgoO7ib1oqx8 8YuH8bDLSU1kIhTDthkIzd0m4Jm17sNU303CO/CKSNxq1MTQ/lFNVX1C6oR1PeH+RY7R p8ig== X-Received: by 10.52.77.69 with SMTP id q5mr23708625vdw.29.1432561603139; Mon, 25 May 2015 06:46:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.185.134 with HTTP; Mon, 25 May 2015 06:46:22 -0700 (PDT) From: Pratik Singhal Date: Mon, 25 May 2015 19:16:22 +0530 Message-ID: Subject: Convert virtual address to physical address To: freebsd-hackers Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 13:46:44 -0000 I need to convert a kernel virtual address to physical address. To do that, as far as I know, we have 2 macros :- vtophys :- In sys/arm/include/pmap.h VTOP :- In sys/boot/i386/libi386/amd64_tramp.S Since, I am working on arm kernel with ARM_NEW_PMAP option, I am using vtophys macro by including the pmap.h file. Now, if I compile the kernel after including the pmap.h file, I am getting the error :- error: field has incomplete type 'struct pmap_statistics' struct pmap_statistics pm_stats; /* pmap statictics */ ^ ./machine/pmap-v6.h:127:9: note: forward declaration of 'struct pmap_statistics' struct pmap_statistics pm_stats; /* pmap statictics */ How, should I resolve this error ? Or is there some other way to convert virtual address to physical address for arm kernel ?