Re: [question/comment/help] pseudo function-call from kernel to a

Marcel Lanz (marcel.lanz@ds9.ch)
Wed, 10 Nov 1999 12:05:13 +0100


"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/