Skip to contentSkip to conversation

Remove atomic_set_bit, atomic_clear_bit and ia64_intrinsic.h and its

PATCH Alex Williamson 2 participants 3 messages May 10, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · Xen staging patchbot-unstable

# HG changeset patch
# User Christian Limpach <[email protected]>
# Date 1178809115 -3600
# Node ID 8f510bf078c7745696547b5245ba95ac5a6192bc
# Parent a4467c0971ba0e876637478b7f5e37ce344768c0
[qemu] Remove atomic_set_bit, atomic_clear_bit and ia64_intrinsic.h and its users.

ia64intrin.h is all but empty in gcc 4.1.2, so there's no point in
including it. dm-exec is still making use of a few of these too, but I guess it's easy enough to inline them there. Patch below. Thanks,

Alex

---

tools/ioemu/exec-all.h +0 -2
diff -r 07b1e917c9d8 tools/ioemu/exec-all.h
@@ -474,8 +474,6 @@ static inline int testandset (int *p)
 #endif
 
 #ifdef __ia64
-#include <ia64intrin.h>
-
 static inline int testandset (int *p)
 {
     return __sync_lock_test_and_set (p, 1);
tools/ioemu/target-i386-dm/exec-dm.c +5 -0
diff -r 07b1e917c9d8 tools/ioemu/target-i386-dm/exec-dm.c
@@ -360,6 +360,11 @@ CPUReadMemoryFunc **cpu_get_io_memory_re
 }
 
 #ifdef __ia64__
+
+#define __ia64_fc(addr)	asm volatile ("fc %0" :: "r"(addr) : "memory")
+#define ia64_sync_i()	asm volatile (";; sync.i" ::: "memory")
+#define ia64_srlz_i()	asm volatile (";; srlz.i ;;" ::: "memory")
+
 /* IA64 has seperate I/D cache, with coherence maintained by DMA controller.
  * So to emulate right behavior that guest OS is assumed, we need to flush
  * I/D cache here.
#2 lore raw

RE: [PATCH] Re: [Xen-staging] [xen-unstable] [qemu] Removeatomic_set_bit, atomic_clear_bit and ia64_intrinsic.h and its

Quoted 4 lines

ia64intrin.h is all but empty in gcc 4.1.2, so there's no point in
including it. dm-exec is still making use of a few of these too, but I
guess it's easy enough to inline them there. Patch below. Thanks,

Would it also work to just leave the include in exec-all.h? I was confused and thought that it was a local include which is why I put #ifndef CONFIG_DM around all the testandset definitions.

So, if I remove the #ifndef CONFIG_DM, anything including exec-all.h should still compile, right? Do I still need the extra #define's in that case?

christian

Quoted 43 lines

Alex

---

diff -r 07b1e917c9d8 tools/ioemu/exec-all.h

tools/ioemu/exec-all.h +0 -2
@@ -474,8 +474,6 @@ static inline int testandset (int *p)
 #endif
 
 #ifdef __ia64
-#include <ia64intrin.h>
-
 static inline int testandset (int *p)
 {
     return __sync_lock_test_and_set (p, 1);

diff -r 07b1e917c9d8 tools/ioemu/target-i386-dm/exec-dm.c
--- a/tools/ioemu/target-i386-dm/exec-dm.c Thu May 10
16:22:27 2007 +0100
+++ b/tools/ioemu/target-i386-dm/exec-dm.c Thu May 10
10:11:38 2007 -0600

tools/ioemu/exec-all.h +5 -0
@@ -360,6 +360,11 @@ CPUReadMemoryFunc **cpu_get_io_memory_re
 }
 
 #ifdef __ia64__
+
+#define __ia64_fc(addr)	asm volatile ("fc %0" :: 
 "r"(addr) : "memory")
+#define ia64_sync_i()	asm volatile (";; sync.i" ::: "memory")
+#define ia64_srlz_i()	asm volatile (";; srlz.i ;;" 
 ::: "memory")
+
 /* IA64 has seperate I/D cache, with coherence maintained by 

DMA controller.
* So to emulate right behavior that guest OS is assumed, we
need to flush
* I/D cache here.

#3 lore raw

RE: [PATCH] Re: [Xen-staging] [xen-unstable] [qemu] Removeatomic_set_bit, atomic_clear_bit and ia64_intrinsic.h and its

Quoted 5 lines · Christian Limpach
Quoted 4 lines

ia64intrin.h is all but empty in gcc 4.1.2, so there's no point in
including it. dm-exec is still making use of a few of these too, but I
guess it's easy enough to inline them there. Patch below. Thanks,

Quoted 7 lines

Would it also work to just leave the include in exec-all.h? I was confused and thought that it was a local include which is why I put #ifndef CONFIG_DM around all the testandset definitions.

So, if I remove the #ifndef CONFIG_DM, anything including exec-all.h should still compile, right? Do I still need the extra #define's in that case?

ia64intrin.h is basically empty, so making it included for the
dm-exec build doesn't really help. The defines still need to come from somewhere. We could replace <ia64intrin.h> with <asm/gcc_intrin.h>, but for this trivial case, I'd rather not get tied up including kernel headers in userspace tools. Thanks,

Alex

Signature · 1 line
Alex Williamson                             HP Open Source & Linux Org.