Messages in this thread | | | Subject | Re: [Basics] spinlocks & copy_to_user | Date | Tue, 8 Feb 2000 21:14:26 +0000 (GMT) | From | Alan Cox <> |
| |
> 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/
| |