From 34e6b5c93bff8a55f8b861640dd17ead46fd2092 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Thu, 23 Sep 2010 14:58:50 -0400 Subject: [PATCH] ia64 v3 sdt.h interoperability. * sdt.h (_SDT_ARGTMPL)(_SDT_COEF) New. Parameterize for ia64.x (_SDT_ARGFMT)(_SDT_ARG): Use it. --- includes/sys/sdt.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h index 5ec38331f..1a9403247 100644 --- a/includes/sys/sdt.h +++ b/includes/sys/sdt.h @@ -40,10 +40,10 @@ # define _SDT_ASM_ARGS(n) _SDT_ASM_STRING(_SDT_ASM_TEMPLATE_##n) # define _SDT_ASM_STRING_1(x) _SDT_ASM_1(.asciz #x) -# define _SDT_ARGFMT(n) %c[_SDT_S##n]@_SDT_ARGTMPL(_SDT_A##n) +# define _SDT_ARGFMT(n) _SDT_ARGLTMPL[_SDT_S##n]@_SDT_ARGTMPL(_SDT_A##n) # define _SDT_ARG(n, x) \ [_SDT_S##n] "n" (((__typeof((x) + 0)) -1L > (__typeof((x) + 0)) 0 \ - ? 1 : -1) \ + _SDT_ARGCOEF) \ * (int) sizeof ((x) + 0)), \ [_SDT_A##n] "nor" ((x) + 0) #endif @@ -55,6 +55,16 @@ # define _SDT_ARGTMPL(id) %[id] #endif +// ppc gcc 4.4.3-4 gives 4[_SDT_S1]) instead of 4 for %n, but %c does work. +// ia64 gcc 4.1.2-48 %c doesn't work, but %n does. Both work on x86. +#if defined(__ia64__) +# define _SDT_ARGLTMPL %n +# define _SDT_ARGCOEF ? -1 : 1 +#else +# define _SDT_ARGLTMPL %c +# define _SDT_ARGCOEF ? 1 : -1 +#endif + #ifdef __LP64__ # define _SDT_ASM_ADDR .8byte #else -- 2.43.5