Re: mmap for I/O access
- From: "Geronimo W. Christ Esq" <thegreatsuprendo@xxxxxxxxxxx>
- Date: Sat, 19 Jan 2008 20:48:27 +0000
Robert Scott wrote:
Not necessarily. The I/O defined at 0x56000000 includes some 32-bit and some
16-bit registers, and even some 8-bit ones. And the documentation gives all the
addresses in terms of byte addresses. So if I want to make my code look like it
corresponds exactly with the documentation, then I want address arithmetic to
work on bytes. The variable mptr is never used directly in my application. I
use it in macros, like:
#define gpb_DAT (*(short int*)(mptr+0x14))
In your situation, I like to use a struct with the __packed__ attribute (as supported by GCC and other compilers). This lets you see registers of different sizes directly by accessing members of a struct. But the outcome is much the same.
.
- Follow-Ups:
- Re: mmap for I/O access
- From: Juergen Beisert
- Re: mmap for I/O access
- References:
- Re: mmap for I/O access
- From: Albert van der Horst
- Re: mmap for I/O access
- Prev by Date: Re: Application starting from boot-up
- Next by Date: Re: mmap for I/O access
- Previous by thread: Re: mmap for I/O access
- Next by thread: Re: mmap for I/O access
- Index(es):
Relevant Pages
|
|