Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/altera Fix off-by-one when computing reset regi...



details:   https://anonhg.NetBSD.org/src/rev/97bcf262160f
branches:  trunk
changeset: 445127:97bcf262160f
user:      aymeric <aymeric%NetBSD.org@localhost>
date:      Sun Oct 14 18:53:01 2018 +0000

description:
Fix off-by-one when computing reset register address

diffstat:

 sys/arch/arm/altera/cycv_rstmgr.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r d2583140d65d -r 97bcf262160f sys/arch/arm/altera/cycv_rstmgr.c
--- a/sys/arch/arm/altera/cycv_rstmgr.c Sun Oct 14 18:50:07 2018 +0000
+++ b/sys/arch/arm/altera/cycv_rstmgr.c Sun Oct 14 18:53:01 2018 +0000
@@ -1,9 +1,9 @@
-/* $NetBSD: cycv_rstmgr.c,v 1.1 2018/09/19 17:31:38 aymeric Exp $ */
+/* $NetBSD: cycv_rstmgr.c,v 1.2 2018/10/14 18:53:01 aymeric Exp $ */
 
 /* This file is in the public domain. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cycv_rstmgr.c,v 1.1 2018/09/19 17:31:38 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cycv_rstmgr.c,v 1.2 2018/10/14 18:53:01 aymeric Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -98,11 +98,11 @@
 
        value = of_decode_int(data);
        if (value < 0 || value >
-           (CYCV_RSTMGR_MISCMODRST - CYCV_RSTMGR_PERMODRST + 4) / 4 * 32)
+           (CYCV_RSTMGR_MISCMODRST - CYCV_RSTMGR_MPUMODRST + 4) / 4 * 32)
                goto err_decode;
 
        reset = kmem_alloc(sizeof *reset, KM_SLEEP);
-       reset->address = CYCV_RSTMGR_PERMODRST + value / 32 * 4;
+       reset->address = CYCV_RSTMGR_MPUMODRST + value / 32 * 4;
        reset->mask = 1 << (value % 32);
 
        if (0) {



Home | Main Index | Thread Index | Old Index