mmaping device memory into userspace.

Hi list,

If we map device memory into user space using mmap(), the user will be
able to do read / write into device using normal memory handling
routines, right?

But as mentioned in LDD3, should appropriate readb() / writeb()
routines be actually used to read / write into device memory?

Thanks,

Dan
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Daniel Rodrick [ Mi, 28 März 2007 06:15 ] [ ID #1670522 ]

Re: mmaping device memory into userspace.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Mar 28, 2007 at 09:45:52AM +0530, Daniel Rodrick wrote:
> If we map device memory into user space using mmap(), the user will be
> able to do read / write into device using normal memory handling
> routines, right?

Right.

> But as mentioned in LDD3, should appropriate readb() / writeb()
> routines be actually used to read / write into device memory?

LDD3 is right (as usual :).


Erik

- --
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGCkOS/PlVHJtIto0RAlkIAJwMalJoA8QoQavSVCkNWUUmKCbsQACf XN9F
KBBecJiZkGziQYhrx0bt8kU=
=XlKa
-----END PGP SIGNATURE-----
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Erik Mouw [ Mi, 28 März 2007 12:29 ] [ ID #1670523 ]

Re: mmaping device memory into userspace.

On 3/28/07, Erik Mouw <mouw [at] nl.linux.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wed, Mar 28, 2007 at 09:45:52AM +0530, Daniel Rodrick wrote:
> > If we map device memory into user space using mmap(), the user will be
> > able to do read / write into device using normal memory handling
> > routines, right?
>
> Right.
>
> > But as mentioned in LDD3, should appropriate readb() / writeb()
> > routines be actually used to read / write into device memory?
>
> LDD3 is right (as usual :).
>

So using mmap() to map device memory into user space, and then reading
/ writing to device memory in same way as normal memory isn't correct?

Thanks,

Dan.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Daniel Rodrick [ Mi, 28 März 2007 18:47 ] [ ID #1670524 ]
Linux » gmane.linux.newbie » mmaping device memory into userspace.

Vorheriges Thema: files and directories with spaces in bash script
Nächstes Thema: KDE doesn't execute programs the first time