locks.S (e5451c8f8330e03ad3cfa16048b4daf961af434f) locks.S (d3867f0483103b8ff7edfdea3ef1981c03d96891)
1/*
2 * locks.S: SMP low-level lock primitives on Sparc.
3 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1998 Anton Blanchard (anton@progsoc.uts.edu.au)
6 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
7 */
8
9#include <asm/ptrace.h>
10#include <asm/psr.h>
11#include <asm/smp.h>
12#include <asm/spinlock.h>
1/*
2 * locks.S: SMP low-level lock primitives on Sparc.
3 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1998 Anton Blanchard (anton@progsoc.uts.edu.au)
6 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
7 */
8
9#include <asm/ptrace.h>
10#include <asm/psr.h>
11#include <asm/smp.h>
12#include <asm/spinlock.h>
13#include <asm/export.h>
13
14 .text
15 .align 4
16
17 /* Read/writer locks, as usual this is overly clever to make it
18 * as fast as possible.
19 */
20

--- 22 unchanged lines hidden (view full) ---

43___rw_write_enter_spin_on_wlock:
44 orcc %g2, 0x0, %g0
45 be,a ___rw_write_enter
46 ldstub [%g1 + 3], %g2
47 b ___rw_write_enter_spin_on_wlock
48 ld [%g1], %g2
49
50 .globl ___rw_read_enter
14
15 .text
16 .align 4
17
18 /* Read/writer locks, as usual this is overly clever to make it
19 * as fast as possible.
20 */
21

--- 22 unchanged lines hidden (view full) ---

44___rw_write_enter_spin_on_wlock:
45 orcc %g2, 0x0, %g0
46 be,a ___rw_write_enter
47 ldstub [%g1 + 3], %g2
48 b ___rw_write_enter_spin_on_wlock
49 ld [%g1], %g2
50
51 .globl ___rw_read_enter
52EXPORT_SYMBOL(___rw_read_enter)
51___rw_read_enter:
52 orcc %g2, 0x0, %g0
53 bne,a ___rw_read_enter_spin_on_wlock
54 ldub [%g1 + 3], %g2
55 ld [%g1], %g2
56 add %g2, 1, %g2
57 st %g2, [%g1]
58 retl
59 mov %g4, %o7
60
61 .globl ___rw_read_exit
53___rw_read_enter:
54 orcc %g2, 0x0, %g0
55 bne,a ___rw_read_enter_spin_on_wlock
56 ldub [%g1 + 3], %g2
57 ld [%g1], %g2
58 add %g2, 1, %g2
59 st %g2, [%g1]
60 retl
61 mov %g4, %o7
62
63 .globl ___rw_read_exit
64EXPORT_SYMBOL(___rw_read_exit)
62___rw_read_exit:
63 orcc %g2, 0x0, %g0
64 bne,a ___rw_read_exit_spin_on_wlock
65 ldub [%g1 + 3], %g2
66 ld [%g1], %g2
67 sub %g2, 0x1ff, %g2
68 st %g2, [%g1]
69 retl
70 mov %g4, %o7
71
72 .globl ___rw_read_try
65___rw_read_exit:
66 orcc %g2, 0x0, %g0
67 bne,a ___rw_read_exit_spin_on_wlock
68 ldub [%g1 + 3], %g2
69 ld [%g1], %g2
70 sub %g2, 0x1ff, %g2
71 st %g2, [%g1]
72 retl
73 mov %g4, %o7
74
75 .globl ___rw_read_try
76EXPORT_SYMBOL(___rw_read_try)
73___rw_read_try:
74 orcc %g2, 0x0, %g0
75 bne ___rw_read_try_spin_on_wlock
76 ld [%g1], %g2
77 add %g2, 1, %g2
78 st %g2, [%g1]
79 set 1, %o1
80 retl
81 mov %g4, %o7
82
83 .globl ___rw_write_enter
77___rw_read_try:
78 orcc %g2, 0x0, %g0
79 bne ___rw_read_try_spin_on_wlock
80 ld [%g1], %g2
81 add %g2, 1, %g2
82 st %g2, [%g1]
83 set 1, %o1
84 retl
85 mov %g4, %o7
86
87 .globl ___rw_write_enter
88EXPORT_SYMBOL(___rw_write_enter)
84___rw_write_enter:
85 orcc %g2, 0x0, %g0
86 bne ___rw_write_enter_spin_on_wlock
87 ld [%g1], %g2
88 andncc %g2, 0xff, %g0
89 bne,a ___rw_write_enter_spin_on_wlock
90 stb %g0, [%g1 + 3]
91 retl
92 mov %g4, %o7
89___rw_write_enter:
90 orcc %g2, 0x0, %g0
91 bne ___rw_write_enter_spin_on_wlock
92 ld [%g1], %g2
93 andncc %g2, 0xff, %g0
94 bne,a ___rw_write_enter_spin_on_wlock
95 stb %g0, [%g1 + 3]
96 retl
97 mov %g4, %o7