PERFORCE change 28175 for review
Peter Wemm
peter at FreeBSD.org
Fri Apr 4 21:24:05 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=28175
Change 28175 by peter at peter_overcee on 2003/04/04 21:23:36
convert copyin
Affected files ...
.. //depot/projects/hammer/sys/x86_64/x86_64/support.s#10 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/x86_64/support.s#10 (text+ko) ====
@@ -133,47 +133,47 @@
* copyin(from_user, to_kernel, len) - MP SAFE
*/
ENTRY(copyin)
- movl PCPU(CURPCB),%eax
- movl $copyin_fault,PCB_ONFAULT(%eax)
- pushl %esi
- pushl %edi
- movl 12(%esp),%esi /* caddr_t from */
- movl 16(%esp),%edi /* caddr_t to */
- movl 20(%esp),%ecx /* size_t len */
+ movq PCPU(CURPCB),%rax
+ movq $copyin_fault,PCB_ONFAULT(%rax)
+ pushq %rsi
+ pushq %rdi
+ movq 24(%rsp),%rsi /* caddr_t from */
+ movq 32(%rsp),%rdi /* caddr_t to */
+ movq 40(%rsp),%rcx /* size_t len */
/*
* make sure address is valid
*/
- movl %esi,%edx
- addl %ecx,%edx
+ movq %rsi,%rdx
+ addq %rcx,%rdx
jc copyin_fault
- cmpl $VM_MAXUSER_ADDRESS,%edx
+ cmpq $VM_MAXUSER_ADDRESS,%rdx
ja copyin_fault
movb %cl,%al
- shrl $2,%ecx /* copy longword-wise */
+ shrq $3,%rcx /* copy longword-wise */
cld
rep
- movsl
+ movsq
movb %al,%cl
- andb $3,%cl /* copy remaining bytes */
+ andb $7,%cl /* copy remaining bytes */
rep
movsb
- popl %edi
- popl %esi
- xorl %eax,%eax
- movl PCPU(CURPCB),%edx
- movl %eax,PCB_ONFAULT(%edx)
+ popq %rdi
+ popq %rsi
+ xorq %rax,%rax
+ movq PCPU(CURPCB),%rdx
+ movq %rax,PCB_ONFAULT(%rdx)
ret
ALIGN_TEXT
copyin_fault:
- popl %edi
- popl %esi
- movl PCPU(CURPCB),%edx
- movl $0,PCB_ONFAULT(%edx)
- movl $EFAULT,%eax
+ 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