PERFORCE change 28179 for review
Peter Wemm
peter at FreeBSD.org
Fri Apr 4 22:13:06 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=28179
Change 28179 by peter at peter_overcee on 2003/04/04 22:12:22
Dont use the non-existing cmpq imm64,reg64 instruction.
Discretely dispose of some other bugs while here. :-)
Affected files ...
.. //depot/projects/hammer/sys/x86_64/x86_64/support.s#14 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/x86_64/support.s#14 (text+ko) ====
@@ -95,7 +95,8 @@
* looks like there is an off by one error, and of course it caused an off
* by one error in several places.
*/
- cmpq $VM_MAXUSER_ADDRESS,%rax
+ movq $VM_MAXUSER_ADDRESS,%rcx
+ cmpq %rcx,%rax
ja copyout_fault
/* bcopy(%rsi, %rdi, %rbx) */
@@ -147,7 +148,8 @@
movq %rsi,%rdx
addq %rcx,%rdx
jc copyin_fault
- cmpq $VM_MAXUSER_ADDRESS,%rdx
+ movq $VM_MAXUSER_ADDRESS,%rax
+ cmpq %rax,%rdx
ja copyin_fault
movb %cl,%al
@@ -183,12 +185,13 @@
movq PCPU(CURPCB),%rcx
movq $fusufault,PCB_ONFAULT(%rcx)
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 */
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rdx /* verify address is valid */
ja fusufault
+ movq 16(%rsp),%rax /* old */
+ movq 24(%rsp),%rcx /* new */
cmpxchgq %rcx, (%rdx)
/*
@@ -212,7 +215,8 @@
movq $fusufault,PCB_ONFAULT(%rcx)
movq 8(%rsp),%rdx /* from */
- cmpq $VM_MAXUSER_ADDRESS-4,%edx /* verify address is valid */
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rdx /* verify address is valid */
ja fusufault
# XXX use the 64 extend
@@ -243,7 +247,8 @@
movq $fusufault,PCB_ONFAULT(%rcx)
movq 8(%rsp),%rdx
- cmpq $VM_MAXUSER_ADDRESS-2,%rdx
+ movq $VM_MAXUSER_ADDRESS-2,%rax
+ cmpq %rax,%rdx
ja fusufault
# XXX use the 64 extend
@@ -260,7 +265,8 @@
movq $fusufault,PCB_ONFAULT(%rcx)
movq 8(%rsp),%rdx
- cmpq $VM_MAXUSER_ADDRESS-1,%rdx
+ movq $VM_MAXUSER_ADDRESS-1,%rax
+ cmpq %rax,%rdx
ja fusufault
# XXX use the 64 extend
@@ -287,10 +293,11 @@
movq $fusufault,PCB_ONFAULT(%rcx)
movq 8(%rsp),%rdx
- cmpq $VM_MAXUSER_ADDRESS-4,%rdx /* verify address validity */
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rdx /* verify address validity */
ja fusufault
- movq 16(%rsp),%rax
+ movl 16(%rsp),%eax
movl %eax,(%rdx)
xorq %rax,%rax
movq PCPU(CURPCB),%rcx
@@ -308,7 +315,8 @@
movq $fusufault,PCB_ONFAULT(%rcx)
movq 8(%rsp),%rdx
- cmpq $VM_MAXUSER_ADDRESS-2,%rdx /* verify address validity */
+ movq $VM_MAXUSER_ADDRESS-2,%rax
+ cmpq %rax,%rdx /* verify address validity */
ja fusufault
movw 16(%rsp),%ax
@@ -326,10 +334,11 @@
movq $fusufault,PCB_ONFAULT(%rcx)
movq 8(%rsp),%rdx
- cmpq $VM_MAXUSER_ADDRESS-1,%rdx /* verify address validity */
+ movq $VM_MAXUSER_ADDRESS-1,%rax
+ cmpq %rax,%rdx /* verify address validity */
ja fusufault
- movb 18(%rsp),%al
+ movb 16(%rsp),%al
movb %al,(%rdx)
xorq %rax,%rax
movq PCPU(CURPCB),%rcx /* restore trashed register */
@@ -384,7 +393,8 @@
jmp cpystrflt_x
3:
/* rdx is zero - return ENAMETOOLONG or EFAULT */
- cmpq $VM_MAXUSER_ADDRESS,%rsi
+ movq $VM_MAXUSER_ADDRESS,%rax
+ cmpq %rax,%rsi
jae cpystrflt
4:
movq $ENAMETOOLONG,%rax
More information about the p4-projects
mailing list