From: Antoine Verheijen Date: Mon, 21 Jan 2013 08:48:01 +0000 (-0700) Subject: OpenBSD: Add support for missing routine memmove() in kernel. X-Git-Tag: upstream/1.8.0_pre1^2~1654 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e130b342eb9aab06f6581f7cc9d5e64741ee3146;p=packages%2Fo%2Fopenafs.git 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 --- 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 */