add temporary dce macro alternatives
authorHajime Tazaki <tazaki@nict.go.jp>
Wed, 30 May 2012 11:24:40 +0900
changeset 21c9fa67dd732a
parent 20 5ca51e147e7f
child 22 ed0d8cc18421
add temporary dce macro alternatives
dce_macro_alt.patch
series
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dce_macro_alt.patch	Wed May 30 11:24:40 2012 +0900
     1.3 @@ -0,0 +1,120 @@
     1.4 +diff -r ae3103c9ee50 model/libc-dce.cc
     1.5 +--- a/model/libc-dce.cc	Fri Apr 27 19:40:18 2012 +0900
     1.6 ++++ b/model/libc-dce.cc	Tue May 29 18:16:48 2012 +0900
     1.7 +@@ -143,6 +143,9 @@
     1.8 + 
     1.9 + #define DCE(name) (*libc)->name ## _fn = (func_t)(__typeof(&name))dce_ ## name;
    1.10 + #define DCET(rtype,name) DCE(name)
    1.11 ++#define DCE2(name,rtype,...) (*libc)->name ## _fn = dce_ ## name;
    1.12 ++#define DCE3(name,rtype,t1,t2) (*libc)->name ## _fn = dce_ ## name;
    1.13 ++#define DCE4(name,rtype,t1,t2,t3) (*libc)->name ## _fn = dce_ ## name;
    1.14 + 
    1.15 + #define NATIVE(name)							\
    1.16 +   (*libc)->name ## _fn = (func_t)name;
    1.17 +diff -r ae3103c9ee50 model/libc-ns3.h
    1.18 +--- a/model/libc-ns3.h	Fri Apr 27 19:40:18 2012 +0900
    1.19 ++++ b/model/libc-ns3.h	Tue May 29 18:16:48 2012 +0900
    1.20 +@@ -14,6 +14,7 @@
    1.21 +  * the internal implementation
    1.22 +  */
    1.23 + 
    1.24 ++
    1.25 + #ifndef DCE
    1.26 + #error Macro DCE should be defined before including libc-ns3.h
    1.27 + #endif
    1.28 +@@ -330,8 +331,8 @@
    1.29 + DCE    (pthread_key_delete)
    1.30 + DCE    (pthread_mutex_destroy)
    1.31 + DCE    (pthread_mutex_init)
    1.32 +-DCE    (pthread_mutex_lock)
    1.33 +-DCE    (pthread_mutex_unlock)
    1.34 ++DCE2    (pthread_mutex_lock, int, pthread_mutex_t *)
    1.35 ++DCE2    (pthread_mutex_unlock, int, pthread_mutex_t *)
    1.36 + DCE    (pthread_mutex_trylock)
    1.37 + DCE    (pthread_mutexattr_init)
    1.38 + DCE    (pthread_mutexattr_destroy)
    1.39 +@@ -351,8 +352,8 @@
    1.40 + DCE    (pthread_cond_init)
    1.41 + DCE    (pthread_cond_broadcast)
    1.42 + DCE    (pthread_cond_signal)
    1.43 +-DCE    (pthread_cond_timedwait)
    1.44 +-DCE    (pthread_cond_wait)
    1.45 ++DCE4    (pthread_cond_timedwait, int, pthread_cond_t*, pthread_mutex_t*, const struct timespec *)
    1.46 ++DCE3    (pthread_cond_wait, int, pthread_cond_t*, pthread_mutex_t*)
    1.47 + DCE    (pthread_condattr_destroy)
    1.48 + DCE    (pthread_condattr_init)
    1.49 + NATIVE (pthread_rwlock_init)
    1.50 +@@ -473,7 +474,8 @@
    1.51 + DCE (initgroups)
    1.52 + 
    1.53 + // this is wrong. clock should be changed to DCE implementation
    1.54 +-DCE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime)
    1.55 ++DCE3 (clock_gettime, int, clockid_t, struct timespec *)
    1.56 ++//DCE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime)
    1.57 + //NATIVE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime)
    1.58 + 
    1.59 + // setjmp.h
    1.60 +@@ -536,6 +538,9 @@
    1.61 + 
    1.62 + #undef DCE
    1.63 + #undef DCET
    1.64 ++#undef DCE2
    1.65 ++#undef DCE3
    1.66 ++#undef DCE4
    1.67 + #undef NATIVE
    1.68 + #undef NATIVE_WITH_ALIAS
    1.69 + #undef NATIVE_WITH_ALIAS2
    1.70 +diff -r ae3103c9ee50 model/libc.cc
    1.71 +--- a/model/libc.cc	Fri Apr 27 19:40:18 2012 +0900
    1.72 ++++ b/model/libc.cc	Tue May 29 18:16:48 2012 +0900
    1.73 +@@ -38,6 +38,26 @@
    1.74 + #define DCET(rtype,name)                                                               \
    1.75 +         GCC_BUILTIN_APPLYT(rtype,name,name)
    1.76 + 
    1.77 ++#define c99_tail(...)     _c99_tail (__VA_ARGS__)
    1.78 ++#define _c99_tail(x,...)  __VA_ARGS__
    1.79 ++
    1.80 ++#define DCE2(name,rtype,...)                                    \
    1.81 ++  rtype name (__VA_ARGS__ a1)                                   \
    1.82 ++  {                                                             \
    1.83 ++    return g_libc.name ## _fn (a1);                             \
    1.84 ++  }
    1.85 ++
    1.86 ++#define DCE3(name,rtype,t1,t2)                  \
    1.87 ++  rtype name (t1 a1, t2 a2)                     \
    1.88 ++  {                                             \
    1.89 ++    return g_libc.name ## _fn (a1,a2);          \
    1.90 ++  }
    1.91 ++  
    1.92 ++#define DCE4(name,rtype,...)                    \
    1.93 ++  rtype name (t1 a1, t2 a2,t3 a3)               \
    1.94 ++  {                                             \
    1.95 ++    return g_libc.name ## _fn (a1,a2,a3);       \
    1.96 ++  }
    1.97 + 
    1.98 + #define DCE_WITH_ALIAS(name)					\
    1.99 + 	GCC_BUILTIN_APPLY(__ ## name,name)			\
   1.100 +diff -r ae3103c9ee50 model/libc.h
   1.101 +--- a/model/libc.h	Fri Apr 27 19:40:18 2012 +0900
   1.102 ++++ b/model/libc.h	Tue May 29 18:16:48 2012 +0900
   1.103 +@@ -1,13 +1,19 @@
   1.104 + #ifndef LIBC_H
   1.105 + #define LIBC_H
   1.106 + 
   1.107 ++#define _SYS_SELECT_H
   1.108 ++#include <sys/types.h>
   1.109 ++#undef _SYS_SELECT_H
   1.110 ++
   1.111 + struct Libc
   1.112 + {
   1.113 + 
   1.114 + #define DCE(name) void (*name ## _fn)(...);
   1.115 + 
   1.116 + #define DCET(rtype, name) DCE(name)
   1.117 +-
   1.118 ++#define DCE2(name,rtype,...) rtype (*name ## _fn)(__VA_ARGS__);
   1.119 ++#define DCE3(name,rtype,t1,t2) rtype (*name ## _fn)(t1,t2);
   1.120 ++#define DCE4(name,rtype,t1,t2,t3) rtype (*name ## _fn)(t1,t2,t3);
   1.121 + #include "libc-ns3.h"
   1.122 + 
   1.123 + };
     2.1 --- a/series	Fri May 11 17:03:32 2012 +0900
     2.2 +++ b/series	Wed May 30 11:24:40 2012 +0900
     2.3 @@ -2,6 +2,7 @@
     2.4  120410-dce-umip-support.patch
     2.5  dns_unbound.patch
     2.6  dns_bind9.patch
     2.7 +dce_macro_alt.patch
     2.8  fedora8-nontimerfd-etc.patch
     2.9  dlm-loader-fix.patch
    2.10  floating_groupd.patch