summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2012-01-27 22:28:49 +0000
committerroot <root>2012-01-27 22:28:49 +0000
commit00ea2078cf01f6fa788743cc8adc465c02c1dd99 (patch)
treea0663dd10aa6ccca8bda6375a7350a7abfbf2c4f
parent97460ea47bb00a61c4e06196561ed7ce5fa6214f (diff)
*** empty log message ***
-rw-r--r--ev.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/ev.c b/ev.c
index ab6b5b0..ca45a13 100644
--- a/ev.c
+++ b/ev.c
@@ -560,8 +560,10 @@ struct signalfd_siginfo
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory")
#elif __sparc || __sparc__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad | " : : : "memory")
- #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory")
+ #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
+ #elif defined(__s390__) || defined(__s390x__)
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("bcr 15,0" : : : "memory")
#endif
#endif
#endif
@@ -856,25 +858,25 @@ ecb_inline uint64_t ecb_rotr64 (uint64_t x, unsigned int count) { return (x << (
#define ecb_unreachable() __builtin_unreachable ()
#else
/* this seems to work fine, but gcc always emits a warning for it :/ */
- ecb_function_ void ecb_unreachable (void) ecb_noreturn;
- ecb_function_ void ecb_unreachable (void) { }
+ ecb_inline void ecb_unreachable (void) ecb_noreturn;
+ ecb_inline void ecb_unreachable (void) { }
#endif
/* try to tell the compiler that some condition is definitely true */
#define ecb_assume(cond) do { if (!(cond)) ecb_unreachable (); } while (0)
-ecb_function_ unsigned char ecb_byteorder_helper (void) ecb_const;
-ecb_function_ unsigned char
+ecb_inline unsigned char ecb_byteorder_helper (void) ecb_const;
+ecb_inline unsigned char
ecb_byteorder_helper (void)
{
const uint32_t u = 0x11223344;
return *(unsigned char *)&u;
}
-ecb_function_ ecb_bool ecb_big_endian (void) ecb_const;
-ecb_function_ ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11; }
-ecb_function_ ecb_bool ecb_little_endian (void) ecb_const;
-ecb_function_ ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44; }
+ecb_inline ecb_bool ecb_big_endian (void) ecb_const;
+ecb_inline ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11; }
+ecb_inline ecb_bool ecb_little_endian (void) ecb_const;
+ecb_inline ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44; }
#if ECB_GCC_VERSION(3,0) || ECB_C99
#define ecb_mod(m,n) ((m) % (n) + ((m) % (n) < 0 ? (n) : 0))