summaryrefslogtreecommitdiff
path: root/exec-all.h
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-08 23:40:45 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-08 23:40:45 +0000
commit204a1b8d5ec12af7f0e4757f51802672fc2e6681 (patch)
treeaa9d78500bac36d69376814450f7c024277e9570 /exec-all.h
parent522777bbafd9151da17199f558c036f791b5cac1 (diff)
Another #elif'ication.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2792 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec-all.h')
-rw-r--r--exec-all.h39
1 files changed, 12 insertions, 27 deletions
diff --git a/exec-all.h b/exec-all.h
index bc118c8a4..d6bbbd20b 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -357,7 +357,7 @@ extern CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4];
extern CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4];
extern void *io_mem_opaque[IO_MEM_NB_ENTRIES];
-#ifdef __powerpc__
+#if defined(__powerpc__)
static inline int testandset (int *p)
{
int ret;
@@ -373,9 +373,7 @@ static inline int testandset (int *p)
: "cr0", "memory");
return ret;
}
-#endif
-
-#ifdef __i386__
+#elif defined(__i386__)
static inline int testandset (int *p)
{
long int readval = 0;
@@ -386,9 +384,7 @@ static inline int testandset (int *p)
: "cc");
return readval;
}
-#endif
-
-#ifdef __x86_64__
+#elif defined(__x86_64__)
static inline int testandset (int *p)
{
long int readval = 0;
@@ -399,9 +395,7 @@ static inline int testandset (int *p)
: "cc");
return readval;
}
-#endif
-
-#ifdef __s390__
+#elif defined(__s390__)
static inline int testandset (int *p)
{
int ret;
@@ -413,9 +407,7 @@ static inline int testandset (int *p)
: "cc", "memory" );
return ret;
}
-#endif
-
-#ifdef __alpha__
+#elif defined(__alpha__)
static inline int testandset (int *p)
{
int ret;
@@ -432,9 +424,7 @@ static inline int testandset (int *p)
: "m" (*p));
return ret;
}
-#endif
-
-#ifdef __sparc__
+#elif defined(__sparc__)
static inline int testandset (int *p)
{
int ret;
@@ -446,9 +436,7 @@ static inline int testandset (int *p)
return (ret ? 1 : 0);
}
-#endif
-
-#ifdef __arm__
+#elif defined(__arm__)
static inline int testandset (int *spinlock)
{
register unsigned int ret;
@@ -458,9 +446,7 @@ static inline int testandset (int *spinlock)
return ret;
}
-#endif
-
-#ifdef __mc68000
+#elif defined(__mc68000)
static inline int testandset (int *p)
{
char ret;
@@ -470,18 +456,15 @@ static inline int testandset (int *p)
: "cc","memory");
return ret;
}
-#endif
+#elif defined(__ia64)
-#ifdef __ia64
#include <ia64intrin.h>
static inline int testandset (int *p)
{
return __sync_lock_test_and_set (p, 1);
}
-#endif
-
-#ifdef __mips__
+#elif defined(__mips__)
static inline int testandset (int *p)
{
int ret;
@@ -501,6 +484,8 @@ static inline int testandset (int *p)
return ret;
}
+#else
+#error unimplemented CPU support
#endif
typedef int spinlock_t;