Update.
[glibc.git] / db2 / mutex / tsl_parisc.s
blobe6054944ecc5e7e5a3e56ec2fd3fc54a7d8b8495
1 /*
2 * Copyright (c) 1996-1997 The University of Utah and the Computer Systems
3 * Laboratory at the University of Utah (CSL). All rights reserved.
5 * Permission to use, copy, modify and distribute this software is hereby
6 * granted provided that (1) source code retains these copyright, permission,
7 * and disclaimer notices, and (2) redistributions including binaries
8 * reproduce the notices in supporting documentation, and (3) all advertising
9 * materials mentioning features or use of this software display the following
10 * acknowledgement: ``This product includes software developed by the Computer
11 * Systems Laboratory at the University of Utah.''
13 * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
14 * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
15 * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 * CSL requests users of this software to return to csl-dist@cs.utah.edu any
18 * improvements that they make and grant CSL redistribution rights.
20 * @(#)tsl_parisc.s 8.4 (Sleepycat) 1/18/97
24 * Spin locks for the PA-RISC. Based on Bob Wheeler's Mach implementation.
26 .SPACE $TEXT$
27 .SUBSPA $CODE$
30 * int tsl_set(tsl_t *tsl)
32 * Try to acquire a lock, return 1 if successful, 0 if not.
34 .EXPORT tsl_set,ENTRY
35 tsl_set
36 .PROC
37 .CALLINFO FRAME=0,NO_CALLS
38 .ENTRY
39 ldo 15(%r26),%r26
40 depi 0,31,4,%r26
41 ldcws 0(%r26),%r28
42 subi,= 0,%r28,%r0
43 ldi 1,%r28
44 bv,n 0(%r2)
45 .EXIT
46 .PROCEND
50 * void tsl_unset(tsl_t *tsl)
52 * Release a lock.
54 .EXPORT tsl_unset,ENTRY
55 tsl_unset
56 .PROC
57 .CALLINFO FRAME=0,NO_CALLS
58 .ENTRY
59 ldo 15(%r26),%r26
60 ldi -1,%r19
61 depi 0,31,4,%r26
62 bv 0(%r2)
63 stw %r19,0(%r26)
64 .EXIT
65 .PROCEND