lkml.org 
[lkml]   [1999]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [question/comment/help] pseudo function-call from kernel to a user-process
"Richard B. Johnson" wrote:
snip snap
> Instead, if you are copying something that can change, so you need a
> spin-lock, do:
>
> spin_lock_irqsave(&lock_flag, flags);
> memcpy(tmp_buf, volatile_buf, len);
> spin_unlock(&lock_flag, flags);
>
> copy_to_user(user_buf, tmp_buf, len);
>
> Stuff that can't possibly change during the operation, requires no
> spin-locks at all. In your code snippet retained above, everything is
> a constant. It needs no lock.
>
> Cheers,
thank you very much. I didn't saw that. I am new on kernel-programming.
Now I see
that it is all task-local, so I haven't to protect anything.

greetings
marcel
--
Marcel Lanz <marcel.lanz@ds9.ch>

PGP-Key fingerprint = 71 BE AC 43 04 53 F9 2D 4F B7 B1 47 E5 9B 91 72

-
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:54    [W:0.065 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site