Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 2003 21:24:02 -0800 (PST)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 28175 for review
Message-ID:  <200304050524.h355O2MR014771@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28175

Change 28175 by peter@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
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304050524.h355O2MR014771>