Rev 115 | Rev 501 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 115 | Rev 458 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
29 | .text |
29 | .text |
30 | 30 | ||
31 | #ifdef __SMP__ |
31 | #ifdef CONFIG_SMP |
32 | 32 | ||
33 | .global spinlock_arch |
33 | .global spinlock_arch |
34 | 34 | ||
35 | # |
35 | # |
36 | # This is a bus-and-hyperthreading-friendly implementation of spinlock |
36 | # This is a bus-and-hyperthreading-friendly implementation of spinlock |
Line 40... | Line 40... | ||
40 | pushl %ebx |
40 | pushl %ebx |
41 | 41 | ||
42 | movl 12(%esp),%ebx |
42 | movl 12(%esp),%ebx |
43 | 43 | ||
44 | 0: |
44 | 0: |
45 | #ifdef __HT__ |
45 | #ifdef CONFIG_HT |
46 | pause # Pentium 4's with HT love this instruction |
46 | pause # Pentium 4's with HT love this instruction |
47 | #endif |
47 | #endif |
48 | movl (%ebx),%eax |
48 | movl (%ebx),%eax |
49 | testl %eax,%eax |
49 | testl %eax,%eax |
50 | jnz 0b # lightweight looping while it is locked |
50 | jnz 0b # lightweight looping while it is locked |