diff options
author | John Polstra <jdp@FreeBSD.org> | 2000-07-08 04:10:38 +0000 |
---|---|---|
committer | John Polstra <jdp@FreeBSD.org> | 2000-07-08 04:10:38 +0000 |
commit | 630df077ab61c69ad927873957c53efc22de140a (patch) | |
tree | efb20d39966915332a54f19a344c679f15642e97 /libexec/rtld-elf/i386/rtld_machdep.h | |
parent | 517191eede15a4a185ac767f523556da2a1ea5d1 (diff) |
Notes
Diffstat (limited to 'libexec/rtld-elf/i386/rtld_machdep.h')
-rw-r--r-- | libexec/rtld-elf/i386/rtld_machdep.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/libexec/rtld-elf/i386/rtld_machdep.h b/libexec/rtld-elf/i386/rtld_machdep.h index b44129ae53e8..37a81d3acba5 100644 --- a/libexec/rtld-elf/i386/rtld_machdep.h +++ b/libexec/rtld-elf/i386/rtld_machdep.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999 John D. Polstra. + * Copyright (c) 1999, 2000 John D. Polstra. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,4 +41,25 @@ (*(Elf_Addr *)(where) = (Elf_Addr)(target)); \ } while (0) +static inline void +atomic_decr_int(volatile int *p) +{ + __asm __volatile ("lock; decl %0" : "=m"(*p) : "0"(*p) : "cc"); +} + +static inline void +atomic_incr_int(volatile int *p) +{ + __asm __volatile ("lock; incl %0" : "=m"(*p) : "0"(*p) : "cc"); +} + +static inline void +atomic_add_int(volatile int *p, int val) +{ + __asm __volatile ("lock; addl %1, %0" + : "=m"(*p) + : "ri"(val), "0"(*p) + : "cc"); +} + #endif |