From 161915fd91d9196887be2a32095f3c60515728a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 2 Sep 2003 04:26:04 +0000 Subject: [PATCH] Resolved the name clashing caused by the introduction of atomic_set() and atomic_test_and_set() to the OpenBeOS headers (prefixed BFS versions with '_'). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4446 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Lock.h | 4 ++-- src/add-ons/kernel/file_systems/bfs/Utility.h | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Lock.h b/src/add-ons/kernel/file_systems/bfs/Lock.h index 8411cae583..93f372b9bd 100644 --- a/src/add-ons/kernel/file_systems/bfs/Lock.h +++ b/src/add-ons/kernel/file_systems/bfs/Lock.h @@ -457,7 +457,7 @@ class SimpleLock { { int32 thisThread = find_thread(NULL); int32 current; - while ((current = atomic_test_and_set(&fHolder, thisThread, -1)) != -1) { + while ((current = _atomic_test_and_set(&fHolder, thisThread, -1)) != -1) { if (current == thisThread) break; @@ -473,7 +473,7 @@ class SimpleLock { void Unlock() { if (atomic_add(&fCount, -1) == 1) - atomic_set(&fHolder, -1); + _atomic_set(&fHolder, -1); } bool IsLocked() const diff --git a/src/add-ons/kernel/file_systems/bfs/Utility.h b/src/add-ons/kernel/file_systems/bfs/Utility.h index 14ddd2763f..7e5183f2df 100644 --- a/src/add-ons/kernel/file_systems/bfs/Utility.h +++ b/src/add-ons/kernel/file_systems/bfs/Utility.h @@ -109,9 +109,9 @@ template struct list { // Some atomic operations that are somehow missing in BeOS: // -// atomic_test_and_set(value, newValue, testAgainst) +// _atomic_test_and_set(value, newValue, testAgainst) // sets "value" to "newValue", if "value" is equal to "testAgainst" -// atomic_set(value, newValue) +// _atomic_set(value, newValue) // sets "value" to "newValue" #if _NO_INLINE_ASM @@ -119,7 +119,7 @@ template struct list { // They are only used for single processor user space tests // (and don't even work correctly there) inline int32 - atomic_test_and_set(volatile int32 *value, int32 newValue, int32 testAgainst) + _atomic_test_and_set(volatile int32 *value, int32 newValue, int32 testAgainst) { int32 oldValue = *value; if (oldValue == testAgainst) @@ -129,13 +129,13 @@ template struct list { } inline void - atomic_set(volatile int32 *value, int32 newValue) + _atomic_set(volatile int32 *value, int32 newValue) { *value = newValue; } #elif __INTEL__ inline int32 - atomic_test_and_set(volatile int32 *value, int32 newValue, int32 testAgainst) + _atomic_test_and_set(volatile int32 *value, int32 newValue, int32 testAgainst) { int32 oldValue; asm volatile("lock; cmpxchg %%ecx, (%%edx)" @@ -144,13 +144,13 @@ template struct list { } inline void - atomic_set(volatile int32 *value, int32 newValue) + _atomic_set(volatile int32 *value, int32 newValue) { asm volatile("lock; xchg %%eax, (%%edx)" : : "a" (newValue), "d" (value)); } #else -# error The macros atomic_set(), and atomic_test_and_set() are not defined for the target processor +# error The macros _atomic_set(), and _atomic_test_and_set() are not defined for the target processor #endif