From e130b342eb9aab06f6581f7cc9d5e64741ee3146 Mon Sep 17 00:00:00 2001 From: Antoine Verheijen Date: Mon, 21 Jan 2013 01:48:01 -0700 Subject: [PATCH] OpenBSD: Add support for missing routine memmove() in kernel. OpenBSD does not have the memmove() routine available to dynamically loaded modules in its kernel. It exists but is not exported so it winds up "mia" on dynamic load of the kernel module. It's needed for the Heimdal code that's been added into OpenAFS. This patch deals with this issue by creating an inline version in the OS-specific param.h file. Note that this issue does not seem to exist in the amd64 version of OpenBSD so (at least for now) tis fix is only applied to the i386 version of the header files. Change-Id: Ide8a5ff49cb662e145fd93aefd8e3a12d7cbead5 Reviewed-on: http://gerrit.openafs.org/8926 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/config/param.i386_obsd46.h | 9 +++++++++ src/config/param.i386_obsd47.h | 9 +++++++++ src/config/param.i386_obsd48.h | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/config/param.i386_obsd46.h b/src/config/param.i386_obsd46.h index aa6107d97..68c60e169 100644 --- a/src/config/param.i386_obsd46.h +++ b/src/config/param.i386_obsd46.h @@ -13,4 +13,13 @@ #define AFS_X86_ENV 1 #define AFSLITTLE_ENDIAN 1 +#ifdef _KERNEL +void bcopy(const void *, void *, size_t); + +static inline void *memmove(void *dst, const void *src, size_t len) { + bcopy(src, dst, len); + return(dst); +} +#endif + #endif /* AFS_I386_PARAM_H */ diff --git a/src/config/param.i386_obsd47.h b/src/config/param.i386_obsd47.h index 28a24dc6c..754b879b9 100644 --- a/src/config/param.i386_obsd47.h +++ b/src/config/param.i386_obsd47.h @@ -13,4 +13,13 @@ #define AFS_X86_ENV 1 #define AFSLITTLE_ENDIAN 1 +#ifdef _KERNEL +void bcopy(const void *, void *, size_t); + +static inline void *memmove(void *dst, const void *src, size_t len) { + bcopy(src, dst, len); + return(dst); +} +#endif + #endif /* AFS_I386_PARAM_H */ diff --git a/src/config/param.i386_obsd48.h b/src/config/param.i386_obsd48.h index 00349767a..9aa45379a 100644 --- a/src/config/param.i386_obsd48.h +++ b/src/config/param.i386_obsd48.h @@ -13,4 +13,13 @@ #define AFS_X86_ENV 1 #define AFSLITTLE_ENDIAN 1 +#ifdef _KERNEL +void bcopy(const void *, void *, size_t); + +static inline void *memmove(void *dst, const void *src, size_t len) { + bcopy(src, dst, len); + return(dst); +} +#endif + #endif /* AFS_I386_PARAM_H */ -- 2.39.5