Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Aug 2009 19:28:08 GMT
From:      Stanislav Sedov <stas@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 167580 for review
Message-ID:  <200908211928.n7LJS8TD076336@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167580

Change 167580 by stas@stas_yandex on 2009/08/21 19:27:33

	- Restore registers in syscall handler.

Affected files ...

.. //depot/projects/valgrind/coregrind/m_syswrap/syscall-amd64-freebsd.S#8 edit

Differences ...

==== //depot/projects/valgrind/coregrind/m_syswrap/syscall-amd64-freebsd.S#8 (text+ko) ====

@@ -73,7 +73,7 @@
 
 /* from vki_arch.h */	
 #define VKI_SIG_SETMASK	3
-	
+
 .globl ML_(do_syscall_for_client_WRK)
 ML_(do_syscall_for_client_WRK):
 	/* save callee-saved regs */
@@ -102,7 +102,7 @@
 	jb	7f	/* sigprocmask failed */
 
 	/* OK, that worked.  Now do the syscall proper. */
-	
+
 	/* 6 register parameters */
 	movq    -16(%rbp), %r11 /* r11 = VexGuestAMD64State * */
         movq    OFFSET_amd64_RDI(%r11), %rdi
@@ -150,7 +150,7 @@
 
 	movq	$__NR_sigprocmask, %rax	// syscall #
 	movq	$VKI_SIG_SETMASK, %rdi		// how
-	movq	%rcx, %rsi			// postmask
+	movq	-32(%rbp), %rsi			// postmask
 	xorq	%rdx, %rdx			// NULL
 	syscall
 
@@ -158,13 +158,23 @@
 
 5:	/* now safe from signals */
 
-	xor	%rax,%rax
+	xorq	%rax,%rax
+	movq	-8(%rbp), %rdi
+	movq	-16(%rbp), %rsi
+	movq	-24(%rbp), %rdx
+	movq	-32(%rbp), %rcx
+	movq	-40(%rbp), %r8
 	movq    %rbp, %rsp
 	popq	%rbp
 	ret
 
 7:	/* failure:	 return 0x8000 | error code */
 	orq	$0x8000, %rax
+	movq	-8(%rbp), %rdi
+	movq	-16(%rbp), %rsi
+	movq	-24(%rbp), %rdx
+	movq	-32(%rbp), %rcx
+	movq	-40(%rbp), %r8
 	movq    %rbp, %rsp
 	popq	%rbp
 	ret



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908211928.n7LJS8TD076336>