PERFORCE change 29912 for review
Peter Wemm
peter at FreeBSD.org
Sun Apr 27 18:48:18 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=29912
Change 29912 by peter at 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 */
More information about the p4-projects
mailing list