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

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

Change 28178 by peter@peter_overcee on 2003/04/04 21:57:04

	get this to assemble - except there is no 64 bit immediate compare. GRR.

Affected files ...

.. //depot/projects/hammer/sys/x86_64/x86_64/support.s#13 edit

Differences ...

==== //depot/projects/hammer/sys/x86_64/x86_64/support.s#13 (text+ko) ====

@@ -182,9 +182,9 @@
 ENTRY(casuptr)
 	movq	PCPU(CURPCB),%rcx
 	movq	$fusufault,PCB_ONFAULT(%rcx)
-	movq	8(%esp),%rdx			/* dst */
-	movq	16(%esp),%rax			/* old */
-	movq	24(%esp),%rcx			/* new */
+	movq	8(%rsp),%rdx			/* dst */
+	movq	16(%rsp),%rax			/* old */
+	movq	24(%rsp),%rcx			/* new */
 
 	cmpq	$VM_MAXUSER_ADDRESS-4,%rdx	/* verify address is valid */
 	ja	fusufault
@@ -210,7 +210,7 @@
 ENTRY(fuword)
 	movq	PCPU(CURPCB),%rcx
 	movq	$fusufault,PCB_ONFAULT(%rcx)
-	movq	8(%rsp),%edx			/* from */
+	movq	8(%rsp),%rdx			/* from */
 
 	cmpq	$VM_MAXUSER_ADDRESS-4,%edx	/* verify address is valid */
 	ja	fusufault
@@ -258,7 +258,7 @@
 ENTRY(fubyte)
 	movq	PCPU(CURPCB),%rcx
 	movq	$fusufault,PCB_ONFAULT(%rcx)
-	movq	8(%rsp),%edx
+	movq	8(%rsp),%rdx
 
 	cmpq	$VM_MAXUSER_ADDRESS-1,%rdx
 	ja	fusufault
@@ -266,7 +266,7 @@
 # XXX use the 64 extend
 	xorq	%rax, %rax
 	movzbl	(%rdx),%eax
-	movl	$0,PCB_ONFAULT(%rcx)
+	movq	$0,PCB_ONFAULT(%rcx)
 	ret
 
 	ALIGN_TEXT
@@ -285,12 +285,12 @@
 ENTRY(suword)
 	movq	PCPU(CURPCB),%rcx
 	movq	$fusufault,PCB_ONFAULT(%rcx)
-	movq	8(%rsp),%edx
+	movq	8(%rsp),%rdx
 
 	cmpq	$VM_MAXUSER_ADDRESS-4,%rdx	/* verify address validity */
 	ja	fusufault
 
-	movl	16(%rsp),%rax
+	movq	16(%rsp),%rax
 	movl	%eax,(%rdx)
 	xorq	%rax,%rax
 	movq	PCPU(CURPCB),%rcx
@@ -345,32 +345,32 @@
  *	return the actual length in *lencopied.
  */
 ENTRY(copyinstr)
-	pushl	%esi
-	pushl	%edi
-	movl	PCPU(CURPCB),%ecx
-	movl	$cpystrflt,PCB_ONFAULT(%ecx)
+	pushq	%rsi
+	pushq	%rdi
+	movq	PCPU(CURPCB),%rcx
+	movq	$cpystrflt,PCB_ONFAULT(%rcx)
 
-	movl	12(%esp),%esi			/* %esi = from */
-	movl	16(%esp),%edi			/* %edi = to */
-	movl	20(%esp),%edx			/* %edx = maxlen */
+	movq	24(%rsp),%rsi			/* %esi = from */
+	movq	32(%rsp),%rdi			/* %edi = to */
+	movq	40(%rsp),%rdx			/* %edx = maxlen */
 
-	movl	$VM_MAXUSER_ADDRESS,%eax
+	movq	$VM_MAXUSER_ADDRESS,%rax
 
 	/* make sure 'from' is within bounds */
-	subl	%esi,%eax
+	subq	%rsi,%rax
 	jbe	cpystrflt
 
 	/* restrict maxlen to <= VM_MAXUSER_ADDRESS-from */
