Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/aarch64 fixed a bug that bus_space_read_reg...



details:   https://anonhg.NetBSD.org/src/rev/dee8aeeb1f10
branches:  trunk
changeset: 373005:dee8aeeb1f10
user:      ryo <ryo%NetBSD.org@localhost>
date:      Thu Jan 12 10:46:48 2023 +0000

description:
fixed a bug that bus_space_read_region_{2,4,8}_swap() accesses wrong address.

diffstat:

 sys/arch/aarch64/aarch64/bus_space_asm_generic.S |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 6c5625d29bce -r dee8aeeb1f10 sys/arch/aarch64/aarch64/bus_space_asm_generic.S
--- a/sys/arch/aarch64/aarch64/bus_space_asm_generic.S  Thu Jan 12 10:22:19 2023 +0000
+++ b/sys/arch/aarch64/aarch64/bus_space_asm_generic.S  Thu Jan 12 10:46:48 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_space_asm_generic.S,v 1.5 2020/11/12 11:28:39 jmcneill Exp $       */
+/*     $NetBSD: bus_space_asm_generic.S,v 1.6 2023/01/12 10:46:48 ryo Exp $    */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -29,7 +29,7 @@
 #include <aarch64/asm.h>
 #include "assym.h"
 
-RCSID("$NetBSD: bus_space_asm_generic.S,v 1.5 2020/11/12 11:28:39 jmcneill Exp $")
+RCSID("$NetBSD: bus_space_asm_generic.S,v 1.6 2023/01/12 10:46:48 ryo Exp $")
 
 .macro generate_bsfunc funcname, dsbop
 /* uint8_t {funcname}_bs_r_1(x0:tag, x1:addr, x2:offset) */
@@ -389,7 +389,7 @@
 0:
        lsl     x2, x2, x8      /* offset <<= tag->bs_stride */
 1:
-       ldrh    w8, [x1, x9]    /* value = *src */
+       ldrh    w8, [x1, x2]    /* value = *src */
        subs    x4, x4, #1      /* count-- */
        add     x2, x2, x9      /* src += delta */
        rev16   w8, w8
@@ -419,7 +419,7 @@
 0:
        lsl     x2, x2, x8      /* offset <<= tag->bs_stride */
 1:
-       ldr     w8, [x1, x9]    /* value = *src */
+       ldr     w8, [x1, x2]    /* value = *src */
        subs    x4, x4, #1      /* count-- */
        add     x2, x2, x9      /* src += delta */
        rev     w8, w8
@@ -449,7 +449,7 @@
 0:
        lsl     x2, x2, x8      /* offset <<= tag->bs_stride */
 1:
-       ldr     x8, [x1, x9]    /* value = *src */
+       ldr     x8, [x1, x2]    /* value = *src */
        subs    x4, x4, #1      /* count-- */
        add     x2, x2, x9      /* src += delta */
        rev     x8, x8



Home | Main Index | Thread Index | Old Index