PERFORCE change 28174 for review
Peter Wemm
peter at FreeBSD.org
Fri Apr 4 21:22:02 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=28174
Change 28174 by peter at peter_overcee on 2003/04/04 21:21:26
convert copyout to x86-64
Affected files ...
.. //depot/projects/hammer/sys/x86_64/x86_64/support.s#9 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/x86_64/support.s#9 (text+ko) ====
@@ -65,14 +65,14 @@
* copyout(from_kernel, to_user, len) - MP SAFE
*/
ENTRY(copyout)
- movl PCPU(CURPCB),%eax
- movl $copyout_fault,PCB_ONFAULT(%eax)
- pushl %esi
- pushl %edi
- pushl %ebx
- movl 16(%esp),%esi
- movl 20(%esp),%edi
- movl 24(%esp),%ebx
+ movq PCPU(CURPCB),%rax
+ movq $copyout_fault,PCB_ONFAULT(%rax)
+ pushq %rsi
+ pushq %rdi
+ pushq %rbx
+ movq 32(%rsp),%rsi
+ movq 40(%rsp),%rdi
+ movq 48(%rsp),%rbx
testl %ebx,%ebx /* anything to do? */
jz done_copyout
@@ -86,8 +86,8 @@
/*
* First, prevent address wrapping.
*/
- movl %edi,%eax
- addl %ebx,%eax
+ movq %rdi,%rax
+ addq %rbx,%rax
jc copyout_fault
/*
* XXX STOP USING VM_MAXUSER_ADDRESS.
@@ -95,38 +95,38 @@
* looks like there is an off by one error, and of course it caused an off
* by one error in several places.
*/
- cmpl $VM_MAXUSER_ADDRESS,%eax
+ cmpq $VM_MAXUSER_ADDRESS,%rax
ja copyout_fault
- /* bcopy(%esi, %edi, %ebx) */
- movl %ebx,%ecx
+ /* bcopy(%rsi, %rdi, %rbx) */
+ movq %rbx,%rcx
- shrl $2,%ecx
+ shrq $3,%rcx
cld
rep
- movsl
+ movsq
movb %bl,%cl
- andb $3,%cl
+ andb $7,%cl
rep
movsb
done_copyout:
- popl %ebx
- popl %edi
- popl %esi
- xorl %eax,%eax
- movl PCPU(CURPCB),%edx
- movl %eax,PCB_ONFAULT(%edx)
+ popq %rbx
+ popq %rdi
+ popq %rsi
+ xorq %rax,%rax
+ movq PCPU(CURPCB),%rdx
+ movq %rax,PCB_ONFAULT(%rdx)
ret
ALIGN_TEXT
copyout_fault:
- popl %ebx
- popl %edi
- popl %esi
- movl PCPU(CURPCB),%edx
- movl $0,PCB_ONFAULT(%edx)
- movl $EFAULT,%eax
+ popq %rbx
+ popq %rdi
+ popq %rsi
+ movq PCPU(CURPCB),%rdx
+ movq $0,PCB_ONFAULT(%rdx)
+ movq $EFAULT,%rax
ret
/*
More information about the p4-projects
mailing list