Re: unhandled page fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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));
}

in my application:
int bytes;
bytes = read(fd, VideoData, sizeof(u8)*650));

what happens if my application isnt sleeping on the waitqueue yet but my driver calls copy_to_user() ?
should i check for that?

Chris.




--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux