Module Name: src Committed By: jmcneill Date: Fri Dec 11 22:42:31 UTC 2020
Modified Files: src/sys/arch/arm/cortex: gicv3_its.c Log Message: Simplify gits_command by getting rid of the _BYTE_ORDER test and just always use the loop + htole64 path. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/cortex/gicv3_its.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/cortex/gicv3_its.c diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.29 src/sys/arch/arm/cortex/gicv3_its.c:1.30 --- src/sys/arch/arm/cortex/gicv3_its.c:1.29 Fri Dec 11 21:40:50 2020 +++ src/sys/arch/arm/cortex/gicv3_its.c Fri Dec 11 22:42:31 2020 @@ -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 @@ gits_command(struct gicv3_its *its, cons 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);