From 3d05e77ca1f743e5b4091c6bfe311460175ed9ae Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 21 Sep 2013 19:53:27 +0200 Subject: libc: change tas/sleep locks to cas/semacquire/semrelease locks (from sources) spinlocks have been changed to use the new semacquire/semrelease syscalls in combination with atomic compare and swap operations. --- sys/include/libc.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sys/include/libc.h') diff --git a/sys/include/libc.h b/sys/include/libc.h index a92e5680d..c84acc0f5 100644 --- a/sys/include/libc.h +++ b/sys/include/libc.h @@ -409,12 +409,19 @@ enum { }; /* what */ extern void prof(void (*fn)(void*), void *arg, int entries, int what); +/* + * atomic + */ +extern long ainc(long*); +extern long adec(long*); + /* * synchronization */ typedef struct Lock { - int val; + long key; + long sem; } Lock; extern int _tas(int*); @@ -701,9 +708,6 @@ extern char* sysname(void); extern void werrstr(char*, ...); #pragma varargck argpos werrstr 1 -extern long ainc(long*); -extern long adec(long*); - extern char *argv0; #define ARGBEGIN for((argv0||(argv0=*argv)),argv++,argc--;\ argv[0] && argv[0][0]=='-' && argv[0][1];\ -- cgit v1.2.3