Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Dec 1998 09:45:19 -0500
From:      Brian McGovern <bmcgover@cisco.com>
To:        hackers@FreeBSD.ORG
Subject:   Aquiring contiguous wired physical memory in the kernel...
Message-ID:  <199812281445.JAA04498@bmcgover-pc.cisco.com>

next in thread | raw e-mail | index | archive | help
I've been looking through the mailing lists for the better part of a half hour
or so trying to find the answer to this, but it seems that the answers either
conflict for method, or the answers work for a specific case. So, I'll ask
the question directly, and hopefully get the "best" answer :)

I'm about 1/3 of the way through writing a device driver for a high-density
tty-like device (108 modems in a PCI slot form factor). While the module has
on-board RAM that I can use for buffering, the device is also capable of using
the host's RAM for buffering, which I'd like to take advantage of.

What I need to be able to do is malloc() a chunk of memory (say 512K-1MB) that
is physically contiguous. Then, I need to be able to get the PHYSICAL address
of this memory chunk, and pass it back off to the board so it can directly
access the memory.

Looking through some of the drivers in the pci subdirectory, it appears that
they use a macro caled vtophys, which calls pmap_kextract, then adds 1073741825
((1024 * 1024 * 1024) + 1) to the result. Others seem to use kv_top() to get
the physical address. 

Anyone care to comment?
	-Brian

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?199812281445.JAA04498>