lkml.org 
[lkml]   [2000]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Basics] spinlocks & copy_to_user
Date
From
> I need to copy information from a kernel memory buffer to a user memory
> buffer. copy_to_user() is the obvious answer. However, the kernel
> buffer can be modified at interrupt time (interrupt handler); to protect
> this, I'm using a spin_lock_irqsave(). But copy_to_user() can sleep.
> Correct me if I'm wrong, but access_ok() does not appear to worry about
> the possibility of a fault, just permissions.

Correct

> I could copy from the kernel buffer to another kernel buffer with irq's
> disabled, then copy_to_user() from the new buffer, but I was hoping to
> avoid the additional copy.

Is it possible to keep two buffers and modify one in the IRQ handler then
flip them with the user copies - ie is this a flow of data or a control
structure in a fixed format ?

Alan


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.036 / U:1.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site