aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-07-23 17:45:07 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-07-23 17:45:07 +0000
commit831b789edd2c650158e91c9e08db55ebee1a1b3c (patch)
tree36f9e0ad3263dc3c7fb3ef5deb47afba5ae6f735
parent027ae837e4559d1dd5a636b8d8992f0d54b2aa82 (diff)
downloadenigma2-831b789edd2c650158e91c9e08db55ebee1a1b3c.tar.gz
enigma2-831b789edd2c650158e91c9e08db55ebee1a1b3c.zip
make refcount value volatile
-rw-r--r--lib/base/object.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/base/object.h b/lib/base/object.h
index 68507a2b..987511be 100644
--- a/lib/base/object.h
+++ b/lib/base/object.h
@@ -27,10 +27,10 @@ public:
class oRefCount
{
- int ref;
+ volatile int ref;
public:
oRefCount(): ref(0) { }
- operator int&() { return ref; }
+ operator volatile int&() { return ref; }
~oRefCount() {
#ifdef OBJECT_DEBUG
if (ref) eDebug("OBJECT_DEBUG FATAL: %p has %d references!", this, ref); else eDebug("OBJECT_DEBUG refcount ok! (%p)", this);
@@ -59,7 +59,7 @@ public:
" beqz %0, 1b # if not atomic (0), try again \n" \
: "=&r" (temp), "=m" ((int)ref) \
: "m" ((int)ref) \
- : "memory"); \
+ : ); \
} \
void c::Release() \
{ \
@@ -75,7 +75,7 @@ public:
" beqz %0, 1b \n" \
: "=&r" (temp), "=m" ((int)ref) \
: "m" ((int)ref) \
- : "memory"); \
+ : ); \
if (!ref) \
delete this; \
}
@@ -91,7 +91,7 @@ public:
__asm__ __volatile__( \
"1: lwarx %0, 0, %3 \n" \
" add %0, %2, %0 \n" \
- " dcbt 0, %3 \n" \
+ " dcbt 0, %3 # workaround for PPC405CR Errata\n" \
" stwcx. %0, 0, %3 \n" \
" bne- 1b \n" \
: "=&r" (temp), "=m" ((int)ref) \
@@ -104,7 +104,7 @@ public:
__asm__ __volatile__( \
"1: lwarx %0, 0, %3 \n" \
" subf %0, %2, %0 \n" \
- " dcbt 0, %3 \n" \
+ " dcbt 0, %3 # workaround for PPC405CR Errata\n" \
" stwcx. %0, 0, %3 \n" \
" bne- 1b \n" \
: "=&r" (temp), "=m" ((int)ref) \