File: alpha.dec

package info (click to toggle)
glibc-pre2.1 2.0.93-980414-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 43,920 kB
  • ctags: 42,602
  • sloc: ansic: 325,848; asm: 23,534; makefile: 3,352; sh: 3,283; awk: 582; perl: 474; csh: 15; sed: 10
file content (25 lines) | stat: -rw-r--r-- 683 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * @(#)alpha.dec	8.3 (Sleepycat Software) 1/18/97
 *
 * The DEC C asm acts as a pseudo-call.  The first argument is the assembly
 * code, and the remaining arguments are assigned as in a procedure call, to
 * r16, r17, etc. (represented in asm as %a0, %a1, and so forth).
 *
 * From: Dave Butenhof.
 */

#include <c_asm.h>

#define	TSL_SET(tsl)	(asm ("mb;					\
    10:	ldl_l	%v0,(%a0) ;						\
	bne	%v0,30f ;						\
	or	%v0,1,%r1 ;						\
	stl_c	%r1,(%a0) ;						\
	beq	%r1,20f ;						\
	mb	;							\
	br	%r31,30f ;						\
    20:	br	%r31,10b ;						\
    30:	", (tsl)))

THIS WAS NOT CONVERTED TO TAKE A POINTER AS AN ARGUMENT...
#define	TSL_UNSET(tsl)	(asm ("mb"), *(tsl) = 0)