Source-Changes-HG archive

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

[src/trunk]: src/sys Restrict strictly-aligned versions of memcmp(9), memcpy(...



details:   https://anonhg.NetBSD.org/src/rev/cca9f99319f2
branches:  trunk
changeset: 366550:cca9f99319f2
user:      rin <rin%NetBSD.org@localhost>
date:      Mon May 30 14:18:10 2022 +0000

description:
Restrict strictly-aligned versions of memcmp(9), memcpy(9), and
memmove(9) to 403, instead of all evbppc machines.

Introduce strict-align LIBKERN_MD_FLAGS for this purpose.

diffstat:

 sys/arch/evbppc/conf/std.explora          |  3 ++-
 sys/lib/libkern/arch/powerpc/Makefile.inc |  5 ++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 5bca54109c1b -r cca9f99319f2 sys/arch/evbppc/conf/std.explora
--- a/sys/arch/evbppc/conf/std.explora  Mon May 30 14:13:59 2022 +0000
+++ b/sys/arch/evbppc/conf/std.explora  Mon May 30 14:18:10 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.explora,v 1.10 2022/05/30 14:09:01 rin Exp $
+#      $NetBSD: std.explora,v 1.11 2022/05/30 14:18:10 rin Exp $
 #
 # Standard/required options for NetBSD/explora.
 
@@ -11,6 +11,7 @@
 
 # 403 does not support unaligned memory access.
 options        PPC_NO_UNALIGNED
+makeoptions    LIBKERN_MD_FLAGS+="strict-align"
 
 options        VMSWAP_DEFAULT_PLAINTEXT        # do not encrypt swap by
                                                # default (slow cpu)
diff -r 5bca54109c1b -r cca9f99319f2 sys/lib/libkern/arch/powerpc/Makefile.inc
--- a/sys/lib/libkern/arch/powerpc/Makefile.inc Mon May 30 14:13:59 2022 +0000
+++ b/sys/lib/libkern/arch/powerpc/Makefile.inc Mon May 30 14:18:10 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.33 2021/07/26 12:49:13 rin Exp $
+#      $NetBSD: Makefile.inc,v 1.34 2022/05/30 14:18:10 rin Exp $
 
 SRCS+= bswap16.c bswap32.c
 SRCS+= htonl.c htons.c ntohl.c ntohs.c
@@ -7,9 +7,8 @@
 SRCS+= ffs.S memset.S strlen.S
 SRCS+= gprsavrest.S
 
-# XXX
+.if !empty(LIBKERN_MD_FLAGS:M*strict-align*)
 # Disable asm versions that use unaligned memory access and thus break 403.
-.if ${MACHINE} == "evbppc"
 .  for name in memcmp memcpy memmove
 .    for suffix in o po pico go d
 ${name}.${suffix}: ${name}.c



Home | Main Index | Thread Index | Old Index