Date: Sun, 27 Apr 2003 18:48:15 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 29912 for review Message-ID: <200304280148.h3S1mFfV009269@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=29912 Change 29912 by peter@peter_daintree on 2003/04/27 18:48:04 as a bonus, preserve %rsi and %rdi across 'syscall'. This means we dont have to use PCB_FULLCTX on return from execve() which passes arguments in %rdi and %rsi. It also makes life easier for things like the pipe(2) wrapper in libc. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/exception.s#32 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/exception.s#32 (text+ko) ==== @@ -241,8 +241,10 @@ call ast jmp 1b 2: /* restore preserved registers */ + movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ + movq TF_RSI(%rsp),%rsi /* bonus: preserve arg 2 */ + movq TF_RDX(%rsp),%rdx /* return value 2 */ movq TF_RAX(%rsp),%rax /* return value 1 */ - movq TF_RDX(%rsp),%rdx /* return value 2 */ movq TF_RBX(%rsp),%rbx /* C preserved */ movq TF_RBP(%rsp),%rbp /* C preserved */ movq TF_R12(%rsp),%r12 /* C preserved */ @@ -251,8 +253,8 @@ movq TF_R15(%rsp),%r15 /* C preserved */ movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ movq TF_RIP(%rsp),%rcx /* original %rip */ - movq TF_RSP(%rsp),%rdi /* user stack pointer */ - movq %rdi,%rsp /* original %rsp */ + movq TF_RSP(%rsp),%r9 /* user stack pointer */ + movq %r9,%rsp /* original %rsp */ #swapgs sysretq 3: /* Requested full context restore, use doreti for that */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304280148.h3S1mFfV009269>