89 #undef PLAT_amd64_linux 90 #undef PLAT_ppc32_linux 91 #undef PLAT_ppc64_linux 92 #undef PLAT_ppc32_aix5 93 #undef PLAT_ppc64_aix5 96 #if defined(_AIX) && defined(__64BIT__) 97 # define PLAT_ppc64_aix5 1 98 #elif defined(_AIX) && !defined(__64BIT__) 99 # define PLAT_ppc32_aix5 1 100 #elif defined(__APPLE__) && defined(__i386__) 101 # define PLAT_x86_darwin 1 102 #elif defined(__APPLE__) && defined(__x86_64__) 103 # define PLAT_amd64_darwin 1 104 #elif defined(__i386__) 105 # define PLAT_x86_linux 1 106 #elif defined(__x86_64__) 107 # define PLAT_amd64_linux 1 108 #elif defined(__powerpc__) && !defined(__powerpc64__) 109 # define PLAT_ppc32_linux 1 110 #elif defined(__powerpc__) && defined(__powerpc64__) 111 # define PLAT_ppc64_linux 1 115 # if !defined(NVALGRIND) 126 #if defined(NVALGRIND) 131 #define VALGRIND_DO_CLIENT_REQUEST( \ 132 _zzq_rlval, _zzq_default, _zzq_request, \ 133 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \ 135 (_zzq_rlval) = (_zzq_default); \ 177 #if defined(PLAT_x86_linux) || defined(PLAT_x86_darwin) 185 #define __SPECIAL_INSTRUCTION_PREAMBLE \ 186 "roll $3, %%edi ; roll $13, %%edi\n\t" \ 187 "roll $29, %%edi ; roll $19, %%edi\n\t" 189 #define VALGRIND_DO_CLIENT_REQUEST( \ 190 _zzq_rlval, _zzq_default, _zzq_request, \ 191 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \ 192 { volatile unsigned int _zzq_args[6]; \ 193 volatile unsigned int _zzq_result; \ 194 _zzq_args[0] = (unsigned int)(_zzq_request); \ 195 _zzq_args[1] = (unsigned int)(_zzq_arg1); \ 196 _zzq_args[2] = (unsigned int)(_zzq_arg2); \ 197 _zzq_args[3] = (unsigned int)(_zzq_arg3); \ 198 _zzq_args[4] = (unsigned int)(_zzq_arg4); \ 199 _zzq_args[5] = (unsigned int)(_zzq_arg5); \ 200 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 202 "xchgl %%ebx,%%ebx" \ 203 : "=d" (_zzq_result) \ 204 : "a" (&_zzq_args[0]), "0" (_zzq_default) \ 207 _zzq_rlval = _zzq_result; \ 210 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \ 211 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \ 212 volatile unsigned int __addr; \ 213 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 215 "xchgl %%ecx,%%ecx" \ 220 _zzq_orig->nraddr = __addr; \ 223 #define VALGRIND_CALL_NOREDIR_EAX \ 224 __SPECIAL_INSTRUCTION_PREAMBLE \ 226 "xchgl %%edx,%%edx\n\t" 231 #if defined(PLAT_amd64_linux) || defined(PLAT_amd64_darwin) 239 #define __SPECIAL_INSTRUCTION_PREAMBLE \ 240 "rolq $3, %%rdi ; rolq $13, %%rdi\n\t" \ 241 "rolq $61, %%rdi ; rolq $51, %%rdi\n\t" 243 #define VALGRIND_DO_CLIENT_REQUEST( \ 244 _zzq_rlval, _zzq_default, _zzq_request, \ 245 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \ 246 { volatile unsigned long long int _zzq_args[6]; \ 247 volatile unsigned long long int _zzq_result; \ 248 _zzq_args[0] = (unsigned long long int)(_zzq_request); \ 249 _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \ 250 _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \ 251 _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \ 252 _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \ 253 _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \ 254 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 256 "xchgq %%rbx,%%rbx" \ 257 : "=d" (_zzq_result) \ 258 : "a" (&_zzq_args[0]), "0" (_zzq_default) \ 261 _zzq_rlval = _zzq_result; \ 264 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \ 265 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \ 266 volatile unsigned long long int __addr; \ 267 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 269 "xchgq %%rcx,%%rcx" \ 274 _zzq_orig->nraddr = __addr; \ 277 #define VALGRIND_CALL_NOREDIR_RAX \ 278 __SPECIAL_INSTRUCTION_PREAMBLE \ 280 "xchgq %%rdx,%%rdx\n\t" 285 #if defined(PLAT_ppc32_linux) 293 #define __SPECIAL_INSTRUCTION_PREAMBLE \ 294 "rlwinm 0,0,3,0,0 ; rlwinm 0,0,13,0,0\n\t" \ 295 "rlwinm 0,0,29,0,0 ; rlwinm 0,0,19,0,0\n\t" 297 #define VALGRIND_DO_CLIENT_REQUEST( \ 298 _zzq_rlval, _zzq_default, _zzq_request, \ 299 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \ 301 { unsigned int _zzq_args[6]; \ 302 unsigned int _zzq_result; \ 303 unsigned int* _zzq_ptr; \ 304 _zzq_args[0] = (unsigned int)(_zzq_request); \ 305 _zzq_args[1] = (unsigned int)(_zzq_arg1); \ 306 _zzq_args[2] = (unsigned int)(_zzq_arg2); \ 307 _zzq_args[3] = (unsigned int)(_zzq_arg3); \ 308 _zzq_args[4] = (unsigned int)(_zzq_arg4); \ 309 _zzq_args[5] = (unsigned int)(_zzq_arg5); \ 310 _zzq_ptr = _zzq_args; \ 311 __asm__ volatile("mr 3,%1\n\t" \ 313 __SPECIAL_INSTRUCTION_PREAMBLE \ 317 : "=b" (_zzq_result) \ 318 : "b" (_zzq_default), "b" (_zzq_ptr) \ 319 : "cc", "memory", "r3", "r4"); \ 320 _zzq_rlval = _zzq_result; \ 323 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \ 324 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \ 325 unsigned int __addr; \ 326 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 332 : "cc", "memory", "r3" \ 334 _zzq_orig->nraddr = __addr; \ 337 #define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 338 __SPECIAL_INSTRUCTION_PREAMBLE \ 345 #if defined(PLAT_ppc64_linux) 349 unsigned long long int nraddr;
350 unsigned long long int r2;
354 #define __SPECIAL_INSTRUCTION_PREAMBLE \ 355 "rotldi 0,0,3 ; rotldi 0,0,13\n\t" \ 356 "rotldi 0,0,61 ; rotldi 0,0,51\n\t" 358 #define VALGRIND_DO_CLIENT_REQUEST( \ 359 _zzq_rlval, _zzq_default, _zzq_request, \ 360 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \ 362 { unsigned long long int _zzq_args[6]; \ 363 register unsigned long long int _zzq_result __asm__("r3"); \ 364 register unsigned long long int* _zzq_ptr __asm__("r4"); \ 365 _zzq_args[0] = (unsigned long long int)(_zzq_request); \ 366 _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \ 367 _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \ 368 _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \ 369 _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \ 370 _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \ 371 _zzq_ptr = _zzq_args; \ 372 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 375 : "=r" (_zzq_result) \ 376 : "0" (_zzq_default), "r" (_zzq_ptr) \ 378 _zzq_rlval = _zzq_result; \ 381 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \ 382 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \ 383 register unsigned long long int __addr __asm__("r3"); \ 384 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 391 _zzq_orig->nraddr = __addr; \ 392 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 399 _zzq_orig->r2 = __addr; \ 402 #define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 403 __SPECIAL_INSTRUCTION_PREAMBLE \ 411 #if defined(PLAT_ppc32_aix5) 420 #define __SPECIAL_INSTRUCTION_PREAMBLE \ 421 "rlwinm 0,0,3,0,0 ; rlwinm 0,0,13,0,0\n\t" \ 422 "rlwinm 0,0,29,0,0 ; rlwinm 0,0,19,0,0\n\t" 424 #define VALGRIND_DO_CLIENT_REQUEST( \ 425 _zzq_rlval, _zzq_default, _zzq_request, \ 426 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \ 428 { unsigned int _zzq_args[7]; \ 429 register unsigned int _zzq_result; \ 430 register unsigned int* _zzq_ptr; \ 431 _zzq_args[0] = (unsigned int)(_zzq_request); \ 432 _zzq_args[1] = (unsigned int)(_zzq_arg1); \ 433 _zzq_args[2] = (unsigned int)(_zzq_arg2); \ 434 _zzq_args[3] = (unsigned int)(_zzq_arg3); \ 435 _zzq_args[4] = (unsigned int)(_zzq_arg4); \ 436 _zzq_args[5] = (unsigned int)(_zzq_arg5); \ 437 _zzq_args[6] = (unsigned int)(_zzq_default); \ 438 _zzq_ptr = _zzq_args; \ 439 __asm__ volatile("mr 4,%1\n\t" \ 441 __SPECIAL_INSTRUCTION_PREAMBLE \ 445 : "=b" (_zzq_result) \ 447 : "r3", "r4", "cc", "memory"); \ 448 _zzq_rlval = _zzq_result; \ 451 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \ 452 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \ 453 register unsigned int __addr; \ 454 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 460 : "r3", "cc", "memory" \ 462 _zzq_orig->nraddr = __addr; \ 463 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 469 : "r3", "cc", "memory" \ 471 _zzq_orig->r2 = __addr; \ 474 #define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 475 __SPECIAL_INSTRUCTION_PREAMBLE \ 483 #if defined(PLAT_ppc64_aix5) 487 unsigned long long int nraddr;
488 unsigned long long int r2;
492 #define __SPECIAL_INSTRUCTION_PREAMBLE \ 493 "rotldi 0,0,3 ; rotldi 0,0,13\n\t" \ 494 "rotldi 0,0,61 ; rotldi 0,0,51\n\t" 496 #define VALGRIND_DO_CLIENT_REQUEST( \ 497 _zzq_rlval, _zzq_default, _zzq_request, \ 498 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \ 500 { unsigned long long int _zzq_args[7]; \ 501 register unsigned long long int _zzq_result; \ 502 register unsigned long long int* _zzq_ptr; \ 503 _zzq_args[0] = (unsigned int long long)(_zzq_request); \ 504 _zzq_args[1] = (unsigned int long long)(_zzq_arg1); \ 505 _zzq_args[2] = (unsigned int long long)(_zzq_arg2); \ 506 _zzq_args[3] = (unsigned int long long)(_zzq_arg3); \ 507 _zzq_args[4] = (unsigned int long long)(_zzq_arg4); \ 508 _zzq_args[5] = (unsigned int long long)(_zzq_arg5); \ 509 _zzq_args[6] = (unsigned int long long)(_zzq_default); \ 510 _zzq_ptr = _zzq_args; \ 511 __asm__ volatile("mr 4,%1\n\t" \ 513 __SPECIAL_INSTRUCTION_PREAMBLE \ 517 : "=b" (_zzq_result) \ 519 : "r3", "r4", "cc", "memory"); \ 520 _zzq_rlval = _zzq_result; \ 523 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \ 524 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \ 525 register unsigned long long int __addr; \ 526 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 532 : "r3", "cc", "memory" \ 534 _zzq_orig->nraddr = __addr; \ 535 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ 541 : "r3", "cc", "memory" \ 543 _zzq_orig->r2 = __addr; \ 546 #define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 547 __SPECIAL_INSTRUCTION_PREAMBLE \ 586 #define VG_CONCAT4(_aa,_bb,_cc,_dd) _aa##_bb##_cc##_dd 588 #define I_WRAP_SONAME_FNNAME_ZU(soname,fnname) \ 589 VG_CONCAT4(_vgwZU_,soname,_,fnname) 591 #define I_WRAP_SONAME_FNNAME_ZZ(soname,fnname) \ 592 VG_CONCAT4(_vgwZZ_,soname,_,fnname) 598 #define VALGRIND_GET_ORIG_FN(_lval) VALGRIND_GET_NR_CONTEXT(_lval) 603 #define CALL_FN_v_v(fnptr) \ 604 do { volatile unsigned long _junk; \ 605 CALL_FN_W_v(_junk,fnptr); } while (0) 607 #define CALL_FN_v_W(fnptr, arg1) \ 608 do { volatile unsigned long _junk; \ 609 CALL_FN_W_W(_junk,fnptr,arg1); } while (0) 611 #define CALL_FN_v_WW(fnptr, arg1,arg2) \ 612 do { volatile unsigned long _junk; \ 613 CALL_FN_W_WW(_junk,fnptr,arg1,arg2); } while (0) 615 #define CALL_FN_v_WWW(fnptr, arg1,arg2,arg3) \ 616 do { volatile unsigned long _junk; \ 617 CALL_FN_W_WWW(_junk,fnptr,arg1,arg2,arg3); } while (0) 619 #define CALL_FN_v_WWWW(fnptr, arg1,arg2,arg3,arg4) \ 620 do { volatile unsigned long _junk; \ 621 CALL_FN_W_WWWW(_junk,fnptr,arg1,arg2,arg3,arg4); } while (0) 623 #define CALL_FN_v_5W(fnptr, arg1,arg2,arg3,arg4,arg5) \ 624 do { volatile unsigned long _junk; \ 625 CALL_FN_W_5W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5); } while (0) 627 #define CALL_FN_v_6W(fnptr, arg1,arg2,arg3,arg4,arg5,arg6) \ 628 do { volatile unsigned long _junk; \ 629 CALL_FN_W_6W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5,arg6); } while (0) 631 #define CALL_FN_v_7W(fnptr, arg1,arg2,arg3,arg4,arg5,arg6,arg7) \ 632 do { volatile unsigned long _junk; \ 633 CALL_FN_W_7W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5,arg6,arg7); } while (0) 637 #if defined(PLAT_x86_linux) || defined(PLAT_x86_darwin) 641 #define __CALLER_SAVED_REGS "ecx", "edx" 646 #define CALL_FN_W_v(lval, orig) \ 648 volatile OrigFn _orig = (orig); \ 649 volatile unsigned long _argvec[1]; \ 650 volatile unsigned long _res; \ 651 _argvec[0] = (unsigned long)_orig.nraddr; \ 653 "movl (%%eax), %%eax\n\t" \ 654 VALGRIND_CALL_NOREDIR_EAX \ 656 : "a" (&_argvec[0]) \ 657 : "cc", "memory", __CALLER_SAVED_REGS \ 659 lval = (__typeof__(lval)) _res; \ 662 #define CALL_FN_W_W(lval, orig, arg1) \ 664 volatile OrigFn _orig = (orig); \ 665 volatile unsigned long _argvec[2]; \ 666 volatile unsigned long _res; \ 667 _argvec[0] = (unsigned long)_orig.nraddr; \ 668 _argvec[1] = (unsigned long)(arg1); \ 670 "pushl 4(%%eax)\n\t" \ 671 "movl (%%eax), %%eax\n\t" \ 672 VALGRIND_CALL_NOREDIR_EAX \ 675 : "a" (&_argvec[0]) \ 676 : "cc", "memory", __CALLER_SAVED_REGS \ 678 lval = (__typeof__(lval)) _res; \ 681 #define CALL_FN_W_WW(lval, orig, arg1,arg2) \ 683 volatile OrigFn _orig = (orig); \ 684 volatile unsigned long _argvec[3]; \ 685 volatile unsigned long _res; \ 686 _argvec[0] = (unsigned long)_orig.nraddr; \ 687 _argvec[1] = (unsigned long)(arg1); \ 688 _argvec[2] = (unsigned long)(arg2); \ 690 "pushl 8(%%eax)\n\t" \ 691 "pushl 4(%%eax)\n\t" \ 692 "movl (%%eax), %%eax\n\t" \ 693 VALGRIND_CALL_NOREDIR_EAX \ 696 : "a" (&_argvec[0]) \ 697 : "cc", "memory", __CALLER_SAVED_REGS \ 699 lval = (__typeof__(lval)) _res; \ 702 #define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \ 704 volatile OrigFn _orig = (orig); \ 705 volatile unsigned long _argvec[4]; \ 706 volatile unsigned long _res; \ 707 _argvec[0] = (unsigned long)_orig.nraddr; \ 708 _argvec[1] = (unsigned long)(arg1); \ 709 _argvec[2] = (unsigned long)(arg2); \ 710 _argvec[3] = (unsigned long)(arg3); \ 712 "pushl 12(%%eax)\n\t" \ 713 "pushl 8(%%eax)\n\t" \ 714 "pushl 4(%%eax)\n\t" \ 715 "movl (%%eax), %%eax\n\t" \ 716 VALGRIND_CALL_NOREDIR_EAX \ 717 "addl $12, %%esp\n" \ 719 : "a" (&_argvec[0]) \ 720 : "cc", "memory", __CALLER_SAVED_REGS \ 722 lval = (__typeof__(lval)) _res; \ 725 #define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \ 727 volatile OrigFn _orig = (orig); \ 728 volatile unsigned long _argvec[5]; \ 729 volatile unsigned long _res; \ 730 _argvec[0] = (unsigned long)_orig.nraddr; \ 731 _argvec[1] = (unsigned long)(arg1); \ 732 _argvec[2] = (unsigned long)(arg2); \ 733 _argvec[3] = (unsigned long)(arg3); \ 734 _argvec[4] = (unsigned long)(arg4); \ 736 "pushl 16(%%eax)\n\t" \ 737 "pushl 12(%%eax)\n\t" \ 738 "pushl 8(%%eax)\n\t" \ 739 "pushl 4(%%eax)\n\t" \ 740 "movl (%%eax), %%eax\n\t" \ 741 VALGRIND_CALL_NOREDIR_EAX \ 742 "addl $16, %%esp\n" \ 744 : "a" (&_argvec[0]) \ 745 : "cc", "memory", __CALLER_SAVED_REGS \ 747 lval = (__typeof__(lval)) _res; \ 750 #define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \ 752 volatile OrigFn _orig = (orig); \ 753 volatile unsigned long _argvec[6]; \ 754 volatile unsigned long _res; \ 755 _argvec[0] = (unsigned long)_orig.nraddr; \ 756 _argvec[1] = (unsigned long)(arg1); \ 757 _argvec[2] = (unsigned long)(arg2); \ 758 _argvec[3] = (unsigned long)(arg3); \ 759 _argvec[4] = (unsigned long)(arg4); \ 760 _argvec[5] = (unsigned long)(arg5); \ 762 "pushl 20(%%eax)\n\t" \ 763 "pushl 16(%%eax)\n\t" \ 764 "pushl 12(%%eax)\n\t" \ 765 "pushl 8(%%eax)\n\t" \ 766 "pushl 4(%%eax)\n\t" \ 767 "movl (%%eax), %%eax\n\t" \ 768 VALGRIND_CALL_NOREDIR_EAX \ 769 "addl $20, %%esp\n" \ 771 : "a" (&_argvec[0]) \ 772 : "cc", "memory", __CALLER_SAVED_REGS \ 774 lval = (__typeof__(lval)) _res; \ 777 #define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \ 779 volatile OrigFn _orig = (orig); \ 780 volatile unsigned long _argvec[7]; \ 781 volatile unsigned long _res; \ 782 _argvec[0] = (unsigned long)_orig.nraddr; \ 783 _argvec[1] = (unsigned long)(arg1); \ 784 _argvec[2] = (unsigned long)(arg2); \ 785 _argvec[3] = (unsigned long)(arg3); \ 786 _argvec[4] = (unsigned long)(arg4); \ 787 _argvec[5] = (unsigned long)(arg5); \ 788 _argvec[6] = (unsigned long)(arg6); \ 790 "pushl 24(%%eax)\n\t" \ 791 "pushl 20(%%eax)\n\t" \ 792 "pushl 16(%%eax)\n\t" \ 793 "pushl 12(%%eax)\n\t" \ 794 "pushl 8(%%eax)\n\t" \ 795 "pushl 4(%%eax)\n\t" \ 796 "movl (%%eax), %%eax\n\t" \ 797 VALGRIND_CALL_NOREDIR_EAX \ 798 "addl $24, %%esp\n" \ 800 : "a" (&_argvec[0]) \ 801 : "cc", "memory", __CALLER_SAVED_REGS \ 803 lval = (__typeof__(lval)) _res; \ 806 #define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 809 volatile OrigFn _orig = (orig); \ 810 volatile unsigned long _argvec[8]; \ 811 volatile unsigned long _res; \ 812 _argvec[0] = (unsigned long)_orig.nraddr; \ 813 _argvec[1] = (unsigned long)(arg1); \ 814 _argvec[2] = (unsigned long)(arg2); \ 815 _argvec[3] = (unsigned long)(arg3); \ 816 _argvec[4] = (unsigned long)(arg4); \ 817 _argvec[5] = (unsigned long)(arg5); \ 818 _argvec[6] = (unsigned long)(arg6); \ 819 _argvec[7] = (unsigned long)(arg7); \ 821 "pushl 28(%%eax)\n\t" \ 822 "pushl 24(%%eax)\n\t" \ 823 "pushl 20(%%eax)\n\t" \ 824 "pushl 16(%%eax)\n\t" \ 825 "pushl 12(%%eax)\n\t" \ 826 "pushl 8(%%eax)\n\t" \ 827 "pushl 4(%%eax)\n\t" \ 828 "movl (%%eax), %%eax\n\t" \ 829 VALGRIND_CALL_NOREDIR_EAX \ 830 "addl $28, %%esp\n" \ 832 : "a" (&_argvec[0]) \ 833 : "cc", "memory", __CALLER_SAVED_REGS \ 835 lval = (__typeof__(lval)) _res; \ 838 #define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 841 volatile OrigFn _orig = (orig); \ 842 volatile unsigned long _argvec[9]; \ 843 volatile unsigned long _res; \ 844 _argvec[0] = (unsigned long)_orig.nraddr; \ 845 _argvec[1] = (unsigned long)(arg1); \ 846 _argvec[2] = (unsigned long)(arg2); \ 847 _argvec[3] = (unsigned long)(arg3); \ 848 _argvec[4] = (unsigned long)(arg4); \ 849 _argvec[5] = (unsigned long)(arg5); \ 850 _argvec[6] = (unsigned long)(arg6); \ 851 _argvec[7] = (unsigned long)(arg7); \ 852 _argvec[8] = (unsigned long)(arg8); \ 854 "pushl 32(%%eax)\n\t" \ 855 "pushl 28(%%eax)\n\t" \ 856 "pushl 24(%%eax)\n\t" \ 857 "pushl 20(%%eax)\n\t" \ 858 "pushl 16(%%eax)\n\t" \ 859 "pushl 12(%%eax)\n\t" \ 860 "pushl 8(%%eax)\n\t" \ 861 "pushl 4(%%eax)\n\t" \ 862 "movl (%%eax), %%eax\n\t" \ 863 VALGRIND_CALL_NOREDIR_EAX \ 864 "addl $32, %%esp\n" \ 866 : "a" (&_argvec[0]) \ 867 : "cc", "memory", __CALLER_SAVED_REGS \ 869 lval = (__typeof__(lval)) _res; \ 872 #define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 875 volatile OrigFn _orig = (orig); \ 876 volatile unsigned long _argvec[10]; \ 877 volatile unsigned long _res; \ 878 _argvec[0] = (unsigned long)_orig.nraddr; \ 879 _argvec[1] = (unsigned long)(arg1); \ 880 _argvec[2] = (unsigned long)(arg2); \ 881 _argvec[3] = (unsigned long)(arg3); \ 882 _argvec[4] = (unsigned long)(arg4); \ 883 _argvec[5] = (unsigned long)(arg5); \ 884 _argvec[6] = (unsigned long)(arg6); \ 885 _argvec[7] = (unsigned long)(arg7); \ 886 _argvec[8] = (unsigned long)(arg8); \ 887 _argvec[9] = (unsigned long)(arg9); \ 889 "pushl 36(%%eax)\n\t" \ 890 "pushl 32(%%eax)\n\t" \ 891 "pushl 28(%%eax)\n\t" \ 892 "pushl 24(%%eax)\n\t" \ 893 "pushl 20(%%eax)\n\t" \ 894 "pushl 16(%%eax)\n\t" \ 895 "pushl 12(%%eax)\n\t" \ 896 "pushl 8(%%eax)\n\t" \ 897 "pushl 4(%%eax)\n\t" \ 898 "movl (%%eax), %%eax\n\t" \ 899 VALGRIND_CALL_NOREDIR_EAX \ 900 "addl $36, %%esp\n" \ 902 : "a" (&_argvec[0]) \ 903 : "cc", "memory", __CALLER_SAVED_REGS \ 905 lval = (__typeof__(lval)) _res; \ 908 #define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 909 arg7,arg8,arg9,arg10) \ 911 volatile OrigFn _orig = (orig); \ 912 volatile unsigned long _argvec[11]; \ 913 volatile unsigned long _res; \ 914 _argvec[0] = (unsigned long)_orig.nraddr; \ 915 _argvec[1] = (unsigned long)(arg1); \ 916 _argvec[2] = (unsigned long)(arg2); \ 917 _argvec[3] = (unsigned long)(arg3); \ 918 _argvec[4] = (unsigned long)(arg4); \ 919 _argvec[5] = (unsigned long)(arg5); \ 920 _argvec[6] = (unsigned long)(arg6); \ 921 _argvec[7] = (unsigned long)(arg7); \ 922 _argvec[8] = (unsigned long)(arg8); \ 923 _argvec[9] = (unsigned long)(arg9); \ 924 _argvec[10] = (unsigned long)(arg10); \ 926 "pushl 40(%%eax)\n\t" \ 927 "pushl 36(%%eax)\n\t" \ 928 "pushl 32(%%eax)\n\t" \ 929 "pushl 28(%%eax)\n\t" \ 930 "pushl 24(%%eax)\n\t" \ 931 "pushl 20(%%eax)\n\t" \ 932 "pushl 16(%%eax)\n\t" \ 933 "pushl 12(%%eax)\n\t" \ 934 "pushl 8(%%eax)\n\t" \ 935 "pushl 4(%%eax)\n\t" \ 936 "movl (%%eax), %%eax\n\t" \ 937 VALGRIND_CALL_NOREDIR_EAX \ 938 "addl $40, %%esp\n" \ 940 : "a" (&_argvec[0]) \ 941 : "cc", "memory", __CALLER_SAVED_REGS \ 943 lval = (__typeof__(lval)) _res; \ 946 #define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5, \ 947 arg6,arg7,arg8,arg9,arg10, \ 950 volatile OrigFn _orig = (orig); \ 951 volatile unsigned long _argvec[12]; \ 952 volatile unsigned long _res; \ 953 _argvec[0] = (unsigned long)_orig.nraddr; \ 954 _argvec[1] = (unsigned long)(arg1); \ 955 _argvec[2] = (unsigned long)(arg2); \ 956 _argvec[3] = (unsigned long)(arg3); \ 957 _argvec[4] = (unsigned long)(arg4); \ 958 _argvec[5] = (unsigned long)(arg5); \ 959 _argvec[6] = (unsigned long)(arg6); \ 960 _argvec[7] = (unsigned long)(arg7); \ 961 _argvec[8] = (unsigned long)(arg8); \ 962 _argvec[9] = (unsigned long)(arg9); \ 963 _argvec[10] = (unsigned long)(arg10); \ 964 _argvec[11] = (unsigned long)(arg11); \ 966 "pushl 44(%%eax)\n\t" \ 967 "pushl 40(%%eax)\n\t" \ 968 "pushl 36(%%eax)\n\t" \ 969 "pushl 32(%%eax)\n\t" \ 970 "pushl 28(%%eax)\n\t" \ 971 "pushl 24(%%eax)\n\t" \ 972 "pushl 20(%%eax)\n\t" \ 973 "pushl 16(%%eax)\n\t" \ 974 "pushl 12(%%eax)\n\t" \ 975 "pushl 8(%%eax)\n\t" \ 976 "pushl 4(%%eax)\n\t" \ 977 "movl (%%eax), %%eax\n\t" \ 978 VALGRIND_CALL_NOREDIR_EAX \ 979 "addl $44, %%esp\n" \ 981 : "a" (&_argvec[0]) \ 982 : "cc", "memory", __CALLER_SAVED_REGS \ 984 lval = (__typeof__(lval)) _res; \ 987 #define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5, \ 988 arg6,arg7,arg8,arg9,arg10, \ 991 volatile OrigFn _orig = (orig); \ 992 volatile unsigned long _argvec[13]; \ 993 volatile unsigned long _res; \ 994 _argvec[0] = (unsigned long)_orig.nraddr; \ 995 _argvec[1] = (unsigned long)(arg1); \ 996 _argvec[2] = (unsigned long)(arg2); \ 997 _argvec[3] = (unsigned long)(arg3); \ 998 _argvec[4] = (unsigned long)(arg4); \ 999 _argvec[5] = (unsigned long)(arg5); \ 1000 _argvec[6] = (unsigned long)(arg6); \ 1001 _argvec[7] = (unsigned long)(arg7); \ 1002 _argvec[8] = (unsigned long)(arg8); \ 1003 _argvec[9] = (unsigned long)(arg9); \ 1004 _argvec[10] = (unsigned long)(arg10); \ 1005 _argvec[11] = (unsigned long)(arg11); \ 1006 _argvec[12] = (unsigned long)(arg12); \ 1008 "pushl 48(%%eax)\n\t" \ 1009 "pushl 44(%%eax)\n\t" \ 1010 "pushl 40(%%eax)\n\t" \ 1011 "pushl 36(%%eax)\n\t" \ 1012 "pushl 32(%%eax)\n\t" \ 1013 "pushl 28(%%eax)\n\t" \ 1014 "pushl 24(%%eax)\n\t" \ 1015 "pushl 20(%%eax)\n\t" \ 1016 "pushl 16(%%eax)\n\t" \ 1017 "pushl 12(%%eax)\n\t" \ 1018 "pushl 8(%%eax)\n\t" \ 1019 "pushl 4(%%eax)\n\t" \ 1020 "movl (%%eax), %%eax\n\t" \ 1021 VALGRIND_CALL_NOREDIR_EAX \ 1022 "addl $48, %%esp\n" \ 1024 : "a" (&_argvec[0]) \ 1025 : "cc", "memory", __CALLER_SAVED_REGS \ 1027 lval = (__typeof__(lval)) _res; \ 1034 #if defined(PLAT_amd64_linux) || defined(PLAT_amd64_darwin) 1039 #define __CALLER_SAVED_REGS "rcx", "rdx", "rsi", \ 1040 "rdi", "r8", "r9", "r10", "r11" 1066 #define CALL_FN_W_v(lval, orig) \ 1068 volatile OrigFn _orig = (orig); \ 1069 volatile unsigned long _argvec[1]; \ 1070 volatile unsigned long _res; \ 1071 _argvec[0] = (unsigned long)_orig.nraddr; \ 1073 "subq $128,%%rsp\n\t" \ 1074 "movq (%%rax), %%rax\n\t" \ 1075 VALGRIND_CALL_NOREDIR_RAX \ 1076 "addq $128,%%rsp\n\t" \ 1078 : "a" (&_argvec[0]) \ 1079 : "cc", "memory", __CALLER_SAVED_REGS \ 1081 lval = (__typeof__(lval)) _res; \ 1084 #define CALL_FN_W_W(lval, orig, arg1) \ 1086 volatile OrigFn _orig = (orig); \ 1087 volatile unsigned long _argvec[2]; \ 1088 volatile unsigned long _res; \ 1089 _argvec[0] = (unsigned long)_orig.nraddr; \ 1090 _argvec[1] = (unsigned long)(arg1); \ 1092 "subq $128,%%rsp\n\t" \ 1093 "movq 8(%%rax), %%rdi\n\t" \ 1094 "movq (%%rax), %%rax\n\t" \ 1095 VALGRIND_CALL_NOREDIR_RAX \ 1096 "addq $128,%%rsp\n\t" \ 1098 : "a" (&_argvec[0]) \ 1099 : "cc", "memory", __CALLER_SAVED_REGS \ 1101 lval = (__typeof__(lval)) _res; \ 1104 #define CALL_FN_W_WW(lval, orig, arg1,arg2) \ 1106 volatile OrigFn _orig = (orig); \ 1107 volatile unsigned long _argvec[3]; \ 1108 volatile unsigned long _res; \ 1109 _argvec[0] = (unsigned long)_orig.nraddr; \ 1110 _argvec[1] = (unsigned long)(arg1); \ 1111 _argvec[2] = (unsigned long)(arg2); \ 1113 "subq $128,%%rsp\n\t" \ 1114 "movq 16(%%rax), %%rsi\n\t" \ 1115 "movq 8(%%rax), %%rdi\n\t" \ 1116 "movq (%%rax), %%rax\n\t" \ 1117 VALGRIND_CALL_NOREDIR_RAX \ 1118 "addq $128,%%rsp\n\t" \ 1120 : "a" (&_argvec[0]) \ 1121 : "cc", "memory", __CALLER_SAVED_REGS \ 1123 lval = (__typeof__(lval)) _res; \ 1126 #define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \ 1128 volatile OrigFn _orig = (orig); \ 1129 volatile unsigned long _argvec[4]; \ 1130 volatile unsigned long _res; \ 1131 _argvec[0] = (unsigned long)_orig.nraddr; \ 1132 _argvec[1] = (unsigned long)(arg1); \ 1133 _argvec[2] = (unsigned long)(arg2); \ 1134 _argvec[3] = (unsigned long)(arg3); \ 1136 "subq $128,%%rsp\n\t" \ 1137 "movq 24(%%rax), %%rdx\n\t" \ 1138 "movq 16(%%rax), %%rsi\n\t" \ 1139 "movq 8(%%rax), %%rdi\n\t" \ 1140 "movq (%%rax), %%rax\n\t" \ 1141 VALGRIND_CALL_NOREDIR_RAX \ 1142 "addq $128,%%rsp\n\t" \ 1144 : "a" (&_argvec[0]) \ 1145 : "cc", "memory", __CALLER_SAVED_REGS \ 1147 lval = (__typeof__(lval)) _res; \ 1150 #define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \ 1152 volatile OrigFn _orig = (orig); \ 1153 volatile unsigned long _argvec[5]; \ 1154 volatile unsigned long _res; \ 1155 _argvec[0] = (unsigned long)_orig.nraddr; \ 1156 _argvec[1] = (unsigned long)(arg1); \ 1157 _argvec[2] = (unsigned long)(arg2); \ 1158 _argvec[3] = (unsigned long)(arg3); \ 1159 _argvec[4] = (unsigned long)(arg4); \ 1161 "subq $128,%%rsp\n\t" \ 1162 "movq 32(%%rax), %%rcx\n\t" \ 1163 "movq 24(%%rax), %%rdx\n\t" \ 1164 "movq 16(%%rax), %%rsi\n\t" \ 1165 "movq 8(%%rax), %%rdi\n\t" \ 1166 "movq (%%rax), %%rax\n\t" \ 1167 VALGRIND_CALL_NOREDIR_RAX \ 1168 "addq $128,%%rsp\n\t" \ 1170 : "a" (&_argvec[0]) \ 1171 : "cc", "memory", __CALLER_SAVED_REGS \ 1173 lval = (__typeof__(lval)) _res; \ 1176 #define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \ 1178 volatile OrigFn _orig = (orig); \ 1179 volatile unsigned long _argvec[6]; \ 1180 volatile unsigned long _res; \ 1181 _argvec[0] = (unsigned long)_orig.nraddr; \ 1182 _argvec[1] = (unsigned long)(arg1); \ 1183 _argvec[2] = (unsigned long)(arg2); \ 1184 _argvec[3] = (unsigned long)(arg3); \ 1185 _argvec[4] = (unsigned long)(arg4); \ 1186 _argvec[5] = (unsigned long)(arg5); \ 1188 "subq $128,%%rsp\n\t" \ 1189 "movq 40(%%rax), %%r8\n\t" \ 1190 "movq 32(%%rax), %%rcx\n\t" \ 1191 "movq 24(%%rax), %%rdx\n\t" \ 1192 "movq 16(%%rax), %%rsi\n\t" \ 1193 "movq 8(%%rax), %%rdi\n\t" \ 1194 "movq (%%rax), %%rax\n\t" \ 1195 VALGRIND_CALL_NOREDIR_RAX \ 1196 "addq $128,%%rsp\n\t" \ 1198 : "a" (&_argvec[0]) \ 1199 : "cc", "memory", __CALLER_SAVED_REGS \ 1201 lval = (__typeof__(lval)) _res; \ 1204 #define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \ 1206 volatile OrigFn _orig = (orig); \ 1207 volatile unsigned long _argvec[7]; \ 1208 volatile unsigned long _res; \ 1209 _argvec[0] = (unsigned long)_orig.nraddr; \ 1210 _argvec[1] = (unsigned long)(arg1); \ 1211 _argvec[2] = (unsigned long)(arg2); \ 1212 _argvec[3] = (unsigned long)(arg3); \ 1213 _argvec[4] = (unsigned long)(arg4); \ 1214 _argvec[5] = (unsigned long)(arg5); \ 1215 _argvec[6] = (unsigned long)(arg6); \ 1217 "subq $128,%%rsp\n\t" \ 1218 "movq 48(%%rax), %%r9\n\t" \ 1219 "movq 40(%%rax), %%r8\n\t" \ 1220 "movq 32(%%rax), %%rcx\n\t" \ 1221 "movq 24(%%rax), %%rdx\n\t" \ 1222 "movq 16(%%rax), %%rsi\n\t" \ 1223 "movq 8(%%rax), %%rdi\n\t" \ 1224 "movq (%%rax), %%rax\n\t" \ 1225 "addq $128,%%rsp\n\t" \ 1226 VALGRIND_CALL_NOREDIR_RAX \ 1228 : "a" (&_argvec[0]) \ 1229 : "cc", "memory", __CALLER_SAVED_REGS \ 1231 lval = (__typeof__(lval)) _res; \ 1234 #define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1237 volatile OrigFn _orig = (orig); \ 1238 volatile unsigned long _argvec[8]; \ 1239 volatile unsigned long _res; \ 1240 _argvec[0] = (unsigned long)_orig.nraddr; \ 1241 _argvec[1] = (unsigned long)(arg1); \ 1242 _argvec[2] = (unsigned long)(arg2); \ 1243 _argvec[3] = (unsigned long)(arg3); \ 1244 _argvec[4] = (unsigned long)(arg4); \ 1245 _argvec[5] = (unsigned long)(arg5); \ 1246 _argvec[6] = (unsigned long)(arg6); \ 1247 _argvec[7] = (unsigned long)(arg7); \ 1249 "subq $128,%%rsp\n\t" \ 1250 "pushq 56(%%rax)\n\t" \ 1251 "movq 48(%%rax), %%r9\n\t" \ 1252 "movq 40(%%rax), %%r8\n\t" \ 1253 "movq 32(%%rax), %%rcx\n\t" \ 1254 "movq 24(%%rax), %%rdx\n\t" \ 1255 "movq 16(%%rax), %%rsi\n\t" \ 1256 "movq 8(%%rax), %%rdi\n\t" \ 1257 "movq (%%rax), %%rax\n\t" \ 1258 VALGRIND_CALL_NOREDIR_RAX \ 1259 "addq $8, %%rsp\n" \ 1260 "addq $128,%%rsp\n\t" \ 1262 : "a" (&_argvec[0]) \ 1263 : "cc", "memory", __CALLER_SAVED_REGS \ 1265 lval = (__typeof__(lval)) _res; \ 1268 #define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1271 volatile OrigFn _orig = (orig); \ 1272 volatile unsigned long _argvec[9]; \ 1273 volatile unsigned long _res; \ 1274 _argvec[0] = (unsigned long)_orig.nraddr; \ 1275 _argvec[1] = (unsigned long)(arg1); \ 1276 _argvec[2] = (unsigned long)(arg2); \ 1277 _argvec[3] = (unsigned long)(arg3); \ 1278 _argvec[4] = (unsigned long)(arg4); \ 1279 _argvec[5] = (unsigned long)(arg5); \ 1280 _argvec[6] = (unsigned long)(arg6); \ 1281 _argvec[7] = (unsigned long)(arg7); \ 1282 _argvec[8] = (unsigned long)(arg8); \ 1284 "subq $128,%%rsp\n\t" \ 1285 "pushq 64(%%rax)\n\t" \ 1286 "pushq 56(%%rax)\n\t" \ 1287 "movq 48(%%rax), %%r9\n\t" \ 1288 "movq 40(%%rax), %%r8\n\t" \ 1289 "movq 32(%%rax), %%rcx\n\t" \ 1290 "movq 24(%%rax), %%rdx\n\t" \ 1291 "movq 16(%%rax), %%rsi\n\t" \ 1292 "movq 8(%%rax), %%rdi\n\t" \ 1293 "movq (%%rax), %%rax\n\t" \ 1294 VALGRIND_CALL_NOREDIR_RAX \ 1295 "addq $16, %%rsp\n" \ 1296 "addq $128,%%rsp\n\t" \ 1298 : "a" (&_argvec[0]) \ 1299 : "cc", "memory", __CALLER_SAVED_REGS \ 1301 lval = (__typeof__(lval)) _res; \ 1304 #define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1307 volatile OrigFn _orig = (orig); \ 1308 volatile unsigned long _argvec[10]; \ 1309 volatile unsigned long _res; \ 1310 _argvec[0] = (unsigned long)_orig.nraddr; \ 1311 _argvec[1] = (unsigned long)(arg1); \ 1312 _argvec[2] = (unsigned long)(arg2); \ 1313 _argvec[3] = (unsigned long)(arg3); \ 1314 _argvec[4] = (unsigned long)(arg4); \ 1315 _argvec[5] = (unsigned long)(arg5); \ 1316 _argvec[6] = (unsigned long)(arg6); \ 1317 _argvec[7] = (unsigned long)(arg7); \ 1318 _argvec[8] = (unsigned long)(arg8); \ 1319 _argvec[9] = (unsigned long)(arg9); \ 1321 "subq $128,%%rsp\n\t" \ 1322 "pushq 72(%%rax)\n\t" \ 1323 "pushq 64(%%rax)\n\t" \ 1324 "pushq 56(%%rax)\n\t" \ 1325 "movq 48(%%rax), %%r9\n\t" \ 1326 "movq 40(%%rax), %%r8\n\t" \ 1327 "movq 32(%%rax), %%rcx\n\t" \ 1328 "movq 24(%%rax), %%rdx\n\t" \ 1329 "movq 16(%%rax), %%rsi\n\t" \ 1330 "movq 8(%%rax), %%rdi\n\t" \ 1331 "movq (%%rax), %%rax\n\t" \ 1332 VALGRIND_CALL_NOREDIR_RAX \ 1333 "addq $24, %%rsp\n" \ 1334 "addq $128,%%rsp\n\t" \ 1336 : "a" (&_argvec[0]) \ 1337 : "cc", "memory", __CALLER_SAVED_REGS \ 1339 lval = (__typeof__(lval)) _res; \ 1342 #define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1343 arg7,arg8,arg9,arg10) \ 1345 volatile OrigFn _orig = (orig); \ 1346 volatile unsigned long _argvec[11]; \ 1347 volatile unsigned long _res; \ 1348 _argvec[0] = (unsigned long)_orig.nraddr; \ 1349 _argvec[1] = (unsigned long)(arg1); \ 1350 _argvec[2] = (unsigned long)(arg2); \ 1351 _argvec[3] = (unsigned long)(arg3); \ 1352 _argvec[4] = (unsigned long)(arg4); \ 1353 _argvec[5] = (unsigned long)(arg5); \ 1354 _argvec[6] = (unsigned long)(arg6); \ 1355 _argvec[7] = (unsigned long)(arg7); \ 1356 _argvec[8] = (unsigned long)(arg8); \ 1357 _argvec[9] = (unsigned long)(arg9); \ 1358 _argvec[10] = (unsigned long)(arg10); \ 1360 "subq $128,%%rsp\n\t" \ 1361 "pushq 80(%%rax)\n\t" \ 1362 "pushq 72(%%rax)\n\t" \ 1363 "pushq 64(%%rax)\n\t" \ 1364 "pushq 56(%%rax)\n\t" \ 1365 "movq 48(%%rax), %%r9\n\t" \ 1366 "movq 40(%%rax), %%r8\n\t" \ 1367 "movq 32(%%rax), %%rcx\n\t" \ 1368 "movq 24(%%rax), %%rdx\n\t" \ 1369 "movq 16(%%rax), %%rsi\n\t" \ 1370 "movq 8(%%rax), %%rdi\n\t" \ 1371 "movq (%%rax), %%rax\n\t" \ 1372 VALGRIND_CALL_NOREDIR_RAX \ 1373 "addq $32, %%rsp\n" \ 1374 "addq $128,%%rsp\n\t" \ 1376 : "a" (&_argvec[0]) \ 1377 : "cc", "memory", __CALLER_SAVED_REGS \ 1379 lval = (__typeof__(lval)) _res; \ 1382 #define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1383 arg7,arg8,arg9,arg10,arg11) \ 1385 volatile OrigFn _orig = (orig); \ 1386 volatile unsigned long _argvec[12]; \ 1387 volatile unsigned long _res; \ 1388 _argvec[0] = (unsigned long)_orig.nraddr; \ 1389 _argvec[1] = (unsigned long)(arg1); \ 1390 _argvec[2] = (unsigned long)(arg2); \ 1391 _argvec[3] = (unsigned long)(arg3); \ 1392 _argvec[4] = (unsigned long)(arg4); \ 1393 _argvec[5] = (unsigned long)(arg5); \ 1394 _argvec[6] = (unsigned long)(arg6); \ 1395 _argvec[7] = (unsigned long)(arg7); \ 1396 _argvec[8] = (unsigned long)(arg8); \ 1397 _argvec[9] = (unsigned long)(arg9); \ 1398 _argvec[10] = (unsigned long)(arg10); \ 1399 _argvec[11] = (unsigned long)(arg11); \ 1401 "subq $128,%%rsp\n\t" \ 1402 "pushq 88(%%rax)\n\t" \ 1403 "pushq 80(%%rax)\n\t" \ 1404 "pushq 72(%%rax)\n\t" \ 1405 "pushq 64(%%rax)\n\t" \ 1406 "pushq 56(%%rax)\n\t" \ 1407 "movq 48(%%rax), %%r9\n\t" \ 1408 "movq 40(%%rax), %%r8\n\t" \ 1409 "movq 32(%%rax), %%rcx\n\t" \ 1410 "movq 24(%%rax), %%rdx\n\t" \ 1411 "movq 16(%%rax), %%rsi\n\t" \ 1412 "movq 8(%%rax), %%rdi\n\t" \ 1413 "movq (%%rax), %%rax\n\t" \ 1414 VALGRIND_CALL_NOREDIR_RAX \ 1415 "addq $40, %%rsp\n" \ 1416 "addq $128,%%rsp\n\t" \ 1418 : "a" (&_argvec[0]) \ 1419 : "cc", "memory", __CALLER_SAVED_REGS \ 1421 lval = (__typeof__(lval)) _res; \ 1424 #define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1425 arg7,arg8,arg9,arg10,arg11,arg12) \ 1427 volatile OrigFn _orig = (orig); \ 1428 volatile unsigned long _argvec[13]; \ 1429 volatile unsigned long _res; \ 1430 _argvec[0] = (unsigned long)_orig.nraddr; \ 1431 _argvec[1] = (unsigned long)(arg1); \ 1432 _argvec[2] = (unsigned long)(arg2); \ 1433 _argvec[3] = (unsigned long)(arg3); \ 1434 _argvec[4] = (unsigned long)(arg4); \ 1435 _argvec[5] = (unsigned long)(arg5); \ 1436 _argvec[6] = (unsigned long)(arg6); \ 1437 _argvec[7] = (unsigned long)(arg7); \ 1438 _argvec[8] = (unsigned long)(arg8); \ 1439 _argvec[9] = (unsigned long)(arg9); \ 1440 _argvec[10] = (unsigned long)(arg10); \ 1441 _argvec[11] = (unsigned long)(arg11); \ 1442 _argvec[12] = (unsigned long)(arg12); \ 1444 "subq $128,%%rsp\n\t" \ 1445 "pushq 96(%%rax)\n\t" \ 1446 "pushq 88(%%rax)\n\t" \ 1447 "pushq 80(%%rax)\n\t" \ 1448 "pushq 72(%%rax)\n\t" \ 1449 "pushq 64(%%rax)\n\t" \ 1450 "pushq 56(%%rax)\n\t" \ 1451 "movq 48(%%rax), %%r9\n\t" \ 1452 "movq 40(%%rax), %%r8\n\t" \ 1453 "movq 32(%%rax), %%rcx\n\t" \ 1454 "movq 24(%%rax), %%rdx\n\t" \ 1455 "movq 16(%%rax), %%rsi\n\t" \ 1456 "movq 8(%%rax), %%rdi\n\t" \ 1457 "movq (%%rax), %%rax\n\t" \ 1458 VALGRIND_CALL_NOREDIR_RAX \ 1459 "addq $48, %%rsp\n" \ 1460 "addq $128,%%rsp\n\t" \ 1462 : "a" (&_argvec[0]) \ 1463 : "cc", "memory", __CALLER_SAVED_REGS \ 1465 lval = (__typeof__(lval)) _res; \ 1472 #if defined(PLAT_ppc32_linux) 1498 #define __CALLER_SAVED_REGS \ 1499 "lr", "ctr", "xer", \ 1500 "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \ 1501 "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \ 1507 #define CALL_FN_W_v(lval, orig) \ 1509 volatile OrigFn _orig = (orig); \ 1510 volatile unsigned long _argvec[1]; \ 1511 volatile unsigned long _res; \ 1512 _argvec[0] = (unsigned long)_orig.nraddr; \ 1515 "lwz 11,0(11)\n\t" \ 1516 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1519 : "r" (&_argvec[0]) \ 1520 : "cc", "memory", __CALLER_SAVED_REGS \ 1522 lval = (__typeof__(lval)) _res; \ 1525 #define CALL_FN_W_W(lval, orig, arg1) \ 1527 volatile OrigFn _orig = (orig); \ 1528 volatile unsigned long _argvec[2]; \ 1529 volatile unsigned long _res; \ 1530 _argvec[0] = (unsigned long)_orig.nraddr; \ 1531 _argvec[1] = (unsigned long)arg1; \ 1535 "lwz 11,0(11)\n\t" \ 1536 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1539 : "r" (&_argvec[0]) \ 1540 : "cc", "memory", __CALLER_SAVED_REGS \ 1542 lval = (__typeof__(lval)) _res; \ 1545 #define CALL_FN_W_WW(lval, orig, arg1,arg2) \ 1547 volatile OrigFn _orig = (orig); \ 1548 volatile unsigned long _argvec[3]; \ 1549 volatile unsigned long _res; \ 1550 _argvec[0] = (unsigned long)_orig.nraddr; \ 1551 _argvec[1] = (unsigned long)arg1; \ 1552 _argvec[2] = (unsigned long)arg2; \ 1557 "lwz 11,0(11)\n\t" \ 1558 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1561 : "r" (&_argvec[0]) \ 1562 : "cc", "memory", __CALLER_SAVED_REGS \ 1564 lval = (__typeof__(lval)) _res; \ 1567 #define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \ 1569 volatile OrigFn _orig = (orig); \ 1570 volatile unsigned long _argvec[4]; \ 1571 volatile unsigned long _res; \ 1572 _argvec[0] = (unsigned long)_orig.nraddr; \ 1573 _argvec[1] = (unsigned long)arg1; \ 1574 _argvec[2] = (unsigned long)arg2; \ 1575 _argvec[3] = (unsigned long)arg3; \ 1580 "lwz 5,12(11)\n\t" \ 1581 "lwz 11,0(11)\n\t" \ 1582 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1585 : "r" (&_argvec[0]) \ 1586 : "cc", "memory", __CALLER_SAVED_REGS \ 1588 lval = (__typeof__(lval)) _res; \ 1591 #define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \ 1593 volatile OrigFn _orig = (orig); \ 1594 volatile unsigned long _argvec[5]; \ 1595 volatile unsigned long _res; \ 1596 _argvec[0] = (unsigned long)_orig.nraddr; \ 1597 _argvec[1] = (unsigned long)arg1; \ 1598 _argvec[2] = (unsigned long)arg2; \ 1599 _argvec[3] = (unsigned long)arg3; \ 1600 _argvec[4] = (unsigned long)arg4; \ 1605 "lwz 5,12(11)\n\t" \ 1606 "lwz 6,16(11)\n\t" \ 1607 "lwz 11,0(11)\n\t" \ 1608 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1611 : "r" (&_argvec[0]) \ 1612 : "cc", "memory", __CALLER_SAVED_REGS \ 1614 lval = (__typeof__(lval)) _res; \ 1617 #define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \ 1619 volatile OrigFn _orig = (orig); \ 1620 volatile unsigned long _argvec[6]; \ 1621 volatile unsigned long _res; \ 1622 _argvec[0] = (unsigned long)_orig.nraddr; \ 1623 _argvec[1] = (unsigned long)arg1; \ 1624 _argvec[2] = (unsigned long)arg2; \ 1625 _argvec[3] = (unsigned long)arg3; \ 1626 _argvec[4] = (unsigned long)arg4; \ 1627 _argvec[5] = (unsigned long)arg5; \ 1632 "lwz 5,12(11)\n\t" \ 1633 "lwz 6,16(11)\n\t" \ 1634 "lwz 7,20(11)\n\t" \ 1635 "lwz 11,0(11)\n\t" \ 1636 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1639 : "r" (&_argvec[0]) \ 1640 : "cc", "memory", __CALLER_SAVED_REGS \ 1642 lval = (__typeof__(lval)) _res; \ 1645 #define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \ 1647 volatile OrigFn _orig = (orig); \ 1648 volatile unsigned long _argvec[7]; \ 1649 volatile unsigned long _res; \ 1650 _argvec[0] = (unsigned long)_orig.nraddr; \ 1651 _argvec[1] = (unsigned long)arg1; \ 1652 _argvec[2] = (unsigned long)arg2; \ 1653 _argvec[3] = (unsigned long)arg3; \ 1654 _argvec[4] = (unsigned long)arg4; \ 1655 _argvec[5] = (unsigned long)arg5; \ 1656 _argvec[6] = (unsigned long)arg6; \ 1661 "lwz 5,12(11)\n\t" \ 1662 "lwz 6,16(11)\n\t" \ 1663 "lwz 7,20(11)\n\t" \ 1664 "lwz 8,24(11)\n\t" \ 1665 "lwz 11,0(11)\n\t" \ 1666 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1669 : "r" (&_argvec[0]) \ 1670 : "cc", "memory", __CALLER_SAVED_REGS \ 1672 lval = (__typeof__(lval)) _res; \ 1675 #define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1678 volatile OrigFn _orig = (orig); \ 1679 volatile unsigned long _argvec[8]; \ 1680 volatile unsigned long _res; \ 1681 _argvec[0] = (unsigned long)_orig.nraddr; \ 1682 _argvec[1] = (unsigned long)arg1; \ 1683 _argvec[2] = (unsigned long)arg2; \ 1684 _argvec[3] = (unsigned long)arg3; \ 1685 _argvec[4] = (unsigned long)arg4; \ 1686 _argvec[5] = (unsigned long)arg5; \ 1687 _argvec[6] = (unsigned long)arg6; \ 1688 _argvec[7] = (unsigned long)arg7; \ 1693 "lwz 5,12(11)\n\t" \ 1694 "lwz 6,16(11)\n\t" \ 1695 "lwz 7,20(11)\n\t" \ 1696 "lwz 8,24(11)\n\t" \ 1697 "lwz 9,28(11)\n\t" \ 1698 "lwz 11,0(11)\n\t" \ 1699 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1702 : "r" (&_argvec[0]) \ 1703 : "cc", "memory", __CALLER_SAVED_REGS \ 1705 lval = (__typeof__(lval)) _res; \ 1708 #define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1711 volatile OrigFn _orig = (orig); \ 1712 volatile unsigned long _argvec[9]; \ 1713 volatile unsigned long _res; \ 1714 _argvec[0] = (unsigned long)_orig.nraddr; \ 1715 _argvec[1] = (unsigned long)arg1; \ 1716 _argvec[2] = (unsigned long)arg2; \ 1717 _argvec[3] = (unsigned long)arg3; \ 1718 _argvec[4] = (unsigned long)arg4; \ 1719 _argvec[5] = (unsigned long)arg5; \ 1720 _argvec[6] = (unsigned long)arg6; \ 1721 _argvec[7] = (unsigned long)arg7; \ 1722 _argvec[8] = (unsigned long)arg8; \ 1727 "lwz 5,12(11)\n\t" \ 1728 "lwz 6,16(11)\n\t" \ 1729 "lwz 7,20(11)\n\t" \ 1730 "lwz 8,24(11)\n\t" \ 1731 "lwz 9,28(11)\n\t" \ 1732 "lwz 10,32(11)\n\t" \ 1733 "lwz 11,0(11)\n\t" \ 1734 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1737 : "r" (&_argvec[0]) \ 1738 : "cc", "memory", __CALLER_SAVED_REGS \ 1740 lval = (__typeof__(lval)) _res; \ 1743 #define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1746 volatile OrigFn _orig = (orig); \ 1747 volatile unsigned long _argvec[10]; \ 1748 volatile unsigned long _res; \ 1749 _argvec[0] = (unsigned long)_orig.nraddr; \ 1750 _argvec[1] = (unsigned long)arg1; \ 1751 _argvec[2] = (unsigned long)arg2; \ 1752 _argvec[3] = (unsigned long)arg3; \ 1753 _argvec[4] = (unsigned long)arg4; \ 1754 _argvec[5] = (unsigned long)arg5; \ 1755 _argvec[6] = (unsigned long)arg6; \ 1756 _argvec[7] = (unsigned long)arg7; \ 1757 _argvec[8] = (unsigned long)arg8; \ 1758 _argvec[9] = (unsigned long)arg9; \ 1761 "addi 1,1,-16\n\t" \ 1763 "lwz 3,36(11)\n\t" \ 1768 "lwz 5,12(11)\n\t" \ 1769 "lwz 6,16(11)\n\t" \ 1770 "lwz 7,20(11)\n\t" \ 1771 "lwz 8,24(11)\n\t" \ 1772 "lwz 9,28(11)\n\t" \ 1773 "lwz 10,32(11)\n\t" \ 1774 "lwz 11,0(11)\n\t" \ 1775 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1779 : "r" (&_argvec[0]) \ 1780 : "cc", "memory", __CALLER_SAVED_REGS \ 1782 lval = (__typeof__(lval)) _res; \ 1785 #define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1786 arg7,arg8,arg9,arg10) \ 1788 volatile OrigFn _orig = (orig); \ 1789 volatile unsigned long _argvec[11]; \ 1790 volatile unsigned long _res; \ 1791 _argvec[0] = (unsigned long)_orig.nraddr; \ 1792 _argvec[1] = (unsigned long)arg1; \ 1793 _argvec[2] = (unsigned long)arg2; \ 1794 _argvec[3] = (unsigned long)arg3; \ 1795 _argvec[4] = (unsigned long)arg4; \ 1796 _argvec[5] = (unsigned long)arg5; \ 1797 _argvec[6] = (unsigned long)arg6; \ 1798 _argvec[7] = (unsigned long)arg7; \ 1799 _argvec[8] = (unsigned long)arg8; \ 1800 _argvec[9] = (unsigned long)arg9; \ 1801 _argvec[10] = (unsigned long)arg10; \ 1804 "addi 1,1,-16\n\t" \ 1806 "lwz 3,40(11)\n\t" \ 1809 "lwz 3,36(11)\n\t" \ 1814 "lwz 5,12(11)\n\t" \ 1815 "lwz 6,16(11)\n\t" \ 1816 "lwz 7,20(11)\n\t" \ 1817 "lwz 8,24(11)\n\t" \ 1818 "lwz 9,28(11)\n\t" \ 1819 "lwz 10,32(11)\n\t" \ 1820 "lwz 11,0(11)\n\t" \ 1821 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1825 : "r" (&_argvec[0]) \ 1826 : "cc", "memory", __CALLER_SAVED_REGS \ 1828 lval = (__typeof__(lval)) _res; \ 1831 #define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1832 arg7,arg8,arg9,arg10,arg11) \ 1834 volatile OrigFn _orig = (orig); \ 1835 volatile unsigned long _argvec[12]; \ 1836 volatile unsigned long _res; \ 1837 _argvec[0] = (unsigned long)_orig.nraddr; \ 1838 _argvec[1] = (unsigned long)arg1; \ 1839 _argvec[2] = (unsigned long)arg2; \ 1840 _argvec[3] = (unsigned long)arg3; \ 1841 _argvec[4] = (unsigned long)arg4; \ 1842 _argvec[5] = (unsigned long)arg5; \ 1843 _argvec[6] = (unsigned long)arg6; \ 1844 _argvec[7] = (unsigned long)arg7; \ 1845 _argvec[8] = (unsigned long)arg8; \ 1846 _argvec[9] = (unsigned long)arg9; \ 1847 _argvec[10] = (unsigned long)arg10; \ 1848 _argvec[11] = (unsigned long)arg11; \ 1851 "addi 1,1,-32\n\t" \ 1853 "lwz 3,44(11)\n\t" \ 1856 "lwz 3,40(11)\n\t" \ 1859 "lwz 3,36(11)\n\t" \ 1864 "lwz 5,12(11)\n\t" \ 1865 "lwz 6,16(11)\n\t" \ 1866 "lwz 7,20(11)\n\t" \ 1867 "lwz 8,24(11)\n\t" \ 1868 "lwz 9,28(11)\n\t" \ 1869 "lwz 10,32(11)\n\t" \ 1870 "lwz 11,0(11)\n\t" \ 1871 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1875 : "r" (&_argvec[0]) \ 1876 : "cc", "memory", __CALLER_SAVED_REGS \ 1878 lval = (__typeof__(lval)) _res; \ 1881 #define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 1882 arg7,arg8,arg9,arg10,arg11,arg12) \ 1884 volatile OrigFn _orig = (orig); \ 1885 volatile unsigned long _argvec[13]; \ 1886 volatile unsigned long _res; \ 1887 _argvec[0] = (unsigned long)_orig.nraddr; \ 1888 _argvec[1] = (unsigned long)arg1; \ 1889 _argvec[2] = (unsigned long)arg2; \ 1890 _argvec[3] = (unsigned long)arg3; \ 1891 _argvec[4] = (unsigned long)arg4; \ 1892 _argvec[5] = (unsigned long)arg5; \ 1893 _argvec[6] = (unsigned long)arg6; \ 1894 _argvec[7] = (unsigned long)arg7; \ 1895 _argvec[8] = (unsigned long)arg8; \ 1896 _argvec[9] = (unsigned long)arg9; \ 1897 _argvec[10] = (unsigned long)arg10; \ 1898 _argvec[11] = (unsigned long)arg11; \ 1899 _argvec[12] = (unsigned long)arg12; \ 1902 "addi 1,1,-32\n\t" \ 1904 "lwz 3,48(11)\n\t" \ 1907 "lwz 3,44(11)\n\t" \ 1910 "lwz 3,40(11)\n\t" \ 1913 "lwz 3,36(11)\n\t" \ 1918 "lwz 5,12(11)\n\t" \ 1919 "lwz 6,16(11)\n\t" \ 1920 "lwz 7,20(11)\n\t" \ 1921 "lwz 8,24(11)\n\t" \ 1922 "lwz 9,28(11)\n\t" \ 1923 "lwz 10,32(11)\n\t" \ 1924 "lwz 11,0(11)\n\t" \ 1925 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1929 : "r" (&_argvec[0]) \ 1930 : "cc", "memory", __CALLER_SAVED_REGS \ 1932 lval = (__typeof__(lval)) _res; \ 1939 #if defined(PLAT_ppc64_linux) 1944 #define __CALLER_SAVED_REGS \ 1945 "lr", "ctr", "xer", \ 1946 "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \ 1947 "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \ 1953 #define CALL_FN_W_v(lval, orig) \ 1955 volatile OrigFn _orig = (orig); \ 1956 volatile unsigned long _argvec[3+0]; \ 1957 volatile unsigned long _res; \ 1959 _argvec[1] = (unsigned long)_orig.r2; \ 1960 _argvec[2] = (unsigned long)_orig.nraddr; \ 1963 "std 2,-16(11)\n\t" \ 1965 "ld 11, 0(11)\n\t" \ 1966 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1971 : "r" (&_argvec[2]) \ 1972 : "cc", "memory", __CALLER_SAVED_REGS \ 1974 lval = (__typeof__(lval)) _res; \ 1977 #define CALL_FN_W_W(lval, orig, arg1) \ 1979 volatile OrigFn _orig = (orig); \ 1980 volatile unsigned long _argvec[3+1]; \ 1981 volatile unsigned long _res; \ 1983 _argvec[1] = (unsigned long)_orig.r2; \ 1984 _argvec[2] = (unsigned long)_orig.nraddr; \ 1985 _argvec[2+1] = (unsigned long)arg1; \ 1988 "std 2,-16(11)\n\t" \ 1991 "ld 11, 0(11)\n\t" \ 1992 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 1997 : "r" (&_argvec[2]) \ 1998 : "cc", "memory", __CALLER_SAVED_REGS \ 2000 lval = (__typeof__(lval)) _res; \ 2003 #define CALL_FN_W_WW(lval, orig, arg1,arg2) \ 2005 volatile OrigFn _orig = (orig); \ 2006 volatile unsigned long _argvec[3+2]; \ 2007 volatile unsigned long _res; \ 2009 _argvec[1] = (unsigned long)_orig.r2; \ 2010 _argvec[2] = (unsigned long)_orig.nraddr; \ 2011 _argvec[2+1] = (unsigned long)arg1; \ 2012 _argvec[2+2] = (unsigned long)arg2; \ 2015 "std 2,-16(11)\n\t" \ 2018 "ld 4, 16(11)\n\t" \ 2019 "ld 11, 0(11)\n\t" \ 2020 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2025 : "r" (&_argvec[2]) \ 2026 : "cc", "memory", __CALLER_SAVED_REGS \ 2028 lval = (__typeof__(lval)) _res; \ 2031 #define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \ 2033 volatile OrigFn _orig = (orig); \ 2034 volatile unsigned long _argvec[3+3]; \ 2035 volatile unsigned long _res; \ 2037 _argvec[1] = (unsigned long)_orig.r2; \ 2038 _argvec[2] = (unsigned long)_orig.nraddr; \ 2039 _argvec[2+1] = (unsigned long)arg1; \ 2040 _argvec[2+2] = (unsigned long)arg2; \ 2041 _argvec[2+3] = (unsigned long)arg3; \ 2044 "std 2,-16(11)\n\t" \ 2047 "ld 4, 16(11)\n\t" \ 2048 "ld 5, 24(11)\n\t" \ 2049 "ld 11, 0(11)\n\t" \ 2050 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2055 : "r" (&_argvec[2]) \ 2056 : "cc", "memory", __CALLER_SAVED_REGS \ 2058 lval = (__typeof__(lval)) _res; \ 2061 #define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \ 2063 volatile OrigFn _orig = (orig); \ 2064 volatile unsigned long _argvec[3+4]; \ 2065 volatile unsigned long _res; \ 2067 _argvec[1] = (unsigned long)_orig.r2; \ 2068 _argvec[2] = (unsigned long)_orig.nraddr; \ 2069 _argvec[2+1] = (unsigned long)arg1; \ 2070 _argvec[2+2] = (unsigned long)arg2; \ 2071 _argvec[2+3] = (unsigned long)arg3; \ 2072 _argvec[2+4] = (unsigned long)arg4; \ 2075 "std 2,-16(11)\n\t" \ 2078 "ld 4, 16(11)\n\t" \ 2079 "ld 5, 24(11)\n\t" \ 2080 "ld 6, 32(11)\n\t" \ 2081 "ld 11, 0(11)\n\t" \ 2082 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2087 : "r" (&_argvec[2]) \ 2088 : "cc", "memory", __CALLER_SAVED_REGS \ 2090 lval = (__typeof__(lval)) _res; \ 2093 #define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \ 2095 volatile OrigFn _orig = (orig); \ 2096 volatile unsigned long _argvec[3+5]; \ 2097 volatile unsigned long _res; \ 2099 _argvec[1] = (unsigned long)_orig.r2; \ 2100 _argvec[2] = (unsigned long)_orig.nraddr; \ 2101 _argvec[2+1] = (unsigned long)arg1; \ 2102 _argvec[2+2] = (unsigned long)arg2; \ 2103 _argvec[2+3] = (unsigned long)arg3; \ 2104 _argvec[2+4] = (unsigned long)arg4; \ 2105 _argvec[2+5] = (unsigned long)arg5; \ 2108 "std 2,-16(11)\n\t" \ 2111 "ld 4, 16(11)\n\t" \ 2112 "ld 5, 24(11)\n\t" \ 2113 "ld 6, 32(11)\n\t" \ 2114 "ld 7, 40(11)\n\t" \ 2115 "ld 11, 0(11)\n\t" \ 2116 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2121 : "r" (&_argvec[2]) \ 2122 : "cc", "memory", __CALLER_SAVED_REGS \ 2124 lval = (__typeof__(lval)) _res; \ 2127 #define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \ 2129 volatile OrigFn _orig = (orig); \ 2130 volatile unsigned long _argvec[3+6]; \ 2131 volatile unsigned long _res; \ 2133 _argvec[1] = (unsigned long)_orig.r2; \ 2134 _argvec[2] = (unsigned long)_orig.nraddr; \ 2135 _argvec[2+1] = (unsigned long)arg1; \ 2136 _argvec[2+2] = (unsigned long)arg2; \ 2137 _argvec[2+3] = (unsigned long)arg3; \ 2138 _argvec[2+4] = (unsigned long)arg4; \ 2139 _argvec[2+5] = (unsigned long)arg5; \ 2140 _argvec[2+6] = (unsigned long)arg6; \ 2143 "std 2,-16(11)\n\t" \ 2146 "ld 4, 16(11)\n\t" \ 2147 "ld 5, 24(11)\n\t" \ 2148 "ld 6, 32(11)\n\t" \ 2149 "ld 7, 40(11)\n\t" \ 2150 "ld 8, 48(11)\n\t" \ 2151 "ld 11, 0(11)\n\t" \ 2152 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2157 : "r" (&_argvec[2]) \ 2158 : "cc", "memory", __CALLER_SAVED_REGS \ 2160 lval = (__typeof__(lval)) _res; \ 2163 #define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2166 volatile OrigFn _orig = (orig); \ 2167 volatile unsigned long _argvec[3+7]; \ 2168 volatile unsigned long _res; \ 2170 _argvec[1] = (unsigned long)_orig.r2; \ 2171 _argvec[2] = (unsigned long)_orig.nraddr; \ 2172 _argvec[2+1] = (unsigned long)arg1; \ 2173 _argvec[2+2] = (unsigned long)arg2; \ 2174 _argvec[2+3] = (unsigned long)arg3; \ 2175 _argvec[2+4] = (unsigned long)arg4; \ 2176 _argvec[2+5] = (unsigned long)arg5; \ 2177 _argvec[2+6] = (unsigned long)arg6; \ 2178 _argvec[2+7] = (unsigned long)arg7; \ 2181 "std 2,-16(11)\n\t" \ 2184 "ld 4, 16(11)\n\t" \ 2185 "ld 5, 24(11)\n\t" \ 2186 "ld 6, 32(11)\n\t" \ 2187 "ld 7, 40(11)\n\t" \ 2188 "ld 8, 48(11)\n\t" \ 2189 "ld 9, 56(11)\n\t" \ 2190 "ld 11, 0(11)\n\t" \ 2191 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2196 : "r" (&_argvec[2]) \ 2197 : "cc", "memory", __CALLER_SAVED_REGS \ 2199 lval = (__typeof__(lval)) _res; \ 2202 #define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2205 volatile OrigFn _orig = (orig); \ 2206 volatile unsigned long _argvec[3+8]; \ 2207 volatile unsigned long _res; \ 2209 _argvec[1] = (unsigned long)_orig.r2; \ 2210 _argvec[2] = (unsigned long)_orig.nraddr; \ 2211 _argvec[2+1] = (unsigned long)arg1; \ 2212 _argvec[2+2] = (unsigned long)arg2; \ 2213 _argvec[2+3] = (unsigned long)arg3; \ 2214 _argvec[2+4] = (unsigned long)arg4; \ 2215 _argvec[2+5] = (unsigned long)arg5; \ 2216 _argvec[2+6] = (unsigned long)arg6; \ 2217 _argvec[2+7] = (unsigned long)arg7; \ 2218 _argvec[2+8] = (unsigned long)arg8; \ 2221 "std 2,-16(11)\n\t" \ 2224 "ld 4, 16(11)\n\t" \ 2225 "ld 5, 24(11)\n\t" \ 2226 "ld 6, 32(11)\n\t" \ 2227 "ld 7, 40(11)\n\t" \ 2228 "ld 8, 48(11)\n\t" \ 2229 "ld 9, 56(11)\n\t" \ 2230 "ld 10, 64(11)\n\t" \ 2231 "ld 11, 0(11)\n\t" \ 2232 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2237 : "r" (&_argvec[2]) \ 2238 : "cc", "memory", __CALLER_SAVED_REGS \ 2240 lval = (__typeof__(lval)) _res; \ 2243 #define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2246 volatile OrigFn _orig = (orig); \ 2247 volatile unsigned long _argvec[3+9]; \ 2248 volatile unsigned long _res; \ 2250 _argvec[1] = (unsigned long)_orig.r2; \ 2251 _argvec[2] = (unsigned long)_orig.nraddr; \ 2252 _argvec[2+1] = (unsigned long)arg1; \ 2253 _argvec[2+2] = (unsigned long)arg2; \ 2254 _argvec[2+3] = (unsigned long)arg3; \ 2255 _argvec[2+4] = (unsigned long)arg4; \ 2256 _argvec[2+5] = (unsigned long)arg5; \ 2257 _argvec[2+6] = (unsigned long)arg6; \ 2258 _argvec[2+7] = (unsigned long)arg7; \ 2259 _argvec[2+8] = (unsigned long)arg8; \ 2260 _argvec[2+9] = (unsigned long)arg9; \ 2263 "std 2,-16(11)\n\t" \ 2265 "addi 1,1,-128\n\t" \ 2268 "std 3,112(1)\n\t" \ 2271 "ld 4, 16(11)\n\t" \ 2272 "ld 5, 24(11)\n\t" \ 2273 "ld 6, 32(11)\n\t" \ 2274 "ld 7, 40(11)\n\t" \ 2275 "ld 8, 48(11)\n\t" \ 2276 "ld 9, 56(11)\n\t" \ 2277 "ld 10, 64(11)\n\t" \ 2278 "ld 11, 0(11)\n\t" \ 2279 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2282 "ld 2,-16(11)\n\t" \ 2285 : "r" (&_argvec[2]) \ 2286 : "cc", "memory", __CALLER_SAVED_REGS \ 2288 lval = (__typeof__(lval)) _res; \ 2291 #define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2292 arg7,arg8,arg9,arg10) \ 2294 volatile OrigFn _orig = (orig); \ 2295 volatile unsigned long _argvec[3+10]; \ 2296 volatile unsigned long _res; \ 2298 _argvec[1] = (unsigned long)_orig.r2; \ 2299 _argvec[2] = (unsigned long)_orig.nraddr; \ 2300 _argvec[2+1] = (unsigned long)arg1; \ 2301 _argvec[2+2] = (unsigned long)arg2; \ 2302 _argvec[2+3] = (unsigned long)arg3; \ 2303 _argvec[2+4] = (unsigned long)arg4; \ 2304 _argvec[2+5] = (unsigned long)arg5; \ 2305 _argvec[2+6] = (unsigned long)arg6; \ 2306 _argvec[2+7] = (unsigned long)arg7; \ 2307 _argvec[2+8] = (unsigned long)arg8; \ 2308 _argvec[2+9] = (unsigned long)arg9; \ 2309 _argvec[2+10] = (unsigned long)arg10; \ 2312 "std 2,-16(11)\n\t" \ 2314 "addi 1,1,-128\n\t" \ 2317 "std 3,120(1)\n\t" \ 2320 "std 3,112(1)\n\t" \ 2323 "ld 4, 16(11)\n\t" \ 2324 "ld 5, 24(11)\n\t" \ 2325 "ld 6, 32(11)\n\t" \ 2326 "ld 7, 40(11)\n\t" \ 2327 "ld 8, 48(11)\n\t" \ 2328 "ld 9, 56(11)\n\t" \ 2329 "ld 10, 64(11)\n\t" \ 2330 "ld 11, 0(11)\n\t" \ 2331 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2334 "ld 2,-16(11)\n\t" \ 2337 : "r" (&_argvec[2]) \ 2338 : "cc", "memory", __CALLER_SAVED_REGS \ 2340 lval = (__typeof__(lval)) _res; \ 2343 #define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2344 arg7,arg8,arg9,arg10,arg11) \ 2346 volatile OrigFn _orig = (orig); \ 2347 volatile unsigned long _argvec[3+11]; \ 2348 volatile unsigned long _res; \ 2350 _argvec[1] = (unsigned long)_orig.r2; \ 2351 _argvec[2] = (unsigned long)_orig.nraddr; \ 2352 _argvec[2+1] = (unsigned long)arg1; \ 2353 _argvec[2+2] = (unsigned long)arg2; \ 2354 _argvec[2+3] = (unsigned long)arg3; \ 2355 _argvec[2+4] = (unsigned long)arg4; \ 2356 _argvec[2+5] = (unsigned long)arg5; \ 2357 _argvec[2+6] = (unsigned long)arg6; \ 2358 _argvec[2+7] = (unsigned long)arg7; \ 2359 _argvec[2+8] = (unsigned long)arg8; \ 2360 _argvec[2+9] = (unsigned long)arg9; \ 2361 _argvec[2+10] = (unsigned long)arg10; \ 2362 _argvec[2+11] = (unsigned long)arg11; \ 2365 "std 2,-16(11)\n\t" \ 2367 "addi 1,1,-144\n\t" \ 2370 "std 3,128(1)\n\t" \ 2373 "std 3,120(1)\n\t" \ 2376 "std 3,112(1)\n\t" \ 2379 "ld 4, 16(11)\n\t" \ 2380 "ld 5, 24(11)\n\t" \ 2381 "ld 6, 32(11)\n\t" \ 2382 "ld 7, 40(11)\n\t" \ 2383 "ld 8, 48(11)\n\t" \ 2384 "ld 9, 56(11)\n\t" \ 2385 "ld 10, 64(11)\n\t" \ 2386 "ld 11, 0(11)\n\t" \ 2387 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2390 "ld 2,-16(11)\n\t" \ 2393 : "r" (&_argvec[2]) \ 2394 : "cc", "memory", __CALLER_SAVED_REGS \ 2396 lval = (__typeof__(lval)) _res; \ 2399 #define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2400 arg7,arg8,arg9,arg10,arg11,arg12) \ 2402 volatile OrigFn _orig = (orig); \ 2403 volatile unsigned long _argvec[3+12]; \ 2404 volatile unsigned long _res; \ 2406 _argvec[1] = (unsigned long)_orig.r2; \ 2407 _argvec[2] = (unsigned long)_orig.nraddr; \ 2408 _argvec[2+1] = (unsigned long)arg1; \ 2409 _argvec[2+2] = (unsigned long)arg2; \ 2410 _argvec[2+3] = (unsigned long)arg3; \ 2411 _argvec[2+4] = (unsigned long)arg4; \ 2412 _argvec[2+5] = (unsigned long)arg5; \ 2413 _argvec[2+6] = (unsigned long)arg6; \ 2414 _argvec[2+7] = (unsigned long)arg7; \ 2415 _argvec[2+8] = (unsigned long)arg8; \ 2416 _argvec[2+9] = (unsigned long)arg9; \ 2417 _argvec[2+10] = (unsigned long)arg10; \ 2418 _argvec[2+11] = (unsigned long)arg11; \ 2419 _argvec[2+12] = (unsigned long)arg12; \ 2422 "std 2,-16(11)\n\t" \ 2424 "addi 1,1,-144\n\t" \ 2427 "std 3,136(1)\n\t" \ 2430 "std 3,128(1)\n\t" \ 2433 "std 3,120(1)\n\t" \ 2436 "std 3,112(1)\n\t" \ 2439 "ld 4, 16(11)\n\t" \ 2440 "ld 5, 24(11)\n\t" \ 2441 "ld 6, 32(11)\n\t" \ 2442 "ld 7, 40(11)\n\t" \ 2443 "ld 8, 48(11)\n\t" \ 2444 "ld 9, 56(11)\n\t" \ 2445 "ld 10, 64(11)\n\t" \ 2446 "ld 11, 0(11)\n\t" \ 2447 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2450 "ld 2,-16(11)\n\t" \ 2453 : "r" (&_argvec[2]) \ 2454 : "cc", "memory", __CALLER_SAVED_REGS \ 2456 lval = (__typeof__(lval)) _res; \ 2463 #if defined(PLAT_ppc32_aix5) 2468 #define __CALLER_SAVED_REGS \ 2469 "lr", "ctr", "xer", \ 2470 "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \ 2471 "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \ 2477 #define VG_EXPAND_FRAME_BY_trashes_r3(_n_fr) \ 2478 "addi 1,1,-" #_n_fr "\n\t" \ 2479 "lwz 3," #_n_fr "(1)\n\t" \ 2482 #define VG_CONTRACT_FRAME_BY(_n_fr) \ 2483 "addi 1,1," #_n_fr "\n\t" 2488 #define CALL_FN_W_v(lval, orig) \ 2490 volatile OrigFn _orig = (orig); \ 2491 volatile unsigned long _argvec[3+0]; \ 2492 volatile unsigned long _res; \ 2494 _argvec[1] = (unsigned long)_orig.r2; \ 2495 _argvec[2] = (unsigned long)_orig.nraddr; \ 2498 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2499 "stw 2,-8(11)\n\t" \ 2500 "lwz 2,-4(11)\n\t" \ 2501 "lwz 11, 0(11)\n\t" \ 2502 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2505 "lwz 2,-8(11)\n\t" \ 2506 VG_CONTRACT_FRAME_BY(512) \ 2508 : "r" (&_argvec[2]) \ 2509 : "cc", "memory", __CALLER_SAVED_REGS \ 2511 lval = (__typeof__(lval)) _res; \ 2514 #define CALL_FN_W_W(lval, orig, arg1) \ 2516 volatile OrigFn _orig = (orig); \ 2517 volatile unsigned long _argvec[3+1]; \ 2518 volatile unsigned long _res; \ 2520 _argvec[1] = (unsigned long)_orig.r2; \ 2521 _argvec[2] = (unsigned long)_orig.nraddr; \ 2522 _argvec[2+1] = (unsigned long)arg1; \ 2525 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2526 "stw 2,-8(11)\n\t" \ 2527 "lwz 2,-4(11)\n\t" \ 2528 "lwz 3, 4(11)\n\t" \ 2529 "lwz 11, 0(11)\n\t" \ 2530 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2533 "lwz 2,-8(11)\n\t" \ 2534 VG_CONTRACT_FRAME_BY(512) \ 2536 : "r" (&_argvec[2]) \ 2537 : "cc", "memory", __CALLER_SAVED_REGS \ 2539 lval = (__typeof__(lval)) _res; \ 2542 #define CALL_FN_W_WW(lval, orig, arg1,arg2) \ 2544 volatile OrigFn _orig = (orig); \ 2545 volatile unsigned long _argvec[3+2]; \ 2546 volatile unsigned long _res; \ 2548 _argvec[1] = (unsigned long)_orig.r2; \ 2549 _argvec[2] = (unsigned long)_orig.nraddr; \ 2550 _argvec[2+1] = (unsigned long)arg1; \ 2551 _argvec[2+2] = (unsigned long)arg2; \ 2554 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2555 "stw 2,-8(11)\n\t" \ 2556 "lwz 2,-4(11)\n\t" \ 2557 "lwz 3, 4(11)\n\t" \ 2558 "lwz 4, 8(11)\n\t" \ 2559 "lwz 11, 0(11)\n\t" \ 2560 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2563 "lwz 2,-8(11)\n\t" \ 2564 VG_CONTRACT_FRAME_BY(512) \ 2566 : "r" (&_argvec[2]) \ 2567 : "cc", "memory", __CALLER_SAVED_REGS \ 2569 lval = (__typeof__(lval)) _res; \ 2572 #define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \ 2574 volatile OrigFn _orig = (orig); \ 2575 volatile unsigned long _argvec[3+3]; \ 2576 volatile unsigned long _res; \ 2578 _argvec[1] = (unsigned long)_orig.r2; \ 2579 _argvec[2] = (unsigned long)_orig.nraddr; \ 2580 _argvec[2+1] = (unsigned long)arg1; \ 2581 _argvec[2+2] = (unsigned long)arg2; \ 2582 _argvec[2+3] = (unsigned long)arg3; \ 2585 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2586 "stw 2,-8(11)\n\t" \ 2587 "lwz 2,-4(11)\n\t" \ 2588 "lwz 3, 4(11)\n\t" \ 2589 "lwz 4, 8(11)\n\t" \ 2590 "lwz 5, 12(11)\n\t" \ 2591 "lwz 11, 0(11)\n\t" \ 2592 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2595 "lwz 2,-8(11)\n\t" \ 2596 VG_CONTRACT_FRAME_BY(512) \ 2598 : "r" (&_argvec[2]) \ 2599 : "cc", "memory", __CALLER_SAVED_REGS \ 2601 lval = (__typeof__(lval)) _res; \ 2604 #define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \ 2606 volatile OrigFn _orig = (orig); \ 2607 volatile unsigned long _argvec[3+4]; \ 2608 volatile unsigned long _res; \ 2610 _argvec[1] = (unsigned long)_orig.r2; \ 2611 _argvec[2] = (unsigned long)_orig.nraddr; \ 2612 _argvec[2+1] = (unsigned long)arg1; \ 2613 _argvec[2+2] = (unsigned long)arg2; \ 2614 _argvec[2+3] = (unsigned long)arg3; \ 2615 _argvec[2+4] = (unsigned long)arg4; \ 2618 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2619 "stw 2,-8(11)\n\t" \ 2620 "lwz 2,-4(11)\n\t" \ 2621 "lwz 3, 4(11)\n\t" \ 2622 "lwz 4, 8(11)\n\t" \ 2623 "lwz 5, 12(11)\n\t" \ 2624 "lwz 6, 16(11)\n\t" \ 2625 "lwz 11, 0(11)\n\t" \ 2626 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2629 "lwz 2,-8(11)\n\t" \ 2630 VG_CONTRACT_FRAME_BY(512) \ 2632 : "r" (&_argvec[2]) \ 2633 : "cc", "memory", __CALLER_SAVED_REGS \ 2635 lval = (__typeof__(lval)) _res; \ 2638 #define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \ 2640 volatile OrigFn _orig = (orig); \ 2641 volatile unsigned long _argvec[3+5]; \ 2642 volatile unsigned long _res; \ 2644 _argvec[1] = (unsigned long)_orig.r2; \ 2645 _argvec[2] = (unsigned long)_orig.nraddr; \ 2646 _argvec[2+1] = (unsigned long)arg1; \ 2647 _argvec[2+2] = (unsigned long)arg2; \ 2648 _argvec[2+3] = (unsigned long)arg3; \ 2649 _argvec[2+4] = (unsigned long)arg4; \ 2650 _argvec[2+5] = (unsigned long)arg5; \ 2653 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2654 "stw 2,-8(11)\n\t" \ 2655 "lwz 2,-4(11)\n\t" \ 2656 "lwz 3, 4(11)\n\t" \ 2657 "lwz 4, 8(11)\n\t" \ 2658 "lwz 5, 12(11)\n\t" \ 2659 "lwz 6, 16(11)\n\t" \ 2660 "lwz 7, 20(11)\n\t" \ 2661 "lwz 11, 0(11)\n\t" \ 2662 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2665 "lwz 2,-8(11)\n\t" \ 2666 VG_CONTRACT_FRAME_BY(512) \ 2668 : "r" (&_argvec[2]) \ 2669 : "cc", "memory", __CALLER_SAVED_REGS \ 2671 lval = (__typeof__(lval)) _res; \ 2674 #define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \ 2676 volatile OrigFn _orig = (orig); \ 2677 volatile unsigned long _argvec[3+6]; \ 2678 volatile unsigned long _res; \ 2680 _argvec[1] = (unsigned long)_orig.r2; \ 2681 _argvec[2] = (unsigned long)_orig.nraddr; \ 2682 _argvec[2+1] = (unsigned long)arg1; \ 2683 _argvec[2+2] = (unsigned long)arg2; \ 2684 _argvec[2+3] = (unsigned long)arg3; \ 2685 _argvec[2+4] = (unsigned long)arg4; \ 2686 _argvec[2+5] = (unsigned long)arg5; \ 2687 _argvec[2+6] = (unsigned long)arg6; \ 2690 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2691 "stw 2,-8(11)\n\t" \ 2692 "lwz 2,-4(11)\n\t" \ 2693 "lwz 3, 4(11)\n\t" \ 2694 "lwz 4, 8(11)\n\t" \ 2695 "lwz 5, 12(11)\n\t" \ 2696 "lwz 6, 16(11)\n\t" \ 2697 "lwz 7, 20(11)\n\t" \ 2698 "lwz 8, 24(11)\n\t" \ 2699 "lwz 11, 0(11)\n\t" \ 2700 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2703 "lwz 2,-8(11)\n\t" \ 2704 VG_CONTRACT_FRAME_BY(512) \ 2706 : "r" (&_argvec[2]) \ 2707 : "cc", "memory", __CALLER_SAVED_REGS \ 2709 lval = (__typeof__(lval)) _res; \ 2712 #define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2715 volatile OrigFn _orig = (orig); \ 2716 volatile unsigned long _argvec[3+7]; \ 2717 volatile unsigned long _res; \ 2719 _argvec[1] = (unsigned long)_orig.r2; \ 2720 _argvec[2] = (unsigned long)_orig.nraddr; \ 2721 _argvec[2+1] = (unsigned long)arg1; \ 2722 _argvec[2+2] = (unsigned long)arg2; \ 2723 _argvec[2+3] = (unsigned long)arg3; \ 2724 _argvec[2+4] = (unsigned long)arg4; \ 2725 _argvec[2+5] = (unsigned long)arg5; \ 2726 _argvec[2+6] = (unsigned long)arg6; \ 2727 _argvec[2+7] = (unsigned long)arg7; \ 2730 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2731 "stw 2,-8(11)\n\t" \ 2732 "lwz 2,-4(11)\n\t" \ 2733 "lwz 3, 4(11)\n\t" \ 2734 "lwz 4, 8(11)\n\t" \ 2735 "lwz 5, 12(11)\n\t" \ 2736 "lwz 6, 16(11)\n\t" \ 2737 "lwz 7, 20(11)\n\t" \ 2738 "lwz 8, 24(11)\n\t" \ 2739 "lwz 9, 28(11)\n\t" \ 2740 "lwz 11, 0(11)\n\t" \ 2741 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2744 "lwz 2,-8(11)\n\t" \ 2745 VG_CONTRACT_FRAME_BY(512) \ 2747 : "r" (&_argvec[2]) \ 2748 : "cc", "memory", __CALLER_SAVED_REGS \ 2750 lval = (__typeof__(lval)) _res; \ 2753 #define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2756 volatile OrigFn _orig = (orig); \ 2757 volatile unsigned long _argvec[3+8]; \ 2758 volatile unsigned long _res; \ 2760 _argvec[1] = (unsigned long)_orig.r2; \ 2761 _argvec[2] = (unsigned long)_orig.nraddr; \ 2762 _argvec[2+1] = (unsigned long)arg1; \ 2763 _argvec[2+2] = (unsigned long)arg2; \ 2764 _argvec[2+3] = (unsigned long)arg3; \ 2765 _argvec[2+4] = (unsigned long)arg4; \ 2766 _argvec[2+5] = (unsigned long)arg5; \ 2767 _argvec[2+6] = (unsigned long)arg6; \ 2768 _argvec[2+7] = (unsigned long)arg7; \ 2769 _argvec[2+8] = (unsigned long)arg8; \ 2772 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2773 "stw 2,-8(11)\n\t" \ 2774 "lwz 2,-4(11)\n\t" \ 2775 "lwz 3, 4(11)\n\t" \ 2776 "lwz 4, 8(11)\n\t" \ 2777 "lwz 5, 12(11)\n\t" \ 2778 "lwz 6, 16(11)\n\t" \ 2779 "lwz 7, 20(11)\n\t" \ 2780 "lwz 8, 24(11)\n\t" \ 2781 "lwz 9, 28(11)\n\t" \ 2782 "lwz 10, 32(11)\n\t" \ 2783 "lwz 11, 0(11)\n\t" \ 2784 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2787 "lwz 2,-8(11)\n\t" \ 2788 VG_CONTRACT_FRAME_BY(512) \ 2790 : "r" (&_argvec[2]) \ 2791 : "cc", "memory", __CALLER_SAVED_REGS \ 2793 lval = (__typeof__(lval)) _res; \ 2796 #define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2799 volatile OrigFn _orig = (orig); \ 2800 volatile unsigned long _argvec[3+9]; \ 2801 volatile unsigned long _res; \ 2803 _argvec[1] = (unsigned long)_orig.r2; \ 2804 _argvec[2] = (unsigned long)_orig.nraddr; \ 2805 _argvec[2+1] = (unsigned long)arg1; \ 2806 _argvec[2+2] = (unsigned long)arg2; \ 2807 _argvec[2+3] = (unsigned long)arg3; \ 2808 _argvec[2+4] = (unsigned long)arg4; \ 2809 _argvec[2+5] = (unsigned long)arg5; \ 2810 _argvec[2+6] = (unsigned long)arg6; \ 2811 _argvec[2+7] = (unsigned long)arg7; \ 2812 _argvec[2+8] = (unsigned long)arg8; \ 2813 _argvec[2+9] = (unsigned long)arg9; \ 2816 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2817 "stw 2,-8(11)\n\t" \ 2818 "lwz 2,-4(11)\n\t" \ 2819 VG_EXPAND_FRAME_BY_trashes_r3(64) \ 2821 "lwz 3,36(11)\n\t" \ 2824 "lwz 3, 4(11)\n\t" \ 2825 "lwz 4, 8(11)\n\t" \ 2826 "lwz 5, 12(11)\n\t" \ 2827 "lwz 6, 16(11)\n\t" \ 2828 "lwz 7, 20(11)\n\t" \ 2829 "lwz 8, 24(11)\n\t" \ 2830 "lwz 9, 28(11)\n\t" \ 2831 "lwz 10, 32(11)\n\t" \ 2832 "lwz 11, 0(11)\n\t" \ 2833 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2836 "lwz 2,-8(11)\n\t" \ 2837 VG_CONTRACT_FRAME_BY(64) \ 2838 VG_CONTRACT_FRAME_BY(512) \ 2840 : "r" (&_argvec[2]) \ 2841 : "cc", "memory", __CALLER_SAVED_REGS \ 2843 lval = (__typeof__(lval)) _res; \ 2846 #define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2847 arg7,arg8,arg9,arg10) \ 2849 volatile OrigFn _orig = (orig); \ 2850 volatile unsigned long _argvec[3+10]; \ 2851 volatile unsigned long _res; \ 2853 _argvec[1] = (unsigned long)_orig.r2; \ 2854 _argvec[2] = (unsigned long)_orig.nraddr; \ 2855 _argvec[2+1] = (unsigned long)arg1; \ 2856 _argvec[2+2] = (unsigned long)arg2; \ 2857 _argvec[2+3] = (unsigned long)arg3; \ 2858 _argvec[2+4] = (unsigned long)arg4; \ 2859 _argvec[2+5] = (unsigned long)arg5; \ 2860 _argvec[2+6] = (unsigned long)arg6; \ 2861 _argvec[2+7] = (unsigned long)arg7; \ 2862 _argvec[2+8] = (unsigned long)arg8; \ 2863 _argvec[2+9] = (unsigned long)arg9; \ 2864 _argvec[2+10] = (unsigned long)arg10; \ 2867 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2868 "stw 2,-8(11)\n\t" \ 2869 "lwz 2,-4(11)\n\t" \ 2870 VG_EXPAND_FRAME_BY_trashes_r3(64) \ 2872 "lwz 3,40(11)\n\t" \ 2875 "lwz 3,36(11)\n\t" \ 2878 "lwz 3, 4(11)\n\t" \ 2879 "lwz 4, 8(11)\n\t" \ 2880 "lwz 5, 12(11)\n\t" \ 2881 "lwz 6, 16(11)\n\t" \ 2882 "lwz 7, 20(11)\n\t" \ 2883 "lwz 8, 24(11)\n\t" \ 2884 "lwz 9, 28(11)\n\t" \ 2885 "lwz 10, 32(11)\n\t" \ 2886 "lwz 11, 0(11)\n\t" \ 2887 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2890 "lwz 2,-8(11)\n\t" \ 2891 VG_CONTRACT_FRAME_BY(64) \ 2892 VG_CONTRACT_FRAME_BY(512) \ 2894 : "r" (&_argvec[2]) \ 2895 : "cc", "memory", __CALLER_SAVED_REGS \ 2897 lval = (__typeof__(lval)) _res; \ 2900 #define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2901 arg7,arg8,arg9,arg10,arg11) \ 2903 volatile OrigFn _orig = (orig); \ 2904 volatile unsigned long _argvec[3+11]; \ 2905 volatile unsigned long _res; \ 2907 _argvec[1] = (unsigned long)_orig.r2; \ 2908 _argvec[2] = (unsigned long)_orig.nraddr; \ 2909 _argvec[2+1] = (unsigned long)arg1; \ 2910 _argvec[2+2] = (unsigned long)arg2; \ 2911 _argvec[2+3] = (unsigned long)arg3; \ 2912 _argvec[2+4] = (unsigned long)arg4; \ 2913 _argvec[2+5] = (unsigned long)arg5; \ 2914 _argvec[2+6] = (unsigned long)arg6; \ 2915 _argvec[2+7] = (unsigned long)arg7; \ 2916 _argvec[2+8] = (unsigned long)arg8; \ 2917 _argvec[2+9] = (unsigned long)arg9; \ 2918 _argvec[2+10] = (unsigned long)arg10; \ 2919 _argvec[2+11] = (unsigned long)arg11; \ 2922 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2923 "stw 2,-8(11)\n\t" \ 2924 "lwz 2,-4(11)\n\t" \ 2925 VG_EXPAND_FRAME_BY_trashes_r3(72) \ 2927 "lwz 3,44(11)\n\t" \ 2930 "lwz 3,40(11)\n\t" \ 2933 "lwz 3,36(11)\n\t" \ 2936 "lwz 3, 4(11)\n\t" \ 2937 "lwz 4, 8(11)\n\t" \ 2938 "lwz 5, 12(11)\n\t" \ 2939 "lwz 6, 16(11)\n\t" \ 2940 "lwz 7, 20(11)\n\t" \ 2941 "lwz 8, 24(11)\n\t" \ 2942 "lwz 9, 28(11)\n\t" \ 2943 "lwz 10, 32(11)\n\t" \ 2944 "lwz 11, 0(11)\n\t" \ 2945 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 2948 "lwz 2,-8(11)\n\t" \ 2949 VG_CONTRACT_FRAME_BY(72) \ 2950 VG_CONTRACT_FRAME_BY(512) \ 2952 : "r" (&_argvec[2]) \ 2953 : "cc", "memory", __CALLER_SAVED_REGS \ 2955 lval = (__typeof__(lval)) _res; \ 2958 #define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 2959 arg7,arg8,arg9,arg10,arg11,arg12) \ 2961 volatile OrigFn _orig = (orig); \ 2962 volatile unsigned long _argvec[3+12]; \ 2963 volatile unsigned long _res; \ 2965 _argvec[1] = (unsigned long)_orig.r2; \ 2966 _argvec[2] = (unsigned long)_orig.nraddr; \ 2967 _argvec[2+1] = (unsigned long)arg1; \ 2968 _argvec[2+2] = (unsigned long)arg2; \ 2969 _argvec[2+3] = (unsigned long)arg3; \ 2970 _argvec[2+4] = (unsigned long)arg4; \ 2971 _argvec[2+5] = (unsigned long)arg5; \ 2972 _argvec[2+6] = (unsigned long)arg6; \ 2973 _argvec[2+7] = (unsigned long)arg7; \ 2974 _argvec[2+8] = (unsigned long)arg8; \ 2975 _argvec[2+9] = (unsigned long)arg9; \ 2976 _argvec[2+10] = (unsigned long)arg10; \ 2977 _argvec[2+11] = (unsigned long)arg11; \ 2978 _argvec[2+12] = (unsigned long)arg12; \ 2981 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 2982 "stw 2,-8(11)\n\t" \ 2983 "lwz 2,-4(11)\n\t" \ 2984 VG_EXPAND_FRAME_BY_trashes_r3(72) \ 2986 "lwz 3,48(11)\n\t" \ 2989 "lwz 3,44(11)\n\t" \ 2992 "lwz 3,40(11)\n\t" \ 2995 "lwz 3,36(11)\n\t" \ 2998 "lwz 3, 4(11)\n\t" \ 2999 "lwz 4, 8(11)\n\t" \ 3000 "lwz 5, 12(11)\n\t" \ 3001 "lwz 6, 16(11)\n\t" \ 3002 "lwz 7, 20(11)\n\t" \ 3003 "lwz 8, 24(11)\n\t" \ 3004 "lwz 9, 28(11)\n\t" \ 3005 "lwz 10, 32(11)\n\t" \ 3006 "lwz 11, 0(11)\n\t" \ 3007 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3010 "lwz 2,-8(11)\n\t" \ 3011 VG_CONTRACT_FRAME_BY(72) \ 3012 VG_CONTRACT_FRAME_BY(512) \ 3014 : "r" (&_argvec[2]) \ 3015 : "cc", "memory", __CALLER_SAVED_REGS \ 3017 lval = (__typeof__(lval)) _res; \ 3024 #if defined(PLAT_ppc64_aix5) 3029 #define __CALLER_SAVED_REGS \ 3030 "lr", "ctr", "xer", \ 3031 "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \ 3032 "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \ 3038 #define VG_EXPAND_FRAME_BY_trashes_r3(_n_fr) \ 3039 "addi 1,1,-" #_n_fr "\n\t" \ 3040 "ld 3," #_n_fr "(1)\n\t" \ 3043 #define VG_CONTRACT_FRAME_BY(_n_fr) \ 3044 "addi 1,1," #_n_fr "\n\t" 3049 #define CALL_FN_W_v(lval, orig) \ 3051 volatile OrigFn _orig = (orig); \ 3052 volatile unsigned long _argvec[3+0]; \ 3053 volatile unsigned long _res; \ 3055 _argvec[1] = (unsigned long)_orig.r2; \ 3056 _argvec[2] = (unsigned long)_orig.nraddr; \ 3059 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3060 "std 2,-16(11)\n\t" \ 3062 "ld 11, 0(11)\n\t" \ 3063 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3066 "ld 2,-16(11)\n\t" \ 3067 VG_CONTRACT_FRAME_BY(512) \ 3069 : "r" (&_argvec[2]) \ 3070 : "cc", "memory", __CALLER_SAVED_REGS \ 3072 lval = (__typeof__(lval)) _res; \ 3075 #define CALL_FN_W_W(lval, orig, arg1) \ 3077 volatile OrigFn _orig = (orig); \ 3078 volatile unsigned long _argvec[3+1]; \ 3079 volatile unsigned long _res; \ 3081 _argvec[1] = (unsigned long)_orig.r2; \ 3082 _argvec[2] = (unsigned long)_orig.nraddr; \ 3083 _argvec[2+1] = (unsigned long)arg1; \ 3086 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3087 "std 2,-16(11)\n\t" \ 3090 "ld 11, 0(11)\n\t" \ 3091 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3094 "ld 2,-16(11)\n\t" \ 3095 VG_CONTRACT_FRAME_BY(512) \ 3097 : "r" (&_argvec[2]) \ 3098 : "cc", "memory", __CALLER_SAVED_REGS \ 3100 lval = (__typeof__(lval)) _res; \ 3103 #define CALL_FN_W_WW(lval, orig, arg1,arg2) \ 3105 volatile OrigFn _orig = (orig); \ 3106 volatile unsigned long _argvec[3+2]; \ 3107 volatile unsigned long _res; \ 3109 _argvec[1] = (unsigned long)_orig.r2; \ 3110 _argvec[2] = (unsigned long)_orig.nraddr; \ 3111 _argvec[2+1] = (unsigned long)arg1; \ 3112 _argvec[2+2] = (unsigned long)arg2; \ 3115 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3116 "std 2,-16(11)\n\t" \ 3119 "ld 4, 16(11)\n\t" \ 3120 "ld 11, 0(11)\n\t" \ 3121 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3124 "ld 2,-16(11)\n\t" \ 3125 VG_CONTRACT_FRAME_BY(512) \ 3127 : "r" (&_argvec[2]) \ 3128 : "cc", "memory", __CALLER_SAVED_REGS \ 3130 lval = (__typeof__(lval)) _res; \ 3133 #define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \ 3135 volatile OrigFn _orig = (orig); \ 3136 volatile unsigned long _argvec[3+3]; \ 3137 volatile unsigned long _res; \ 3139 _argvec[1] = (unsigned long)_orig.r2; \ 3140 _argvec[2] = (unsigned long)_orig.nraddr; \ 3141 _argvec[2+1] = (unsigned long)arg1; \ 3142 _argvec[2+2] = (unsigned long)arg2; \ 3143 _argvec[2+3] = (unsigned long)arg3; \ 3146 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3147 "std 2,-16(11)\n\t" \ 3150 "ld 4, 16(11)\n\t" \ 3151 "ld 5, 24(11)\n\t" \ 3152 "ld 11, 0(11)\n\t" \ 3153 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3156 "ld 2,-16(11)\n\t" \ 3157 VG_CONTRACT_FRAME_BY(512) \ 3159 : "r" (&_argvec[2]) \ 3160 : "cc", "memory", __CALLER_SAVED_REGS \ 3162 lval = (__typeof__(lval)) _res; \ 3165 #define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \ 3167 volatile OrigFn _orig = (orig); \ 3168 volatile unsigned long _argvec[3+4]; \ 3169 volatile unsigned long _res; \ 3171 _argvec[1] = (unsigned long)_orig.r2; \ 3172 _argvec[2] = (unsigned long)_orig.nraddr; \ 3173 _argvec[2+1] = (unsigned long)arg1; \ 3174 _argvec[2+2] = (unsigned long)arg2; \ 3175 _argvec[2+3] = (unsigned long)arg3; \ 3176 _argvec[2+4] = (unsigned long)arg4; \ 3179 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3180 "std 2,-16(11)\n\t" \ 3183 "ld 4, 16(11)\n\t" \ 3184 "ld 5, 24(11)\n\t" \ 3185 "ld 6, 32(11)\n\t" \ 3186 "ld 11, 0(11)\n\t" \ 3187 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3190 "ld 2,-16(11)\n\t" \ 3191 VG_CONTRACT_FRAME_BY(512) \ 3193 : "r" (&_argvec[2]) \ 3194 : "cc", "memory", __CALLER_SAVED_REGS \ 3196 lval = (__typeof__(lval)) _res; \ 3199 #define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \ 3201 volatile OrigFn _orig = (orig); \ 3202 volatile unsigned long _argvec[3+5]; \ 3203 volatile unsigned long _res; \ 3205 _argvec[1] = (unsigned long)_orig.r2; \ 3206 _argvec[2] = (unsigned long)_orig.nraddr; \ 3207 _argvec[2+1] = (unsigned long)arg1; \ 3208 _argvec[2+2] = (unsigned long)arg2; \ 3209 _argvec[2+3] = (unsigned long)arg3; \ 3210 _argvec[2+4] = (unsigned long)arg4; \ 3211 _argvec[2+5] = (unsigned long)arg5; \ 3214 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3215 "std 2,-16(11)\n\t" \ 3218 "ld 4, 16(11)\n\t" \ 3219 "ld 5, 24(11)\n\t" \ 3220 "ld 6, 32(11)\n\t" \ 3221 "ld 7, 40(11)\n\t" \ 3222 "ld 11, 0(11)\n\t" \ 3223 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3226 "ld 2,-16(11)\n\t" \ 3227 VG_CONTRACT_FRAME_BY(512) \ 3229 : "r" (&_argvec[2]) \ 3230 : "cc", "memory", __CALLER_SAVED_REGS \ 3232 lval = (__typeof__(lval)) _res; \ 3235 #define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \ 3237 volatile OrigFn _orig = (orig); \ 3238 volatile unsigned long _argvec[3+6]; \ 3239 volatile unsigned long _res; \ 3241 _argvec[1] = (unsigned long)_orig.r2; \ 3242 _argvec[2] = (unsigned long)_orig.nraddr; \ 3243 _argvec[2+1] = (unsigned long)arg1; \ 3244 _argvec[2+2] = (unsigned long)arg2; \ 3245 _argvec[2+3] = (unsigned long)arg3; \ 3246 _argvec[2+4] = (unsigned long)arg4; \ 3247 _argvec[2+5] = (unsigned long)arg5; \ 3248 _argvec[2+6] = (unsigned long)arg6; \ 3251 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3252 "std 2,-16(11)\n\t" \ 3255 "ld 4, 16(11)\n\t" \ 3256 "ld 5, 24(11)\n\t" \ 3257 "ld 6, 32(11)\n\t" \ 3258 "ld 7, 40(11)\n\t" \ 3259 "ld 8, 48(11)\n\t" \ 3260 "ld 11, 0(11)\n\t" \ 3261 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3264 "ld 2,-16(11)\n\t" \ 3265 VG_CONTRACT_FRAME_BY(512) \ 3267 : "r" (&_argvec[2]) \ 3268 : "cc", "memory", __CALLER_SAVED_REGS \ 3270 lval = (__typeof__(lval)) _res; \ 3273 #define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 3276 volatile OrigFn _orig = (orig); \ 3277 volatile unsigned long _argvec[3+7]; \ 3278 volatile unsigned long _res; \ 3280 _argvec[1] = (unsigned long)_orig.r2; \ 3281 _argvec[2] = (unsigned long)_orig.nraddr; \ 3282 _argvec[2+1] = (unsigned long)arg1; \ 3283 _argvec[2+2] = (unsigned long)arg2; \ 3284 _argvec[2+3] = (unsigned long)arg3; \ 3285 _argvec[2+4] = (unsigned long)arg4; \ 3286 _argvec[2+5] = (unsigned long)arg5; \ 3287 _argvec[2+6] = (unsigned long)arg6; \ 3288 _argvec[2+7] = (unsigned long)arg7; \ 3291 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3292 "std 2,-16(11)\n\t" \ 3295 "ld 4, 16(11)\n\t" \ 3296 "ld 5, 24(11)\n\t" \ 3297 "ld 6, 32(11)\n\t" \ 3298 "ld 7, 40(11)\n\t" \ 3299 "ld 8, 48(11)\n\t" \ 3300 "ld 9, 56(11)\n\t" \ 3301 "ld 11, 0(11)\n\t" \ 3302 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3305 "ld 2,-16(11)\n\t" \ 3306 VG_CONTRACT_FRAME_BY(512) \ 3308 : "r" (&_argvec[2]) \ 3309 : "cc", "memory", __CALLER_SAVED_REGS \ 3311 lval = (__typeof__(lval)) _res; \ 3314 #define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 3317 volatile OrigFn _orig = (orig); \ 3318 volatile unsigned long _argvec[3+8]; \ 3319 volatile unsigned long _res; \ 3321 _argvec[1] = (unsigned long)_orig.r2; \ 3322 _argvec[2] = (unsigned long)_orig.nraddr; \ 3323 _argvec[2+1] = (unsigned long)arg1; \ 3324 _argvec[2+2] = (unsigned long)arg2; \ 3325 _argvec[2+3] = (unsigned long)arg3; \ 3326 _argvec[2+4] = (unsigned long)arg4; \ 3327 _argvec[2+5] = (unsigned long)arg5; \ 3328 _argvec[2+6] = (unsigned long)arg6; \ 3329 _argvec[2+7] = (unsigned long)arg7; \ 3330 _argvec[2+8] = (unsigned long)arg8; \ 3333 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3334 "std 2,-16(11)\n\t" \ 3337 "ld 4, 16(11)\n\t" \ 3338 "ld 5, 24(11)\n\t" \ 3339 "ld 6, 32(11)\n\t" \ 3340 "ld 7, 40(11)\n\t" \ 3341 "ld 8, 48(11)\n\t" \ 3342 "ld 9, 56(11)\n\t" \ 3343 "ld 10, 64(11)\n\t" \ 3344 "ld 11, 0(11)\n\t" \ 3345 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3348 "ld 2,-16(11)\n\t" \ 3349 VG_CONTRACT_FRAME_BY(512) \ 3351 : "r" (&_argvec[2]) \ 3352 : "cc", "memory", __CALLER_SAVED_REGS \ 3354 lval = (__typeof__(lval)) _res; \ 3357 #define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 3360 volatile OrigFn _orig = (orig); \ 3361 volatile unsigned long _argvec[3+9]; \ 3362 volatile unsigned long _res; \ 3364 _argvec[1] = (unsigned long)_orig.r2; \ 3365 _argvec[2] = (unsigned long)_orig.nraddr; \ 3366 _argvec[2+1] = (unsigned long)arg1; \ 3367 _argvec[2+2] = (unsigned long)arg2; \ 3368 _argvec[2+3] = (unsigned long)arg3; \ 3369 _argvec[2+4] = (unsigned long)arg4; \ 3370 _argvec[2+5] = (unsigned long)arg5; \ 3371 _argvec[2+6] = (unsigned long)arg6; \ 3372 _argvec[2+7] = (unsigned long)arg7; \ 3373 _argvec[2+8] = (unsigned long)arg8; \ 3374 _argvec[2+9] = (unsigned long)arg9; \ 3377 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3378 "std 2,-16(11)\n\t" \ 3380 VG_EXPAND_FRAME_BY_trashes_r3(128) \ 3383 "std 3,112(1)\n\t" \ 3386 "ld 4, 16(11)\n\t" \ 3387 "ld 5, 24(11)\n\t" \ 3388 "ld 6, 32(11)\n\t" \ 3389 "ld 7, 40(11)\n\t" \ 3390 "ld 8, 48(11)\n\t" \ 3391 "ld 9, 56(11)\n\t" \ 3392 "ld 10, 64(11)\n\t" \ 3393 "ld 11, 0(11)\n\t" \ 3394 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3397 "ld 2,-16(11)\n\t" \ 3398 VG_CONTRACT_FRAME_BY(128) \ 3399 VG_CONTRACT_FRAME_BY(512) \ 3401 : "r" (&_argvec[2]) \ 3402 : "cc", "memory", __CALLER_SAVED_REGS \ 3404 lval = (__typeof__(lval)) _res; \ 3407 #define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 3408 arg7,arg8,arg9,arg10) \ 3410 volatile OrigFn _orig = (orig); \ 3411 volatile unsigned long _argvec[3+10]; \ 3412 volatile unsigned long _res; \ 3414 _argvec[1] = (unsigned long)_orig.r2; \ 3415 _argvec[2] = (unsigned long)_orig.nraddr; \ 3416 _argvec[2+1] = (unsigned long)arg1; \ 3417 _argvec[2+2] = (unsigned long)arg2; \ 3418 _argvec[2+3] = (unsigned long)arg3; \ 3419 _argvec[2+4] = (unsigned long)arg4; \ 3420 _argvec[2+5] = (unsigned long)arg5; \ 3421 _argvec[2+6] = (unsigned long)arg6; \ 3422 _argvec[2+7] = (unsigned long)arg7; \ 3423 _argvec[2+8] = (unsigned long)arg8; \ 3424 _argvec[2+9] = (unsigned long)arg9; \ 3425 _argvec[2+10] = (unsigned long)arg10; \ 3428 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3429 "std 2,-16(11)\n\t" \ 3431 VG_EXPAND_FRAME_BY_trashes_r3(128) \ 3434 "std 3,120(1)\n\t" \ 3437 "std 3,112(1)\n\t" \ 3440 "ld 4, 16(11)\n\t" \ 3441 "ld 5, 24(11)\n\t" \ 3442 "ld 6, 32(11)\n\t" \ 3443 "ld 7, 40(11)\n\t" \ 3444 "ld 8, 48(11)\n\t" \ 3445 "ld 9, 56(11)\n\t" \ 3446 "ld 10, 64(11)\n\t" \ 3447 "ld 11, 0(11)\n\t" \ 3448 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3451 "ld 2,-16(11)\n\t" \ 3452 VG_CONTRACT_FRAME_BY(128) \ 3453 VG_CONTRACT_FRAME_BY(512) \ 3455 : "r" (&_argvec[2]) \ 3456 : "cc", "memory", __CALLER_SAVED_REGS \ 3458 lval = (__typeof__(lval)) _res; \ 3461 #define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 3462 arg7,arg8,arg9,arg10,arg11) \ 3464 volatile OrigFn _orig = (orig); \ 3465 volatile unsigned long _argvec[3+11]; \ 3466 volatile unsigned long _res; \ 3468 _argvec[1] = (unsigned long)_orig.r2; \ 3469 _argvec[2] = (unsigned long)_orig.nraddr; \ 3470 _argvec[2+1] = (unsigned long)arg1; \ 3471 _argvec[2+2] = (unsigned long)arg2; \ 3472 _argvec[2+3] = (unsigned long)arg3; \ 3473 _argvec[2+4] = (unsigned long)arg4; \ 3474 _argvec[2+5] = (unsigned long)arg5; \ 3475 _argvec[2+6] = (unsigned long)arg6; \ 3476 _argvec[2+7] = (unsigned long)arg7; \ 3477 _argvec[2+8] = (unsigned long)arg8; \ 3478 _argvec[2+9] = (unsigned long)arg9; \ 3479 _argvec[2+10] = (unsigned long)arg10; \ 3480 _argvec[2+11] = (unsigned long)arg11; \ 3483 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3484 "std 2,-16(11)\n\t" \ 3486 VG_EXPAND_FRAME_BY_trashes_r3(144) \ 3489 "std 3,128(1)\n\t" \ 3492 "std 3,120(1)\n\t" \ 3495 "std 3,112(1)\n\t" \ 3498 "ld 4, 16(11)\n\t" \ 3499 "ld 5, 24(11)\n\t" \ 3500 "ld 6, 32(11)\n\t" \ 3501 "ld 7, 40(11)\n\t" \ 3502 "ld 8, 48(11)\n\t" \ 3503 "ld 9, 56(11)\n\t" \ 3504 "ld 10, 64(11)\n\t" \ 3505 "ld 11, 0(11)\n\t" \ 3506 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3509 "ld 2,-16(11)\n\t" \ 3510 VG_CONTRACT_FRAME_BY(144) \ 3511 VG_CONTRACT_FRAME_BY(512) \ 3513 : "r" (&_argvec[2]) \ 3514 : "cc", "memory", __CALLER_SAVED_REGS \ 3516 lval = (__typeof__(lval)) _res; \ 3519 #define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \ 3520 arg7,arg8,arg9,arg10,arg11,arg12) \ 3522 volatile OrigFn _orig = (orig); \ 3523 volatile unsigned long _argvec[3+12]; \ 3524 volatile unsigned long _res; \ 3526 _argvec[1] = (unsigned long)_orig.r2; \ 3527 _argvec[2] = (unsigned long)_orig.nraddr; \ 3528 _argvec[2+1] = (unsigned long)arg1; \ 3529 _argvec[2+2] = (unsigned long)arg2; \ 3530 _argvec[2+3] = (unsigned long)arg3; \ 3531 _argvec[2+4] = (unsigned long)arg4; \ 3532 _argvec[2+5] = (unsigned long)arg5; \ 3533 _argvec[2+6] = (unsigned long)arg6; \ 3534 _argvec[2+7] = (unsigned long)arg7; \ 3535 _argvec[2+8] = (unsigned long)arg8; \ 3536 _argvec[2+9] = (unsigned long)arg9; \ 3537 _argvec[2+10] = (unsigned long)arg10; \ 3538 _argvec[2+11] = (unsigned long)arg11; \ 3539 _argvec[2+12] = (unsigned long)arg12; \ 3542 VG_EXPAND_FRAME_BY_trashes_r3(512) \ 3543 "std 2,-16(11)\n\t" \ 3545 VG_EXPAND_FRAME_BY_trashes_r3(144) \ 3548 "std 3,136(1)\n\t" \ 3551 "std 3,128(1)\n\t" \ 3554 "std 3,120(1)\n\t" \ 3557 "std 3,112(1)\n\t" \ 3560 "ld 4, 16(11)\n\t" \ 3561 "ld 5, 24(11)\n\t" \ 3562 "ld 6, 32(11)\n\t" \ 3563 "ld 7, 40(11)\n\t" \ 3564 "ld 8, 48(11)\n\t" \ 3565 "ld 9, 56(11)\n\t" \ 3566 "ld 10, 64(11)\n\t" \ 3567 "ld 11, 0(11)\n\t" \ 3568 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ 3571 "ld 2,-16(11)\n\t" \ 3572 VG_CONTRACT_FRAME_BY(144) \ 3573 VG_CONTRACT_FRAME_BY(512) \ 3575 : "r" (&_argvec[2]) \ 3576 : "cc", "memory", __CALLER_SAVED_REGS \ 3578 lval = (__typeof__(lval)) _res; \ 3599 #define VG_USERREQ_TOOL_BASE(a,b) \ 3600 ((unsigned int)(((a)&0xff) << 24 | ((b)&0xff) << 16)) 3601 #define VG_IS_TOOL_USERREQ(a, b, v) \ 3602 (VG_USERREQ_TOOL_BASE(a,b) == ((v) & 0xffff0000)) 3654 #if !defined(__GNUC__) 3655 # define __extension__ 3662 #define RUNNING_ON_VALGRIND __extension__ \ 3663 ({unsigned int _qzz_res; \ 3664 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 , \ 3665 VG_USERREQ__RUNNING_ON_VALGRIND, \ 3675 #define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len) \ 3676 {unsigned int _qzz_res; \ 3677 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3678 VG_USERREQ__DISCARD_TRANSLATIONS, \ 3679 _qzz_addr, _qzz_len, 0, 0, 0); \ 3688 #if defined(NVALGRIND) 3690 # define VALGRIND_PRINTF(...) 3691 # define VALGRIND_PRINTF_BACKTRACE(...) 3698 __attribute__((format(__printf__, 1, 2), __unused__));
3702 unsigned long _qzz_res;
3704 va_start(vargs, format);
3706 (
unsigned long)format, (
unsigned long)vargs,
3709 return (
int)_qzz_res;
3713 __attribute__((
format(__printf__, 1, 2), __unused__));
3717 unsigned long _qzz_res;
3719 va_start(vargs, format);
3721 (
unsigned long)format, (
unsigned long)vargs,
3724 return (
int)_qzz_res;
3753 #define VALGRIND_NON_SIMD_CALL0(_qyy_fn) \ 3755 ({unsigned long _qyy_res; \ 3756 VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 , \ 3757 VG_USERREQ__CLIENT_CALL0, \ 3763 #define VALGRIND_NON_SIMD_CALL1(_qyy_fn, _qyy_arg1) \ 3765 ({unsigned long _qyy_res; \ 3766 VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 , \ 3767 VG_USERREQ__CLIENT_CALL1, \ 3769 _qyy_arg1, 0, 0, 0); \ 3773 #define VALGRIND_NON_SIMD_CALL2(_qyy_fn, _qyy_arg1, _qyy_arg2) \ 3775 ({unsigned long _qyy_res; \ 3776 VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 , \ 3777 VG_USERREQ__CLIENT_CALL2, \ 3779 _qyy_arg1, _qyy_arg2, 0, 0); \ 3783 #define VALGRIND_NON_SIMD_CALL3(_qyy_fn, _qyy_arg1, _qyy_arg2, _qyy_arg3) \ 3785 ({unsigned long _qyy_res; \ 3786 VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 , \ 3787 VG_USERREQ__CLIENT_CALL3, \ 3789 _qyy_arg1, _qyy_arg2, \ 3798 #define VALGRIND_COUNT_ERRORS \ 3800 ({unsigned int _qyy_res; \ 3801 VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 , \ 3802 VG_USERREQ__COUNT_ERRORS, \ 3894 #define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed) \ 3895 {unsigned int _qzz_res; \ 3896 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3897 VG_USERREQ__MALLOCLIKE_BLOCK, \ 3898 addr, sizeB, rzB, is_zeroed, 0); \ 3905 #define VALGRIND_FREELIKE_BLOCK(addr, rzB) \ 3906 {unsigned int _qzz_res; \ 3907 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3908 VG_USERREQ__FREELIKE_BLOCK, \ 3909 addr, rzB, 0, 0, 0); \ 3914 #define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed) \ 3915 {unsigned int _qzz_res; \ 3916 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3917 VG_USERREQ__CREATE_MEMPOOL, \ 3918 pool, rzB, is_zeroed, 0, 0); \ 3922 #define VALGRIND_DESTROY_MEMPOOL(pool) \ 3923 {unsigned int _qzz_res; \ 3924 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3925 VG_USERREQ__DESTROY_MEMPOOL, \ 3926 pool, 0, 0, 0, 0); \ 3930 #define VALGRIND_MEMPOOL_ALLOC(pool, addr, size) \ 3931 {unsigned int _qzz_res; \ 3932 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3933 VG_USERREQ__MEMPOOL_ALLOC, \ 3934 pool, addr, size, 0, 0); \ 3938 #define VALGRIND_MEMPOOL_FREE(pool, addr) \ 3939 {unsigned int _qzz_res; \ 3940 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3941 VG_USERREQ__MEMPOOL_FREE, \ 3942 pool, addr, 0, 0, 0); \ 3946 #define VALGRIND_MEMPOOL_TRIM(pool, addr, size) \ 3947 {unsigned int _qzz_res; \ 3948 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3949 VG_USERREQ__MEMPOOL_TRIM, \ 3950 pool, addr, size, 0, 0); \ 3954 #define VALGRIND_MOVE_MEMPOOL(poolA, poolB) \ 3955 {unsigned int _qzz_res; \ 3956 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3957 VG_USERREQ__MOVE_MEMPOOL, \ 3958 poolA, poolB, 0, 0, 0); \ 3962 #define VALGRIND_MEMPOOL_CHANGE(pool, addrA, addrB, size) \ 3963 {unsigned int _qzz_res; \ 3964 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3965 VG_USERREQ__MEMPOOL_CHANGE, \ 3966 pool, addrA, addrB, size, 0); \ 3970 #define VALGRIND_MEMPOOL_EXISTS(pool) \ 3972 ({unsigned int _qzz_res; \ 3973 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3974 VG_USERREQ__MEMPOOL_EXISTS, \ 3975 pool, 0, 0, 0, 0); \ 3980 #define VALGRIND_STACK_REGISTER(start, end) \ 3982 ({unsigned int _qzz_res; \ 3983 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3984 VG_USERREQ__STACK_REGISTER, \ 3985 start, end, 0, 0, 0); \ 3991 #define VALGRIND_STACK_DEREGISTER(id) \ 3992 {unsigned int _qzz_res; \ 3993 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 3994 VG_USERREQ__STACK_DEREGISTER, \ 3999 #define VALGRIND_STACK_CHANGE(id, start, end) \ 4000 {unsigned int _qzz_res; \ 4001 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 4002 VG_USERREQ__STACK_CHANGE, \ 4003 id, start, end, 0, 0); \ 4007 #define VALGRIND_LOAD_PDB_DEBUGINFO(fd, ptr, total_size, delta) \ 4008 {unsigned int _qzz_res; \ 4009 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ 4010 VG_USERREQ__LOAD_PDB_DEBUGINFO, \ 4011 fd, ptr, total_size, delta, 0); \ 4015 #undef PLAT_x86_linux 4016 #undef PLAT_amd64_linux 4017 #undef PLAT_ppc32_linux 4018 #undef PLAT_ppc64_linux 4019 #undef PLAT_ppc32_aix5 4020 #undef PLAT_ppc64_aix5
static int VALGRIND_PRINTF_BACKTRACE(const char *format,...)
static int VALGRIND_PRINTF(const char *format,...)
unsigned long long int nraddr
#define VALGRIND_DO_CLIENT_REQUEST(_zzq_rlval, _zzq_default, _zzq_request,_zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)