Lines Matching full:canonical
397 the platform-specific in-guest-state format to the canonical
401 void getSyscallArgsFromGuestState ( /*OUT*/SyscallArgs* canonical,
407 canonical->sysno = gst->guest_EAX;
408 canonical->arg1 = gst->guest_EBX;
409 canonical->arg2 = gst->guest_ECX;
410 canonical->arg3 = gst->guest_EDX;
411 canonical->arg4 = gst->guest_ESI;
412 canonical->arg5 = gst->guest_EDI;
413 canonical->arg6 = gst->guest_EBP;
414 canonical->arg7 = 0;
415 canonical->arg8 = 0;
419 canonical->sysno = gst->guest_RAX;
420 canonical->arg1 = gst->guest_RDI;
421 canonical->arg2 = gst->guest_RSI;
422 canonical->arg3 = gst->guest_RDX;
423 canonical->arg4 = gst->guest_R10;
424 canonical->arg5 = gst->guest_R8;
425 canonical->arg6 = gst->guest_R9;
426 canonical->arg7 = 0;
427 canonical->arg8 = 0;
431 canonical->sysno = gst->guest_GPR0;
432 canonical->arg1 = gst->guest_GPR3;
433 canonical->arg2 = gst->guest_GPR4;
434 canonical->arg3 = gst->guest_GPR5;
435 canonical->arg4 = gst->guest_GPR6;
436 canonical->arg5 = gst->guest_GPR7;
437 canonical->arg6 = gst->guest_GPR8;
438 canonical->arg7 = 0;
439 canonical
443 canonical->sysno = gst->guest_GPR0;
444 canonical->arg1 = gst->guest_GPR3;
445 canonical->arg2 = gst->guest_GPR4;
446 canonical->arg3 = gst->guest_GPR5;
447 canonical->arg4 = gst->guest_GPR6;
448 canonical->arg5 = gst->guest_GPR7;
449 canonical->arg6 = gst->guest_GPR8;
450 canonical->arg7 = 0;
451 canonical->arg8 = 0;
455 canonical->sysno = gst->guest_R7;
456 canonical->arg1 = gst->guest_R0;
457 canonical->arg2 = gst->guest_R1;
458 canonical->arg3 = gst->guest_R2;
459 canonical->arg4 = gst->guest_R3;
460 canonical->arg5 = gst->guest_R4;
461 canonical->arg6 = gst->guest_R5;
462 canonical->arg7 = 0;
463 canonical->arg8 = 0;
469 canonical->sysno = gst->guest_EAX;
470 if (canonical->sysno != 0) {
472 canonical->arg1 = stack[1];
473 canonical->arg2 = stack[2];
474 canonical->arg3 = stack[3];
475 canonical->arg4 = stack[4];
476 canonical->arg5 = stack[5];
477 canonical->arg6 = stack[6];
478 canonical->arg7 = stack[7];
479 canonical->arg8 = stack[8];
487 canonical->sysno = stack[1];
488 vg_assert(canonical->sysno != 0);
489 canonical->arg1 = stack[2];
490 canonical->arg2 = stack[3];
491 canonical->arg3 = stack[4];
492 canonical->arg4 = stack[5];
493 canonical->arg5 = stack[6];
494 canonical->arg6 = stack[7];
495 canonical->arg7 = stack[8];
496 canonical->arg8 = stack[9];
500 VG_SYSNUM_STRING(0), VG_SYSNUM_STRING(canonical->sysno));
512 vg_assert(canonical->sysno >= 0);
513 canonical->sysno = VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(canonical->sysno);
518 if (canonical->sysno >= 0) {
520 canonical->sysno = VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(canonical->sysno
523 canonical->sysno = VG_DARWIN_SYSCALL_CONSTRUCT_MACH(-canonical->sysno);
528 vg_assert(canonical->sysno < 0);
529 canonical->sysno = VG_DARWIN_SYSCALL_CONSTRUCT_MACH(-canonical->sysno);
533 vg_assert(canonical->sysno >= 0);
534 canonical->sysno = VG_DARWIN_SYSCALL_CONSTRUCT_MDEP(canonical->sysno);
548 canonical->sysno = gst->guest_RAX;
549 if (canonical->sysno != __NR_syscall) {
551 canonical->arg1 = gst->guest_RDI;
552 canonical->arg2 = gst->guest_RSI;
553 canonical->arg3 = gst->guest_RDX;
554 canonical->arg4 = gst->guest_R10; // not rcx with syscall insn
555 canonical->arg5 = gst->guest_R8;
556 canonical->arg6 = gst->guest_R9;
557 canonical->arg7 = stack[1];
558 canonical->arg8 = stack[2];
566 canonical->sysno = VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(gst->guest_RDI);
567 vg_assert(canonical->sysno != __NR_syscall);
568 canonical->arg1 = gst->guest_RSI;
569 canonical->arg2 = gst->guest_RDX;
570 canonical->arg3 = gst->guest_R10; // not rcx with syscall insn
571 canonical->arg4 = gst->guest_R8;
572 canonical->arg5 = gst->guest_R9;
573 canonical->arg6 = stack[1];
574 canonical->arg7 = stack[2];
575 canonical->arg8 = stack[3];
579 VG_SYSNUM_STRING(0), VG_SYSNUM_STRING(canonical->sysno));
582 // no canonical->sysno adjustment needed
586 canonical->sysno = gst->guest_SYSNO;
587 canonical->arg1 = gst->guest_r2;
588 canonical->arg2 = gst->guest_r3;
589 canonical->arg3 = gst->guest_r4;
590 canonical->arg4 = gst->guest_r5;
591 canonical->arg5 = gst->guest_r6;
592 canonical->arg6 = gst->guest_r7;
593 canonical->arg7 = 0;
594 canonical->arg8 = 0;
601 void putSyscallArgsIntoGuestState ( /*IN*/ SyscallArgs* canonical,
606 gst->guest_EAX = canonical->sysno;
607 gst->guest_EBX = canonical->arg1;
608 gst->guest_ECX = canonical->arg2;
609 gst->guest_EDX = canonical->arg3;
610 gst->guest_ESI = canonical->arg4;
611 gst->guest_EDI = canonical->arg5;
612 gst->guest_EBP = canonical->arg6;
616 gst->guest_RAX = canonical->sysno;
617 gst->guest_RDI = canonical->arg1;
618 gst->guest_RSI = canonical->arg2;
619 gst->guest_RDX = canonical->arg3;
620 gst->guest_R10 = canonical->arg4;
621 gst->guest_R8 = canonical->arg5;
622 gst->guest_R9 = canonical->arg6;
626 gst->guest_GPR0 = canonical->sysno;
627 gst->guest_GPR3 = canonical->arg1;
628 gst->guest_GPR4 = canonical->arg2;
629 gst->guest_GPR5 = canonical->arg3;
630 gst->guest_GPR6 = canonical->arg4;
631 gst->guest_GPR7 = canonical->arg5;
632 gst->guest_GPR8 = canonical->arg6;
636 gst->guest_GPR0 = canonical->sysno;
637 gst->guest_GPR3 = canonical->arg1;
638 gst->guest_GPR4 = canonical->arg2;
639 gst->guest_GPR5 = canonical->arg3;
640 gst->guest_GPR6 = canonical->arg4;
641 gst->guest_GPR7 = canonical->arg5;
642 gst->guest_GPR8 = canonical->arg6;
646 gst->guest_R7 = canonical->sysno;
647 gst->guest_R0 = canonical->arg1;
648 gst->guest_R1 = canonical->arg2;
649 gst->guest_R2 = canonical->arg3;
650 gst->guest_R3 = canonical->arg4;
651 gst->guest_R4 = canonical->arg5;
652 gst->guest_R5 = canonical->arg6;
658 gst->guest_EAX = VG_DARWIN_SYSNO_FOR_KERNEL(canonical->sysno);
662 stack[1] = canonical->arg1;
663 stack[2] = canonical->arg2;
664 stack[3] = canonical->arg3;
665 stack[4] = canonical->arg4;
666 stack[5] = canonical->arg5;
667 stack[6] = canonical->arg6;
668 stack[7] = canonical->arg7;
669 stack[8] = canonical->arg8;
675 gst->guest_RAX = VG_DARWIN_SYSNO_FOR_KERNEL(canonical->sysno);
679 gst->guest_RDI = canonical->arg1;
680 gst->guest_RSI = canonical->arg2;
681 gst->guest_RDX = canonical->arg3;
682 gst->guest_RCX = canonical->arg4;
683 gst->guest_R8 = canonical->arg5;
684 gst->guest_R9 = canonical->arg6;
685 stack[1] = canonical->arg7;
686 stack[2] = canonical->arg8;
690 gst->guest_SYSNO = canonical->sysno;
691 gst->guest_r2 = canonical->arg1;
692 gst->guest_r3 = canonical->arg2;
693 gst->guest_r4 = canonical->arg3;
694 gst->guest_r5 = canonical->arg4;
695 gst->guest_r6 = canonical->arg5;
696 gst->guest_r7 = canonical->arg6;
704 void getSyscallStatusFromGuestState ( /*OUT*/SyscallStatus* canonical,
709 canonical->sres = VG_(mk_SysRes_x86_linux)( gst->guest_EAX );
710 canonical->what = SsComplete;
714 canonical->sres = VG_(mk_SysRes_amd64_linux)( gst->guest_RAX );
715 canonical->what = SsComplete;
721 canonical->sres = VG_(mk_SysRes_ppc32_linux)( gst->guest_GPR3, cr0so );
722 canonical->what = SsComplete;
728 canonical->sres = VG_(mk_SysRes_ppc64_linux)( gst->guest_GPR3, cr0so );
729 canonical->what = SsComplete;
733 canonical->sres = VG_(mk_SysRes_arm_linux)( gst->guest_R0 );
734 canonical->what = SsComplete;
762 canonical->sres = VG_(mk_SysRes_x86_darwin)(
766 canonical->what = SsComplete;
794 canonical->sres = VG_(mk_SysRes_amd64_darwin)(
798 canonical->what = SsComplete;
802 canonical->sres = VG_(mk_SysRes_s390x_linux)( gst->guest_r2 );
803 canonical->what = SsComplete;
812 /*IN*/ SyscallStatus* canonical,
817 vg_assert(canonical->what == SsComplete);
818 if (sr_isError(canonical->sres)) {
822 gst->guest_EAX = - (Int)sr_Err(canonical->sres);
824 gst->guest_EAX = sr_Res(canonical->sres);
831 vg_assert(canonical->what == SsComplete);
832 if (sr_isError(canonical->sres)) {
836 gst->guest_RAX = - (Long)sr_Err(canonical->sres);
838 gst->guest_RAX = sr_Res(canonical->sres);
846 vg_assert(canonical->what == SsComplete);
847 if (sr_isError(canonical->sres)) {
850 gst->guest_GPR3 = sr_Err(canonical->sres);
854 gst->guest_GPR3 = sr_Res(canonical->sres);
864 vg_assert(canonical->what == SsComplete);
865 if (sr_isError(canonical->sres)) {
868 gst->guest_GPR3 = sr_Err(canonical->sres);
872 gst->guest_GPR3 = sr_Res(canonical->sres);
881 vg_assert(canonical->what == SsComplete);
882 if (sr_isError(canonical->sres)) {
886 gst->guest_R0 = - (Int)sr_Err(canonical->sres);
888 gst->guest_R0 = sr_Res(canonical
895 SysRes sres = canonical->sres;
896 vg_assert(canonical->what == SsComplete);
928 SysRes sres = canonical->sres;
929 vg_assert(canonical->what == SsComplete);
961 vg_assert(canonical->what == SsComplete);
962 if (sr_isError(canonical->sres)) {
963 gst->guest_r2 = - (Long)sr_Err(canonical->sres);
965 gst->guest_r2 = sr_Res(canonical->sres);
1943 SyscallStatus canonical;
2048 canonical = convert_SysRes_to_SyscallStatus(
2052 putSyscallStatusIntoGuestState( tid, &canonical, &th_regs->vex );
2053 sci->status = canonical;
2066 canonical = convert_SysRes_to_SyscallStatus( sres );
2068 putSyscallStatusIntoGuestState( tid, &canonical, &th_regs->vex );
2069 sci->status = canonical;