Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/planix-v0/sys/src/cmd/unix/drawterm/posix-amd64/tas.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include "u.h"
2
#include "libc.h"
3
 
4
int
5
tas(long *x)
6
{
7
	int     v;
8
 
9
	__asm__(	"movl   $1, %%eax\n\t"
10
				"xchgl  %%eax,(%%rcx)"
11
				: "=a" (v)
12
				: "c" (x)
13
	);
14
	switch(v) {
15
	case 0:
16
	case 1:
17
		return v;
18
	default:
19
		print("canlock: corrupted 0x%lux\n", v);
20
		return 1;
21
	}
22
}
23