Date: Thu, 11 May 2006 08:26:36 -0700 From: John-Mark Gurney <gurney_j@resnet.uoregon.edu> To: hongz@promisechina.com Cc: freebsd-hackers@freebsd.org Subject: Re: help:How to map a physical address into a kernel address? Message-ID: <20060511152636.GN59504@funkthat.com> In-Reply-To: <1147340690$36076$55833599@hongz@promisechina.com> References: <1147340690$36076$55833599@hongz@promisechina.com>
index | next in thread | previous in thread | raw e-mail
hongz@promisechina.com wrote this message on Thu, May 11, 2006 at 17:45 +0800:
> To access sg_table in kernel address, I need to map the starting physical
> address of a segment into a kernel address. As I know that, we can use
> phystovirt()/bustovirt(), or kmap()/kmap_atomic() to map a bus/physical
> address or a physical page into a kernel address in Linux, but I did not
> find such a function in FreeBSD. Please help me on this, it is very urgent!
That's what bus_space is used for... You need to allocate the resource
that contains the sg_table, and then you can use the bus_space macros
to access the table.. you could use bus_space_write_region to copy
the table from kernel memory to your device, or just write the updated
values...
--
John-Mark Gurney Voice: +1 415 225 5579
"All that I will do, has been done, All that I have, has not."
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060511152636.GN59504>
