Subject: Will ll/sc work from user space?

From: David Daney <[email-masked]>
Date: Thu, 18 Sep 2003 17:30:57 -0700

Q:  Will ll/sc instructions work from a linux user process ?

If so What happens if there is a context switch between the two?

What happens if the memory location is paged out and then back into a 
different physical page?

Thanks in advance for any insight into this.

David Daney.

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Fri, 19 Sep 2003 13:17:49 +0200 (MET DST)

> Q:  Will ll/sc instructions work from a linux user process ?

 Yep.

> What happens if the memory location is paged out and then back into a 

 Then sc will fail.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email-masked], PGP key available        +

---

From: Dominic Sweetman <[email-masked]>
Date: Fri, 19 Sep 2003 22:11:37 +0200

David,

> Q:  Will ll/sc instructions work from a linux user process ?

As Maciej says, yes.

> If so What happens if there is a context switch between the two?

The sc fails.

It fails whenever any interrupt or other exception (perhaps a VM
event, for example) happens after the ll but before the sc.

> What happens if the memory location is paged out and then back into a 

If that happens between the ll and the sc, then you must certainly
have got an interrupt.

--
Dominic Sweetman
MIPS Technologies