io.h question

Fillod Stephane stephane.fillod at thomson.net
Mon Jan 9 23:16:33 EST 2006


Arnd Bergmann wrote:
>On Thursday 05 January 2006 21:00, mcnernbm at notes.udayton.edu wrote:
>> I finally noticed out_8 and in_8 and what not are located in the
>> ppc io.h file in the kernel development download.  But when I 
>> tried to do a io.h with in my program I added #include <asm/io.h> 
>> and it seems to find it with not problems but it can not find the
>> functions with in that file.  Am i missing a define I need to set
>> or something so I can see the right files with in io.h I am
>> compiling for a ppc405 on a xilinx virtex 4 board.      
>
>The definitions in that file are only usable from inside the kernel,
>you can not use them in a user space application.

You may not include the file directly from a user-land application
program, but you may copy/paste the in_*/out_* macros, with appropriate 
care off course.

>The correct way to solve your problem (which you did not explain, so
>I can only guess) would be to write a kernel device driver for
>the peripherial you want to drive, at least if it does not exist yet.

Sometimes, user-land access can make things simpler. YMMV.

>For prototyping, you can play with mmap() on /dev/mem in a user
>application, but that is often not very reliable.

For sake of curiosity, what is not reliable in mmap'ed access
by user application?

Regards,
-- 
Stephane




More information about the Linuxppc-embedded mailing list