sol_compat.h File Reference

#include "config.h"
#include <stdint.h>
#include <pthread.h>
#include <sys/time.h>

Go to the source code of this file.

Defines

#define THR_RETURN   void *
#define THR_API
#define INLINE   inline
#define thr_self()   pthread_self()
#define thr_sigsetmask   pthread_sigmask
#define THR_BOUND   1
#define THR_DETACHED   2
#define THR_DAEMON   4
#define mutex_init(mp, type, arg)   pthread_mutex_init(mp, NULL)
#define mutex_lock(mp)   pthread_mutex_lock(mp)
#define mutex_unlock(mp)   pthread_mutex_unlock(mp)
#define mutex_destroy(mp)   pthread_mutex_destroy(mp)
#define mutex_trylock(mp)   pthread_mutex_trylock(mp)
#define DEFAULTMUTEX   PTHREAD_MUTEX_INITIALIZER
#define DEFAULTCV   PTHREAD_COND_INITIALIZER
#define MUTEX_HELD(mp)   1
#define cond_init(c, type, arg)   pthread_cond_init(c, NULL)
#define cond_wait(c, m)   pthread_cond_wait(c, m)
#define _cond_wait(c, m)   pthread_cond_wait(c, m)
#define cond_signal(c)   pthread_cond_signal(c)
#define cond_broadcast(c)   pthread_cond_broadcast(c)
#define cond_destroy(c)   pthread_cond_destroy(c)
#define cond_timedwait   pthread_cond_timedwait
#define _cond_timedwait   pthread_cond_timedwait
#define RTLD_FIRST   0
#define ec_atomic_inc64(a)   (*a)++
#define P2PHASE(x, align)   ((x) & ((align) - 1))
#define P2ALIGN(x, align)   ((x) & -(align))
#define P2NPHASE(x, align)   (-(x) & ((align) - 1))
#define P2ROUNDUP(x, align)   (-(-(x) & -(align)))
#define P2END(x, align)   (-(~(x) & -(align)))
#define P2PHASEUP(x, align, phase)   ((phase) - (((phase) - (x)) & -(align)))
#define P2CROSS(x, y, align)   (((x) ^ (y)) > (align) - 1)
#define P2SAMEHIGHBIT(x, y)   (((x) ^ (y)) < ((x) & (y)))
#define IS_P2ALIGNED(v, a)   ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
#define ISP2(x)   (((x) & ((x) - 1)) == 0)
#define atomic_add_64(lvalptr, delta)   ec_atomic_inc64(lvalptr)
#define atomic_add_32_nv(a, b)   ec_atomic_inc(a)
#define NANOSEC   1000000000
#define issetugid()   (geteuid() == 0)
#define _sysconf(a)   sysconf(a)
#define __NORETURN   __attribute__ ((noreturn))
#define EC_UMEM_DUMMY_PCSTACK   1
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
#define MAX(a, b)   ((a) > (b) ? (a) : (b))

Typedefs

typedef pthread_t thread_t
typedef pthread_mutex_t mutex_t
typedef pthread_cond_t cond_t
typedef u_int64_t hrtime_t
typedef uint32_t uint_t
typedef unsigned long ulong_t
typedef struct timespec timestruc_t
typedef long long longlong_t
typedef struct timespec timespec_t


Define Documentation

#define __NORETURN   __attribute__ ((noreturn))

#define _cond_timedwait   pthread_cond_timedwait

#define _cond_wait ( c,
 )     pthread_cond_wait(c, m)

Referenced by umem_init(), and vmem_xalloc().

#define _sysconf (  )     sysconf(a)

Referenced by umem_type_init(), and vmem_mmap_arena().

#define atomic_add_32_nv ( a,
 )     ec_atomic_inc(a)

Referenced by vmem_create().

#define atomic_add_64 ( lvalptr,
delta   )     ec_atomic_inc64(lvalptr)

Referenced by _umem_cache_alloc().

#define cond_broadcast (  )     pthread_cond_broadcast(c)

#define cond_destroy (  )     pthread_cond_destroy(c)

Referenced by vmem_destroy().

#define cond_init ( c,
type,
arg   )     pthread_cond_init(c, NULL)

Referenced by vmem_create().

#define cond_signal (  )     pthread_cond_signal(c)

#define cond_timedwait   pthread_cond_timedwait

#define cond_wait ( c,
 )     pthread_cond_wait(c, m)

#define DEFAULTCV   PTHREAD_COND_INITIALIZER

#define DEFAULTMUTEX   PTHREAD_MUTEX_INITIALIZER

Referenced by vmem_heap_arena().

#define ec_atomic_inc64 (  )     (*a)++

#define EC_UMEM_DUMMY_PCSTACK   1

#define INLINE   inline

#define IS_P2ALIGNED ( v,
 )     ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)

#define ISP2 (  )     (((x) & ((x) - 1)) == 0)

Referenced by vmem_sbrk_arena().

 
#define issetugid (  )     (geteuid() == 0)

#define MAX ( a,
 )     ((a) > (b) ? (a) : (b))

#define MIN ( a,
 )     ((a) < (b) ? (a) : (b))

#define mutex_destroy ( mp   )     pthread_mutex_destroy(mp)

#define MUTEX_HELD ( mp   )     1

#define mutex_init ( mp,
type,
arg   )     pthread_mutex_init(mp, NULL)

Referenced by umem_cache_create(), and vmem_create().

#define mutex_lock ( mp   )     pthread_mutex_lock(mp)

#define mutex_trylock ( mp   )     pthread_mutex_trylock(mp)

#define mutex_unlock ( mp   )     pthread_mutex_unlock(mp)

#define NANOSEC   1000000000

Referenced by hrt2ts(), and umem_init().

#define P2ALIGN ( x,
align   )     ((x) & -(align))

Referenced by vmem_alloc(), and vmem_xalloc().

#define P2CROSS ( x,
y,
align   )     (((x) ^ (y)) > (align) - 1)

Referenced by vmem_xalloc().

#define P2END ( x,
align   )     (-(~(x) & -(align)))

#define P2NPHASE ( x,
align   )     (-(x) & ((align) - 1))

Referenced by umem_cache_create(), and vmem_xalloc().

#define P2PHASE ( x,
align   )     ((x) & ((align) - 1))

#define P2PHASEUP ( x,
align,
phase   )     ((phase) - (((phase) - (x)) & -(align)))

Referenced by vmem_xalloc().

#define P2ROUNDUP ( x,
align   )     (-(-(x) & -(align)))

#define P2SAMEHIGHBIT ( x,
 )     (((x) ^ (y)) < ((x) & (y)))

#define RTLD_FIRST   0

Referenced by umem_setup_envvars().

#define THR_API

#define THR_BOUND   1

#define THR_DAEMON   4

#define THR_DETACHED   2

#define THR_RETURN   void *

 
#define thr_self (  )     pthread_self()

#define thr_sigsetmask   pthread_sigmask


Typedef Documentation

typedef pthread_cond_t cond_t

typedef u_int64_t hrtime_t

typedef long long longlong_t

typedef pthread_mutex_t mutex_t

typedef pthread_t thread_t

typedef struct timespec timespec_t

typedef struct timespec timestruc_t

typedef uint32_t uint_t

typedef unsigned long ulong_t


Generated on Wed Sep 9 01:07:05 2009 for umem by  doxygen 1.5.9