From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 18:34:10 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 8B06E16A4DD; Mon, 7 Aug 2006 18:34:10 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1143543D72; Mon, 7 Aug 2006 18:34:09 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (nsxb7dwc712h1y2q@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k77IY7Yv041000; Mon, 7 Aug 2006 11:34:07 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k77IY6hF040999; Mon, 7 Aug 2006 11:34:06 -0700 (PDT) (envelope-from jmg) Date: Mon, 7 Aug 2006 11:34:06 -0700 From: John-Mark Gurney To: Niki Denev Message-ID: <20060807183406.GB99774@funkthat.com> Mail-Followup-To: Niki Denev , Suleiman Souhlal , freebsd-hackers@freebsd.org References: <44D3C333.3030702@cytexbg.com> <44D735E5.4030809@FreeBSD.org> <200608071628.15316.nike_d@cytexbg.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200608071628.15316.nike_d@cytexbg.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-hackers@freebsd.org, Suleiman Souhlal Subject: Re: linux ioremap equivalent on freebsd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2006 18:34:10 -0000 Niki Denev wrote this message on Mon, Aug 07, 2006 at 16:28 +0300: > On Monday 07 August 2006 15:45, Suleiman Souhlal wrote: > > Niki Denev wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > > > Hash: SHA1 > > > > > > Hi, > > > > > > I'm in the middle of a struggle to port the linux > > > nozomi(Option GloberTrotter 3G+ HSDPA cardbus adapter) driver to freebsd. > > > And given the fact that i have very little previous kernel coding > > > experience i can't find what i can use in freebsd as equivalent of > > > linux's ioremap(). > > > > > > Any ideas are appreciated. Thanks! > > > > I think the equivalent of linux's ioremap() in FreeBSD is pmap_mapdev(). > > > > -- Suleiman > > Thanks! > > Is there a reason that there is no manual page about pmap_mapdev, and it's not > mentioned in the other pmap_* man pages? Because for the most part it is only suppose to be used by MD code... The correct way to get device's memory is to use bus_alloc_resource_any... Make sure you review the handbook on device driver writing: http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/devicedrivers.html I did a presentation at BSDcan on writing devices drivers: http://people.freebsd.org/~jmg/drivers/ The handout is a cheat sheet of useful functions for writing a device driver... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."