Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/include Fix LOADADDR on aarch64 and use memm...



details:   https://anonhg.NetBSD.org/src/rev/c3038bc60f23
branches:  trunk
changeset: 992304:c3038bc60f23
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Aug 23 19:01:22 2018 +0000

description:
Fix LOADADDR on aarch64 and use memmove for bcopy instead of memcpy

diffstat:

 sys/arch/evbarm/include/loadfile_machdep.h |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r 8987a482266c -r c3038bc60f23 sys/arch/evbarm/include/loadfile_machdep.h
--- a/sys/arch/evbarm/include/loadfile_machdep.h        Thu Aug 23 17:35:42 2018 +0000
+++ b/sys/arch/evbarm/include/loadfile_machdep.h        Thu Aug 23 19:01:22 2018 +0000
@@ -8,10 +8,14 @@
 #define LOAD_KERNEL    (LOAD_ALL & ~LOAD_TEXTA)
 #define COUNT_KERNEL   (COUNT_ALL & ~COUNT_TEXTA)
 
+#if defined(__aarch64__)
+#define LOADADDR(a)            ((((u_long)(a)) + offset) & 0x3fffffffff)
+#else
 #define LOADADDR(a)            (((u_long)(a)))
+#endif
 #define ALIGNENTRY(a)          ((u_long)(a))
 #define READ(f, b, c)          read((f), (void*)LOADADDR(b), (c))
-#define BCOPY(s, d, c)         memcpy((void*)LOADADDR(d), (void*)(s), (c))
+#define BCOPY(s, d, c)         memmove((void*)LOADADDR(d), (void*)(s), (c))
 #define BZERO(d, c)            memset((void*)LOADADDR(d), 0, (c))
 #define        WARN(a)                 do { \
                                        (void)printf a; \



Home | Main Index | Thread Index | Old Index