PERFORCE change 167580 for review
Stanislav Sedov
stas at FreeBSD.org
Fri Aug 21 19:28:09 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167580
Change 167580 by stas at 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
More information about the p4-projects
mailing list