From: Paul Floyd Date: Wed, 26 Nov 2025 19:27:43 +0000 (+0100) Subject: A few more syscall comments and doc tweaks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0e79f983bfc042fa29eaa83ea6a4324be8935e2;p=thirdparty%2Fvalgrind.git A few more syscall comments and doc tweaks --- diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c index ff9960225..07f193046 100644 --- a/coregrind/m_syswrap/syswrap-main.c +++ b/coregrind/m_syswrap/syswrap-main.c @@ -1858,6 +1858,10 @@ void getSyscallArgLayout ( /*OUT*/SyscallArgLayout* layout, /*IN*/Bool syscall_s layout->uu_arg8 = -1; /* impossible value */ #elif defined(VGP_x86_freebsd) + // libc converts syscall_syscall to canonical form + // (it just needs to pop the ret address, pop the sysno into eax + // do the syscall + // and push back the ret address) layout->o_sysno = OFFSET_x86_EAX; // syscall parameters are on stack in C convention layout->s_arg1 = sizeof(UWord) * 1; diff --git a/docs/internals/client_syscall_arguments.txt b/docs/internals/client_syscall_arguments.txt index 1ef113db8..233d33212 100644 --- a/docs/internals/client_syscall_arguments.txt +++ b/docs/internals/client_syscall_arguments.txt @@ -56,6 +56,7 @@ This stores the canonical arguments (syscall syscall format gets shuffled) in the SyscallArgs structure. 2. Get the syscall argument layout +Call getSyscallArgLayout() This just initialises the fields of the SyscallArgLayout structure. The layout will be different depending if it is a normal syscall or a syscall syscall. It cannot be canonicalised - we can shuffle around the values but we can't @@ -83,7 +84,7 @@ This is the more complicated of the two as we need to release the global lock, change to using the guest signal mask, do the syscall, restore the Valgrind signal mask and request the global lock again. -A call to putSyscallArgsIntoGuestState is made. The PRE may have changed +A call to putSyscallArgsIntoGuestState() is made. The PRE may have changed some of the arguments so we need to put the arguments back into VexGuestArchState. @@ -93,7 +94,7 @@ from VexGuestArchState. 6. Perform a non-blocking syscall. -This is much simpler. It performs the syscall via VG_(do_syscall). +This is much simpler. It performs the syscall via VG_(do_syscall)(). The arguments are passed via struct SyscallArgs (possibly modified by the PRE wrapper).