Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/amd64 Fix a bug in ucas_32 and ucas_64. There...



details:   https://anonhg.NetBSD.org/src/rev/4241eeced7cd
branches:  trunk
changeset: 826240:4241eeced7cd
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Aug 23 08:04:22 2017 +0000

description:
Fix a bug in ucas_32 and ucas_64. There is a branch where they don't
initialize %rax.

diffstat:

 sys/arch/amd64/amd64/copy.S |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (41 lines):

diff -r b8566d28a999 -r 4241eeced7cd sys/arch/amd64/amd64/copy.S
--- a/sys/arch/amd64/amd64/copy.S       Wed Aug 23 01:17:46 2017 +0000
+++ b/sys/arch/amd64/amd64/copy.S       Wed Aug 23 08:04:22 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: copy.S,v 1.20 2015/12/09 16:55:18 maxv Exp $   */
+/*     $NetBSD: copy.S,v 1.21 2017/08/23 08:04:22 maxv Exp $   */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -446,7 +446,7 @@
        /* Fail if kernel-space */
        movq    $VM_MAXUSER_ADDRESS-8, %r8
        cmpq    %r8, %rdi
-       ja      _C_LABEL(ucas_fault)
+       ja      _C_LABEL(ucas_efault)
        movq    %rsi, %rax
 .Lucas64_start:
        /* Perform the CAS */
@@ -470,7 +470,7 @@
        /* Fail if kernel-space */
        movq    $VM_MAXUSER_ADDRESS-4, %r8
        cmpq    %r8, %rdi
-       ja      _C_LABEL(ucas_fault)
+       ja      _C_LABEL(ucas_efault)
        movl    %esi, %eax
 .Lucas32_start:
        /* Perform the CAS */
@@ -486,10 +486,9 @@
        ret
        DEFERRED_SWITCH_CALL
 
-/*
- * Fault handler for ucas_*().
- * Just return the error set by trap().
- */
+ENTRY(ucas_efault)
+       movq    $EFAULT,%rax
+
 NENTRY(ucas_fault)
        ret
 



Home | Main Index | Thread Index | Old Index