93#define __VALGRIND_MAJOR__ 3
94#define __VALGRIND_MINOR__ 9
113#undef PLAT_x86_darwin
114#undef PLAT_amd64_darwin
116#undef PLAT_amd64_win64
118#undef PLAT_amd64_linux
119#undef PLAT_ppc32_linux
120#undef PLAT_ppc64_linux
122#undef PLAT_arm64_linux
123#undef PLAT_s390x_linux
124#undef PLAT_mips32_linux
125#undef PLAT_mips64_linux
128#if defined(__APPLE__) && defined(__i386__)
129# define PLAT_x86_darwin 1
130#elif defined(__APPLE__) && defined(__x86_64__)
131# define PLAT_amd64_darwin 1
132#elif defined(__MINGW32__) || defined(__CYGWIN32__) \
133 || (defined(_WIN32) && defined(_M_IX86))
134# define PLAT_x86_win32 1
135#elif defined(__MINGW64__) || (defined(_WIN64) && defined(_M_X64))
136# define PLAT_amd64_win64 1
137#elif defined(__linux__) && defined(__i386__)
138# define PLAT_x86_linux 1
139#elif defined(__linux__) && defined(__x86_64__)
140# define PLAT_amd64_linux 1
141#elif defined(__linux__) && defined(__powerpc__) && !defined(__powerpc64__)
142# define PLAT_ppc32_linux 1
143#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__)
144# define PLAT_ppc64_linux 1
145#elif defined(__linux__) && defined(__arm__) && !defined(__aarch64__)
146# define PLAT_arm_linux 1
147#elif defined(__linux__) && defined(__aarch64__) && !defined(__arm__)
148# define PLAT_arm64_linux 1
149#elif defined(__linux__) && defined(__s390__) && defined(__s390x__)
150# define PLAT_s390x_linux 1
151#elif defined(__linux__) && defined(__mips__) && (__mips==64)
152# define PLAT_mips64_linux 1
153#elif defined(__linux__) && defined(__mips__) && (__mips!=64)
154# define PLAT_mips32_linux 1
158# if !defined(NVALGRIND)
182#define VALGRIND_DO_CLIENT_REQUEST(_zzq_rlval, _zzq_default, \
183 _zzq_request, _zzq_arg1, _zzq_arg2, \
184 _zzq_arg3, _zzq_arg4, _zzq_arg5) \
185 do { (_zzq_rlval) = VALGRIND_DO_CLIENT_REQUEST_EXPR((_zzq_default), \
186 (_zzq_request), (_zzq_arg1), (_zzq_arg2), \
187 (_zzq_arg3), (_zzq_arg4), (_zzq_arg5)); } while (0)
189#define VALGRIND_DO_CLIENT_REQUEST_STMT(_zzq_request, _zzq_arg1, \
190 _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
191 do { (void) VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
192 (_zzq_request), (_zzq_arg1), (_zzq_arg2), \
193 (_zzq_arg3), (_zzq_arg4), (_zzq_arg5)); } while (0)
195#if defined(NVALGRIND)
200#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
201 _zzq_default, _zzq_request, \
202 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
244#if defined(PLAT_x86_linux) || defined(PLAT_x86_darwin) \
245 || (defined(PLAT_x86_win32) && defined(__GNUC__))
253#define __SPECIAL_INSTRUCTION_PREAMBLE \
254 "roll $3, %%edi ; roll $13, %%edi\n\t" \
255 "roll $29, %%edi ; roll $19, %%edi\n\t"
257#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
258 _zzq_default, _zzq_request, \
259 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
261 ({volatile unsigned int _zzq_args[6]; \
262 volatile unsigned int _zzq_result; \
263 _zzq_args[0] = (unsigned int)(_zzq_request); \
264 _zzq_args[1] = (unsigned int)(_zzq_arg1); \
265 _zzq_args[2] = (unsigned int)(_zzq_arg2); \
266 _zzq_args[3] = (unsigned int)(_zzq_arg3); \
267 _zzq_args[4] = (unsigned int)(_zzq_arg4); \
268 _zzq_args[5] = (unsigned int)(_zzq_arg5); \
269 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
271 "xchgl %%ebx,%%ebx" \
272 : "=d" (_zzq_result) \
273 : "a" (&_zzq_args[0]), "0" (_zzq_default) \
279#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
280 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
281 volatile unsigned int __addr; \
282 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
284 "xchgl %%ecx,%%ecx" \
289 _zzq_orig->nraddr = __addr; \
292#define VALGRIND_CALL_NOREDIR_EAX \
293 __SPECIAL_INSTRUCTION_PREAMBLE \
295 "xchgl %%edx,%%edx\n\t"
297#define VALGRIND_VEX_INJECT_IR() \
299 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
300 "xchgl %%edi,%%edi\n\t" \
301 : : : "cc", "memory" \
309#if defined(PLAT_x86_win32) && !defined(__GNUC__)
319#define __SPECIAL_INSTRUCTION_PREAMBLE \
320 __asm rol edi, 3 __asm rol edi, 13 \
321 __asm rol edi, 29 __asm rol edi, 19
323#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
324 _zzq_default, _zzq_request, \
325 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
326 valgrind_do_client_request_expr((uintptr_t)(_zzq_default), \
327 (uintptr_t)(_zzq_request), (uintptr_t)(_zzq_arg1), \
328 (uintptr_t)(_zzq_arg2), (uintptr_t)(_zzq_arg3), \
329 (uintptr_t)(_zzq_arg4), (uintptr_t)(_zzq_arg5))
331static __inline uintptr_t
332valgrind_do_client_request_expr(uintptr_t _zzq_default, uintptr_t _zzq_request,
333 uintptr_t _zzq_arg1, uintptr_t _zzq_arg2,
334 uintptr_t _zzq_arg3, uintptr_t _zzq_arg4,
337 volatile uintptr_t _zzq_args[6];
338 volatile unsigned int _zzq_result;
339 _zzq_args[0] = (uintptr_t)(_zzq_request);
340 _zzq_args[1] = (uintptr_t)(_zzq_arg1);
341 _zzq_args[2] = (uintptr_t)(_zzq_arg2);
342 _zzq_args[3] = (uintptr_t)(_zzq_arg3);
343 _zzq_args[4] = (uintptr_t)(_zzq_arg4);
344 _zzq_args[5] = (uintptr_t)(_zzq_arg5);
345 __asm { __asm lea eax, _zzq_args __asm mov edx, _zzq_default
346 __SPECIAL_INSTRUCTION_PREAMBLE
349 __asm mov _zzq_result, edx
354#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
355 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
356 volatile unsigned int __addr; \
357 __asm { __SPECIAL_INSTRUCTION_PREAMBLE \
360 __asm mov __addr, eax \
362 _zzq_orig->nraddr = __addr; \
365#define VALGRIND_CALL_NOREDIR_EAX ERROR
367#define VALGRIND_VEX_INJECT_IR() \
369 __asm { __SPECIAL_INSTRUCTION_PREAMBLE \
375#error Unsupported compiler.
382#if defined(PLAT_amd64_linux) || defined(PLAT_amd64_darwin)
386 unsigned long long int nraddr;
390#define __SPECIAL_INSTRUCTION_PREAMBLE \
391 "rolq $3, %%rdi ; rolq $13, %%rdi\n\t" \
392 "rolq $61, %%rdi ; rolq $51, %%rdi\n\t"
394#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
395 _zzq_default, _zzq_request, \
396 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
398 ({ volatile unsigned long long int _zzq_args[6]; \
399 volatile unsigned long long int _zzq_result; \
400 _zzq_args[0] = (unsigned long long int)(_zzq_request); \
401 _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \
402 _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \
403 _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \
404 _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \
405 _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \
406 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
408 "xchgq %%rbx,%%rbx" \
409 : "=d" (_zzq_result) \
410 : "a" (&_zzq_args[0]), "0" (_zzq_default) \
416#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
417 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
418 volatile unsigned long long int __addr; \
419 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
421 "xchgq %%rcx,%%rcx" \
426 _zzq_orig->nraddr = __addr; \
429#define VALGRIND_CALL_NOREDIR_RAX \
430 __SPECIAL_INSTRUCTION_PREAMBLE \
432 "xchgq %%rdx,%%rdx\n\t"
434#define VALGRIND_VEX_INJECT_IR() \
436 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
437 "xchgq %%rdi,%%rdi\n\t" \
438 : : : "cc", "memory" \
446#if defined(PLAT_ppc32_linux)
454#define __SPECIAL_INSTRUCTION_PREAMBLE \
455 "rlwinm 0,0,3,0,31 ; rlwinm 0,0,13,0,31\n\t" \
456 "rlwinm 0,0,29,0,31 ; rlwinm 0,0,19,0,31\n\t"
458#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
459 _zzq_default, _zzq_request, \
460 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
463 ({ unsigned int _zzq_args[6]; \
464 unsigned int _zzq_result; \
465 unsigned int* _zzq_ptr; \
466 _zzq_args[0] = (unsigned int)(_zzq_request); \
467 _zzq_args[1] = (unsigned int)(_zzq_arg1); \
468 _zzq_args[2] = (unsigned int)(_zzq_arg2); \
469 _zzq_args[3] = (unsigned int)(_zzq_arg3); \
470 _zzq_args[4] = (unsigned int)(_zzq_arg4); \
471 _zzq_args[5] = (unsigned int)(_zzq_arg5); \
472 _zzq_ptr = _zzq_args; \
473 __asm__ volatile("mr 3,%1\n\t" \
475 __SPECIAL_INSTRUCTION_PREAMBLE \
479 : "=b" (_zzq_result) \
480 : "b" (_zzq_default), "b" (_zzq_ptr) \
481 : "cc", "memory", "r3", "r4"); \
485#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
486 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
487 unsigned int __addr; \
488 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
494 : "cc", "memory", "r3" \
496 _zzq_orig->nraddr = __addr; \
499#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
500 __SPECIAL_INSTRUCTION_PREAMBLE \
504#define VALGRIND_VEX_INJECT_IR() \
506 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
515#if defined(PLAT_ppc64_linux)
519 unsigned long long int nraddr;
520 unsigned long long int r2;
524#define __SPECIAL_INSTRUCTION_PREAMBLE \
525 "rotldi 0,0,3 ; rotldi 0,0,13\n\t" \
526 "rotldi 0,0,61 ; rotldi 0,0,51\n\t"
528#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
529 _zzq_default, _zzq_request, \
530 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
533 ({ unsigned long long int _zzq_args[6]; \
534 unsigned long long int _zzq_result; \
535 unsigned long long int* _zzq_ptr; \
536 _zzq_args[0] = (unsigned long long int)(_zzq_request); \
537 _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \
538 _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \
539 _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \
540 _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \
541 _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \
542 _zzq_ptr = _zzq_args; \
543 __asm__ volatile("mr 3,%1\n\t" \
545 __SPECIAL_INSTRUCTION_PREAMBLE \
549 : "=b" (_zzq_result) \
550 : "b" (_zzq_default), "b" (_zzq_ptr) \
551 : "cc", "memory", "r3", "r4"); \
555#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
556 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
557 unsigned long long int __addr; \
558 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
564 : "cc", "memory", "r3" \
566 _zzq_orig->nraddr = __addr; \
567 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
573 : "cc", "memory", "r3" \
575 _zzq_orig->r2 = __addr; \
578#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
579 __SPECIAL_INSTRUCTION_PREAMBLE \
583#define VALGRIND_VEX_INJECT_IR() \
585 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
594#if defined(PLAT_arm_linux)
602#define __SPECIAL_INSTRUCTION_PREAMBLE \
603 "mov r12, r12, ror #3 ; mov r12, r12, ror #13 \n\t" \
604 "mov r12, r12, ror #29 ; mov r12, r12, ror #19 \n\t"
606#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
607 _zzq_default, _zzq_request, \
608 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
611 ({volatile unsigned int _zzq_args[6]; \
612 volatile unsigned int _zzq_result; \
613 _zzq_args[0] = (unsigned int)(_zzq_request); \
614 _zzq_args[1] = (unsigned int)(_zzq_arg1); \
615 _zzq_args[2] = (unsigned int)(_zzq_arg2); \
616 _zzq_args[3] = (unsigned int)(_zzq_arg3); \
617 _zzq_args[4] = (unsigned int)(_zzq_arg4); \
618 _zzq_args[5] = (unsigned int)(_zzq_arg5); \
619 __asm__ volatile("mov r3, %1\n\t" \
621 __SPECIAL_INSTRUCTION_PREAMBLE \
623 "orr r10, r10, r10\n\t" \
625 : "=r" (_zzq_result) \
626 : "r" (_zzq_default), "r" (&_zzq_args[0]) \
627 : "cc","memory", "r3", "r4"); \
631#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
632 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
633 unsigned int __addr; \
634 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
636 "orr r11, r11, r11\n\t" \
640 : "cc", "memory", "r3" \
642 _zzq_orig->nraddr = __addr; \
645#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
646 __SPECIAL_INSTRUCTION_PREAMBLE \
648 "orr r12, r12, r12\n\t"
650#define VALGRIND_VEX_INJECT_IR() \
652 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
653 "orr r9, r9, r9\n\t" \
654 : : : "cc", "memory" \
662#if defined(PLAT_arm64_linux)
666 unsigned long long int nraddr;
670#define __SPECIAL_INSTRUCTION_PREAMBLE \
671 "ror x12, x12, #3 ; ror x12, x12, #13 \n\t" \
672 "ror x12, x12, #51 ; ror x12, x12, #61 \n\t"
674#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
675 _zzq_default, _zzq_request, \
676 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
679 ({volatile unsigned long long int _zzq_args[6]; \
680 volatile unsigned long long int _zzq_result; \
681 _zzq_args[0] = (unsigned long long int)(_zzq_request); \
682 _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \
683 _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \
684 _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \
685 _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \
686 _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \
687 __asm__ volatile("mov x3, %1\n\t" \
689 __SPECIAL_INSTRUCTION_PREAMBLE \
691 "orr x10, x10, x10\n\t" \
693 : "=r" (_zzq_result) \
694 : "r" (_zzq_default), "r" (&_zzq_args[0]) \
695 : "cc","memory", "x3", "x4"); \
699#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
700 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
701 unsigned long long int __addr; \
702 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
704 "orr x11, x11, x11\n\t" \
708 : "cc", "memory", "x3" \
710 _zzq_orig->nraddr = __addr; \
713#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8 \
714 __SPECIAL_INSTRUCTION_PREAMBLE \
716 "orr x12, x12, x12\n\t"
718#define VALGRIND_VEX_INJECT_IR() \
720 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
721 "orr x9, x9, x9\n\t" \
722 : : : "cc", "memory" \
730#if defined(PLAT_s390x_linux)
734 unsigned long long int nraddr;
742#define __SPECIAL_INSTRUCTION_PREAMBLE \
748#define __CLIENT_REQUEST_CODE "lr 2,2\n\t"
749#define __GET_NR_CONTEXT_CODE "lr 3,3\n\t"
750#define __CALL_NO_REDIR_CODE "lr 4,4\n\t"
751#define __VEX_INJECT_IR_CODE "lr 5,5\n\t"
753#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
754 _zzq_default, _zzq_request, \
755 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
757 ({volatile unsigned long long int _zzq_args[6]; \
758 volatile unsigned long long int _zzq_result; \
759 _zzq_args[0] = (unsigned long long int)(_zzq_request); \
760 _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \
761 _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \
762 _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \
763 _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \
764 _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \
769 __SPECIAL_INSTRUCTION_PREAMBLE \
770 __CLIENT_REQUEST_CODE \
773 : "=d" (_zzq_result) \
774 : "a" (&_zzq_args[0]), "0" (_zzq_default) \
775 : "cc", "2", "3", "memory" \
780#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
781 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
782 volatile unsigned long long int __addr; \
783 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
784 __GET_NR_CONTEXT_CODE \
788 : "cc", "3", "memory" \
790 _zzq_orig->nraddr = __addr; \
793#define VALGRIND_CALL_NOREDIR_R1 \
794 __SPECIAL_INSTRUCTION_PREAMBLE \
797#define VALGRIND_VEX_INJECT_IR() \
799 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
800 __VEX_INJECT_IR_CODE); \
807#if defined(PLAT_mips32_linux)
819#define __SPECIAL_INSTRUCTION_PREAMBLE \
820 "srl $0, $0, 13\n\t" \
821 "srl $0, $0, 29\n\t" \
822 "srl $0, $0, 3\n\t" \
825#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
826 _zzq_default, _zzq_request, \
827 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
829 ({ volatile unsigned int _zzq_args[6]; \
830 volatile unsigned int _zzq_result; \
831 _zzq_args[0] = (unsigned int)(_zzq_request); \
832 _zzq_args[1] = (unsigned int)(_zzq_arg1); \
833 _zzq_args[2] = (unsigned int)(_zzq_arg2); \
834 _zzq_args[3] = (unsigned int)(_zzq_arg3); \
835 _zzq_args[4] = (unsigned int)(_zzq_arg4); \
836 _zzq_args[5] = (unsigned int)(_zzq_arg5); \
837 __asm__ volatile("move $11, %1\n\t" \
839 __SPECIAL_INSTRUCTION_PREAMBLE \
841 "or $13, $13, $13\n\t" \
843 : "=r" (_zzq_result) \
844 : "r" (_zzq_default), "r" (&_zzq_args[0]) \
849#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
850 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
851 volatile unsigned int __addr; \
852 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
854 "or $14, $14, $14\n\t" \
860 _zzq_orig->nraddr = __addr; \
863#define VALGRIND_CALL_NOREDIR_T9 \
864 __SPECIAL_INSTRUCTION_PREAMBLE \
866 "or $15, $15, $15\n\t"
868#define VALGRIND_VEX_INJECT_IR() \
870 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
871 "or $11, $11, $11\n\t" \
880#if defined(PLAT_mips64_linux)
884 unsigned long long nraddr;
892#define __SPECIAL_INSTRUCTION_PREAMBLE \
893 "dsll $0,$0, 3 ; dsll $0,$0,13\n\t" \
894 "dsll $0,$0,29 ; dsll $0,$0,19\n\t"
896#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
897 _zzq_default, _zzq_request, \
898 _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
900 ({ volatile unsigned long long int _zzq_args[6]; \
901 volatile unsigned long long int _zzq_result; \
902 _zzq_args[0] = (unsigned long long int)(_zzq_request); \
903 _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \
904 _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \
905 _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \
906 _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \
907 _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \
908 __asm__ volatile("move $11, %1\n\t" \
910 __SPECIAL_INSTRUCTION_PREAMBLE \
912 "or $13, $13, $13\n\t" \
914 : "=r" (_zzq_result) \
915 : "r" (_zzq_default), "r" (&_zzq_args[0]) \
920#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
921 { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
922 volatile unsigned long long int __addr; \
923 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
925 "or $14, $14, $14\n\t" \
930 _zzq_orig->nraddr = __addr; \
933#define VALGRIND_CALL_NOREDIR_T9 \
934 __SPECIAL_INSTRUCTION_PREAMBLE \
936 "or $15, $15, $15\n\t"
938#define VALGRIND_VEX_INJECT_IR() \
940 __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
941 "or $11, $11, $11\n\t" \
983#define VG_CONCAT4(_aa,_bb,_cc,_dd) _aa##_bb##_cc##_dd
985#define I_WRAP_SONAME_FNNAME_ZU(soname,fnname) \
986 VG_CONCAT4(_vgw00000ZU_,soname,_,fnname)
988#define I_WRAP_SONAME_FNNAME_ZZ(soname,fnname) \
989 VG_CONCAT4(_vgw00000ZZ_,soname,_,fnname)
995#define VALGRIND_GET_ORIG_FN(_lval) VALGRIND_GET_NR_CONTEXT(_lval)
1003#define I_REPLACE_SONAME_FNNAME_ZU(soname,fnname) \
1004 VG_CONCAT4(_vgr00000ZU_,soname,_,fnname)
1006#define I_REPLACE_SONAME_FNNAME_ZZ(soname,fnname) \
1007 VG_CONCAT4(_vgr00000ZZ_,soname,_,fnname)
1012#define CALL_FN_v_v(fnptr) \
1013 do { volatile unsigned long _junk; \
1014 CALL_FN_W_v(_junk,fnptr); } while (0)
1016#define CALL_FN_v_W(fnptr, arg1) \
1017 do { volatile unsigned long _junk; \
1018 CALL_FN_W_W(_junk,fnptr,arg1); } while (0)
1020#define CALL_FN_v_WW(fnptr, arg1,arg2) \
1021 do { volatile unsigned long _junk; \
1022 CALL_FN_W_WW(_junk,fnptr,arg1,arg2); } while (0)
1024#define CALL_FN_v_WWW(fnptr, arg1,arg2,arg3) \
1025 do { volatile unsigned long _junk; \
1026 CALL_FN_W_WWW(_junk,fnptr,arg1,arg2,arg3); } while (0)
1028#define CALL_FN_v_WWWW(fnptr, arg1,arg2,arg3,arg4) \
1029 do { volatile unsigned long _junk; \
1030 CALL_FN_W_WWWW(_junk,fnptr,arg1,arg2,arg3,arg4); } while (0)
1032#define CALL_FN_v_5W(fnptr, arg1,arg2,arg3,arg4,arg5) \
1033 do { volatile unsigned long _junk; \
1034 CALL_FN_W_5W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5); } while (0)
1036#define CALL_FN_v_6W(fnptr, arg1,arg2,arg3,arg4,arg5,arg6) \
1037 do { volatile unsigned long _junk; \
1038 CALL_FN_W_6W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5,arg6); } while (0)
1040#define CALL_FN_v_7W(fnptr, arg1,arg2,arg3,arg4,arg5,arg6,arg7) \
1041 do { volatile unsigned long _junk; \
1042 CALL_FN_W_7W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5,arg6,arg7); } while (0)
1046#if defined(PLAT_x86_linux) || defined(PLAT_x86_darwin)
1050#define __CALLER_SAVED_REGS "ecx", "edx"
1057#define VALGRIND_ALIGN_STACK \
1058 "movl %%esp,%%edi\n\t" \
1059 "andl $0xfffffff0,%%esp\n\t"
1060#define VALGRIND_RESTORE_STACK \
1061 "movl %%edi,%%esp\n\t"
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 VALGRIND_ALIGN_STACK \
1074 "movl (%%eax), %%eax\n\t" \
1075 VALGRIND_CALL_NOREDIR_EAX \
1076 VALGRIND_RESTORE_STACK \
1078 :
"a" (&_argvec[0]) \
1079 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
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 VALGRIND_ALIGN_STACK \
1093 "subl $12, %%esp\n\t" \
1094 "pushl 4(%%eax)\n\t" \
1095 "movl (%%eax), %%eax\n\t"
\
1096 VALGRIND_CALL_NOREDIR_EAX \
1097 VALGRIND_RESTORE_STACK \
1099 :
"a" (&_argvec[0]) \
1100 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1102 lval = (__typeof__(lval)) _res; \
1105#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
1107 volatile OrigFn _orig = (orig); \
1108 volatile unsigned long _argvec[3]; \
1109 volatile unsigned long _res; \
1110 _argvec[0] = (unsigned long)_orig.nraddr; \
1111 _argvec[1] = (unsigned long)(arg1); \
1112 _argvec[2] = (unsigned long)(arg2); \
1114 VALGRIND_ALIGN_STACK \
1115 "subl $8, %%esp\n\t" \
1116 "pushl 8(%%eax)\n\t" \
1117 "pushl 4(%%eax)\n\t" \
1118 "movl (%%eax), %%eax\n\t"
\
1119 VALGRIND_CALL_NOREDIR_EAX \
1120 VALGRIND_RESTORE_STACK \
1122 :
"a" (&_argvec[0]) \
1123 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1125 lval = (__typeof__(lval)) _res; \
1128#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \
1130 volatile OrigFn _orig = (orig); \
1131 volatile unsigned long _argvec[4]; \
1132 volatile unsigned long _res; \
1133 _argvec[0] = (unsigned long)_orig.nraddr; \
1134 _argvec[1] = (unsigned long)(arg1); \
1135 _argvec[2] = (unsigned long)(arg2); \
1136 _argvec[3] = (unsigned long)(arg3); \
1138 VALGRIND_ALIGN_STACK \
1139 "subl $4, %%esp\n\t" \
1140 "pushl 12(%%eax)\n\t" \
1141 "pushl 8(%%eax)\n\t" \
1142 "pushl 4(%%eax)\n\t" \
1143 "movl (%%eax), %%eax\n\t"
\
1144 VALGRIND_CALL_NOREDIR_EAX \
1145 VALGRIND_RESTORE_STACK \
1147 :
"a" (&_argvec[0]) \
1148 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1150 lval = (__typeof__(lval)) _res; \
1153#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \
1155 volatile OrigFn _orig = (orig); \
1156 volatile unsigned long _argvec[5]; \
1157 volatile unsigned long _res; \
1158 _argvec[0] = (unsigned long)_orig.nraddr; \
1159 _argvec[1] = (unsigned long)(arg1); \
1160 _argvec[2] = (unsigned long)(arg2); \
1161 _argvec[3] = (unsigned long)(arg3); \
1162 _argvec[4] = (unsigned long)(arg4); \
1164 VALGRIND_ALIGN_STACK \
1165 "pushl 16(%%eax)\n\t" \
1166 "pushl 12(%%eax)\n\t" \
1167 "pushl 8(%%eax)\n\t" \
1168 "pushl 4(%%eax)\n\t" \
1169 "movl (%%eax), %%eax\n\t"
\
1170 VALGRIND_CALL_NOREDIR_EAX \
1171 VALGRIND_RESTORE_STACK \
1173 :
"a" (&_argvec[0]) \
1174 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1176 lval = (__typeof__(lval)) _res; \
1179#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \
1181 volatile OrigFn _orig = (orig); \
1182 volatile unsigned long _argvec[6]; \
1183 volatile unsigned long _res; \
1184 _argvec[0] = (unsigned long)_orig.nraddr; \
1185 _argvec[1] = (unsigned long)(arg1); \
1186 _argvec[2] = (unsigned long)(arg2); \
1187 _argvec[3] = (unsigned long)(arg3); \
1188 _argvec[4] = (unsigned long)(arg4); \
1189 _argvec[5] = (unsigned long)(arg5); \
1191 VALGRIND_ALIGN_STACK \
1192 "subl $12, %%esp\n\t" \
1193 "pushl 20(%%eax)\n\t" \
1194 "pushl 16(%%eax)\n\t" \
1195 "pushl 12(%%eax)\n\t" \
1196 "pushl 8(%%eax)\n\t" \
1197 "pushl 4(%%eax)\n\t" \
1198 "movl (%%eax), %%eax\n\t"
\
1199 VALGRIND_CALL_NOREDIR_EAX \
1200 VALGRIND_RESTORE_STACK \
1202 :
"a" (&_argvec[0]) \
1203 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1205 lval = (__typeof__(lval)) _res; \
1208#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \
1210 volatile OrigFn _orig = (orig); \
1211 volatile unsigned long _argvec[7]; \
1212 volatile unsigned long _res; \
1213 _argvec[0] = (unsigned long)_orig.nraddr; \
1214 _argvec[1] = (unsigned long)(arg1); \
1215 _argvec[2] = (unsigned long)(arg2); \
1216 _argvec[3] = (unsigned long)(arg3); \
1217 _argvec[4] = (unsigned long)(arg4); \
1218 _argvec[5] = (unsigned long)(arg5); \
1219 _argvec[6] = (unsigned long)(arg6); \
1221 VALGRIND_ALIGN_STACK \
1222 "subl $8, %%esp\n\t" \
1223 "pushl 24(%%eax)\n\t" \
1224 "pushl 20(%%eax)\n\t" \
1225 "pushl 16(%%eax)\n\t" \
1226 "pushl 12(%%eax)\n\t" \
1227 "pushl 8(%%eax)\n\t" \
1228 "pushl 4(%%eax)\n\t" \
1229 "movl (%%eax), %%eax\n\t"
\
1230 VALGRIND_CALL_NOREDIR_EAX \
1231 VALGRIND_RESTORE_STACK \
1233 :
"a" (&_argvec[0]) \
1234 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1236 lval = (__typeof__(lval)) _res; \
1239#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1242 volatile OrigFn _orig = (orig); \
1243 volatile unsigned long _argvec[8]; \
1244 volatile unsigned long _res; \
1245 _argvec[0] = (unsigned long)_orig.nraddr; \
1246 _argvec[1] = (unsigned long)(arg1); \
1247 _argvec[2] = (unsigned long)(arg2); \
1248 _argvec[3] = (unsigned long)(arg3); \
1249 _argvec[4] = (unsigned long)(arg4); \
1250 _argvec[5] = (unsigned long)(arg5); \
1251 _argvec[6] = (unsigned long)(arg6); \
1252 _argvec[7] = (unsigned long)(arg7); \
1254 VALGRIND_ALIGN_STACK \
1255 "subl $4, %%esp\n\t" \
1256 "pushl 28(%%eax)\n\t" \
1257 "pushl 24(%%eax)\n\t" \
1258 "pushl 20(%%eax)\n\t" \
1259 "pushl 16(%%eax)\n\t" \
1260 "pushl 12(%%eax)\n\t" \
1261 "pushl 8(%%eax)\n\t" \
1262 "pushl 4(%%eax)\n\t" \
1263 "movl (%%eax), %%eax\n\t"
\
1264 VALGRIND_CALL_NOREDIR_EAX \
1265 VALGRIND_RESTORE_STACK \
1267 :
"a" (&_argvec[0]) \
1268 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1270 lval = (__typeof__(lval)) _res; \
1273#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1276 volatile OrigFn _orig = (orig); \
1277 volatile unsigned long _argvec[9]; \
1278 volatile unsigned long _res; \
1279 _argvec[0] = (unsigned long)_orig.nraddr; \
1280 _argvec[1] = (unsigned long)(arg1); \
1281 _argvec[2] = (unsigned long)(arg2); \
1282 _argvec[3] = (unsigned long)(arg3); \
1283 _argvec[4] = (unsigned long)(arg4); \
1284 _argvec[5] = (unsigned long)(arg5); \
1285 _argvec[6] = (unsigned long)(arg6); \
1286 _argvec[7] = (unsigned long)(arg7); \
1287 _argvec[8] = (unsigned long)(arg8); \
1289 VALGRIND_ALIGN_STACK \
1290 "pushl 32(%%eax)\n\t" \
1291 "pushl 28(%%eax)\n\t" \
1292 "pushl 24(%%eax)\n\t" \
1293 "pushl 20(%%eax)\n\t" \
1294 "pushl 16(%%eax)\n\t" \
1295 "pushl 12(%%eax)\n\t" \
1296 "pushl 8(%%eax)\n\t" \
1297 "pushl 4(%%eax)\n\t" \
1298 "movl (%%eax), %%eax\n\t"
\
1299 VALGRIND_CALL_NOREDIR_EAX \
1300 VALGRIND_RESTORE_STACK \
1302 :
"a" (&_argvec[0]) \
1303 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1305 lval = (__typeof__(lval)) _res; \
1308#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1311 volatile OrigFn _orig = (orig); \
1312 volatile unsigned long _argvec[10]; \
1313 volatile unsigned long _res; \
1314 _argvec[0] = (unsigned long)_orig.nraddr; \
1315 _argvec[1] = (unsigned long)(arg1); \
1316 _argvec[2] = (unsigned long)(arg2); \
1317 _argvec[3] = (unsigned long)(arg3); \
1318 _argvec[4] = (unsigned long)(arg4); \
1319 _argvec[5] = (unsigned long)(arg5); \
1320 _argvec[6] = (unsigned long)(arg6); \
1321 _argvec[7] = (unsigned long)(arg7); \
1322 _argvec[8] = (unsigned long)(arg8); \
1323 _argvec[9] = (unsigned long)(arg9); \
1325 VALGRIND_ALIGN_STACK \
1326 "subl $12, %%esp\n\t" \
1327 "pushl 36(%%eax)\n\t" \
1328 "pushl 32(%%eax)\n\t" \
1329 "pushl 28(%%eax)\n\t" \
1330 "pushl 24(%%eax)\n\t" \
1331 "pushl 20(%%eax)\n\t" \
1332 "pushl 16(%%eax)\n\t" \
1333 "pushl 12(%%eax)\n\t" \
1334 "pushl 8(%%eax)\n\t" \
1335 "pushl 4(%%eax)\n\t" \
1336 "movl (%%eax), %%eax\n\t"
\
1337 VALGRIND_CALL_NOREDIR_EAX \
1338 VALGRIND_RESTORE_STACK \
1340 :
"a" (&_argvec[0]) \
1341 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1343 lval = (__typeof__(lval)) _res; \
1346#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1347 arg7,arg8,arg9,arg10) \
1349 volatile OrigFn _orig = (orig); \
1350 volatile unsigned long _argvec[11]; \
1351 volatile unsigned long _res; \
1352 _argvec[0] = (unsigned long)_orig.nraddr; \
1353 _argvec[1] = (unsigned long)(arg1); \
1354 _argvec[2] = (unsigned long)(arg2); \
1355 _argvec[3] = (unsigned long)(arg3); \
1356 _argvec[4] = (unsigned long)(arg4); \
1357 _argvec[5] = (unsigned long)(arg5); \
1358 _argvec[6] = (unsigned long)(arg6); \
1359 _argvec[7] = (unsigned long)(arg7); \
1360 _argvec[8] = (unsigned long)(arg8); \
1361 _argvec[9] = (unsigned long)(arg9); \
1362 _argvec[10] = (unsigned long)(arg10); \
1364 VALGRIND_ALIGN_STACK \
1365 "subl $8, %%esp\n\t" \
1366 "pushl 40(%%eax)\n\t" \
1367 "pushl 36(%%eax)\n\t" \
1368 "pushl 32(%%eax)\n\t" \
1369 "pushl 28(%%eax)\n\t" \
1370 "pushl 24(%%eax)\n\t" \
1371 "pushl 20(%%eax)\n\t" \
1372 "pushl 16(%%eax)\n\t" \
1373 "pushl 12(%%eax)\n\t" \
1374 "pushl 8(%%eax)\n\t" \
1375 "pushl 4(%%eax)\n\t" \
1376 "movl (%%eax), %%eax\n\t"
\
1377 VALGRIND_CALL_NOREDIR_EAX \
1378 VALGRIND_RESTORE_STACK \
1380 :
"a" (&_argvec[0]) \
1381 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1383 lval = (__typeof__(lval)) _res; \
1386#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
1387 arg6,arg7,arg8,arg9,arg10, \
1390 volatile OrigFn _orig = (orig); \
1391 volatile unsigned long _argvec[12]; \
1392 volatile unsigned long _res; \
1393 _argvec[0] = (unsigned long)_orig.nraddr; \
1394 _argvec[1] = (unsigned long)(arg1); \
1395 _argvec[2] = (unsigned long)(arg2); \
1396 _argvec[3] = (unsigned long)(arg3); \
1397 _argvec[4] = (unsigned long)(arg4); \
1398 _argvec[5] = (unsigned long)(arg5); \
1399 _argvec[6] = (unsigned long)(arg6); \
1400 _argvec[7] = (unsigned long)(arg7); \
1401 _argvec[8] = (unsigned long)(arg8); \
1402 _argvec[9] = (unsigned long)(arg9); \
1403 _argvec[10] = (unsigned long)(arg10); \
1404 _argvec[11] = (unsigned long)(arg11); \
1406 VALGRIND_ALIGN_STACK \
1407 "subl $4, %%esp\n\t" \
1408 "pushl 44(%%eax)\n\t" \
1409 "pushl 40(%%eax)\n\t" \
1410 "pushl 36(%%eax)\n\t" \
1411 "pushl 32(%%eax)\n\t" \
1412 "pushl 28(%%eax)\n\t" \
1413 "pushl 24(%%eax)\n\t" \
1414 "pushl 20(%%eax)\n\t" \
1415 "pushl 16(%%eax)\n\t" \
1416 "pushl 12(%%eax)\n\t" \
1417 "pushl 8(%%eax)\n\t" \
1418 "pushl 4(%%eax)\n\t" \
1419 "movl (%%eax), %%eax\n\t"
\
1420 VALGRIND_CALL_NOREDIR_EAX \
1421 VALGRIND_RESTORE_STACK \
1423 :
"a" (&_argvec[0]) \
1424 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1426 lval = (__typeof__(lval)) _res; \
1429#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
1430 arg6,arg7,arg8,arg9,arg10, \
1433 volatile OrigFn _orig = (orig); \
1434 volatile unsigned long _argvec[13]; \
1435 volatile unsigned long _res; \
1436 _argvec[0] = (unsigned long)_orig.nraddr; \
1437 _argvec[1] = (unsigned long)(arg1); \
1438 _argvec[2] = (unsigned long)(arg2); \
1439 _argvec[3] = (unsigned long)(arg3); \
1440 _argvec[4] = (unsigned long)(arg4); \
1441 _argvec[5] = (unsigned long)(arg5); \
1442 _argvec[6] = (unsigned long)(arg6); \
1443 _argvec[7] = (unsigned long)(arg7); \
1444 _argvec[8] = (unsigned long)(arg8); \
1445 _argvec[9] = (unsigned long)(arg9); \
1446 _argvec[10] = (unsigned long)(arg10); \
1447 _argvec[11] = (unsigned long)(arg11); \
1448 _argvec[12] = (unsigned long)(arg12); \
1450 VALGRIND_ALIGN_STACK \
1451 "pushl 48(%%eax)\n\t" \
1452 "pushl 44(%%eax)\n\t" \
1453 "pushl 40(%%eax)\n\t" \
1454 "pushl 36(%%eax)\n\t" \
1455 "pushl 32(%%eax)\n\t" \
1456 "pushl 28(%%eax)\n\t" \
1457 "pushl 24(%%eax)\n\t" \
1458 "pushl 20(%%eax)\n\t" \
1459 "pushl 16(%%eax)\n\t" \
1460 "pushl 12(%%eax)\n\t" \
1461 "pushl 8(%%eax)\n\t" \
1462 "pushl 4(%%eax)\n\t" \
1463 "movl (%%eax), %%eax\n\t"
\
1464 VALGRIND_CALL_NOREDIR_EAX \
1465 VALGRIND_RESTORE_STACK \
1467 :
"a" (&_argvec[0]) \
1468 :
"cc", "memory", __CALLER_SAVED_REGS, "edi" \
1470 lval = (__typeof__(lval)) _res; \
1477#if defined(PLAT_amd64_linux) || defined(PLAT_amd64_darwin)
1482#define __CALLER_SAVED_REGS "rcx", "rdx", "rsi", \
1483 "rdi", "r8", "r9", "r10", "r11"
1539#if defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)
1540# define __FRAME_POINTER \
1541 ,"r"(__builtin_dwarf_cfa())
1542# define VALGRIND_CFI_PROLOGUE \
1543 "movq %%rbp, %%r15\n\t" \
1544 "movq %2, %%rbp\n\t" \
1545 ".cfi_remember_state\n\t" \
1546 ".cfi_def_cfa rbp, 0\n\t"
1547# define VALGRIND_CFI_EPILOGUE \
1548 "movq %%r15, %%rbp\n\t" \
1549 ".cfi_restore_state\n\t"
1551# define __FRAME_POINTER
1552# define VALGRIND_CFI_PROLOGUE
1553# define VALGRIND_CFI_EPILOGUE
1561#define VALGRIND_ALIGN_STACK \
1562 "movq %%rsp,%%r14\n\t" \
1563 "andq $0xfffffffffffffff0,%%rsp\n\t"
1564#define VALGRIND_RESTORE_STACK \
1565 "movq %%r14,%%rsp\n\t"
1591#define CALL_FN_W_v(lval, orig) \
1593 volatile OrigFn _orig = (orig); \
1594 volatile unsigned long _argvec[1]; \
1595 volatile unsigned long _res; \
1596 _argvec[0] = (unsigned long)_orig.nraddr; \
1598 VALGRIND_CFI_PROLOGUE \
1599 VALGRIND_ALIGN_STACK \
1600 "subq $128,%%rsp\n\t" \
1601 "movq (%%rax), %%rax\n\t"
\
1602 VALGRIND_CALL_NOREDIR_RAX \
1603 VALGRIND_RESTORE_STACK \
1604 VALGRIND_CFI_EPILOGUE \
1606 :
"a" (&_argvec[0]) __FRAME_POINTER \
1607 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1609 lval = (__typeof__(lval)) _res; \
1612#define CALL_FN_W_W(lval, orig, arg1) \
1614 volatile OrigFn _orig = (orig); \
1615 volatile unsigned long _argvec[2]; \
1616 volatile unsigned long _res; \
1617 _argvec[0] = (unsigned long)_orig.nraddr; \
1618 _argvec[1] = (unsigned long)(arg1); \
1620 VALGRIND_CFI_PROLOGUE \
1621 VALGRIND_ALIGN_STACK \
1622 "subq $128,%%rsp\n\t" \
1623 "movq 8(%%rax), %%rdi\n\t" \
1624 "movq (%%rax), %%rax\n\t"
\
1625 VALGRIND_CALL_NOREDIR_RAX \
1626 VALGRIND_RESTORE_STACK \
1627 VALGRIND_CFI_EPILOGUE \
1629 :
"a" (&_argvec[0]) __FRAME_POINTER \
1630 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1632 lval = (__typeof__(lval)) _res; \
1635#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
1637 volatile OrigFn _orig = (orig); \
1638 volatile unsigned long _argvec[3]; \
1639 volatile unsigned long _res; \
1640 _argvec[0] = (unsigned long)_orig.nraddr; \
1641 _argvec[1] = (unsigned long)(arg1); \
1642 _argvec[2] = (unsigned long)(arg2); \
1644 VALGRIND_CFI_PROLOGUE \
1645 VALGRIND_ALIGN_STACK \
1646 "subq $128,%%rsp\n\t" \
1647 "movq 16(%%rax), %%rsi\n\t" \
1648 "movq 8(%%rax), %%rdi\n\t" \
1649 "movq (%%rax), %%rax\n\t"
\
1650 VALGRIND_CALL_NOREDIR_RAX \
1651 VALGRIND_RESTORE_STACK \
1652 VALGRIND_CFI_EPILOGUE \
1654 :
"a" (&_argvec[0]) __FRAME_POINTER \
1655 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1657 lval = (__typeof__(lval)) _res; \
1660#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \
1662 volatile OrigFn _orig = (orig); \
1663 volatile unsigned long _argvec[4]; \
1664 volatile unsigned long _res; \
1665 _argvec[0] = (unsigned long)_orig.nraddr; \
1666 _argvec[1] = (unsigned long)(arg1); \
1667 _argvec[2] = (unsigned long)(arg2); \
1668 _argvec[3] = (unsigned long)(arg3); \
1670 VALGRIND_CFI_PROLOGUE \
1671 VALGRIND_ALIGN_STACK \
1672 "subq $128,%%rsp\n\t" \
1673 "movq 24(%%rax), %%rdx\n\t" \
1674 "movq 16(%%rax), %%rsi\n\t" \
1675 "movq 8(%%rax), %%rdi\n\t" \
1676 "movq (%%rax), %%rax\n\t"
\
1677 VALGRIND_CALL_NOREDIR_RAX \
1678 VALGRIND_RESTORE_STACK \
1679 VALGRIND_CFI_EPILOGUE \
1681 :
"a" (&_argvec[0]) __FRAME_POINTER \
1682 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1684 lval = (__typeof__(lval)) _res; \
1687#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \
1689 volatile OrigFn _orig = (orig); \
1690 volatile unsigned long _argvec[5]; \
1691 volatile unsigned long _res; \
1692 _argvec[0] = (unsigned long)_orig.nraddr; \
1693 _argvec[1] = (unsigned long)(arg1); \
1694 _argvec[2] = (unsigned long)(arg2); \
1695 _argvec[3] = (unsigned long)(arg3); \
1696 _argvec[4] = (unsigned long)(arg4); \
1698 VALGRIND_CFI_PROLOGUE \
1699 VALGRIND_ALIGN_STACK \
1700 "subq $128,%%rsp\n\t" \
1701 "movq 32(%%rax), %%rcx\n\t" \
1702 "movq 24(%%rax), %%rdx\n\t" \
1703 "movq 16(%%rax), %%rsi\n\t" \
1704 "movq 8(%%rax), %%rdi\n\t" \
1705 "movq (%%rax), %%rax\n\t"
\
1706 VALGRIND_CALL_NOREDIR_RAX \
1707 VALGRIND_RESTORE_STACK \
1708 VALGRIND_CFI_EPILOGUE \
1710 :
"a" (&_argvec[0]) __FRAME_POINTER \
1711 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1713 lval = (__typeof__(lval)) _res; \
1716#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \
1718 volatile OrigFn _orig = (orig); \
1719 volatile unsigned long _argvec[6]; \
1720 volatile unsigned long _res; \
1721 _argvec[0] = (unsigned long)_orig.nraddr; \
1722 _argvec[1] = (unsigned long)(arg1); \
1723 _argvec[2] = (unsigned long)(arg2); \
1724 _argvec[3] = (unsigned long)(arg3); \
1725 _argvec[4] = (unsigned long)(arg4); \
1726 _argvec[5] = (unsigned long)(arg5); \
1728 VALGRIND_CFI_PROLOGUE \
1729 VALGRIND_ALIGN_STACK \
1730 "subq $128,%%rsp\n\t" \
1731 "movq 40(%%rax), %%r8\n\t" \
1732 "movq 32(%%rax), %%rcx\n\t" \
1733 "movq 24(%%rax), %%rdx\n\t" \
1734 "movq 16(%%rax), %%rsi\n\t" \
1735 "movq 8(%%rax), %%rdi\n\t" \
1736 "movq (%%rax), %%rax\n\t"
\
1737 VALGRIND_CALL_NOREDIR_RAX \
1738 VALGRIND_RESTORE_STACK \
1739 VALGRIND_CFI_EPILOGUE \
1741 :
"a" (&_argvec[0]) __FRAME_POINTER \
1742 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1744 lval = (__typeof__(lval)) _res; \
1747#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \
1749 volatile OrigFn _orig = (orig); \
1750 volatile unsigned long _argvec[7]; \
1751 volatile unsigned long _res; \
1752 _argvec[0] = (unsigned long)_orig.nraddr; \
1753 _argvec[1] = (unsigned long)(arg1); \
1754 _argvec[2] = (unsigned long)(arg2); \
1755 _argvec[3] = (unsigned long)(arg3); \
1756 _argvec[4] = (unsigned long)(arg4); \
1757 _argvec[5] = (unsigned long)(arg5); \
1758 _argvec[6] = (unsigned long)(arg6); \
1760 VALGRIND_CFI_PROLOGUE \
1761 VALGRIND_ALIGN_STACK \
1762 "subq $128,%%rsp\n\t" \
1763 "movq 48(%%rax), %%r9\n\t" \
1764 "movq 40(%%rax), %%r8\n\t" \
1765 "movq 32(%%rax), %%rcx\n\t" \
1766 "movq 24(%%rax), %%rdx\n\t" \
1767 "movq 16(%%rax), %%rsi\n\t" \
1768 "movq 8(%%rax), %%rdi\n\t" \
1769 "movq (%%rax), %%rax\n\t"
\
1770 VALGRIND_CALL_NOREDIR_RAX \
1771 VALGRIND_RESTORE_STACK \
1772 VALGRIND_CFI_EPILOGUE \
1774 :
"a" (&_argvec[0]) __FRAME_POINTER \
1775 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1777 lval = (__typeof__(lval)) _res; \
1780#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1783 volatile OrigFn _orig = (orig); \
1784 volatile unsigned long _argvec[8]; \
1785 volatile unsigned long _res; \
1786 _argvec[0] = (unsigned long)_orig.nraddr; \
1787 _argvec[1] = (unsigned long)(arg1); \
1788 _argvec[2] = (unsigned long)(arg2); \
1789 _argvec[3] = (unsigned long)(arg3); \
1790 _argvec[4] = (unsigned long)(arg4); \
1791 _argvec[5] = (unsigned long)(arg5); \
1792 _argvec[6] = (unsigned long)(arg6); \
1793 _argvec[7] = (unsigned long)(arg7); \
1795 VALGRIND_CFI_PROLOGUE \
1796 VALGRIND_ALIGN_STACK \
1797 "subq $136,%%rsp\n\t" \
1798 "pushq 56(%%rax)\n\t" \
1799 "movq 48(%%rax), %%r9\n\t" \
1800 "movq 40(%%rax), %%r8\n\t" \
1801 "movq 32(%%rax), %%rcx\n\t" \
1802 "movq 24(%%rax), %%rdx\n\t" \
1803 "movq 16(%%rax), %%rsi\n\t" \
1804 "movq 8(%%rax), %%rdi\n\t" \
1805 "movq (%%rax), %%rax\n\t"
\
1806 VALGRIND_CALL_NOREDIR_RAX \
1807 VALGRIND_RESTORE_STACK \
1808 VALGRIND_CFI_EPILOGUE \
1810 :
"a" (&_argvec[0]) __FRAME_POINTER \
1811 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1813 lval = (__typeof__(lval)) _res; \
1816#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1819 volatile OrigFn _orig = (orig); \
1820 volatile unsigned long _argvec[9]; \
1821 volatile unsigned long _res; \
1822 _argvec[0] = (unsigned long)_orig.nraddr; \
1823 _argvec[1] = (unsigned long)(arg1); \
1824 _argvec[2] = (unsigned long)(arg2); \
1825 _argvec[3] = (unsigned long)(arg3); \
1826 _argvec[4] = (unsigned long)(arg4); \
1827 _argvec[5] = (unsigned long)(arg5); \
1828 _argvec[6] = (unsigned long)(arg6); \
1829 _argvec[7] = (unsigned long)(arg7); \
1830 _argvec[8] = (unsigned long)(arg8); \
1832 VALGRIND_CFI_PROLOGUE \
1833 VALGRIND_ALIGN_STACK \
1834 "subq $128,%%rsp\n\t" \
1835 "pushq 64(%%rax)\n\t" \
1836 "pushq 56(%%rax)\n\t" \
1837 "movq 48(%%rax), %%r9\n\t" \
1838 "movq 40(%%rax), %%r8\n\t" \
1839 "movq 32(%%rax), %%rcx\n\t" \
1840 "movq 24(%%rax), %%rdx\n\t" \
1841 "movq 16(%%rax), %%rsi\n\t" \
1842 "movq 8(%%rax), %%rdi\n\t" \
1843 "movq (%%rax), %%rax\n\t"
\
1844 VALGRIND_CALL_NOREDIR_RAX \
1845 VALGRIND_RESTORE_STACK \
1846 VALGRIND_CFI_EPILOGUE \
1848 :
"a" (&_argvec[0]) __FRAME_POINTER \
1849 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1851 lval = (__typeof__(lval)) _res; \
1854#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1857 volatile OrigFn _orig = (orig); \
1858 volatile unsigned long _argvec[10]; \
1859 volatile unsigned long _res; \
1860 _argvec[0] = (unsigned long)_orig.nraddr; \
1861 _argvec[1] = (unsigned long)(arg1); \
1862 _argvec[2] = (unsigned long)(arg2); \
1863 _argvec[3] = (unsigned long)(arg3); \
1864 _argvec[4] = (unsigned long)(arg4); \
1865 _argvec[5] = (unsigned long)(arg5); \
1866 _argvec[6] = (unsigned long)(arg6); \
1867 _argvec[7] = (unsigned long)(arg7); \
1868 _argvec[8] = (unsigned long)(arg8); \
1869 _argvec[9] = (unsigned long)(arg9); \
1871 VALGRIND_CFI_PROLOGUE \
1872 VALGRIND_ALIGN_STACK \
1873 "subq $136,%%rsp\n\t" \
1874 "pushq 72(%%rax)\n\t" \
1875 "pushq 64(%%rax)\n\t" \
1876 "pushq 56(%%rax)\n\t" \
1877 "movq 48(%%rax), %%r9\n\t" \
1878 "movq 40(%%rax), %%r8\n\t" \
1879 "movq 32(%%rax), %%rcx\n\t" \
1880 "movq 24(%%rax), %%rdx\n\t" \
1881 "movq 16(%%rax), %%rsi\n\t" \
1882 "movq 8(%%rax), %%rdi\n\t" \
1883 "movq (%%rax), %%rax\n\t"
\
1884 VALGRIND_CALL_NOREDIR_RAX \
1885 VALGRIND_RESTORE_STACK \
1886 VALGRIND_CFI_EPILOGUE \
1888 :
"a" (&_argvec[0]) __FRAME_POINTER \
1889 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1891 lval = (__typeof__(lval)) _res; \
1894#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1895 arg7,arg8,arg9,arg10) \
1897 volatile OrigFn _orig = (orig); \
1898 volatile unsigned long _argvec[11]; \
1899 volatile unsigned long _res; \
1900 _argvec[0] = (unsigned long)_orig.nraddr; \
1901 _argvec[1] = (unsigned long)(arg1); \
1902 _argvec[2] = (unsigned long)(arg2); \
1903 _argvec[3] = (unsigned long)(arg3); \
1904 _argvec[4] = (unsigned long)(arg4); \
1905 _argvec[5] = (unsigned long)(arg5); \
1906 _argvec[6] = (unsigned long)(arg6); \
1907 _argvec[7] = (unsigned long)(arg7); \
1908 _argvec[8] = (unsigned long)(arg8); \
1909 _argvec[9] = (unsigned long)(arg9); \
1910 _argvec[10] = (unsigned long)(arg10); \
1912 VALGRIND_CFI_PROLOGUE \
1913 VALGRIND_ALIGN_STACK \
1914 "subq $128,%%rsp\n\t" \
1915 "pushq 80(%%rax)\n\t" \
1916 "pushq 72(%%rax)\n\t" \
1917 "pushq 64(%%rax)\n\t" \
1918 "pushq 56(%%rax)\n\t" \
1919 "movq 48(%%rax), %%r9\n\t" \
1920 "movq 40(%%rax), %%r8\n\t" \
1921 "movq 32(%%rax), %%rcx\n\t" \
1922 "movq 24(%%rax), %%rdx\n\t" \
1923 "movq 16(%%rax), %%rsi\n\t" \
1924 "movq 8(%%rax), %%rdi\n\t" \
1925 "movq (%%rax), %%rax\n\t"
\
1926 VALGRIND_CALL_NOREDIR_RAX \
1927 VALGRIND_RESTORE_STACK \
1928 VALGRIND_CFI_EPILOGUE \
1930 :
"a" (&_argvec[0]) __FRAME_POINTER \
1931 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1933 lval = (__typeof__(lval)) _res; \
1936#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1937 arg7,arg8,arg9,arg10,arg11) \
1939 volatile OrigFn _orig = (orig); \
1940 volatile unsigned long _argvec[12]; \
1941 volatile unsigned long _res; \
1942 _argvec[0] = (unsigned long)_orig.nraddr; \
1943 _argvec[1] = (unsigned long)(arg1); \
1944 _argvec[2] = (unsigned long)(arg2); \
1945 _argvec[3] = (unsigned long)(arg3); \
1946 _argvec[4] = (unsigned long)(arg4); \
1947 _argvec[5] = (unsigned long)(arg5); \
1948 _argvec[6] = (unsigned long)(arg6); \
1949 _argvec[7] = (unsigned long)(arg7); \
1950 _argvec[8] = (unsigned long)(arg8); \
1951 _argvec[9] = (unsigned long)(arg9); \
1952 _argvec[10] = (unsigned long)(arg10); \
1953 _argvec[11] = (unsigned long)(arg11); \
1955 VALGRIND_CFI_PROLOGUE \
1956 VALGRIND_ALIGN_STACK \
1957 "subq $136,%%rsp\n\t" \
1958 "pushq 88(%%rax)\n\t" \
1959 "pushq 80(%%rax)\n\t" \
1960 "pushq 72(%%rax)\n\t" \
1961 "pushq 64(%%rax)\n\t" \
1962 "pushq 56(%%rax)\n\t" \
1963 "movq 48(%%rax), %%r9\n\t" \
1964 "movq 40(%%rax), %%r8\n\t" \
1965 "movq 32(%%rax), %%rcx\n\t" \
1966 "movq 24(%%rax), %%rdx\n\t" \
1967 "movq 16(%%rax), %%rsi\n\t" \
1968 "movq 8(%%rax), %%rdi\n\t" \
1969 "movq (%%rax), %%rax\n\t"
\
1970 VALGRIND_CALL_NOREDIR_RAX \
1971 VALGRIND_RESTORE_STACK \
1972 VALGRIND_CFI_EPILOGUE \
1974 :
"a" (&_argvec[0]) __FRAME_POINTER \
1975 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
1977 lval = (__typeof__(lval)) _res; \
1980#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
1981 arg7,arg8,arg9,arg10,arg11,arg12) \
1983 volatile OrigFn _orig = (orig); \
1984 volatile unsigned long _argvec[13]; \
1985 volatile unsigned long _res; \
1986 _argvec[0] = (unsigned long)_orig.nraddr; \
1987 _argvec[1] = (unsigned long)(arg1); \
1988 _argvec[2] = (unsigned long)(arg2); \
1989 _argvec[3] = (unsigned long)(arg3); \
1990 _argvec[4] = (unsigned long)(arg4); \
1991 _argvec[5] = (unsigned long)(arg5); \
1992 _argvec[6] = (unsigned long)(arg6); \
1993 _argvec[7] = (unsigned long)(arg7); \
1994 _argvec[8] = (unsigned long)(arg8); \
1995 _argvec[9] = (unsigned long)(arg9); \
1996 _argvec[10] = (unsigned long)(arg10); \
1997 _argvec[11] = (unsigned long)(arg11); \
1998 _argvec[12] = (unsigned long)(arg12); \
2000 VALGRIND_CFI_PROLOGUE \
2001 VALGRIND_ALIGN_STACK \
2002 "subq $128,%%rsp\n\t" \
2003 "pushq 96(%%rax)\n\t" \
2004 "pushq 88(%%rax)\n\t" \
2005 "pushq 80(%%rax)\n\t" \
2006 "pushq 72(%%rax)\n\t" \
2007 "pushq 64(%%rax)\n\t" \
2008 "pushq 56(%%rax)\n\t" \
2009 "movq 48(%%rax), %%r9\n\t" \
2010 "movq 40(%%rax), %%r8\n\t" \
2011 "movq 32(%%rax), %%rcx\n\t" \
2012 "movq 24(%%rax), %%rdx\n\t" \
2013 "movq 16(%%rax), %%rsi\n\t" \
2014 "movq 8(%%rax), %%rdi\n\t" \
2015 "movq (%%rax), %%rax\n\t"
\
2016 VALGRIND_CALL_NOREDIR_RAX \
2017 VALGRIND_RESTORE_STACK \
2018 VALGRIND_CFI_EPILOGUE \
2020 :
"a" (&_argvec[0]) __FRAME_POINTER \
2021 :
"cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
2023 lval = (__typeof__(lval)) _res; \
2030#if defined(PLAT_ppc32_linux)
2056#define __CALLER_SAVED_REGS \
2057 "lr", "ctr", "xer", \
2058 "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \
2059 "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \
2067#define VALGRIND_ALIGN_STACK \
2069 "rlwinm 1,1,0,0,27\n\t"
2070#define VALGRIND_RESTORE_STACK \
2076#define CALL_FN_W_v(lval, orig) \
2078 volatile OrigFn _orig = (orig); \
2079 volatile unsigned long _argvec[1]; \
2080 volatile unsigned long _res; \
2081 _argvec[0] = (unsigned long)_orig.nraddr; \
2083 VALGRIND_ALIGN_STACK \
2085 "lwz 11,0(11)\n\t"
\
2086 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2087 VALGRIND_RESTORE_STACK \
2090 :
"r" (&_argvec[0]) \
2091 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2093 lval = (__typeof__(lval)) _res; \
2096#define CALL_FN_W_W(lval, orig, arg1) \
2098 volatile OrigFn _orig = (orig); \
2099 volatile unsigned long _argvec[2]; \
2100 volatile unsigned long _res; \
2101 _argvec[0] = (unsigned long)_orig.nraddr; \
2102 _argvec[1] = (unsigned long)arg1; \
2104 VALGRIND_ALIGN_STACK \
2107 "lwz 11,0(11)\n\t" \
2108 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2109 VALGRIND_RESTORE_STACK \
2112 :
"r" (&_argvec[0]) \
2113 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2115 lval = (__typeof__(lval)) _res; \
2118#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
2120 volatile OrigFn _orig = (orig); \
2121 volatile unsigned long _argvec[3]; \
2122 volatile unsigned long _res; \
2123 _argvec[0] = (unsigned long)_orig.nraddr; \
2124 _argvec[1] = (unsigned long)arg1; \
2125 _argvec[2] = (unsigned long)arg2; \
2127 VALGRIND_ALIGN_STACK \
2131 "lwz 11,0(11)\n\t"
\
2132 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2133 VALGRIND_RESTORE_STACK \
2136 :
"r" (&_argvec[0]) \
2137 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2139 lval = (__typeof__(lval)) _res; \
2142#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \
2144 volatile OrigFn _orig = (orig); \
2145 volatile unsigned long _argvec[4]; \
2146 volatile unsigned long _res; \
2147 _argvec[0] = (unsigned long)_orig.nraddr; \
2148 _argvec[1] = (unsigned long)arg1; \
2149 _argvec[2] = (unsigned long)arg2; \
2150 _argvec[3] = (unsigned long)arg3; \
2152 VALGRIND_ALIGN_STACK \
2156 "lwz 5,12(11)\n\t" \
2157 "lwz 11,0(11)\n\t"
\
2158 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2159 VALGRIND_RESTORE_STACK \
2162 :
"r" (&_argvec[0]) \
2163 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2165 lval = (__typeof__(lval)) _res; \
2168#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \
2170 volatile OrigFn _orig = (orig); \
2171 volatile unsigned long _argvec[5]; \
2172 volatile unsigned long _res; \
2173 _argvec[0] = (unsigned long)_orig.nraddr; \
2174 _argvec[1] = (unsigned long)arg1; \
2175 _argvec[2] = (unsigned long)arg2; \
2176 _argvec[3] = (unsigned long)arg3; \
2177 _argvec[4] = (unsigned long)arg4; \
2179 VALGRIND_ALIGN_STACK \
2183 "lwz 5,12(11)\n\t" \
2184 "lwz 6,16(11)\n\t"
\
2185 "lwz 11,0(11)\n\t" \
2186 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2187 VALGRIND_RESTORE_STACK \
2190 :
"r" (&_argvec[0]) \
2191 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2193 lval = (__typeof__(lval)) _res; \
2196#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \
2198 volatile OrigFn _orig = (orig); \
2199 volatile unsigned long _argvec[6]; \
2200 volatile unsigned long _res; \
2201 _argvec[0] = (unsigned long)_orig.nraddr; \
2202 _argvec[1] = (unsigned long)arg1; \
2203 _argvec[2] = (unsigned long)arg2; \
2204 _argvec[3] = (unsigned long)arg3; \
2205 _argvec[4] = (unsigned long)arg4; \
2206 _argvec[5] = (unsigned long)arg5; \
2208 VALGRIND_ALIGN_STACK \
2212 "lwz 5,12(11)\n\t" \
2213 "lwz 6,16(11)\n\t"
\
2214 "lwz 7,20(11)\n\t" \
2215 "lwz 11,0(11)\n\t"
\
2216 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2217 VALGRIND_RESTORE_STACK \
2220 :
"r" (&_argvec[0]) \
2221 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2223 lval = (__typeof__(lval)) _res; \
2226#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \
2228 volatile OrigFn _orig = (orig); \
2229 volatile unsigned long _argvec[7]; \
2230 volatile unsigned long _res; \
2231 _argvec[0] = (unsigned long)_orig.nraddr; \
2232 _argvec[1] = (unsigned long)arg1; \
2233 _argvec[2] = (unsigned long)arg2; \
2234 _argvec[3] = (unsigned long)arg3; \
2235 _argvec[4] = (unsigned long)arg4; \
2236 _argvec[5] = (unsigned long)arg5; \
2237 _argvec[6] = (unsigned long)arg6; \
2239 VALGRIND_ALIGN_STACK \
2243 "lwz 5,12(11)\n\t" \
2244 "lwz 6,16(11)\n\t"
\
2245 "lwz 7,20(11)\n\t" \
2246 "lwz 8,24(11)\n\t" \
2247 "lwz 11,0(11)\n\t"
\
2248 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2249 VALGRIND_RESTORE_STACK \
2252 :
"r" (&_argvec[0]) \
2253 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2255 lval = (__typeof__(lval)) _res; \
2258#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2261 volatile OrigFn _orig = (orig); \
2262 volatile unsigned long _argvec[8]; \
2263 volatile unsigned long _res; \
2264 _argvec[0] = (unsigned long)_orig.nraddr; \
2265 _argvec[1] = (unsigned long)arg1; \
2266 _argvec[2] = (unsigned long)arg2; \
2267 _argvec[3] = (unsigned long)arg3; \
2268 _argvec[4] = (unsigned long)arg4; \
2269 _argvec[5] = (unsigned long)arg5; \
2270 _argvec[6] = (unsigned long)arg6; \
2271 _argvec[7] = (unsigned long)arg7; \
2273 VALGRIND_ALIGN_STACK \
2277 "lwz 5,12(11)\n\t" \
2278 "lwz 6,16(11)\n\t"
\
2279 "lwz 7,20(11)\n\t" \
2280 "lwz 8,24(11)\n\t" \
2281 "lwz 9,28(11)\n\t" \
2282 "lwz 11,0(11)\n\t"
\
2283 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2284 VALGRIND_RESTORE_STACK \
2287 :
"r" (&_argvec[0]) \
2288 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2290 lval = (__typeof__(lval)) _res; \
2293#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2296 volatile OrigFn _orig = (orig); \
2297 volatile unsigned long _argvec[9]; \
2298 volatile unsigned long _res; \
2299 _argvec[0] = (unsigned long)_orig.nraddr; \
2300 _argvec[1] = (unsigned long)arg1; \
2301 _argvec[2] = (unsigned long)arg2; \
2302 _argvec[3] = (unsigned long)arg3; \
2303 _argvec[4] = (unsigned long)arg4; \
2304 _argvec[5] = (unsigned long)arg5; \
2305 _argvec[6] = (unsigned long)arg6; \
2306 _argvec[7] = (unsigned long)arg7; \
2307 _argvec[8] = (unsigned long)arg8; \
2309 VALGRIND_ALIGN_STACK \
2313 "lwz 5,12(11)\n\t" \
2314 "lwz 6,16(11)\n\t"
\
2315 "lwz 7,20(11)\n\t" \
2316 "lwz 8,24(11)\n\t" \
2317 "lwz 9,28(11)\n\t" \
2318 "lwz 10,32(11)\n\t"
\
2319 "lwz 11,0(11)\n\t" \
2320 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2321 VALGRIND_RESTORE_STACK \
2324 :
"r" (&_argvec[0]) \
2325 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2327 lval = (__typeof__(lval)) _res; \
2330#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2333 volatile OrigFn _orig = (orig); \
2334 volatile unsigned long _argvec[10]; \
2335 volatile unsigned long _res; \
2336 _argvec[0] = (unsigned long)_orig.nraddr; \
2337 _argvec[1] = (unsigned long)arg1; \
2338 _argvec[2] = (unsigned long)arg2; \
2339 _argvec[3] = (unsigned long)arg3; \
2340 _argvec[4] = (unsigned long)arg4; \
2341 _argvec[5] = (unsigned long)arg5; \
2342 _argvec[6] = (unsigned long)arg6; \
2343 _argvec[7] = (unsigned long)arg7; \
2344 _argvec[8] = (unsigned long)arg8; \
2345 _argvec[9] = (unsigned long)arg9; \
2347 VALGRIND_ALIGN_STACK \
2349 "addi 1,1,-16\n\t" \
2351 "lwz 3,36(11)\n\t" \
2356 "lwz 5,12(11)\n\t" \
2357 "lwz 6,16(11)\n\t"
\
2358 "lwz 7,20(11)\n\t" \
2359 "lwz 8,24(11)\n\t" \
2360 "lwz 9,28(11)\n\t" \
2361 "lwz 10,32(11)\n\t"
\
2362 "lwz 11,0(11)\n\t" \
2363 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2364 VALGRIND_RESTORE_STACK \
2367 :
"r" (&_argvec[0]) \
2368 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2370 lval = (__typeof__(lval)) _res; \
2373#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2374 arg7,arg8,arg9,arg10) \
2376 volatile OrigFn _orig = (orig); \
2377 volatile unsigned long _argvec[11]; \
2378 volatile unsigned long _res; \
2379 _argvec[0] = (unsigned long)_orig.nraddr; \
2380 _argvec[1] = (unsigned long)arg1; \
2381 _argvec[2] = (unsigned long)arg2; \
2382 _argvec[3] = (unsigned long)arg3; \
2383 _argvec[4] = (unsigned long)arg4; \
2384 _argvec[5] = (unsigned long)arg5; \
2385 _argvec[6] = (unsigned long)arg6; \
2386 _argvec[7] = (unsigned long)arg7; \
2387 _argvec[8] = (unsigned long)arg8; \
2388 _argvec[9] = (unsigned long)arg9; \
2389 _argvec[10] = (unsigned long)arg10; \
2391 VALGRIND_ALIGN_STACK \
2393 "addi 1,1,-16\n\t" \
2395 "lwz 3,40(11)\n\t" \
2398 "lwz 3,36(11)\n\t" \
2403 "lwz 5,12(11)\n\t" \
2404 "lwz 6,16(11)\n\t"
\
2405 "lwz 7,20(11)\n\t" \
2406 "lwz 8,24(11)\n\t" \
2407 "lwz 9,28(11)\n\t" \
2408 "lwz 10,32(11)\n\t"
\
2409 "lwz 11,0(11)\n\t" \
2410 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2411 VALGRIND_RESTORE_STACK \
2414 :
"r" (&_argvec[0]) \
2415 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2417 lval = (__typeof__(lval)) _res; \
2420#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2421 arg7,arg8,arg9,arg10,arg11) \
2423 volatile OrigFn _orig = (orig); \
2424 volatile unsigned long _argvec[12]; \
2425 volatile unsigned long _res; \
2426 _argvec[0] = (unsigned long)_orig.nraddr; \
2427 _argvec[1] = (unsigned long)arg1; \
2428 _argvec[2] = (unsigned long)arg2; \
2429 _argvec[3] = (unsigned long)arg3; \
2430 _argvec[4] = (unsigned long)arg4; \
2431 _argvec[5] = (unsigned long)arg5; \
2432 _argvec[6] = (unsigned long)arg6; \
2433 _argvec[7] = (unsigned long)arg7; \
2434 _argvec[8] = (unsigned long)arg8; \
2435 _argvec[9] = (unsigned long)arg9; \
2436 _argvec[10] = (unsigned long)arg10; \
2437 _argvec[11] = (unsigned long)arg11; \
2439 VALGRIND_ALIGN_STACK \
2441 "addi 1,1,-32\n\t" \
2443 "lwz 3,44(11)\n\t" \
2446 "lwz 3,40(11)\n\t" \
2449 "lwz 3,36(11)\n\t" \
2454 "lwz 5,12(11)\n\t" \
2455 "lwz 6,16(11)\n\t"
\
2456 "lwz 7,20(11)\n\t" \
2457 "lwz 8,24(11)\n\t" \
2458 "lwz 9,28(11)\n\t" \
2459 "lwz 10,32(11)\n\t"
\
2460 "lwz 11,0(11)\n\t" \
2461 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2462 VALGRIND_RESTORE_STACK \
2465 :
"r" (&_argvec[0]) \
2466 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2468 lval = (__typeof__(lval)) _res; \
2471#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2472 arg7,arg8,arg9,arg10,arg11,arg12) \
2474 volatile OrigFn _orig = (orig); \
2475 volatile unsigned long _argvec[13]; \
2476 volatile unsigned long _res; \
2477 _argvec[0] = (unsigned long)_orig.nraddr; \
2478 _argvec[1] = (unsigned long)arg1; \
2479 _argvec[2] = (unsigned long)arg2; \
2480 _argvec[3] = (unsigned long)arg3; \
2481 _argvec[4] = (unsigned long)arg4; \
2482 _argvec[5] = (unsigned long)arg5; \
2483 _argvec[6] = (unsigned long)arg6; \
2484 _argvec[7] = (unsigned long)arg7; \
2485 _argvec[8] = (unsigned long)arg8; \
2486 _argvec[9] = (unsigned long)arg9; \
2487 _argvec[10] = (unsigned long)arg10; \
2488 _argvec[11] = (unsigned long)arg11; \
2489 _argvec[12] = (unsigned long)arg12; \
2491 VALGRIND_ALIGN_STACK \
2493 "addi 1,1,-32\n\t" \
2495 "lwz 3,48(11)\n\t" \
2498 "lwz 3,44(11)\n\t" \
2501 "lwz 3,40(11)\n\t" \
2504 "lwz 3,36(11)\n\t" \
2509 "lwz 5,12(11)\n\t" \
2510 "lwz 6,16(11)\n\t"
\
2511 "lwz 7,20(11)\n\t" \
2512 "lwz 8,24(11)\n\t" \
2513 "lwz 9,28(11)\n\t" \
2514 "lwz 10,32(11)\n\t"
\
2515 "lwz 11,0(11)\n\t" \
2516 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2517 VALGRIND_RESTORE_STACK \
2520 :
"r" (&_argvec[0]) \
2521 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2523 lval = (__typeof__(lval)) _res; \
2530#if defined(PLAT_ppc64_linux)
2535#define __CALLER_SAVED_REGS \
2536 "lr", "ctr", "xer", \
2537 "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \
2538 "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \
2546#define VALGRIND_ALIGN_STACK \
2548 "rldicr 1,1,0,59\n\t"
2549#define VALGRIND_RESTORE_STACK \
2555#define CALL_FN_W_v(lval, orig) \
2557 volatile OrigFn _orig = (orig); \
2558 volatile unsigned long _argvec[3+0]; \
2559 volatile unsigned long _res; \
2561 _argvec[1] = (unsigned long)_orig.r2; \
2562 _argvec[2] = (unsigned long)_orig.nraddr; \
2564 VALGRIND_ALIGN_STACK \
2566 "std 2,-16(11)\n\t"
\
2568 "ld 11, 0(11)\n\t" \
2569 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2572 "ld 2,-16(11)\n\t"
\
2573 VALGRIND_RESTORE_STACK \
2575 :
"r" (&_argvec[2]) \
2576 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2578 lval = (__typeof__(lval)) _res; \
2581#define CALL_FN_W_W(lval, orig, arg1) \
2583 volatile OrigFn _orig = (orig); \
2584 volatile unsigned long _argvec[3+1]; \
2585 volatile unsigned long _res; \
2587 _argvec[1] = (unsigned long)_orig.r2; \
2588 _argvec[2] = (unsigned long)_orig.nraddr; \
2589 _argvec[2+1] = (unsigned long)arg1; \
2591 VALGRIND_ALIGN_STACK \
2593 "std 2,-16(11)\n\t"
\
2596 "ld 11, 0(11)\n\t" \
2597 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2600 "ld 2,-16(11)\n\t"
\
2601 VALGRIND_RESTORE_STACK \
2603 :
"r" (&_argvec[2]) \
2604 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2606 lval = (__typeof__(lval)) _res; \
2609#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
2611 volatile OrigFn _orig = (orig); \
2612 volatile unsigned long _argvec[3+2]; \
2613 volatile unsigned long _res; \
2615 _argvec[1] = (unsigned long)_orig.r2; \
2616 _argvec[2] = (unsigned long)_orig.nraddr; \
2617 _argvec[2+1] = (unsigned long)arg1; \
2618 _argvec[2+2] = (unsigned long)arg2; \
2620 VALGRIND_ALIGN_STACK \
2622 "std 2,-16(11)\n\t"
\
2625 "ld 4, 16(11)\n\t" \
2626 "ld 11, 0(11)\n\t" \
2627 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2630 "ld 2,-16(11)\n\t"
\
2631 VALGRIND_RESTORE_STACK \
2633 :
"r" (&_argvec[2]) \
2634 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2636 lval = (__typeof__(lval)) _res; \
2639#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \
2641 volatile OrigFn _orig = (orig); \
2642 volatile unsigned long _argvec[3+3]; \
2643 volatile unsigned long _res; \
2645 _argvec[1] = (unsigned long)_orig.r2; \
2646 _argvec[2] = (unsigned long)_orig.nraddr; \
2647 _argvec[2+1] = (unsigned long)arg1; \
2648 _argvec[2+2] = (unsigned long)arg2; \
2649 _argvec[2+3] = (unsigned long)arg3; \
2651 VALGRIND_ALIGN_STACK \
2653 "std 2,-16(11)\n\t"
\
2656 "ld 4, 16(11)\n\t" \
2657 "ld 5, 24(11)\n\t" \
2658 "ld 11, 0(11)\n\t" \
2659 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2662 "ld 2,-16(11)\n\t"
\
2663 VALGRIND_RESTORE_STACK \
2665 :
"r" (&_argvec[2]) \
2666 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2668 lval = (__typeof__(lval)) _res; \
2671#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \
2673 volatile OrigFn _orig = (orig); \
2674 volatile unsigned long _argvec[3+4]; \
2675 volatile unsigned long _res; \
2677 _argvec[1] = (unsigned long)_orig.r2; \
2678 _argvec[2] = (unsigned long)_orig.nraddr; \
2679 _argvec[2+1] = (unsigned long)arg1; \
2680 _argvec[2+2] = (unsigned long)arg2; \
2681 _argvec[2+3] = (unsigned long)arg3; \
2682 _argvec[2+4] = (unsigned long)arg4; \
2684 VALGRIND_ALIGN_STACK \
2686 "std 2,-16(11)\n\t"
\
2689 "ld 4, 16(11)\n\t" \
2690 "ld 5, 24(11)\n\t" \
2691 "ld 6, 32(11)\n\t" \
2692 "ld 11, 0(11)\n\t" \
2693 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2696 "ld 2,-16(11)\n\t"
\
2697 VALGRIND_RESTORE_STACK \
2699 :
"r" (&_argvec[2]) \
2700 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2702 lval = (__typeof__(lval)) _res; \
2705#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \
2707 volatile OrigFn _orig = (orig); \
2708 volatile unsigned long _argvec[3+5]; \
2709 volatile unsigned long _res; \
2711 _argvec[1] = (unsigned long)_orig.r2; \
2712 _argvec[2] = (unsigned long)_orig.nraddr; \
2713 _argvec[2+1] = (unsigned long)arg1; \
2714 _argvec[2+2] = (unsigned long)arg2; \
2715 _argvec[2+3] = (unsigned long)arg3; \
2716 _argvec[2+4] = (unsigned long)arg4; \
2717 _argvec[2+5] = (unsigned long)arg5; \
2719 VALGRIND_ALIGN_STACK \
2721 "std 2,-16(11)\n\t"
\
2724 "ld 4, 16(11)\n\t" \
2725 "ld 5, 24(11)\n\t" \
2726 "ld 6, 32(11)\n\t" \
2727 "ld 7, 40(11)\n\t" \
2728 "ld 11, 0(11)\n\t" \
2729 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2732 "ld 2,-16(11)\n\t"
\
2733 VALGRIND_RESTORE_STACK \
2735 :
"r" (&_argvec[2]) \
2736 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2738 lval = (__typeof__(lval)) _res; \
2741#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \
2743 volatile OrigFn _orig = (orig); \
2744 volatile unsigned long _argvec[3+6]; \
2745 volatile unsigned long _res; \
2747 _argvec[1] = (unsigned long)_orig.r2; \
2748 _argvec[2] = (unsigned long)_orig.nraddr; \
2749 _argvec[2+1] = (unsigned long)arg1; \
2750 _argvec[2+2] = (unsigned long)arg2; \
2751 _argvec[2+3] = (unsigned long)arg3; \
2752 _argvec[2+4] = (unsigned long)arg4; \
2753 _argvec[2+5] = (unsigned long)arg5; \
2754 _argvec[2+6] = (unsigned long)arg6; \
2756 VALGRIND_ALIGN_STACK \
2758 "std 2,-16(11)\n\t"
\
2761 "ld 4, 16(11)\n\t" \
2762 "ld 5, 24(11)\n\t" \
2763 "ld 6, 32(11)\n\t" \
2764 "ld 7, 40(11)\n\t" \
2765 "ld 8, 48(11)\n\t" \
2766 "ld 11, 0(11)\n\t" \
2767 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2770 "ld 2,-16(11)\n\t"
\
2771 VALGRIND_RESTORE_STACK \
2773 :
"r" (&_argvec[2]) \
2774 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2776 lval = (__typeof__(lval)) _res; \
2779#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2782 volatile OrigFn _orig = (orig); \
2783 volatile unsigned long _argvec[3+7]; \
2784 volatile unsigned long _res; \
2786 _argvec[1] = (unsigned long)_orig.r2; \
2787 _argvec[2] = (unsigned long)_orig.nraddr; \
2788 _argvec[2+1] = (unsigned long)arg1; \
2789 _argvec[2+2] = (unsigned long)arg2; \
2790 _argvec[2+3] = (unsigned long)arg3; \
2791 _argvec[2+4] = (unsigned long)arg4; \
2792 _argvec[2+5] = (unsigned long)arg5; \
2793 _argvec[2+6] = (unsigned long)arg6; \
2794 _argvec[2+7] = (unsigned long)arg7; \
2796 VALGRIND_ALIGN_STACK \
2798 "std 2,-16(11)\n\t"
\
2801 "ld 4, 16(11)\n\t" \
2802 "ld 5, 24(11)\n\t" \
2803 "ld 6, 32(11)\n\t" \
2804 "ld 7, 40(11)\n\t" \
2805 "ld 8, 48(11)\n\t" \
2806 "ld 9, 56(11)\n\t" \
2807 "ld 11, 0(11)\n\t" \
2808 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2811 "ld 2,-16(11)\n\t"
\
2812 VALGRIND_RESTORE_STACK \
2814 :
"r" (&_argvec[2]) \
2815 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2817 lval = (__typeof__(lval)) _res; \
2820#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2823 volatile OrigFn _orig = (orig); \
2824 volatile unsigned long _argvec[3+8]; \
2825 volatile unsigned long _res; \
2827 _argvec[1] = (unsigned long)_orig.r2; \
2828 _argvec[2] = (unsigned long)_orig.nraddr; \
2829 _argvec[2+1] = (unsigned long)arg1; \
2830 _argvec[2+2] = (unsigned long)arg2; \
2831 _argvec[2+3] = (unsigned long)arg3; \
2832 _argvec[2+4] = (unsigned long)arg4; \
2833 _argvec[2+5] = (unsigned long)arg5; \
2834 _argvec[2+6] = (unsigned long)arg6; \
2835 _argvec[2+7] = (unsigned long)arg7; \
2836 _argvec[2+8] = (unsigned long)arg8; \
2838 VALGRIND_ALIGN_STACK \
2840 "std 2,-16(11)\n\t"
\
2843 "ld 4, 16(11)\n\t" \
2844 "ld 5, 24(11)\n\t" \
2845 "ld 6, 32(11)\n\t" \
2846 "ld 7, 40(11)\n\t" \
2847 "ld 8, 48(11)\n\t" \
2848 "ld 9, 56(11)\n\t" \
2849 "ld 10, 64(11)\n\t" \
2850 "ld 11, 0(11)\n\t" \
2851 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2854 "ld 2,-16(11)\n\t"
\
2855 VALGRIND_RESTORE_STACK \
2857 :
"r" (&_argvec[2]) \
2858 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2860 lval = (__typeof__(lval)) _res; \
2863#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2866 volatile OrigFn _orig = (orig); \
2867 volatile unsigned long _argvec[3+9]; \
2868 volatile unsigned long _res; \
2870 _argvec[1] = (unsigned long)_orig.r2; \
2871 _argvec[2] = (unsigned long)_orig.nraddr; \
2872 _argvec[2+1] = (unsigned long)arg1; \
2873 _argvec[2+2] = (unsigned long)arg2; \
2874 _argvec[2+3] = (unsigned long)arg3; \
2875 _argvec[2+4] = (unsigned long)arg4; \
2876 _argvec[2+5] = (unsigned long)arg5; \
2877 _argvec[2+6] = (unsigned long)arg6; \
2878 _argvec[2+7] = (unsigned long)arg7; \
2879 _argvec[2+8] = (unsigned long)arg8; \
2880 _argvec[2+9] = (unsigned long)arg9; \
2882 VALGRIND_ALIGN_STACK \
2884 "std 2,-16(11)\n\t"
\
2886 "addi 1,1,-128\n\t" \
2889 "std 3,112(1)\n\t" \
2892 "ld 4, 16(11)\n\t" \
2893 "ld 5, 24(11)\n\t" \
2894 "ld 6, 32(11)\n\t" \
2895 "ld 7, 40(11)\n\t" \
2896 "ld 8, 48(11)\n\t" \
2897 "ld 9, 56(11)\n\t" \
2898 "ld 10, 64(11)\n\t" \
2899 "ld 11, 0(11)\n\t" \
2900 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2903 "ld 2,-16(11)\n\t"
\
2904 VALGRIND_RESTORE_STACK \
2906 :
"r" (&_argvec[2]) \
2907 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2909 lval = (__typeof__(lval)) _res; \
2912#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2913 arg7,arg8,arg9,arg10) \
2915 volatile OrigFn _orig = (orig); \
2916 volatile unsigned long _argvec[3+10]; \
2917 volatile unsigned long _res; \
2919 _argvec[1] = (unsigned long)_orig.r2; \
2920 _argvec[2] = (unsigned long)_orig.nraddr; \
2921 _argvec[2+1] = (unsigned long)arg1; \
2922 _argvec[2+2] = (unsigned long)arg2; \
2923 _argvec[2+3] = (unsigned long)arg3; \
2924 _argvec[2+4] = (unsigned long)arg4; \
2925 _argvec[2+5] = (unsigned long)arg5; \
2926 _argvec[2+6] = (unsigned long)arg6; \
2927 _argvec[2+7] = (unsigned long)arg7; \
2928 _argvec[2+8] = (unsigned long)arg8; \
2929 _argvec[2+9] = (unsigned long)arg9; \
2930 _argvec[2+10] = (unsigned long)arg10; \
2932 VALGRIND_ALIGN_STACK \
2934 "std 2,-16(11)\n\t"
\
2936 "addi 1,1,-128\n\t" \
2939 "std 3,120(1)\n\t" \
2942 "std 3,112(1)\n\t" \
2945 "ld 4, 16(11)\n\t" \
2946 "ld 5, 24(11)\n\t" \
2947 "ld 6, 32(11)\n\t" \
2948 "ld 7, 40(11)\n\t" \
2949 "ld 8, 48(11)\n\t" \
2950 "ld 9, 56(11)\n\t" \
2951 "ld 10, 64(11)\n\t" \
2952 "ld 11, 0(11)\n\t" \
2953 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
2956 "ld 2,-16(11)\n\t"
\
2957 VALGRIND_RESTORE_STACK \
2959 :
"r" (&_argvec[2]) \
2960 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
2962 lval = (__typeof__(lval)) _res; \
2965#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
2966 arg7,arg8,arg9,arg10,arg11) \
2968 volatile OrigFn _orig = (orig); \
2969 volatile unsigned long _argvec[3+11]; \
2970 volatile unsigned long _res; \
2972 _argvec[1] = (unsigned long)_orig.r2; \
2973 _argvec[2] = (unsigned long)_orig.nraddr; \
2974 _argvec[2+1] = (unsigned long)arg1; \
2975 _argvec[2+2] = (unsigned long)arg2; \
2976 _argvec[2+3] = (unsigned long)arg3; \
2977 _argvec[2+4] = (unsigned long)arg4; \
2978 _argvec[2+5] = (unsigned long)arg5; \
2979 _argvec[2+6] = (unsigned long)arg6; \
2980 _argvec[2+7] = (unsigned long)arg7; \
2981 _argvec[2+8] = (unsigned long)arg8; \
2982 _argvec[2+9] = (unsigned long)arg9; \
2983 _argvec[2+10] = (unsigned long)arg10; \
2984 _argvec[2+11] = (unsigned long)arg11; \
2986 VALGRIND_ALIGN_STACK \
2988 "std 2,-16(11)\n\t"
\
2990 "addi 1,1,-144\n\t" \
2993 "std 3,128(1)\n\t" \
2996 "std 3,120(1)\n\t" \
2999 "std 3,112(1)\n\t" \
3002 "ld 4, 16(11)\n\t" \
3003 "ld 5, 24(11)\n\t" \
3004 "ld 6, 32(11)\n\t" \
3005 "ld 7, 40(11)\n\t" \
3006 "ld 8, 48(11)\n\t" \
3007 "ld 9, 56(11)\n\t" \
3008 "ld 10, 64(11)\n\t" \
3009 "ld 11, 0(11)\n\t" \
3010 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
3013 "ld 2,-16(11)\n\t"
\
3014 VALGRIND_RESTORE_STACK \
3016 :
"r" (&_argvec[2]) \
3017 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
3019 lval = (__typeof__(lval)) _res; \
3022#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
3023 arg7,arg8,arg9,arg10,arg11,arg12) \
3025 volatile OrigFn _orig = (orig); \
3026 volatile unsigned long _argvec[3+12]; \
3027 volatile unsigned long _res; \
3029 _argvec[1] = (unsigned long)_orig.r2; \
3030 _argvec[2] = (unsigned long)_orig.nraddr; \
3031 _argvec[2+1] = (unsigned long)arg1; \
3032 _argvec[2+2] = (unsigned long)arg2; \
3033 _argvec[2+3] = (unsigned long)arg3; \
3034 _argvec[2+4] = (unsigned long)arg4; \
3035 _argvec[2+5] = (unsigned long)arg5; \
3036 _argvec[2+6] = (unsigned long)arg6; \
3037 _argvec[2+7] = (unsigned long)arg7; \
3038 _argvec[2+8] = (unsigned long)arg8; \
3039 _argvec[2+9] = (unsigned long)arg9; \
3040 _argvec[2+10] = (unsigned long)arg10; \
3041 _argvec[2+11] = (unsigned long)arg11; \
3042 _argvec[2+12] = (unsigned long)arg12; \
3044 VALGRIND_ALIGN_STACK \
3046 "std 2,-16(11)\n\t"
\
3048 "addi 1,1,-144\n\t" \
3051 "std 3,136(1)\n\t" \
3054 "std 3,128(1)\n\t" \
3057 "std 3,120(1)\n\t" \
3060 "std 3,112(1)\n\t" \
3063 "ld 4, 16(11)\n\t" \
3064 "ld 5, 24(11)\n\t" \
3065 "ld 6, 32(11)\n\t" \
3066 "ld 7, 40(11)\n\t" \
3067 "ld 8, 48(11)\n\t" \
3068 "ld 9, 56(11)\n\t" \
3069 "ld 10, 64(11)\n\t" \
3070 "ld 11, 0(11)\n\t" \
3071 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
3074 "ld 2,-16(11)\n\t"
\
3075 VALGRIND_RESTORE_STACK \
3077 :
"r" (&_argvec[2]) \
3078 :
"cc", "memory", __CALLER_SAVED_REGS, "r28" \
3080 lval = (__typeof__(lval)) _res; \
3087#if defined(PLAT_arm_linux)
3090#define __CALLER_SAVED_REGS "r0", "r1", "r2", "r3","r4","r14"
3105#define VALGRIND_ALIGN_STACK \
3108 "bic r4, r4, #7\n\t" \
3110#define VALGRIND_RESTORE_STACK \
3116#define CALL_FN_W_v(lval, orig) \
3118 volatile OrigFn _orig = (orig); \
3119 volatile unsigned long _argvec[1]; \
3120 volatile unsigned long _res; \
3121 _argvec[0] = (unsigned long)_orig.nraddr; \
3123 VALGRIND_ALIGN_STACK \
3124 "ldr r4, [%1] \n\t" \
3125 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3126 VALGRIND_RESTORE_STACK \
3129 :
"0" (&_argvec[0]) \
3130 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3132 lval = (__typeof__(lval)) _res; \
3135#define CALL_FN_W_W(lval, orig, arg1) \
3137 volatile OrigFn _orig = (orig); \
3138 volatile unsigned long _argvec[2]; \
3139 volatile unsigned long _res; \
3140 _argvec[0] = (unsigned long)_orig.nraddr; \
3141 _argvec[1] = (unsigned long)(arg1); \
3143 VALGRIND_ALIGN_STACK \
3144 "ldr r0, [%1, #4] \n\t" \
3145 "ldr r4, [%1] \n\t"
\
3146 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3147 VALGRIND_RESTORE_STACK \
3150 :
"0" (&_argvec[0]) \
3151 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3153 lval = (__typeof__(lval)) _res; \
3156#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
3158 volatile OrigFn _orig = (orig); \
3159 volatile unsigned long _argvec[3]; \
3160 volatile unsigned long _res; \
3161 _argvec[0] = (unsigned long)_orig.nraddr; \
3162 _argvec[1] = (unsigned long)(arg1); \
3163 _argvec[2] = (unsigned long)(arg2); \
3165 VALGRIND_ALIGN_STACK \
3166 "ldr r0, [%1, #4] \n\t" \
3167 "ldr r1, [%1, #8] \n\t" \
3168 "ldr r4, [%1] \n\t"
\
3169 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3170 VALGRIND_RESTORE_STACK \
3173 :
"0" (&_argvec[0]) \
3174 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3176 lval = (__typeof__(lval)) _res; \
3179#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \
3181 volatile OrigFn _orig = (orig); \
3182 volatile unsigned long _argvec[4]; \
3183 volatile unsigned long _res; \
3184 _argvec[0] = (unsigned long)_orig.nraddr; \
3185 _argvec[1] = (unsigned long)(arg1); \
3186 _argvec[2] = (unsigned long)(arg2); \
3187 _argvec[3] = (unsigned long)(arg3); \
3189 VALGRIND_ALIGN_STACK \
3190 "ldr r0, [%1, #4] \n\t" \
3191 "ldr r1, [%1, #8] \n\t" \
3192 "ldr r2, [%1, #12] \n\t" \
3193 "ldr r4, [%1] \n\t"
\
3194 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3195 VALGRIND_RESTORE_STACK \
3198 :
"0" (&_argvec[0]) \
3199 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3201 lval = (__typeof__(lval)) _res; \
3204#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \
3206 volatile OrigFn _orig = (orig); \
3207 volatile unsigned long _argvec[5]; \
3208 volatile unsigned long _res; \
3209 _argvec[0] = (unsigned long)_orig.nraddr; \
3210 _argvec[1] = (unsigned long)(arg1); \
3211 _argvec[2] = (unsigned long)(arg2); \
3212 _argvec[3] = (unsigned long)(arg3); \
3213 _argvec[4] = (unsigned long)(arg4); \
3215 VALGRIND_ALIGN_STACK \
3216 "ldr r0, [%1, #4] \n\t" \
3217 "ldr r1, [%1, #8] \n\t" \
3218 "ldr r2, [%1, #12] \n\t" \
3219 "ldr r3, [%1, #16] \n\t" \
3220 "ldr r4, [%1] \n\t"
\
3221 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3222 VALGRIND_RESTORE_STACK \
3225 :
"0" (&_argvec[0]) \
3226 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3228 lval = (__typeof__(lval)) _res; \
3231#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \
3233 volatile OrigFn _orig = (orig); \
3234 volatile unsigned long _argvec[6]; \
3235 volatile unsigned long _res; \
3236 _argvec[0] = (unsigned long)_orig.nraddr; \
3237 _argvec[1] = (unsigned long)(arg1); \
3238 _argvec[2] = (unsigned long)(arg2); \
3239 _argvec[3] = (unsigned long)(arg3); \
3240 _argvec[4] = (unsigned long)(arg4); \
3241 _argvec[5] = (unsigned long)(arg5); \
3243 VALGRIND_ALIGN_STACK \
3244 "sub sp, sp, #4 \n\t" \
3245 "ldr r0, [%1, #20] \n\t" \
3247 "ldr r0, [%1, #4] \n\t" \
3248 "ldr r1, [%1, #8] \n\t" \
3249 "ldr r2, [%1, #12] \n\t" \
3250 "ldr r3, [%1, #16] \n\t" \
3251 "ldr r4, [%1] \n\t"
\
3252 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3253 VALGRIND_RESTORE_STACK \
3256 :
"0" (&_argvec[0]) \
3257 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3259 lval = (__typeof__(lval)) _res; \
3262#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \
3264 volatile OrigFn _orig = (orig); \
3265 volatile unsigned long _argvec[7]; \
3266 volatile unsigned long _res; \
3267 _argvec[0] = (unsigned long)_orig.nraddr; \
3268 _argvec[1] = (unsigned long)(arg1); \
3269 _argvec[2] = (unsigned long)(arg2); \
3270 _argvec[3] = (unsigned long)(arg3); \
3271 _argvec[4] = (unsigned long)(arg4); \
3272 _argvec[5] = (unsigned long)(arg5); \
3273 _argvec[6] = (unsigned long)(arg6); \
3275 VALGRIND_ALIGN_STACK \
3276 "ldr r0, [%1, #20] \n\t" \
3277 "ldr r1, [%1, #24] \n\t" \
3278 "push {r0, r1} \n\t" \
3279 "ldr r0, [%1, #4] \n\t" \
3280 "ldr r1, [%1, #8] \n\t" \
3281 "ldr r2, [%1, #12] \n\t" \
3282 "ldr r3, [%1, #16] \n\t" \
3283 "ldr r4, [%1] \n\t"
\
3284 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3285 VALGRIND_RESTORE_STACK \
3288 :
"0" (&_argvec[0]) \
3289 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3291 lval = (__typeof__(lval)) _res; \
3294#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
3297 volatile OrigFn _orig = (orig); \
3298 volatile unsigned long _argvec[8]; \
3299 volatile unsigned long _res; \
3300 _argvec[0] = (unsigned long)_orig.nraddr; \
3301 _argvec[1] = (unsigned long)(arg1); \
3302 _argvec[2] = (unsigned long)(arg2); \
3303 _argvec[3] = (unsigned long)(arg3); \
3304 _argvec[4] = (unsigned long)(arg4); \
3305 _argvec[5] = (unsigned long)(arg5); \
3306 _argvec[6] = (unsigned long)(arg6); \
3307 _argvec[7] = (unsigned long)(arg7); \
3309 VALGRIND_ALIGN_STACK \
3310 "sub sp, sp, #4 \n\t" \
3311 "ldr r0, [%1, #20] \n\t" \
3312 "ldr r1, [%1, #24] \n\t" \
3313 "ldr r2, [%1, #28] \n\t" \
3314 "push {r0, r1, r2} \n\t" \
3315 "ldr r0, [%1, #4] \n\t" \
3316 "ldr r1, [%1, #8] \n\t" \
3317 "ldr r2, [%1, #12] \n\t" \
3318 "ldr r3, [%1, #16] \n\t" \
3319 "ldr r4, [%1] \n\t"
\
3320 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3321 VALGRIND_RESTORE_STACK \
3324 :
"0" (&_argvec[0]) \
3325 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3327 lval = (__typeof__(lval)) _res; \
3330#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
3333 volatile OrigFn _orig = (orig); \
3334 volatile unsigned long _argvec[9]; \
3335 volatile unsigned long _res; \
3336 _argvec[0] = (unsigned long)_orig.nraddr; \
3337 _argvec[1] = (unsigned long)(arg1); \
3338 _argvec[2] = (unsigned long)(arg2); \
3339 _argvec[3] = (unsigned long)(arg3); \
3340 _argvec[4] = (unsigned long)(arg4); \
3341 _argvec[5] = (unsigned long)(arg5); \
3342 _argvec[6] = (unsigned long)(arg6); \
3343 _argvec[7] = (unsigned long)(arg7); \
3344 _argvec[8] = (unsigned long)(arg8); \
3346 VALGRIND_ALIGN_STACK \
3347 "ldr r0, [%1, #20] \n\t" \
3348 "ldr r1, [%1, #24] \n\t" \
3349 "ldr r2, [%1, #28] \n\t" \
3350 "ldr r3, [%1, #32] \n\t" \
3351 "push {r0, r1, r2, r3} \n\t" \
3352 "ldr r0, [%1, #4] \n\t" \
3353 "ldr r1, [%1, #8] \n\t" \
3354 "ldr r2, [%1, #12] \n\t" \
3355 "ldr r3, [%1, #16] \n\t" \
3356 "ldr r4, [%1] \n\t"
\
3357 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3358 VALGRIND_RESTORE_STACK \
3361 :
"0" (&_argvec[0]) \
3362 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3364 lval = (__typeof__(lval)) _res; \
3367#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
3370 volatile OrigFn _orig = (orig); \
3371 volatile unsigned long _argvec[10]; \
3372 volatile unsigned long _res; \
3373 _argvec[0] = (unsigned long)_orig.nraddr; \
3374 _argvec[1] = (unsigned long)(arg1); \
3375 _argvec[2] = (unsigned long)(arg2); \
3376 _argvec[3] = (unsigned long)(arg3); \
3377 _argvec[4] = (unsigned long)(arg4); \
3378 _argvec[5] = (unsigned long)(arg5); \
3379 _argvec[6] = (unsigned long)(arg6); \
3380 _argvec[7] = (unsigned long)(arg7); \
3381 _argvec[8] = (unsigned long)(arg8); \
3382 _argvec[9] = (unsigned long)(arg9); \
3384 VALGRIND_ALIGN_STACK \
3385 "sub sp, sp, #4 \n\t" \
3386 "ldr r0, [%1, #20] \n\t" \
3387 "ldr r1, [%1, #24] \n\t" \
3388 "ldr r2, [%1, #28] \n\t" \
3389 "ldr r3, [%1, #32] \n\t" \
3390 "ldr r4, [%1, #36] \n\t" \
3391 "push {r0, r1, r2, r3, r4} \n\t" \
3392 "ldr r0, [%1, #4] \n\t" \
3393 "ldr r1, [%1, #8] \n\t" \
3394 "ldr r2, [%1, #12] \n\t" \
3395 "ldr r3, [%1, #16] \n\t" \
3396 "ldr r4, [%1] \n\t"
\
3397 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3398 VALGRIND_RESTORE_STACK \
3401 :
"0" (&_argvec[0]) \
3402 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
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[11]; \
3412 volatile unsigned long _res; \
3413 _argvec[0] = (unsigned long)_orig.nraddr; \
3414 _argvec[1] = (unsigned long)(arg1); \
3415 _argvec[2] = (unsigned long)(arg2); \
3416 _argvec[3] = (unsigned long)(arg3); \
3417 _argvec[4] = (unsigned long)(arg4); \
3418 _argvec[5] = (unsigned long)(arg5); \
3419 _argvec[6] = (unsigned long)(arg6); \
3420 _argvec[7] = (unsigned long)(arg7); \
3421 _argvec[8] = (unsigned long)(arg8); \
3422 _argvec[9] = (unsigned long)(arg9); \
3423 _argvec[10] = (unsigned long)(arg10); \
3425 VALGRIND_ALIGN_STACK \
3426 "ldr r0, [%1, #40] \n\t" \
3428 "ldr r0, [%1, #20] \n\t" \
3429 "ldr r1, [%1, #24] \n\t" \
3430 "ldr r2, [%1, #28] \n\t" \
3431 "ldr r3, [%1, #32] \n\t" \
3432 "ldr r4, [%1, #36] \n\t" \
3433 "push {r0, r1, r2, r3, r4} \n\t" \
3434 "ldr r0, [%1, #4] \n\t" \
3435 "ldr r1, [%1, #8] \n\t" \
3436 "ldr r2, [%1, #12] \n\t" \
3437 "ldr r3, [%1, #16] \n\t" \
3438 "ldr r4, [%1] \n\t"
\
3439 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3440 VALGRIND_RESTORE_STACK \
3443 :
"0" (&_argvec[0]) \
3444 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3446 lval = (__typeof__(lval)) _res; \
3449#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
3450 arg6,arg7,arg8,arg9,arg10, \
3453 volatile OrigFn _orig = (orig); \
3454 volatile unsigned long _argvec[12]; \
3455 volatile unsigned long _res; \
3456 _argvec[0] = (unsigned long)_orig.nraddr; \
3457 _argvec[1] = (unsigned long)(arg1); \
3458 _argvec[2] = (unsigned long)(arg2); \
3459 _argvec[3] = (unsigned long)(arg3); \
3460 _argvec[4] = (unsigned long)(arg4); \
3461 _argvec[5] = (unsigned long)(arg5); \
3462 _argvec[6] = (unsigned long)(arg6); \
3463 _argvec[7] = (unsigned long)(arg7); \
3464 _argvec[8] = (unsigned long)(arg8); \
3465 _argvec[9] = (unsigned long)(arg9); \
3466 _argvec[10] = (unsigned long)(arg10); \
3467 _argvec[11] = (unsigned long)(arg11); \
3469 VALGRIND_ALIGN_STACK \
3470 "sub sp, sp, #4 \n\t" \
3471 "ldr r0, [%1, #40] \n\t" \
3472 "ldr r1, [%1, #44] \n\t" \
3473 "push {r0, r1} \n\t" \
3474 "ldr r0, [%1, #20] \n\t" \
3475 "ldr r1, [%1, #24] \n\t" \
3476 "ldr r2, [%1, #28] \n\t" \
3477 "ldr r3, [%1, #32] \n\t" \
3478 "ldr r4, [%1, #36] \n\t" \
3479 "push {r0, r1, r2, r3, r4} \n\t" \
3480 "ldr r0, [%1, #4] \n\t" \
3481 "ldr r1, [%1, #8] \n\t" \
3482 "ldr r2, [%1, #12] \n\t" \
3483 "ldr r3, [%1, #16] \n\t" \
3484 "ldr r4, [%1] \n\t"
\
3485 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3486 VALGRIND_RESTORE_STACK \
3489 :
"0" (&_argvec[0]) \
3490 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3492 lval = (__typeof__(lval)) _res; \
3495#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
3496 arg6,arg7,arg8,arg9,arg10, \
3499 volatile OrigFn _orig = (orig); \
3500 volatile unsigned long _argvec[13]; \
3501 volatile unsigned long _res; \
3502 _argvec[0] = (unsigned long)_orig.nraddr; \
3503 _argvec[1] = (unsigned long)(arg1); \
3504 _argvec[2] = (unsigned long)(arg2); \
3505 _argvec[3] = (unsigned long)(arg3); \
3506 _argvec[4] = (unsigned long)(arg4); \
3507 _argvec[5] = (unsigned long)(arg5); \
3508 _argvec[6] = (unsigned long)(arg6); \
3509 _argvec[7] = (unsigned long)(arg7); \
3510 _argvec[8] = (unsigned long)(arg8); \
3511 _argvec[9] = (unsigned long)(arg9); \
3512 _argvec[10] = (unsigned long)(arg10); \
3513 _argvec[11] = (unsigned long)(arg11); \
3514 _argvec[12] = (unsigned long)(arg12); \
3516 VALGRIND_ALIGN_STACK \
3517 "ldr r0, [%1, #40] \n\t" \
3518 "ldr r1, [%1, #44] \n\t" \
3519 "ldr r2, [%1, #48] \n\t" \
3520 "push {r0, r1, r2} \n\t" \
3521 "ldr r0, [%1, #20] \n\t" \
3522 "ldr r1, [%1, #24] \n\t" \
3523 "ldr r2, [%1, #28] \n\t" \
3524 "ldr r3, [%1, #32] \n\t" \
3525 "ldr r4, [%1, #36] \n\t" \
3526 "push {r0, r1, r2, r3, r4} \n\t" \
3527 "ldr r0, [%1, #4] \n\t" \
3528 "ldr r1, [%1, #8] \n\t" \
3529 "ldr r2, [%1, #12] \n\t" \
3530 "ldr r3, [%1, #16] \n\t" \
3531 "ldr r4, [%1] \n\t"
\
3532 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4 \
3533 VALGRIND_RESTORE_STACK \
3536 :
"0" (&_argvec[0]) \
3537 :
"cc", "memory", __CALLER_SAVED_REGS, "r10" \
3539 lval = (__typeof__(lval)) _res; \
3546#if defined(PLAT_arm64_linux)
3549#define __CALLER_SAVED_REGS \
3550 "x0", "x1", "x2", "x3","x4", "x5", "x6", "x7", "x8", "x9", \
3551 "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", \
3552 "x18", "x19", "x20", "x30", \
3553 "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", \
3554 "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", \
3555 "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", \
3556 "v26", "v27", "v28", "v29", "v30", "v31"
3560#define VALGRIND_ALIGN_STACK \
3562 "bic sp, x21, #15\n\t"
3563#define VALGRIND_RESTORE_STACK \
3569#define CALL_FN_W_v(lval, orig) \
3571 volatile OrigFn _orig = (orig); \
3572 volatile unsigned long _argvec[1]; \
3573 volatile unsigned long _res; \
3574 _argvec[0] = (unsigned long)_orig.nraddr; \
3576 VALGRIND_ALIGN_STACK \
3577 "ldr x8, [%1] \n\t" \
3578 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8 \
3579 VALGRIND_RESTORE_STACK \
3582 :
"0" (&_argvec[0]) \
3583 :
"cc", "memory", __CALLER_SAVED_REGS, "x21" \
3585 lval = (__typeof__(lval)) _res; \
3588#define CALL_FN_W_W(lval, orig, arg1) \
3590 volatile OrigFn _orig = (orig); \
3591 volatile unsigned long _argvec[2]; \
3592 volatile unsigned long _res; \
3593 _argvec[0] = (unsigned long)_orig.nraddr; \
3594 _argvec[1] = (unsigned long)(arg1); \
3596 VALGRIND_ALIGN_STACK \
3597 "ldr x0, [%1, #8] \n\t" \
3598 "ldr x8, [%1] \n\t"
\
3599 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8 \
3600 VALGRIND_RESTORE_STACK \
3603 :
"0" (&_argvec[0]) \
3604 :
"cc", "memory", __CALLER_SAVED_REGS, "x21" \
3606 lval = (__typeof__(lval)) _res; \
3609#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
3611 volatile OrigFn _orig = (orig); \
3612 volatile unsigned long _argvec[3]; \
3613 volatile unsigned long _res; \
3614 _argvec[0] = (unsigned long)_orig.nraddr; \
3615 _argvec[1] = (unsigned long)(arg1); \
3616 _argvec[2] = (unsigned long)(arg2); \
3618 VALGRIND_ALIGN_STACK \
3619 "ldr x0, [%1, #8] \n\t" \
3620 "ldr x1, [%1, #16] \n\t" \
3621 "ldr x8, [%1] \n\t"
\
3622 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8 \
3623 VALGRIND_RESTORE_STACK \
3626 :
"0" (&_argvec[0]) \
3627 :
"cc", "memory", __CALLER_SAVED_REGS
\
3629 lval = (__typeof__(lval)) _res; \
3632#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \
3634 volatile OrigFn _orig = (orig); \
3635 volatile unsigned long _argvec[4]; \
3636 volatile unsigned long _res; \
3637 _argvec[0] = (unsigned long)_orig.nraddr; \
3638 _argvec[1] = (unsigned long)(arg1); \
3639 _argvec[2] = (unsigned long)(arg2); \
3640 _argvec[3] = (unsigned long)(arg3); \
3642 VALGRIND_ALIGN_STACK \
3643 "ldr x0, [%1, #8] \n\t" \
3644 "ldr x1, [%1, #16] \n\t" \
3645 "ldr x2, [%1, #24] \n\t" \
3646 "ldr x8, [%1] \n\t"
\
3647 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8 \
3648 VALGRIND_RESTORE_STACK \
3651 :
"0" (&_argvec[0]) \
3652 :
"cc", "memory", __CALLER_SAVED_REGS
\
3654 lval = (__typeof__(lval)) _res; \
3657#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \
3659 volatile OrigFn _orig = (orig); \
3660 volatile unsigned long _argvec[5]; \
3661 volatile unsigned long _res; \
3662 _argvec[0] = (unsigned long)_orig.nraddr; \
3663 _argvec[1] = (unsigned long)(arg1); \
3664 _argvec[2] = (unsigned long)(arg2); \
3665 _argvec[3] = (unsigned long)(arg3); \
3666 _argvec[4] = (unsigned long)(arg4); \
3668 VALGRIND_ALIGN_STACK \
3669 "ldr x0, [%1, #8] \n\t" \
3670 "ldr x1, [%1, #16] \n\t" \
3671 "ldr x2, [%1, #24] \n\t" \
3672 "ldr x3, [%1, #32] \n\t" \
3673 "ldr x8, [%1] \n\t"
\
3674 VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8 \
3675 VALGRIND_RESTORE_STACK \
3678 :
"0" (&_argvec[0]) \
3679 :
"cc", "memory", __CALLER_SAVED_REGS
\
3681 lval = (__typeof__(lval)) _res; \
3688#if defined(PLAT_s390x_linux)
3694#if defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)
3695# define __FRAME_POINTER \
3696 ,"d"(__builtin_dwarf_cfa())
3697# define VALGRIND_CFI_PROLOGUE \
3698 ".cfi_remember_state\n\t" \
3702 ".cfi_def_cfa r11, 0\n\t"
3703# define VALGRIND_CFI_EPILOGUE \
3705 ".cfi_restore_state\n\t"
3707# define __FRAME_POINTER
3708# define VALGRIND_CFI_PROLOGUE \
3710# define VALGRIND_CFI_EPILOGUE
3722#define __CALLER_SAVED_REGS "0","1","2","3","4","5","14", \
3723 "f0","f1","f2","f3","f4","f5","f6","f7"
3734#define CALL_FN_W_v(lval, orig) \
3736 volatile OrigFn _orig = (orig); \
3737 volatile unsigned long _argvec[1]; \
3738 volatile unsigned long _res; \
3739 _argvec[0] = (unsigned long)_orig.nraddr; \
3741 VALGRIND_CFI_PROLOGUE \
3742 "aghi 15,-160\n\t" \
3744 VALGRIND_CALL_NOREDIR_R1 \
3747 VALGRIND_CFI_EPILOGUE \
3749 :
"d" (&_argvec[0]) __FRAME_POINTER \
3750 :
"cc", "memory", __CALLER_SAVED_REGS,"7" \
3752 lval = (__typeof__(lval)) _res; \
3756#define CALL_FN_W_W(lval, orig, arg1) \
3758 volatile OrigFn _orig = (orig); \
3759 volatile unsigned long _argvec[2]; \
3760 volatile unsigned long _res; \
3761 _argvec[0] = (unsigned long)_orig.nraddr; \
3762 _argvec[1] = (unsigned long)arg1; \
3764 VALGRIND_CFI_PROLOGUE \
3765 "aghi 15,-160\n\t" \
3768 VALGRIND_CALL_NOREDIR_R1 \
3771 VALGRIND_CFI_EPILOGUE \
3773 :
"a" (&_argvec[0]) __FRAME_POINTER \
3774 :
"cc", "memory", __CALLER_SAVED_REGS,"7" \
3776 lval = (__typeof__(lval)) _res; \
3779#define CALL_FN_W_WW(lval, orig, arg1, arg2) \
3781 volatile OrigFn _orig = (orig); \
3782 volatile unsigned long _argvec[3]; \
3783 volatile unsigned long _res; \
3784 _argvec[0] = (unsigned long)_orig.nraddr; \
3785 _argvec[1] = (unsigned long)arg1; \
3786 _argvec[2] = (unsigned long)arg2; \
3788 VALGRIND_CFI_PROLOGUE \
3789 "aghi 15,-160\n\t" \
3793 VALGRIND_CALL_NOREDIR_R1 \
3796 VALGRIND_CFI_EPILOGUE \
3798 :
"a" (&_argvec[0]) __FRAME_POINTER \
3799 :
"cc", "memory", __CALLER_SAVED_REGS,"7" \
3801 lval = (__typeof__(lval)) _res; \
3804#define CALL_FN_W_WWW(lval, orig, arg1, arg2, arg3) \
3806 volatile OrigFn _orig = (orig); \
3807 volatile unsigned long _argvec[4]; \
3808 volatile unsigned long _res; \
3809 _argvec[0] = (unsigned long)_orig.nraddr; \
3810 _argvec[1] = (unsigned long)arg1; \
3811 _argvec[2] = (unsigned long)arg2; \
3812 _argvec[3] = (unsigned long)arg3; \
3814 VALGRIND_CFI_PROLOGUE \
3815 "aghi 15,-160\n\t" \
3820 VALGRIND_CALL_NOREDIR_R1 \
3823 VALGRIND_CFI_EPILOGUE \
3825 :
"a" (&_argvec[0]) __FRAME_POINTER \
3826 :
"cc", "memory", __CALLER_SAVED_REGS,"7" \
3828 lval = (__typeof__(lval)) _res; \
3831#define CALL_FN_W_WWWW(lval, orig, arg1, arg2, arg3, arg4) \
3833 volatile OrigFn _orig = (orig); \
3834 volatile unsigned long _argvec[5]; \
3835 volatile unsigned long _res; \
3836 _argvec[0] = (unsigned long)_orig.nraddr; \
3837 _argvec[1] = (unsigned long)arg1; \
3838 _argvec[2] = (unsigned long)arg2; \
3839 _argvec[3] = (unsigned long)arg3; \
3840 _argvec[4] = (unsigned long)arg4; \
3842 VALGRIND_CFI_PROLOGUE \
3843 "aghi 15,-160\n\t" \
3849 VALGRIND_CALL_NOREDIR_R1 \
3852 VALGRIND_CFI_EPILOGUE \
3854 :
"a" (&_argvec[0]) __FRAME_POINTER \
3855 :
"cc", "memory", __CALLER_SAVED_REGS,"7" \
3857 lval = (__typeof__(lval)) _res; \
3860#define CALL_FN_W_5W(lval, orig, arg1, arg2, arg3, arg4, arg5) \
3862 volatile OrigFn _orig = (orig); \
3863 volatile unsigned long _argvec[6]; \
3864 volatile unsigned long _res; \
3865 _argvec[0] = (unsigned long)_orig.nraddr; \
3866 _argvec[1] = (unsigned long)arg1; \
3867 _argvec[2] = (unsigned long)arg2; \
3868 _argvec[3] = (unsigned long)arg3; \
3869 _argvec[4] = (unsigned long)arg4; \
3870 _argvec[5] = (unsigned long)arg5; \
3872 VALGRIND_CFI_PROLOGUE \
3873 "aghi 15,-160\n\t" \
3880 VALGRIND_CALL_NOREDIR_R1 \
3883 VALGRIND_CFI_EPILOGUE \
3885 :
"a" (&_argvec[0]) __FRAME_POINTER \
3886 :
"cc", "memory", __CALLER_SAVED_REGS,"6","7" \
3888 lval = (__typeof__(lval)) _res; \
3891#define CALL_FN_W_6W(lval, orig, arg1, arg2, arg3, arg4, arg5, \
3894 volatile OrigFn _orig = (orig); \
3895 volatile unsigned long _argvec[7]; \
3896 volatile unsigned long _res; \
3897 _argvec[0] = (unsigned long)_orig.nraddr; \
3898 _argvec[1] = (unsigned long)arg1; \
3899 _argvec[2] = (unsigned long)arg2; \
3900 _argvec[3] = (unsigned long)arg3; \
3901 _argvec[4] = (unsigned long)arg4; \
3902 _argvec[5] = (unsigned long)arg5; \
3903 _argvec[6] = (unsigned long)arg6; \
3905 VALGRIND_CFI_PROLOGUE \
3906 "aghi 15,-168\n\t" \
3912 "mvc 160(8,15), 48(1)\n\t" \
3914 VALGRIND_CALL_NOREDIR_R1 \
3917 VALGRIND_CFI_EPILOGUE \
3919 :
"a" (&_argvec[0]) __FRAME_POINTER \
3920 :
"cc", "memory", __CALLER_SAVED_REGS,"6","7" \
3922 lval = (__typeof__(lval)) _res; \
3925#define CALL_FN_W_7W(lval, orig, arg1, arg2, arg3, arg4, arg5, \
3928 volatile OrigFn _orig = (orig); \
3929 volatile unsigned long _argvec[8]; \
3930 volatile unsigned long _res; \
3931 _argvec[0] = (unsigned long)_orig.nraddr; \
3932 _argvec[1] = (unsigned long)arg1; \
3933 _argvec[2] = (unsigned long)arg2; \
3934 _argvec[3] = (unsigned long)arg3; \
3935 _argvec[4] = (unsigned long)arg4; \
3936 _argvec[5] = (unsigned long)arg5; \
3937 _argvec[6] = (unsigned long)arg6; \
3938 _argvec[7] = (unsigned long)arg7; \
3940 VALGRIND_CFI_PROLOGUE \
3941 "aghi 15,-176\n\t" \
3947 "mvc 160(8,15), 48(1)\n\t" \
3948 "mvc 168(8,15), 56(1)\n\t" \
3950 VALGRIND_CALL_NOREDIR_R1 \
3953 VALGRIND_CFI_EPILOGUE \
3955 :
"a" (&_argvec[0]) __FRAME_POINTER \
3956 :
"cc", "memory", __CALLER_SAVED_REGS,"6","7" \
3958 lval = (__typeof__(lval)) _res; \
3961#define CALL_FN_W_8W(lval, orig, arg1, arg2, arg3, arg4, arg5, \
3964 volatile OrigFn _orig = (orig); \
3965 volatile unsigned long _argvec[9]; \
3966 volatile unsigned long _res; \
3967 _argvec[0] = (unsigned long)_orig.nraddr; \
3968 _argvec[1] = (unsigned long)arg1; \
3969 _argvec[2] = (unsigned long)arg2; \
3970 _argvec[3] = (unsigned long)arg3; \
3971 _argvec[4] = (unsigned long)arg4; \
3972 _argvec[5] = (unsigned long)arg5; \
3973 _argvec[6] = (unsigned long)arg6; \
3974 _argvec[7] = (unsigned long)arg7; \
3975 _argvec[8] = (unsigned long)arg8; \
3977 VALGRIND_CFI_PROLOGUE \
3978 "aghi 15,-184\n\t" \
3984 "mvc 160(8,15), 48(1)\n\t" \
3985 "mvc 168(8,15), 56(1)\n\t" \
3986 "mvc 176(8,15), 64(1)\n\t" \
3988 VALGRIND_CALL_NOREDIR_R1 \
3991 VALGRIND_CFI_EPILOGUE \
3993 :
"a" (&_argvec[0]) __FRAME_POINTER \
3994 :
"cc", "memory", __CALLER_SAVED_REGS,"6","7" \
3996 lval = (__typeof__(lval)) _res; \
3999#define CALL_FN_W_9W(lval, orig, arg1, arg2, arg3, arg4, arg5, \
4000 arg6, arg7 ,arg8, arg9) \
4002 volatile OrigFn _orig = (orig); \
4003 volatile unsigned long _argvec[10]; \
4004 volatile unsigned long _res; \
4005 _argvec[0] = (unsigned long)_orig.nraddr; \
4006 _argvec[1] = (unsigned long)arg1; \
4007 _argvec[2] = (unsigned long)arg2; \
4008 _argvec[3] = (unsigned long)arg3; \
4009 _argvec[4] = (unsigned long)arg4; \
4010 _argvec[5] = (unsigned long)arg5; \
4011 _argvec[6] = (unsigned long)arg6; \
4012 _argvec[7] = (unsigned long)arg7; \
4013 _argvec[8] = (unsigned long)arg8; \
4014 _argvec[9] = (unsigned long)arg9; \
4016 VALGRIND_CFI_PROLOGUE \
4017 "aghi 15,-192\n\t" \
4023 "mvc 160(8,15), 48(1)\n\t" \
4024 "mvc 168(8,15), 56(1)\n\t" \
4025 "mvc 176(8,15), 64(1)\n\t" \
4026 "mvc 184(8,15), 72(1)\n\t" \
4028 VALGRIND_CALL_NOREDIR_R1 \
4031 VALGRIND_CFI_EPILOGUE \
4033 :
"a" (&_argvec[0]) __FRAME_POINTER \
4034 :
"cc", "memory", __CALLER_SAVED_REGS,"6","7" \
4036 lval = (__typeof__(lval)) _res; \
4039#define CALL_FN_W_10W(lval, orig, arg1, arg2, arg3, arg4, arg5, \
4040 arg6, arg7 ,arg8, arg9, arg10) \
4042 volatile OrigFn _orig = (orig); \
4043 volatile unsigned long _argvec[11]; \
4044 volatile unsigned long _res; \
4045 _argvec[0] = (unsigned long)_orig.nraddr; \
4046 _argvec[1] = (unsigned long)arg1; \
4047 _argvec[2] = (unsigned long)arg2; \
4048 _argvec[3] = (unsigned long)arg3; \
4049 _argvec[4] = (unsigned long)arg4; \
4050 _argvec[5] = (unsigned long)arg5; \
4051 _argvec[6] = (unsigned long)arg6; \
4052 _argvec[7] = (unsigned long)arg7; \
4053 _argvec[8] = (unsigned long)arg8; \
4054 _argvec[9] = (unsigned long)arg9; \
4055 _argvec[10] = (unsigned long)arg10; \
4057 VALGRIND_CFI_PROLOGUE \
4058 "aghi 15,-200\n\t" \
4064 "mvc 160(8,15), 48(1)\n\t" \
4065 "mvc 168(8,15), 56(1)\n\t" \
4066 "mvc 176(8,15), 64(1)\n\t" \
4067 "mvc 184(8,15), 72(1)\n\t" \
4068 "mvc 192(8,15), 80(1)\n\t" \
4070 VALGRIND_CALL_NOREDIR_R1 \
4073 VALGRIND_CFI_EPILOGUE \
4075 :
"a" (&_argvec[0]) __FRAME_POINTER \
4076 :
"cc", "memory", __CALLER_SAVED_REGS,"6","7" \
4078 lval = (__typeof__(lval)) _res; \
4081#define CALL_FN_W_11W(lval, orig, arg1, arg2, arg3, arg4, arg5, \
4082 arg6, arg7 ,arg8, arg9, arg10, arg11) \
4084 volatile OrigFn _orig = (orig); \
4085 volatile unsigned long _argvec[12]; \
4086 volatile unsigned long _res; \
4087 _argvec[0] = (unsigned long)_orig.nraddr; \
4088 _argvec[1] = (unsigned long)arg1; \
4089 _argvec[2] = (unsigned long)arg2; \
4090 _argvec[3] = (unsigned long)arg3; \
4091 _argvec[4] = (unsigned long)arg4; \
4092 _argvec[5] = (unsigned long)arg5; \
4093 _argvec[6] = (unsigned long)arg6; \
4094 _argvec[7] = (unsigned long)arg7; \
4095 _argvec[8] = (unsigned long)arg8; \
4096 _argvec[9] = (unsigned long)arg9; \
4097 _argvec[10] = (unsigned long)arg10; \
4098 _argvec[11] = (unsigned long)arg11; \
4100 VALGRIND_CFI_PROLOGUE \
4101 "aghi 15,-208\n\t" \
4107 "mvc 160(8,15), 48(1)\n\t" \
4108 "mvc 168(8,15), 56(1)\n\t" \
4109 "mvc 176(8,15), 64(1)\n\t" \
4110 "mvc 184(8,15), 72(1)\n\t" \
4111 "mvc 192(8,15), 80(1)\n\t" \
4112 "mvc 200(8,15), 88(1)\n\t" \
4114 VALGRIND_CALL_NOREDIR_R1 \
4117 VALGRIND_CFI_EPILOGUE \
4119 :
"a" (&_argvec[0]) __FRAME_POINTER \
4120 :
"cc", "memory", __CALLER_SAVED_REGS,"6","7" \
4122 lval = (__typeof__(lval)) _res; \
4125#define CALL_FN_W_12W(lval, orig, arg1, arg2, arg3, arg4, arg5, \
4126 arg6, arg7 ,arg8, arg9, arg10, arg11, arg12)\
4128 volatile OrigFn _orig = (orig); \
4129 volatile unsigned long _argvec[13]; \
4130 volatile unsigned long _res; \
4131 _argvec[0] = (unsigned long)_orig.nraddr; \
4132 _argvec[1] = (unsigned long)arg1; \
4133 _argvec[2] = (unsigned long)arg2; \
4134 _argvec[3] = (unsigned long)arg3; \
4135 _argvec[4] = (unsigned long)arg4; \
4136 _argvec[5] = (unsigned long)arg5; \
4137 _argvec[6] = (unsigned long)arg6; \
4138 _argvec[7] = (unsigned long)arg7; \
4139 _argvec[8] = (unsigned long)arg8; \
4140 _argvec[9] = (unsigned long)arg9; \
4141 _argvec[10] = (unsigned long)arg10; \
4142 _argvec[11] = (unsigned long)arg11; \
4143 _argvec[12] = (unsigned long)arg12; \
4145 VALGRIND_CFI_PROLOGUE \
4146 "aghi 15,-216\n\t" \
4152 "mvc 160(8,15), 48(1)\n\t" \
4153 "mvc 168(8,15), 56(1)\n\t" \
4154 "mvc 176(8,15), 64(1)\n\t" \
4155 "mvc 184(8,15), 72(1)\n\t" \
4156 "mvc 192(8,15), 80(1)\n\t" \
4157 "mvc 200(8,15), 88(1)\n\t" \
4158 "mvc 208(8,15), 96(1)\n\t" \
4160 VALGRIND_CALL_NOREDIR_R1 \
4163 VALGRIND_CFI_EPILOGUE \
4165 :
"a" (&_argvec[0]) __FRAME_POINTER \
4166 :
"cc", "memory", __CALLER_SAVED_REGS,"6","7" \
4168 lval = (__typeof__(lval)) _res; \
4176#if defined(PLAT_mips32_linux)
4179#define __CALLER_SAVED_REGS "$2", "$3", "$4", "$5", "$6", \
4180"$7", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
4186#define CALL_FN_W_v(lval, orig) \
4188 volatile OrigFn _orig = (orig); \
4189 volatile unsigned long _argvec[1]; \
4190 volatile unsigned long _res; \
4191 _argvec[0] = (unsigned long)_orig.nraddr; \
4193 "subu $29, $29, 8 \n\t" \
4194 "sw $28, 0($29) \n\t" \
4195 "sw $31, 4($29) \n\t" \
4196 "subu $29, $29, 16 \n\t" \
4197 "lw $25, 0(%1) \n\t"
\
4198 VALGRIND_CALL_NOREDIR_T9 \
4199 "addu $29, $29, 16\n\t" \
4200 "lw $28, 0($29) \n\t" \
4201 "lw $31, 4($29) \n\t" \
4202 "addu $29, $29, 8 \n\t" \
4205 :
"0" (&_argvec[0]) \
4206 :
"memory", __CALLER_SAVED_REGS \
4208 lval = (__typeof__(lval)) _res; \
4211#define CALL_FN_W_W(lval, orig, arg1) \
4213 volatile OrigFn _orig = (orig); \
4214 volatile unsigned long _argvec[2]; \
4215 volatile unsigned long _res; \
4216 _argvec[0] = (unsigned long)_orig.nraddr; \
4217 _argvec[1] = (unsigned long)(arg1); \
4219 "subu $29, $29, 8 \n\t" \
4220 "sw $28, 0($29) \n\t" \
4221 "sw $31, 4($29) \n\t" \
4222 "subu $29, $29, 16 \n\t" \
4223 "lw $4, 4(%1) \n\t"
\
4224 "lw $25, 0(%1) \n\t" \
4225 VALGRIND_CALL_NOREDIR_T9 \
4226 "addu $29, $29, 16 \n\t" \
4227 "lw $28, 0($29) \n\t" \
4228 "lw $31, 4($29) \n\t" \
4229 "addu $29, $29, 8 \n\t" \
4232 :
"0" (&_argvec[0]) \
4233 :
"memory", __CALLER_SAVED_REGS \
4235 lval = (__typeof__(lval)) _res; \
4238#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
4240 volatile OrigFn _orig = (orig); \
4241 volatile unsigned long _argvec[3]; \
4242 volatile unsigned long _res; \
4243 _argvec[0] = (unsigned long)_orig.nraddr; \
4244 _argvec[1] = (unsigned long)(arg1); \
4245 _argvec[2] = (unsigned long)(arg2); \
4247 "subu $29, $29, 8 \n\t" \
4248 "sw $28, 0($29) \n\t" \
4249 "sw $31, 4($29) \n\t" \
4250 "subu $29, $29, 16 \n\t" \
4251 "lw $4, 4(%1) \n\t" \
4252 "lw $5, 8(%1) \n\t" \
4253 "lw $25, 0(%1) \n\t"
\
4254 VALGRIND_CALL_NOREDIR_T9 \
4255 "addu $29, $29, 16 \n\t" \
4256 "lw $28, 0($29) \n\t" \
4257 "lw $31, 4($29) \n\t" \
4258 "addu $29, $29, 8 \n\t" \
4261 :
"0" (&_argvec[0]) \
4262 :
"memory", __CALLER_SAVED_REGS \
4264 lval = (__typeof__(lval)) _res; \
4267#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \
4269 volatile OrigFn _orig = (orig); \
4270 volatile unsigned long _argvec[4]; \
4271 volatile unsigned long _res; \
4272 _argvec[0] = (unsigned long)_orig.nraddr; \
4273 _argvec[1] = (unsigned long)(arg1); \
4274 _argvec[2] = (unsigned long)(arg2); \
4275 _argvec[3] = (unsigned long)(arg3); \
4277 "subu $29, $29, 8 \n\t" \
4278 "sw $28, 0($29) \n\t" \
4279 "sw $31, 4($29) \n\t" \
4280 "subu $29, $29, 16 \n\t" \
4281 "lw $4, 4(%1) \n\t" \
4282 "lw $5, 8(%1) \n\t" \
4283 "lw $6, 12(%1) \n\t" \
4284 "lw $25, 0(%1) \n\t"
\
4285 VALGRIND_CALL_NOREDIR_T9 \
4286 "addu $29, $29, 16 \n\t" \
4287 "lw $28, 0($29) \n\t" \
4288 "lw $31, 4($29) \n\t" \
4289 "addu $29, $29, 8 \n\t" \
4292 :
"0" (&_argvec[0]) \
4293 :
"memory", __CALLER_SAVED_REGS \
4295 lval = (__typeof__(lval)) _res; \
4298#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \
4300 volatile OrigFn _orig = (orig); \
4301 volatile unsigned long _argvec[5]; \
4302 volatile unsigned long _res; \
4303 _argvec[0] = (unsigned long)_orig.nraddr; \
4304 _argvec[1] = (unsigned long)(arg1); \
4305 _argvec[2] = (unsigned long)(arg2); \
4306 _argvec[3] = (unsigned long)(arg3); \
4307 _argvec[4] = (unsigned long)(arg4); \
4309 "subu $29, $29, 8 \n\t" \
4310 "sw $28, 0($29) \n\t" \
4311 "sw $31, 4($29) \n\t" \
4312 "subu $29, $29, 16 \n\t" \
4313 "lw $4, 4(%1) \n\t" \
4314 "lw $5, 8(%1) \n\t" \
4315 "lw $6, 12(%1) \n\t" \
4316 "lw $7, 16(%1) \n\t" \
4317 "lw $25, 0(%1) \n\t"
\
4318 VALGRIND_CALL_NOREDIR_T9 \
4319 "addu $29, $29, 16 \n\t" \
4320 "lw $28, 0($29) \n\t" \
4321 "lw $31, 4($29) \n\t" \
4322 "addu $29, $29, 8 \n\t" \
4325 :
"0" (&_argvec[0]) \
4326 :
"memory", __CALLER_SAVED_REGS \
4328 lval = (__typeof__(lval)) _res; \
4331#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \
4333 volatile OrigFn _orig = (orig); \
4334 volatile unsigned long _argvec[6]; \
4335 volatile unsigned long _res; \
4336 _argvec[0] = (unsigned long)_orig.nraddr; \
4337 _argvec[1] = (unsigned long)(arg1); \
4338 _argvec[2] = (unsigned long)(arg2); \
4339 _argvec[3] = (unsigned long)(arg3); \
4340 _argvec[4] = (unsigned long)(arg4); \
4341 _argvec[5] = (unsigned long)(arg5); \
4343 "subu $29, $29, 8 \n\t" \
4344 "sw $28, 0($29) \n\t" \
4345 "sw $31, 4($29) \n\t" \
4346 "lw $4, 20(%1) \n\t" \
4347 "subu $29, $29, 24\n\t" \
4348 "sw $4, 16($29) \n\t" \
4349 "lw $4, 4(%1) \n\t" \
4350 "lw $5, 8(%1) \n\t" \
4351 "lw $6, 12(%1) \n\t" \
4352 "lw $7, 16(%1) \n\t" \
4353 "lw $25, 0(%1) \n\t"
\
4354 VALGRIND_CALL_NOREDIR_T9 \
4355 "addu $29, $29, 24 \n\t" \
4356 "lw $28, 0($29) \n\t" \
4357 "lw $31, 4($29) \n\t" \
4358 "addu $29, $29, 8 \n\t" \
4361 :
"0" (&_argvec[0]) \
4362 :
"memory", __CALLER_SAVED_REGS \
4364 lval = (__typeof__(lval)) _res; \
4366#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \
4368 volatile OrigFn _orig = (orig); \
4369 volatile unsigned long _argvec[7]; \
4370 volatile unsigned long _res; \
4371 _argvec[0] = (unsigned long)_orig.nraddr; \
4372 _argvec[1] = (unsigned long)(arg1); \
4373 _argvec[2] = (unsigned long)(arg2); \
4374 _argvec[3] = (unsigned long)(arg3); \
4375 _argvec[4] = (unsigned long)(arg4); \
4376 _argvec[5] = (unsigned long)(arg5); \
4377 _argvec[6] = (unsigned long)(arg6); \
4379 "subu $29, $29, 8 \n\t" \
4380 "sw $28, 0($29) \n\t" \
4381 "sw $31, 4($29) \n\t" \
4382 "lw $4, 20(%1) \n\t" \
4383 "subu $29, $29, 32\n\t" \
4384 "sw $4, 16($29) \n\t" \
4385 "lw $4, 24(%1) \n\t" \
4387 "sw $4, 20($29) \n\t" \
4388 "lw $4, 4(%1) \n\t" \
4389 "lw $5, 8(%1) \n\t" \
4390 "lw $6, 12(%1) \n\t" \
4391 "lw $7, 16(%1) \n\t" \
4392 "lw $25, 0(%1) \n\t"
\
4393 VALGRIND_CALL_NOREDIR_T9 \
4394 "addu $29, $29, 32 \n\t" \
4395 "lw $28, 0($29) \n\t" \
4396 "lw $31, 4($29) \n\t" \
4397 "addu $29, $29, 8 \n\t" \
4400 :
"0" (&_argvec[0]) \
4401 :
"memory", __CALLER_SAVED_REGS \
4403 lval = (__typeof__(lval)) _res; \
4406#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
4409 volatile OrigFn _orig = (orig); \
4410 volatile unsigned long _argvec[8]; \
4411 volatile unsigned long _res; \
4412 _argvec[0] = (unsigned long)_orig.nraddr; \
4413 _argvec[1] = (unsigned long)(arg1); \
4414 _argvec[2] = (unsigned long)(arg2); \
4415 _argvec[3] = (unsigned long)(arg3); \
4416 _argvec[4] = (unsigned long)(arg4); \
4417 _argvec[5] = (unsigned long)(arg5); \
4418 _argvec[6] = (unsigned long)(arg6); \
4419 _argvec[7] = (unsigned long)(arg7); \
4421 "subu $29, $29, 8 \n\t" \
4422 "sw $28, 0($29) \n\t" \
4423 "sw $31, 4($29) \n\t" \
4424 "lw $4, 20(%1) \n\t" \
4425 "subu $29, $29, 32\n\t" \
4426 "sw $4, 16($29) \n\t" \
4427 "lw $4, 24(%1) \n\t" \
4428 "sw $4, 20($29) \n\t" \
4429 "lw $4, 28(%1) \n\t" \
4430 "sw $4, 24($29) \n\t" \
4431 "lw $4, 4(%1) \n\t" \
4432 "lw $5, 8(%1) \n\t" \
4433 "lw $6, 12(%1) \n\t" \
4434 "lw $7, 16(%1) \n\t" \
4435 "lw $25, 0(%1) \n\t"
\
4436 VALGRIND_CALL_NOREDIR_T9 \
4437 "addu $29, $29, 32 \n\t" \
4438 "lw $28, 0($29) \n\t" \
4439 "lw $31, 4($29) \n\t" \
4440 "addu $29, $29, 8 \n\t" \
4443 :
"0" (&_argvec[0]) \
4444 :
"memory", __CALLER_SAVED_REGS \
4446 lval = (__typeof__(lval)) _res; \
4449#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
4452 volatile OrigFn _orig = (orig); \
4453 volatile unsigned long _argvec[9]; \
4454 volatile unsigned long _res; \
4455 _argvec[0] = (unsigned long)_orig.nraddr; \
4456 _argvec[1] = (unsigned long)(arg1); \
4457 _argvec[2] = (unsigned long)(arg2); \
4458 _argvec[3] = (unsigned long)(arg3); \
4459 _argvec[4] = (unsigned long)(arg4); \
4460 _argvec[5] = (unsigned long)(arg5); \
4461 _argvec[6] = (unsigned long)(arg6); \
4462 _argvec[7] = (unsigned long)(arg7); \
4463 _argvec[8] = (unsigned long)(arg8); \
4465 "subu $29, $29, 8 \n\t" \
4466 "sw $28, 0($29) \n\t" \
4467 "sw $31, 4($29) \n\t" \
4468 "lw $4, 20(%1) \n\t" \
4469 "subu $29, $29, 40\n\t" \
4470 "sw $4, 16($29) \n\t" \
4471 "lw $4, 24(%1) \n\t" \
4472 "sw $4, 20($29) \n\t" \
4473 "lw $4, 28(%1) \n\t" \
4474 "sw $4, 24($29) \n\t" \
4475 "lw $4, 32(%1) \n\t" \
4476 "sw $4, 28($29) \n\t" \
4477 "lw $4, 4(%1) \n\t" \
4478 "lw $5, 8(%1) \n\t" \
4479 "lw $6, 12(%1) \n\t" \
4480 "lw $7, 16(%1) \n\t" \
4481 "lw $25, 0(%1) \n\t"
\
4482 VALGRIND_CALL_NOREDIR_T9 \
4483 "addu $29, $29, 40 \n\t" \
4484 "lw $28, 0($29) \n\t" \
4485 "lw $31, 4($29) \n\t" \
4486 "addu $29, $29, 8 \n\t" \
4489 :
"0" (&_argvec[0]) \
4490 :
"memory", __CALLER_SAVED_REGS \
4492 lval = (__typeof__(lval)) _res; \
4495#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
4498 volatile OrigFn _orig = (orig); \
4499 volatile unsigned long _argvec[10]; \
4500 volatile unsigned long _res; \
4501 _argvec[0] = (unsigned long)_orig.nraddr; \
4502 _argvec[1] = (unsigned long)(arg1); \
4503 _argvec[2] = (unsigned long)(arg2); \
4504 _argvec[3] = (unsigned long)(arg3); \
4505 _argvec[4] = (unsigned long)(arg4); \
4506 _argvec[5] = (unsigned long)(arg5); \
4507 _argvec[6] = (unsigned long)(arg6); \
4508 _argvec[7] = (unsigned long)(arg7); \
4509 _argvec[8] = (unsigned long)(arg8); \
4510 _argvec[9] = (unsigned long)(arg9); \
4512 "subu $29, $29, 8 \n\t" \
4513 "sw $28, 0($29) \n\t" \
4514 "sw $31, 4($29) \n\t" \
4515 "lw $4, 20(%1) \n\t" \
4516 "subu $29, $29, 40\n\t" \
4517 "sw $4, 16($29) \n\t" \
4518 "lw $4, 24(%1) \n\t" \
4519 "sw $4, 20($29) \n\t" \
4520 "lw $4, 28(%1) \n\t" \
4521 "sw $4, 24($29) \n\t" \
4522 "lw $4, 32(%1) \n\t" \
4523 "sw $4, 28($29) \n\t" \
4524 "lw $4, 36(%1) \n\t" \
4525 "sw $4, 32($29) \n\t" \
4526 "lw $4, 4(%1) \n\t" \
4527 "lw $5, 8(%1) \n\t" \
4528 "lw $6, 12(%1) \n\t" \
4529 "lw $7, 16(%1) \n\t" \
4530 "lw $25, 0(%1) \n\t"
\
4531 VALGRIND_CALL_NOREDIR_T9 \
4532 "addu $29, $29, 40 \n\t" \
4533 "lw $28, 0($29) \n\t" \
4534 "lw $31, 4($29) \n\t" \
4535 "addu $29, $29, 8 \n\t" \
4538 :
"0" (&_argvec[0]) \
4539 :
"memory", __CALLER_SAVED_REGS \
4541 lval = (__typeof__(lval)) _res; \
4544#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
4545 arg7,arg8,arg9,arg10) \
4547 volatile OrigFn _orig = (orig); \
4548 volatile unsigned long _argvec[11]; \
4549 volatile unsigned long _res; \
4550 _argvec[0] = (unsigned long)_orig.nraddr; \
4551 _argvec[1] = (unsigned long)(arg1); \
4552 _argvec[2] = (unsigned long)(arg2); \
4553 _argvec[3] = (unsigned long)(arg3); \
4554 _argvec[4] = (unsigned long)(arg4); \
4555 _argvec[5] = (unsigned long)(arg5); \
4556 _argvec[6] = (unsigned long)(arg6); \
4557 _argvec[7] = (unsigned long)(arg7); \
4558 _argvec[8] = (unsigned long)(arg8); \
4559 _argvec[9] = (unsigned long)(arg9); \
4560 _argvec[10] = (unsigned long)(arg10); \
4562 "subu $29, $29, 8 \n\t" \
4563 "sw $28, 0($29) \n\t" \
4564 "sw $31, 4($29) \n\t" \
4565 "lw $4, 20(%1) \n\t" \
4566 "subu $29, $29, 48\n\t" \
4567 "sw $4, 16($29) \n\t" \
4568 "lw $4, 24(%1) \n\t" \
4569 "sw $4, 20($29) \n\t" \
4570 "lw $4, 28(%1) \n\t" \
4571 "sw $4, 24($29) \n\t" \
4572 "lw $4, 32(%1) \n\t" \
4573 "sw $4, 28($29) \n\t" \
4574 "lw $4, 36(%1) \n\t" \
4575 "sw $4, 32($29) \n\t" \
4576 "lw $4, 40(%1) \n\t" \
4577 "sw $4, 36($29) \n\t" \
4578 "lw $4, 4(%1) \n\t" \
4579 "lw $5, 8(%1) \n\t" \
4580 "lw $6, 12(%1) \n\t" \
4581 "lw $7, 16(%1) \n\t" \
4582 "lw $25, 0(%1) \n\t"
\
4583 VALGRIND_CALL_NOREDIR_T9 \
4584 "addu $29, $29, 48 \n\t" \
4585 "lw $28, 0($29) \n\t" \
4586 "lw $31, 4($29) \n\t" \
4587 "addu $29, $29, 8 \n\t" \
4590 :
"0" (&_argvec[0]) \
4591 :
"memory", __CALLER_SAVED_REGS \
4593 lval = (__typeof__(lval)) _res; \
4596#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
4597 arg6,arg7,arg8,arg9,arg10, \
4600 volatile OrigFn _orig = (orig); \
4601 volatile unsigned long _argvec[12]; \
4602 volatile unsigned long _res; \
4603 _argvec[0] = (unsigned long)_orig.nraddr; \
4604 _argvec[1] = (unsigned long)(arg1); \
4605 _argvec[2] = (unsigned long)(arg2); \
4606 _argvec[3] = (unsigned long)(arg3); \
4607 _argvec[4] = (unsigned long)(arg4); \
4608 _argvec[5] = (unsigned long)(arg5); \
4609 _argvec[6] = (unsigned long)(arg6); \
4610 _argvec[7] = (unsigned long)(arg7); \
4611 _argvec[8] = (unsigned long)(arg8); \
4612 _argvec[9] = (unsigned long)(arg9); \
4613 _argvec[10] = (unsigned long)(arg10); \
4614 _argvec[11] = (unsigned long)(arg11); \
4616 "subu $29, $29, 8 \n\t" \
4617 "sw $28, 0($29) \n\t" \
4618 "sw $31, 4($29) \n\t" \
4619 "lw $4, 20(%1) \n\t" \
4620 "subu $29, $29, 48\n\t" \
4621 "sw $4, 16($29) \n\t" \
4622 "lw $4, 24(%1) \n\t" \
4623 "sw $4, 20($29) \n\t" \
4624 "lw $4, 28(%1) \n\t" \
4625 "sw $4, 24($29) \n\t" \
4626 "lw $4, 32(%1) \n\t" \
4627 "sw $4, 28($29) \n\t" \
4628 "lw $4, 36(%1) \n\t" \
4629 "sw $4, 32($29) \n\t" \
4630 "lw $4, 40(%1) \n\t" \
4631 "sw $4, 36($29) \n\t" \
4632 "lw $4, 44(%1) \n\t" \
4633 "sw $4, 40($29) \n\t" \
4634 "lw $4, 4(%1) \n\t" \
4635 "lw $5, 8(%1) \n\t" \
4636 "lw $6, 12(%1) \n\t" \
4637 "lw $7, 16(%1) \n\t" \
4638 "lw $25, 0(%1) \n\t"
\
4639 VALGRIND_CALL_NOREDIR_T9 \
4640 "addu $29, $29, 48 \n\t" \
4641 "lw $28, 0($29) \n\t" \
4642 "lw $31, 4($29) \n\t" \
4643 "addu $29, $29, 8 \n\t" \
4646 :
"0" (&_argvec[0]) \
4647 :
"memory", __CALLER_SAVED_REGS \
4649 lval = (__typeof__(lval)) _res; \
4652#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
4653 arg6,arg7,arg8,arg9,arg10, \
4656 volatile OrigFn _orig = (orig); \
4657 volatile unsigned long _argvec[13]; \
4658 volatile unsigned long _res; \
4659 _argvec[0] = (unsigned long)_orig.nraddr; \
4660 _argvec[1] = (unsigned long)(arg1); \
4661 _argvec[2] = (unsigned long)(arg2); \
4662 _argvec[3] = (unsigned long)(arg3); \
4663 _argvec[4] = (unsigned long)(arg4); \
4664 _argvec[5] = (unsigned long)(arg5); \
4665 _argvec[6] = (unsigned long)(arg6); \
4666 _argvec[7] = (unsigned long)(arg7); \
4667 _argvec[8] = (unsigned long)(arg8); \
4668 _argvec[9] = (unsigned long)(arg9); \
4669 _argvec[10] = (unsigned long)(arg10); \
4670 _argvec[11] = (unsigned long)(arg11); \
4671 _argvec[12] = (unsigned long)(arg12); \
4673 "subu $29, $29, 8 \n\t" \
4674 "sw $28, 0($29) \n\t" \
4675 "sw $31, 4($29) \n\t" \
4676 "lw $4, 20(%1) \n\t" \
4677 "subu $29, $29, 56\n\t" \
4678 "sw $4, 16($29) \n\t" \
4679 "lw $4, 24(%1) \n\t" \
4680 "sw $4, 20($29) \n\t" \
4681 "lw $4, 28(%1) \n\t" \
4682 "sw $4, 24($29) \n\t" \
4683 "lw $4, 32(%1) \n\t" \
4684 "sw $4, 28($29) \n\t" \
4685 "lw $4, 36(%1) \n\t" \
4686 "sw $4, 32($29) \n\t" \
4687 "lw $4, 40(%1) \n\t" \
4688 "sw $4, 36($29) \n\t" \
4689 "lw $4, 44(%1) \n\t" \
4690 "sw $4, 40($29) \n\t" \
4691 "lw $4, 48(%1) \n\t" \
4692 "sw $4, 44($29) \n\t" \
4693 "lw $4, 4(%1) \n\t" \
4694 "lw $5, 8(%1) \n\t" \
4695 "lw $6, 12(%1) \n\t" \
4696 "lw $7, 16(%1) \n\t" \
4697 "lw $25, 0(%1) \n\t"
\
4698 VALGRIND_CALL_NOREDIR_T9 \
4699 "addu $29, $29, 56 \n\t" \
4700 "lw $28, 0($29) \n\t" \
4701 "lw $31, 4($29) \n\t" \
4702 "addu $29, $29, 8 \n\t" \
4705 :
"r" (&_argvec[0]) \
4706 :
"memory", __CALLER_SAVED_REGS \
4708 lval = (__typeof__(lval)) _res; \
4715#if defined(PLAT_mips64_linux)
4718#define __CALLER_SAVED_REGS "$2", "$3", "$4", "$5", "$6", \
4719"$7", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
4725#define CALL_FN_W_v(lval, orig) \
4727 volatile OrigFn _orig = (orig); \
4728 volatile unsigned long _argvec[1]; \
4729 volatile unsigned long _res; \
4730 _argvec[0] = (unsigned long)_orig.nraddr; \
4732 "ld $25, 0(%1)\n\t" \
4733 VALGRIND_CALL_NOREDIR_T9 \
4736 :
"0" (&_argvec[0]) \
4737 :
"memory", __CALLER_SAVED_REGS \
4739 lval = (__typeof__(lval)) _res; \
4742#define CALL_FN_W_W(lval, orig, arg1) \
4744 volatile OrigFn _orig = (orig); \
4745 volatile unsigned long _argvec[2]; \
4746 volatile unsigned long _res; \
4747 _argvec[0] = (unsigned long)_orig.nraddr; \
4748 _argvec[1] = (unsigned long)(arg1); \
4750 "ld $4, 8(%1)\n\t" \
4751 "ld $25, 0(%1)\n\t" \
4752 VALGRIND_CALL_NOREDIR_T9 \
4755 :
"r" (&_argvec[0]) \
4756 :
"memory", __CALLER_SAVED_REGS \
4758 lval = (__typeof__(lval)) _res; \
4761#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
4763 volatile OrigFn _orig = (orig); \
4764 volatile unsigned long _argvec[3]; \
4765 volatile unsigned long _res; \
4766 _argvec[0] = (unsigned long)_orig.nraddr; \
4767 _argvec[1] = (unsigned long)(arg1); \
4768 _argvec[2] = (unsigned long)(arg2); \
4770 "ld $4, 8(%1)\n\t" \
4771 "ld $5, 16(%1)\n\t" \
4772 "ld $25, 0(%1)\n\t"
\
4773 VALGRIND_CALL_NOREDIR_T9 \
4776 :
"r" (&_argvec[0]) \
4777 :
"memory", __CALLER_SAVED_REGS \
4779 lval = (__typeof__(lval)) _res; \
4782#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \
4784 volatile OrigFn _orig = (orig); \
4785 volatile unsigned long _argvec[4]; \
4786 volatile unsigned long _res; \
4787 _argvec[0] = (unsigned long)_orig.nraddr; \
4788 _argvec[1] = (unsigned long)(arg1); \
4789 _argvec[2] = (unsigned long)(arg2); \
4790 _argvec[3] = (unsigned long)(arg3); \
4792 "ld $4, 8(%1)\n\t" \
4793 "ld $5, 16(%1)\n\t" \
4794 "ld $6, 24(%1)\n\t" \
4795 "ld $25, 0(%1)\n\t"
\
4796 VALGRIND_CALL_NOREDIR_T9 \
4799 :
"r" (&_argvec[0]) \
4800 :
"memory", __CALLER_SAVED_REGS \
4802 lval = (__typeof__(lval)) _res; \
4805#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \
4807 volatile OrigFn _orig = (orig); \
4808 volatile unsigned long _argvec[5]; \
4809 volatile unsigned long _res; \
4810 _argvec[0] = (unsigned long)_orig.nraddr; \
4811 _argvec[1] = (unsigned long)(arg1); \
4812 _argvec[2] = (unsigned long)(arg2); \
4813 _argvec[3] = (unsigned long)(arg3); \
4814 _argvec[4] = (unsigned long)(arg4); \
4816 "ld $4, 8(%1)\n\t" \
4817 "ld $5, 16(%1)\n\t" \
4818 "ld $6, 24(%1)\n\t" \
4819 "ld $7, 32(%1)\n\t" \
4820 "ld $25, 0(%1)\n\t"
\
4821 VALGRIND_CALL_NOREDIR_T9 \
4824 :
"r" (&_argvec[0]) \
4825 :
"memory", __CALLER_SAVED_REGS \
4827 lval = (__typeof__(lval)) _res; \
4830#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \
4832 volatile OrigFn _orig = (orig); \
4833 volatile unsigned long _argvec[6]; \
4834 volatile unsigned long _res; \
4835 _argvec[0] = (unsigned long)_orig.nraddr; \
4836 _argvec[1] = (unsigned long)(arg1); \
4837 _argvec[2] = (unsigned long)(arg2); \
4838 _argvec[3] = (unsigned long)(arg3); \
4839 _argvec[4] = (unsigned long)(arg4); \
4840 _argvec[5] = (unsigned long)(arg5); \
4842 "ld $4, 8(%1)\n\t" \
4843 "ld $5, 16(%1)\n\t" \
4844 "ld $6, 24(%1)\n\t" \
4845 "ld $7, 32(%1)\n\t" \
4846 "ld $8, 40(%1)\n\t" \
4847 "ld $25, 0(%1)\n\t"
\
4848 VALGRIND_CALL_NOREDIR_T9 \
4851 :
"r" (&_argvec[0]) \
4852 :
"memory", __CALLER_SAVED_REGS \
4854 lval = (__typeof__(lval)) _res; \
4857#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \
4859 volatile OrigFn _orig = (orig); \
4860 volatile unsigned long _argvec[7]; \
4861 volatile unsigned long _res; \
4862 _argvec[0] = (unsigned long)_orig.nraddr; \
4863 _argvec[1] = (unsigned long)(arg1); \
4864 _argvec[2] = (unsigned long)(arg2); \
4865 _argvec[3] = (unsigned long)(arg3); \
4866 _argvec[4] = (unsigned long)(arg4); \
4867 _argvec[5] = (unsigned long)(arg5); \
4868 _argvec[6] = (unsigned long)(arg6); \
4870 "ld $4, 8(%1)\n\t" \
4871 "ld $5, 16(%1)\n\t" \
4872 "ld $6, 24(%1)\n\t" \
4873 "ld $7, 32(%1)\n\t" \
4874 "ld $8, 40(%1)\n\t" \
4875 "ld $9, 48(%1)\n\t" \
4876 "ld $25, 0(%1)\n\t"
\
4877 VALGRIND_CALL_NOREDIR_T9 \
4880 :
"r" (&_argvec[0]) \
4881 :
"memory", __CALLER_SAVED_REGS \
4883 lval = (__typeof__(lval)) _res; \
4886#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
4889 volatile OrigFn _orig = (orig); \
4890 volatile unsigned long _argvec[8]; \
4891 volatile unsigned long _res; \
4892 _argvec[0] = (unsigned long)_orig.nraddr; \
4893 _argvec[1] = (unsigned long)(arg1); \
4894 _argvec[2] = (unsigned long)(arg2); \
4895 _argvec[3] = (unsigned long)(arg3); \
4896 _argvec[4] = (unsigned long)(arg4); \
4897 _argvec[5] = (unsigned long)(arg5); \
4898 _argvec[6] = (unsigned long)(arg6); \
4899 _argvec[7] = (unsigned long)(arg7); \
4901 "ld $4, 8(%1)\n\t" \
4902 "ld $5, 16(%1)\n\t" \
4903 "ld $6, 24(%1)\n\t" \
4904 "ld $7, 32(%1)\n\t" \
4905 "ld $8, 40(%1)\n\t" \
4906 "ld $9, 48(%1)\n\t" \
4907 "ld $10, 56(%1)\n\t" \
4908 "ld $25, 0(%1) \n\t"
\
4909 VALGRIND_CALL_NOREDIR_T9 \
4912 :
"r" (&_argvec[0]) \
4913 :
"memory", __CALLER_SAVED_REGS \
4915 lval = (__typeof__(lval)) _res; \
4918#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
4921 volatile OrigFn _orig = (orig); \
4922 volatile unsigned long _argvec[9]; \
4923 volatile unsigned long _res; \
4924 _argvec[0] = (unsigned long)_orig.nraddr; \
4925 _argvec[1] = (unsigned long)(arg1); \
4926 _argvec[2] = (unsigned long)(arg2); \
4927 _argvec[3] = (unsigned long)(arg3); \
4928 _argvec[4] = (unsigned long)(arg4); \
4929 _argvec[5] = (unsigned long)(arg5); \
4930 _argvec[6] = (unsigned long)(arg6); \
4931 _argvec[7] = (unsigned long)(arg7); \
4932 _argvec[8] = (unsigned long)(arg8); \
4934 "ld $4, 8(%1)\n\t" \
4935 "ld $5, 16(%1)\n\t" \
4936 "ld $6, 24(%1)\n\t" \
4937 "ld $7, 32(%1)\n\t" \
4938 "ld $8, 40(%1)\n\t" \
4939 "ld $9, 48(%1)\n\t" \
4940 "ld $10, 56(%1)\n\t" \
4941 "ld $11, 64(%1)\n\t" \
4942 "ld $25, 0(%1) \n\t"
\
4943 VALGRIND_CALL_NOREDIR_T9 \
4946 :
"r" (&_argvec[0]) \
4947 :
"memory", __CALLER_SAVED_REGS \
4949 lval = (__typeof__(lval)) _res; \
4952#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
4955 volatile OrigFn _orig = (orig); \
4956 volatile unsigned long _argvec[10]; \
4957 volatile unsigned long _res; \
4958 _argvec[0] = (unsigned long)_orig.nraddr; \
4959 _argvec[1] = (unsigned long)(arg1); \
4960 _argvec[2] = (unsigned long)(arg2); \
4961 _argvec[3] = (unsigned long)(arg3); \
4962 _argvec[4] = (unsigned long)(arg4); \
4963 _argvec[5] = (unsigned long)(arg5); \
4964 _argvec[6] = (unsigned long)(arg6); \
4965 _argvec[7] = (unsigned long)(arg7); \
4966 _argvec[8] = (unsigned long)(arg8); \
4967 _argvec[9] = (unsigned long)(arg9); \
4969 "dsubu $29, $29, 8\n\t" \
4970 "ld $4, 72(%1)\n\t" \
4971 "sd $4, 0($29)\n\t" \
4972 "ld $4, 8(%1)\n\t" \
4973 "ld $5, 16(%1)\n\t" \
4974 "ld $6, 24(%1)\n\t" \
4975 "ld $7, 32(%1)\n\t" \
4976 "ld $8, 40(%1)\n\t" \
4977 "ld $9, 48(%1)\n\t" \
4978 "ld $10, 56(%1)\n\t" \
4979 "ld $11, 64(%1)\n\t" \
4980 "ld $25, 0(%1)\n\t"
\
4981 VALGRIND_CALL_NOREDIR_T9 \
4982 "daddu $29, $29, 8\n\t" \
4985 :
"r" (&_argvec[0]) \
4986 :
"memory", __CALLER_SAVED_REGS \
4988 lval = (__typeof__(lval)) _res; \
4991#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
4992 arg7,arg8,arg9,arg10) \
4994 volatile OrigFn _orig = (orig); \
4995 volatile unsigned long _argvec[11]; \
4996 volatile unsigned long _res; \
4997 _argvec[0] = (unsigned long)_orig.nraddr; \
4998 _argvec[1] = (unsigned long)(arg1); \
4999 _argvec[2] = (unsigned long)(arg2); \
5000 _argvec[3] = (unsigned long)(arg3); \
5001 _argvec[4] = (unsigned long)(arg4); \
5002 _argvec[5] = (unsigned long)(arg5); \
5003 _argvec[6] = (unsigned long)(arg6); \
5004 _argvec[7] = (unsigned long)(arg7); \
5005 _argvec[8] = (unsigned long)(arg8); \
5006 _argvec[9] = (unsigned long)(arg9); \
5007 _argvec[10] = (unsigned long)(arg10); \
5009 "dsubu $29, $29, 16\n\t" \
5010 "ld $4, 72(%1)\n\t" \
5011 "sd $4, 0($29)\n\t" \
5012 "ld $4, 80(%1)\n\t" \
5013 "sd $4, 8($29)\n\t" \
5014 "ld $4, 8(%1)\n\t" \
5015 "ld $5, 16(%1)\n\t" \
5016 "ld $6, 24(%1)\n\t" \
5017 "ld $7, 32(%1)\n\t" \
5018 "ld $8, 40(%1)\n\t" \
5019 "ld $9, 48(%1)\n\t" \
5020 "ld $10, 56(%1)\n\t" \
5021 "ld $11, 64(%1)\n\t" \
5022 "ld $25, 0(%1)\n\t"
\
5023 VALGRIND_CALL_NOREDIR_T9 \
5024 "daddu $29, $29, 16\n\t" \
5027 :
"r" (&_argvec[0]) \
5028 :
"memory", __CALLER_SAVED_REGS \
5030 lval = (__typeof__(lval)) _res; \
5033#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
5034 arg6,arg7,arg8,arg9,arg10, \
5037 volatile OrigFn _orig = (orig); \
5038 volatile unsigned long _argvec[12]; \
5039 volatile unsigned long _res; \
5040 _argvec[0] = (unsigned long)_orig.nraddr; \
5041 _argvec[1] = (unsigned long)(arg1); \
5042 _argvec[2] = (unsigned long)(arg2); \
5043 _argvec[3] = (unsigned long)(arg3); \
5044 _argvec[4] = (unsigned long)(arg4); \
5045 _argvec[5] = (unsigned long)(arg5); \
5046 _argvec[6] = (unsigned long)(arg6); \
5047 _argvec[7] = (unsigned long)(arg7); \
5048 _argvec[8] = (unsigned long)(arg8); \
5049 _argvec[9] = (unsigned long)(arg9); \
5050 _argvec[10] = (unsigned long)(arg10); \
5051 _argvec[11] = (unsigned long)(arg11); \
5053 "dsubu $29, $29, 24\n\t" \
5054 "ld $4, 72(%1)\n\t" \
5055 "sd $4, 0($29)\n\t" \
5056 "ld $4, 80(%1)\n\t" \
5057 "sd $4, 8($29)\n\t" \
5058 "ld $4, 88(%1)\n\t" \
5059 "sd $4, 16($29)\n\t" \
5060 "ld $4, 8(%1)\n\t" \
5061 "ld $5, 16(%1)\n\t" \
5062 "ld $6, 24(%1)\n\t" \
5063 "ld $7, 32(%1)\n\t" \
5064 "ld $8, 40(%1)\n\t" \
5065 "ld $9, 48(%1)\n\t" \
5066 "ld $10, 56(%1)\n\t" \
5067 "ld $11, 64(%1)\n\t" \
5068 "ld $25, 0(%1)\n\t"
\
5069 VALGRIND_CALL_NOREDIR_T9 \
5070 "daddu $29, $29, 24\n\t" \
5073 :
"r" (&_argvec[0]) \
5074 :
"memory", __CALLER_SAVED_REGS \
5076 lval = (__typeof__(lval)) _res; \
5079#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
5080 arg6,arg7,arg8,arg9,arg10, \
5083 volatile OrigFn _orig = (orig); \
5084 volatile unsigned long _argvec[13]; \
5085 volatile unsigned long _res; \
5086 _argvec[0] = (unsigned long)_orig.nraddr; \
5087 _argvec[1] = (unsigned long)(arg1); \
5088 _argvec[2] = (unsigned long)(arg2); \
5089 _argvec[3] = (unsigned long)(arg3); \
5090 _argvec[4] = (unsigned long)(arg4); \
5091 _argvec[5] = (unsigned long)(arg5); \
5092 _argvec[6] = (unsigned long)(arg6); \
5093 _argvec[7] = (unsigned long)(arg7); \
5094 _argvec[8] = (unsigned long)(arg8); \
5095 _argvec[9] = (unsigned long)(arg9); \
5096 _argvec[10] = (unsigned long)(arg10); \
5097 _argvec[11] = (unsigned long)(arg11); \
5098 _argvec[12] = (unsigned long)(arg12); \
5100 "dsubu $29, $29, 32\n\t" \
5101 "ld $4, 72(%1)\n\t" \
5102 "sd $4, 0($29)\n\t" \
5103 "ld $4, 80(%1)\n\t" \
5104 "sd $4, 8($29)\n\t" \
5105 "ld $4, 88(%1)\n\t" \
5106 "sd $4, 16($29)\n\t" \
5107 "ld $4, 96(%1)\n\t" \
5108 "sd $4, 24($29)\n\t" \
5109 "ld $4, 8(%1)\n\t" \
5110 "ld $5, 16(%1)\n\t" \
5111 "ld $6, 24(%1)\n\t" \
5112 "ld $7, 32(%1)\n\t" \
5113 "ld $8, 40(%1)\n\t" \
5114 "ld $9, 48(%1)\n\t" \
5115 "ld $10, 56(%1)\n\t" \
5116 "ld $11, 64(%1)\n\t" \
5117 "ld $25, 0(%1)\n\t"
\
5118 VALGRIND_CALL_NOREDIR_T9 \
5119 "daddu $29, $29, 32\n\t" \
5122 :
"r" (&_argvec[0]) \
5123 :
"memory", __CALLER_SAVED_REGS \
5125 lval = (__typeof__(lval)) _res; \
5146#define VG_USERREQ_TOOL_BASE(a,b) \
5147 ((unsigned int)(((a)&0xff) << 24 | ((b)&0xff) << 16))
5148#define VG_IS_TOOL_USERREQ(a, b, v) \
5149 (VG_USERREQ_TOOL_BASE(a,b) == ((v) & 0xffff0000))
5228#if !defined(__GNUC__)
5229# define __extension__
5237#define RUNNING_ON_VALGRIND \
5238 (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 , \
5239 VG_USERREQ__RUNNING_ON_VALGRIND, \
5247#define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len) \
5248 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DISCARD_TRANSLATIONS, \
5249 _qzz_addr, _qzz_len, 0, 0, 0)
5257#if defined(__GNUC__) || defined(__INTEL_COMPILER) && !defined(_MSC_VER)
5261 __attribute__((format(__printf__, 1, 2), __unused__));
5264#if defined(_MSC_VER)
5269#if defined(NVALGRIND)
5272#if defined(_MSC_VER) || defined(__MINGW64__)
5275 unsigned long _qzz_res;
5278 va_start(vargs, format);
5279#if defined(_MSC_VER) || defined(__MINGW64__)
5288 (
unsigned long)format,
5289 (
unsigned long)&vargs,
5293 return (
int)_qzz_res;
5297#if defined(__GNUC__) || defined(__INTEL_COMPILER) && !defined(_MSC_VER)
5299 __attribute__((format(__printf__, 1, 2), __unused__));
5302#if defined(_MSC_VER)
5307#if defined(NVALGRIND)
5310#if defined(_MSC_VER) || defined(__MINGW64__)
5313 unsigned long _qzz_res;
5316 va_start(vargs, format);
5317#if defined(_MSC_VER) || defined(__MINGW64__)
5326 (
unsigned long)format,
5327 (
unsigned long)&vargs,
5331 return (
int)_qzz_res;
5359#define VALGRIND_NON_SIMD_CALL0(_qyy_fn) \
5360 VALGRIND_DO_CLIENT_REQUEST_EXPR(0 , \
5361 VG_USERREQ__CLIENT_CALL0, \
5365#define VALGRIND_NON_SIMD_CALL1(_qyy_fn, _qyy_arg1) \
5366 VALGRIND_DO_CLIENT_REQUEST_EXPR(0 , \
5367 VG_USERREQ__CLIENT_CALL1, \
5371#define VALGRIND_NON_SIMD_CALL2(_qyy_fn, _qyy_arg1, _qyy_arg2) \
5372 VALGRIND_DO_CLIENT_REQUEST_EXPR(0 , \
5373 VG_USERREQ__CLIENT_CALL2, \
5375 _qyy_arg1, _qyy_arg2, 0, 0)
5377#define VALGRIND_NON_SIMD_CALL3(_qyy_fn, _qyy_arg1, _qyy_arg2, _qyy_arg3) \
5378 VALGRIND_DO_CLIENT_REQUEST_EXPR(0 , \
5379 VG_USERREQ__CLIENT_CALL3, \
5381 _qyy_arg1, _qyy_arg2, \
5388#define VALGRIND_COUNT_ERRORS \
5389 (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR( \
5391 VG_USERREQ__COUNT_ERRORS, \
5495#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed) \
5496 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MALLOCLIKE_BLOCK, \
5497 addr, sizeB, rzB, is_zeroed, 0)
5502#define VALGRIND_RESIZEINPLACE_BLOCK(addr, oldSizeB, newSizeB, rzB) \
5503 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__RESIZEINPLACE_BLOCK, \
5504 addr, oldSizeB, newSizeB, rzB, 0)
5509#define VALGRIND_FREELIKE_BLOCK(addr, rzB) \
5510 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__FREELIKE_BLOCK, \
5514#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed) \
5515 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL, \
5516 pool, rzB, is_zeroed, 0, 0)
5519#define VALGRIND_DESTROY_MEMPOOL(pool) \
5520 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DESTROY_MEMPOOL, \
5524#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size) \
5525 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_ALLOC, \
5526 pool, addr, size, 0, 0)
5529#define VALGRIND_MEMPOOL_FREE(pool, addr) \
5530 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_FREE, \
5531 pool, addr, 0, 0, 0)
5534#define VALGRIND_MEMPOOL_TRIM(pool, addr, size) \
5535 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_TRIM, \
5536 pool, addr, size, 0, 0)
5539#define VALGRIND_MOVE_MEMPOOL(poolA, poolB) \
5540 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MOVE_MEMPOOL, \
5541 poolA, poolB, 0, 0, 0)
5544#define VALGRIND_MEMPOOL_CHANGE(pool, addrA, addrB, size) \
5545 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_CHANGE, \
5546 pool, addrA, addrB, size, 0)
5549#define VALGRIND_MEMPOOL_EXISTS(pool) \
5550 (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
5551 VG_USERREQ__MEMPOOL_EXISTS, \
5555#define VALGRIND_STACK_REGISTER(start, end) \
5556 (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
5557 VG_USERREQ__STACK_REGISTER, \
5558 start, end, 0, 0, 0)
5562#define VALGRIND_STACK_DEREGISTER(id) \
5563 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STACK_DEREGISTER, \
5567#define VALGRIND_STACK_CHANGE(id, start, end) \
5568 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STACK_CHANGE, \
5569 id, start, end, 0, 0)
5572#define VALGRIND_LOAD_PDB_DEBUGINFO(fd, ptr, total_size, delta) \
5573 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__LOAD_PDB_DEBUGINFO, \
5574 fd, ptr, total_size, delta, 0)
5580#define VALGRIND_MAP_IP_TO_SRCLOC(addr, buf64) \
5581 (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
5582 VG_USERREQ__MAP_IP_TO_SRCLOC, \
5583 addr, buf64, 0, 0, 0)
5593#define VALGRIND_DISABLE_ERROR_REPORTING \
5594 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CHANGE_ERR_DISABLEMENT, \
5599#define VALGRIND_ENABLE_ERROR_REPORTING \
5600 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CHANGE_ERR_DISABLEMENT, \
5608#define VALGRIND_MONITOR_COMMAND(command) \
5609 VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__GDB_MONITOR_COMMAND, \
5610 command, 0, 0, 0, 0)
5613#undef PLAT_x86_darwin
5614#undef PLAT_amd64_darwin
5615#undef PLAT_x86_win32
5616#undef PLAT_amd64_win64
5617#undef PLAT_x86_linux
5618#undef PLAT_amd64_linux
5619#undef PLAT_ppc32_linux
5620#undef PLAT_ppc64_linux
5621#undef PLAT_arm_linux
5622#undef PLAT_s390x_linux
5623#undef PLAT_mips32_linux
5624#undef PLAT_mips64_linux
static int VALGRIND_PRINTF_BACKTRACE(const char *format,...)
@ VG_USERREQ__DESTROY_MEMPOOL
@ VG_USERREQ__MAP_IP_TO_SRCLOC
@ VG_USERREQ__LOAD_PDB_DEBUGINFO
@ VG_USERREQ__VEX_INIT_FOR_IRI
@ VG_USERREQ__PRINTF_BACKTRACE
@ VG_USERREQ__GDB_MONITOR_COMMAND
@ VG_USERREQ__MEMPOOL_ALLOC
@ VG_USERREQ__RESIZEINPLACE_BLOCK
@ VG_USERREQ__MALLOCLIKE_BLOCK
@ VG_USERREQ__COUNT_ERRORS
@ VG_USERREQ__STACK_REGISTER
@ VG_USERREQ__MEMPOOL_CHANGE
@ VG_USERREQ__PRINTF_VALIST_BY_REF
@ VG_USERREQ__RUNNING_ON_VALGRIND
@ VG_USERREQ__CLIENT_CALL0