On Tue, Sep 09, 2008 at 04:34:07PM -0700, Henry Bausley wrote:
>I am trying to give user space application access to I/O.   Previously I
>used 2.6.14 with RT Linux and made a kernel device driver with a mmap
>routine on a 440EP.
>
>I am converting to a PPC460Ex with 2.6.26-2 with Xenomai the same code
>results in a Machine Check in Kernel mode when I attempt to use the code
>in user space.
>
>
>The io memory is in the device tree and with ioremap and I can read and
>write to it in kernel mode with
>
>of_address_to_resource(np,0,&res)
>piom = (unsigned *) ioremap( res.start, RTL_SHIOM_SIZE);
> 
>
>
>In addition I tried  
>
>       void *map_base, * virtAddr;
>       off_t target = ((unsigned int)addr) & ~MAP_MASK;
>       int fd;
>
>       if ((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) {
>               printf("/dev/mem could not be opened.\n");
>               exit(1);
>       }
>
>       /* Map one page */
>       map_base = mmap((void *)target, length, PROT_READ | PROT_WRITE,
>                       MAP_SHARED, fd, target);

You want mmap2 here.  The I/O on 440EPx is above 4GiB.

josh
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Reply via email to