Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 May 2000 15:47:27 +0930 (CST)
From:      "Daniel O'Connor" <doconnor@gsoft.com.au>
To:        Coleman Kane <cokane@one.net>
Cc:        hackers@freebsd.org
Subject:   RE: mmap cdev function in device drivers
Message-ID:  <XFMail.000508154727.doconnor@gsoft.com.au>
In-Reply-To: <20000508020139.A10146@cokane.yi.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.000508154727.doconnor>