Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/cortex Simplify gits_command by getting rid of ...



details:   https://anonhg.NetBSD.org/src/rev/f491aa0e32e5
branches:  trunk
changeset: 957801:f491aa0e32e5
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Dec 11 22:42:31 2020 +0000

description:
Simplify gits_command by getting rid of the _BYTE_ORDER test and just
always use the loop + htole64 path.

diffstat:

 sys/arch/arm/cortex/gicv3_its.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (32 lines):

diff -r 6755087cf529 -r f491aa0e32e5 sys/arch/arm/cortex/gicv3_its.c
--- a/sys/arch/arm/cortex/gicv3_its.c   Fri Dec 11 22:33:06 2020 +0000
+++ b/sys/arch/arm/cortex/gicv3_its.c   Fri Dec 11 22:42:31 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.29 2020/12/11 21:40:50 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.30 2020/12/11 22:42:31 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.29 2020/12/11 21:40:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.30 2020/12/11 22:42:31 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -118,13 +118,9 @@
        cwriter = gits_read_8(its, GITS_CWRITER);
        woff = cwriter & GITS_CWRITER_Offset;
 
-#if _BYTE_ORDER == _BIG_ENDIAN
        uint64_t *dw = (uint64_t *)(its->its_cmd.base + woff);
        for (int i = 0; i < __arraycount(cmd->dw); i++)
                dw[i] = htole64(cmd->dw[i]);
-#else
-       memcpy(its->its_cmd.base + woff, cmd->dw, sizeof(cmd->dw));
-#endif
        bus_dmamap_sync(its->its_dmat, its->its_cmd.map, woff, sizeof(cmd->dw), BUS_DMASYNC_PREWRITE);
 
        woff += sizeof(cmd->dw);



Home | Main Index | Thread Index | Old Index