From owner-freebsd-hackers Sun May 7 23:17:41 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from cain.gsoft.com.au (genesi.lnk.telstra.net [139.130.136.161]) by hub.freebsd.org (Postfix) with ESMTP id A2DB037BD25 for ; Sun, 7 May 2000 23:17:36 -0700 (PDT) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (doconnor@cain [203.38.152.97]) by cain.gsoft.com.au (8.8.8/8.8.8) with ESMTP id GAA00797; Mon, 8 May 2000 06:17:28 GMT (envelope-from doconnor@gsoft.com.au) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20000508020139.A10146@cokane.yi.org> Date: Mon, 08 May 2000 15:47:27 +0930 (CST) From: "Daniel O'Connor" To: Coleman Kane Subject: RE: mmap cdev function in device drivers Cc: hackers@freebsd.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 08-May-00 Coleman Kane wrote: > the memory region mapped by the PCI BIOS (in this case the 0x1000000 region > between 0xec000000 and 0xecffffff), or an address of a mapped region within > kernel memory area? I had it return the former and it crashed the machine, > trying to use bus_alloc_resource(...) with the SYS_RES_MEMORY parameter just > won't map any memory The return type is the errno for the mmap() call.. You need to inform the VM systems about it. The meat of your mmap call should be -> return(i386_btop(vtophys(rman_get_virtual(sc->g_membase.reshandle)) + offset)); rman_get_virtual() gets the kernel virtual address out of the memeory handle, vtophys turns it into a physical address (hmm.. come to think of it I could probably replace those two with rman_get_start), and i386_btop does, err, magic :) --- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message