diff options
author | kan <kan@FreeBSD.org> | 2003-05-29 22:58:26 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2003-05-29 22:58:26 +0000 |
commit | 949c40c5fd683b40f39ebfa2783d06b8226148ab (patch) | |
tree | b9989a6b77c2c503eafdb3cf6bf13370f5c6396b /libexec/rtld-elf/amd64 | |
parent | b292a2679ee1e9385409c38e0e898f0c2f4cb41c (diff) | |
download | FreeBSD-src-949c40c5fd683b40f39ebfa2783d06b8226148ab.zip FreeBSD-src-949c40c5fd683b40f39ebfa2783d06b8226148ab.tar.gz |
Allow threading libraries to register their own locking
implementation in case default one provided by rtld is
not suitable.
Consolidate various identical MD lock implementation into
a single file using appropriate machine/atomic.h.
Approved by: re (scottl)
Diffstat (limited to 'libexec/rtld-elf/amd64')
-rw-r--r-- | libexec/rtld-elf/amd64/rtld_machdep.h | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/libexec/rtld-elf/amd64/rtld_machdep.h b/libexec/rtld-elf/amd64/rtld_machdep.h index 4bd7ae2..953e289 100644 --- a/libexec/rtld-elf/amd64/rtld_machdep.h +++ b/libexec/rtld-elf/amd64/rtld_machdep.h @@ -29,6 +29,11 @@ #ifndef RTLD_MACHDEP_H #define RTLD_MACHDEP_H 1 +#include <sys/types.h> +#include <machine/atomic.h> + +#define CACHE_LINE_SIZE 32 + struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ @@ -53,25 +58,4 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, #define call_initfini_pointer(obj, target) \ (((InitFunc)(target))()) -static inline void -atomic_decr_int(volatile int *p) -{ - __asm __volatile ("lock; decl %0" : "+m"(*p) : : "cc"); -} - -static inline void -atomic_incr_int(volatile int *p) -{ - __asm __volatile ("lock; incl %0" : "+m"(*p) : : "cc"); -} - -static inline void -atomic_add_int(volatile int *p, int val) -{ - __asm __volatile ("lock; addl %1, %0" - : "+m"(*p) - : "ri"(val) - : "cc"); -} - #endif |