lkml.org 
[lkml]   [2003]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[Patch] asm workarounds in generic header files
Date
From
Intel ecc compiler doesn't support inline assembly. 
Attached patch is required to enable linux kernel build with Intel ecc compiler.
Please apply.

thanks,
suresh

diff -Nru linux/include/linux/compiler.h linux-2.5/include/linux/compiler.h
--- linux/include/linux/compiler.h Mon Sep 8 11:51:00 2003
+++ linux-2.5/include/linux/compiler.h Mon Sep 8 13:22:13 2003
@@ -74,10 +74,26 @@
#define __attribute_pure__ /* unimplemented */
#endif

+#if defined(__INTEL_COMPILER) && defined(__ECC)
+/* Optimization barrier */
+#include <asm/intrinsics.h>
+#define barrier() __memory_barrier()
+
+#define RELOC_HIDE(ptr, off) \
+ ({ unsigned long __ptr; \
+ __ptr = (unsigned long) (ptr); \
+ (typeof(ptr)) (__ptr + (off)); })
+#else
+/* Optimization barrier */
+/* The "volatile" is due to gcc bugs */
+#define barrier() asm volatile ("":::"memory")
+
/* This macro obfuscates arithmetic on a variable address so that gcc
shouldn't recognize the original var, and make assumptions about it */
#define RELOC_HIDE(ptr, off) \
({ unsigned long __ptr; \
__asm__ ("" : "=g"(__ptr) : "0"(ptr)); \
(typeof(ptr)) (__ptr + (off)); })
+#endif
+
#endif /* __LINUX_COMPILER_H */
diff -Nru linux/include/linux/kernel.h linux-2.5/include/linux/kernel.h
--- linux/include/linux/kernel.h Mon Sep 8 11:51:01 2003
+++ linux-2.5/include/linux/kernel.h Mon Sep 8 12:06:14 2003
@@ -15,10 +15,6 @@
#include <asm/byteorder.h>
#include <asm/bug.h>

-/* Optimization barrier */
-/* The "volatile" is due to gcc bugs */
-#define barrier() __asm__ __volatile__("": : :"memory")
-
#define INT_MAX ((int)(~0U>>1))
#define INT_MIN (-INT_MAX - 1)
#define UINT_MAX (~0U)[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.031 / U:3.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site