OpenBSD: Add support for missing routine memmove() in kernel.
authorAntoine Verheijen <antoine@ualberta.ca>
Mon, 21 Jan 2013 08:48:01 +0000 (01:48 -0700)
committerDerrick Brashear <shadow@your-file-system.com>
Mon, 21 Jan 2013 12:32:00 +0000 (04:32 -0800)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/config/param.i386_obsd46.h
src/config/param.i386_obsd47.h
src/config/param.i386_obsd48.h

index aa6107d..68c60e1 100644 (file)
 #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 */
index 28a24dc..754b879 100644 (file)
 #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 */
index 0034976..9aa4537 100644 (file)
 #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 */