-	cmpl	%edx,%eax
+	cmpq	%rdx,%rax
 	jae	1f
-	movl	%eax,%edx
-	movl	%eax,20(%esp)
+	movq	%rax,%rdx
+	movq	%rax,40(%rsp)
 1:
-	incl	%edx
+	incq	%rdx
 	cld
 
 2:
-	decl	%edx
+	decq	%rdx
 	jz	3f
 
 	lodsb
@@ -379,33 +379,33 @@
 	jnz	2b
 
 	/* Success -- 0 byte reached */
-	decl	%edx
-	xorl	%eax,%eax
+	decq	%rdx
+	xorq	%rax,%rax
 	jmp	cpystrflt_x
 3:
-	/* edx is zero - return ENAMETOOLONG or EFAULT */
-	cmpl	$VM_MAXUSER_ADDRESS,%esi
+	/* rdx is zero - return ENAMETOOLONG or EFAULT */
+	cmpq	$VM_MAXUSER_ADDRESS,%rsi
 	jae	cpystrflt
 4:
-	movl	$ENAMETOOLONG,%eax
+	movq	$ENAMETOOLONG,%rax
 	jmp	cpystrflt_x
 
 cpystrflt:
-	movl	$EFAULT,%eax
+	movq	$EFAULT,%rax
 
 cpystrflt_x:
 	/* set *lencopied and return %eax */
-	movl	PCPU(CURPCB),%ecx
-	movl	$0,PCB_ONFAULT(%ecx)
-	movl	20(%esp),%ecx
-	subl	%edx,%ecx
-	movl	24(%esp),%edx
-	testl	%edx,%edx
+	movq	PCPU(CURPCB),%rcx
+	movq	$0,PCB_ONFAULT(%rcx)
+	movq	40(%rsp),%rcx
+	subq	%rdx,%rcx
+	movq	48(%rsp),%rdx
+	testq	%rdx,%rdx
 	jz	1f
-	movl	%ecx,(%edx)
+	movq	%rcx,(%rdx)
 1:
-	popl	%edi
-	popl	%esi
+	popq	%rdi
+	popq	%rsi
 	ret
 
 
@@ -413,16 +413,16 @@
  * copystr(from, to, maxlen, int *lencopied) - MP SAFE
  */
 ENTRY(copystr)
-	pushl	%esi
-	pushl	%edi
+	pushq	%rsi
+	pushq	%rdi
 
-	movl	12(%esp),%esi			/* %esi = from */
-	movl	16(%esp),%edi			/* %edi = to */
-	movl	20(%esp),%edx			/* %edx = maxlen */
-	incl	%edx
+	movq	24(%rsp),%rsi			/* %esi = from */
+	movq	32(%rsp),%rdi			/* %edi = to */
+	movq	40(%rsp),%rdx			/* %edx = maxlen */
+	incq	%rdx
 	cld
 1:
-	decl	%edx
+	decq	%rdx
 	jz	4f
 	lodsb
 	stosb
@@ -430,24 +430,24 @@
 	jnz	1b
 
 	/* Success -- 0 byte reached */
-	decl	%edx
-	xorl	%eax,%eax
+	decq	%rdx
+	xorq	%rax,%rax
 	jmp	6f
 4:
-	/* edx is zero -- return ENAMETOOLONG */
-	movl	$ENAMETOOLONG,%eax
+	/* rdx is zero -- return ENAMETOOLONG */
+	movq	$ENAMETOOLONG,%rax
 
 6:
-	/* set *lencopied and return %eax */
-	movl	20(%esp),%ecx
-	subl	%edx,%ecx
-	movl	24(%esp),%edx
-	testl	%edx,%edx
+	/* set *lencopied and return %rax */
+	movq	40(%rsp),%rcx
+	subq	%rdx,%rcx
+	movq	48(%rsp),%rdx
+	testq	%rdx,%rdx
 	jz	7f
-	movl	%ecx,(%edx)
+	movq	%rcx,(%rdx)
 7:
-	popl	%edi
-	popl	%esi
+	popq	%rdi
+	popq	%rsi
 	ret
 
 /*



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