Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Nov 2003 14:40:50 -0800
From:      Sean McNeil <sean@mcneil.com>
To:        freebsd-hackers@freebsd.org
Subject:   question about user space addressed, mmap, and getting phys address
Message-ID:  <1067726450.65578.6.camel@blue.mcneil.com>

next in thread | raw e-mail | index | archive | help
Hi everyone,

Sorry I am not on the list, but I was hoping someone here might be able
to help me.  I have a design that I cannot change that does the
following:

1) Calls mmap on a chunk of memory that the device driver uses to DMA to
a video decoder.

2) This chunk of memory is treated as several DMA buffers.  There is an
ioctl setup to indicate when a section of that memory is being used and
when it is freed (usage count).

I need to take the address from the mmap, add an offset, send it through
an ioctl, and then relate it back to the physical address that it was
originally mapped from.

Unfortunately, the address I get from the ioctl is a user-space address
and when I use vtophys I get back 0.  Is there some other mechanism to
convert a user-space address to a physical address?

Any and all help will be greatly appreciated.

Thanks in advance,
Sean




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