Browse Source

*** empty log message ***

master
Marc Alexander Lehmann 7 years ago
parent
commit
866562b42d
2 changed files with 22 additions and 6 deletions
  1. +3
    -0
      Changes
  2. +19
    -6
      ev.c

+ 3
- 0
Changes View File

@ -13,6 +13,7 @@ TODO: store loop pid_t and compare isndie signal handler,store 1 for same, 2 for
TODO: embed watchers need updating when fd changes
TODO: document portbaility requirements for atomic pointer access
TODO: possible cb aliasing?
TODO: document requirements for function piinters and calling conventions.
- mark event pipe fd as cloexec after a fork (analyzed by Sami Farin).
- (ecb) support m68k, m88k and sh (patch by Miod Vallat).
@ -23,6 +24,8 @@ TODO: possible cb aliasing?
doing clock_gettime in userspace).
- ensure extern "C" function pointers are used for externally-visible
loop callbacks (not watcher callbacks yet).
- (ecb) work around memory barriers and volatile apparently both being
broken in visual studio 2008 and later (analysed and patch by Nicolas Noble).
4.15 Fri Mar 1 12:04:50 CET 2013
- destroying a non-default loop would stop the global waitpid


+ 19
- 6
ev.c View File

@ -484,7 +484,7 @@ struct signalfd_siginfo
/*
* libecb - http://software.schmorp.de/pkg/libecb
*
* Copyright (©) 2009-2012 Marc Alexander Lehmann <libecb@schmorp.de>
* Copyright (©) 2009-2013 Marc Alexander Lehmann <libecb@schmorp.de>
* Copyright (©) 2011 Emanuele Giaquinta
* All rights reserved.
*
@ -549,7 +549,7 @@ struct signalfd_siginfo
#endif
/* work around x32 idiocy by defining proper macros */
#if __x86_64 || _M_AMD64
#if __amd64 || __x86_64 || _M_AMD64 || _M_X64
#if _ILP32
#define ECB_AMD64_X32 1
#else
@ -619,7 +619,7 @@ struct signalfd_siginfo
#elif defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \
|| defined __ARM_ARCH_7M__ || defined __ARM_ARCH_7R__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory")
#elif __sparc || __sparc__
#elif (__sparc || __sparc__) && !__sparcv8
#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_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
@ -662,6 +662,12 @@ struct signalfd_siginfo
#elif ECB_GCC_VERSION(4,4) || defined __INTEL_COMPILER || defined __clang__
#define ECB_MEMORY_FENCE __sync_synchronize ()
#elif _MSC_VER >= 1500 /* VC++ 2008 */
/* apparently, microsoft broke all the memory barrier stuff in Visual Studio 2008... */
#pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier)
#define ECB_MEMORY_FENCE _ReadWriteBarrier (); MemoryBarrier()
#define ECB_MEMORY_FENCE_ACQUIRE _ReadWriteBarrier (); MemoryBarrier() /* according to msdn, _ReadBarrier is not a load fence */
#define ECB_MEMORY_FENCE_RELEASE _WriteBarrier (); MemoryBarrier()
#elif _MSC_VER >= 1400 /* VC++ 2005 */
#pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier)
#define ECB_MEMORY_FENCE _ReadWriteBarrier ()
@ -1072,10 +1078,17 @@ ecb_inline ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () ==
#include <math.h> /* for frexp*, ldexp*, INFINITY, NAN */
#ifdef NEN
/* only the oldest of old doesn't have this one. solaris. */
#ifdef INFINITY
#define ECB_INFINITY INFINITY
#else
#define ECB_INFINITY HUGE_VAL
#endif
#ifdef NAN
#define ECB_NAN NAN
#else
#define ECB_NAN INFINITY
#define ECB_NAN ECB_INFINITY
#endif
/* converts an ieee half/binary16 to a float */
@ -1090,7 +1103,7 @@ ecb_inline ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () ==
if (!e ) r = ldexpf (m , -24);
else if (e != 31) r = ldexpf (m + 0x400, e - 25);
else if (m ) r = ECB_NAN;
else r = INFINITY;
else r = ECB_INFINITY;
return x & 0x8000 ? -r : r;
}


Loading…
Cancel
Save