mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Atomic increment and decrement functions for m68k
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28310 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
24bd346ee5
commit
f3723a5426
2 changed files with 28 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
2009-05-29 Riccardo Mottola <rmottola@users.sf.net>
|
||||
|
||||
* Source/NSObject.m: Atomic increment and decrement functions for m68k
|
||||
|
||||
2009-05-29 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
* GNUmakefile: Use $(warning ...) instead of $(info ...) since
|
||||
|
|
|
@ -292,6 +292,30 @@ GSAtomicDecrement(gsatomic_t X)
|
|||
return *X;
|
||||
}
|
||||
|
||||
#elif defined(__m68k__)
|
||||
|
||||
typedef int32_t volatile *gsatomic_t;
|
||||
|
||||
#define GSATOMICREAD(X) (*(X))
|
||||
|
||||
static __inline__ int
|
||||
GSAtomicIncrement(gsatomic_t X)
|
||||
{
|
||||
__asm__ __volatile__ (
|
||||
"addq%.l %#1, %0"
|
||||
:"=m" (*X));
|
||||
return *X;
|
||||
}
|
||||
|
||||
static __inline__ int
|
||||
GSAtomicDecrement(gsatomic_t X)
|
||||
{
|
||||
__asm__ __volatile__ (
|
||||
"subq%.l %#1, %0"
|
||||
:"=m" (*X));
|
||||
return *X;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(GSATOMICREAD)
|
||||
|
|
Loading…
Reference in a new issue