On Wed, 2006-07-26 at 16:54 +0200, Christian Boon wrote: > Arjan van de Ven wrote: > > >On Wed, 2006-07-26 at 16:25 +0200, Christian Boon wrote: > > > > > >>Hello, > >> > >>i've got a question about a page fault: > >> > >>If have a kernel module that puts data in an array from an external fifo > >>after an interrupt: > >> > >>static void *datapointer; > >>__u16 Data[325]; > >> > >>for (Counter = 0 ; Counter < 325; Counter++) > >>{ > >> Data[Counter] = readw(datapointer); > >>} > >>wake_up_interruptible(&waitqueue); > >> > >>My application is sleeping on the waitqueue. > >> > >>in the application: > >> > >>typedef unsigned char u8; > >>u8 VideoData[650]; > >> > >>bytes = read(fd, VideoData, sizeof(u8)); > >> > >>So i want to store the array u16 and read in userspace u8. > >>is this a problem? maybe alignment? > >> > >>sometimes i get this error: > >> > >>PraxisSC: unhandled page fault at pc=0x40026df0, lr=0x40089790 (bad > >> > >> > > > >that looks like a bug in your read function... unfortunately you didn't > >provide a pointer to your source so it's hard for us to point that out > >in more detail... > > > >Greetings, > > Arjan van de Ven > > > ssize_t EribRead(struct file *filp, char *buf, size_t count, loff_t *offp) > { > interruptible_sleep_on(&waitqueue); > copy_to_user(buf, &Data, sizeof(Data)); > } you're not returning a return value.. that'll blow up bigtime (and you're not handling error conditions either, and interruptible_sleep_on() has many nasty corner cases that you don't handle, you really shouldn't use that API) -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/