Index: /trunk/include/iprt/asm.h
===================================================================
--- /trunk/include/iprt/asm.h	(revision 60602)
+++ /trunk/include/iprt/asm.h	(revision 60603)
@@ -3954,5 +3954,6 @@
  * @remarks No alignment requirements.
  */
-#if !defined(RT_OS_LINUX) || !defined(__KERNEL__)
+#if    (!defined(RT_OS_LINUX) || !defined(__KERNEL__)) \
+    && (!defined(RT_OS_FREEBSD) || !defined(_KERNEL))
 DECLASM(void *) ASMMemFirstMismatchingU8(void const *pv, size_t cb, uint8_t u8);
 #else
Index: /trunk/include/iprt/string.h
===================================================================
--- /trunk/include/iprt/string.h	(revision 60602)
+++ /trunk/include/iprt/string.h	(revision 60603)
@@ -114,5 +114,5 @@
 #endif
 
-#if !defined(RT_OS_LINUX) || !defined(_GNU_SOURCE)
+#if (!defined(RT_OS_LINUX) || !defined(_GNU_SOURCE)) && !defined(RT_OS_FREEBSD)
 RT_C_DECLS_BEGIN
 void *memrchr(const char *pv, int ch, size_t cb);
Index: /trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp	(revision 60602)
+++ /trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp	(revision 60603)
@@ -468,5 +468,7 @@
     /* VBoxUSB */
     (PFNRT)RTPathStripFilename,
+#if !defined(RT_OS_FREEBSD)
     (PFNRT)RTStrPurgeEncoding,
+#endif
     NULL
 };
Index: /trunk/src/VBox/HostDrivers/Support/freebsd/Makefile
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/freebsd/Makefile	(revision 60602)
+++ /trunk/src/VBox/HostDrivers/Support/freebsd/Makefile	(revision 60603)
@@ -149,4 +149,5 @@
 SRCS += \
 	alloc-r0drv.c \
+	alloc-ef-r0drv.c \
 	initterm-r0drv.c \
 	memobj-r0drv.c \
Index: /trunk/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv	(revision 60602)
+++ /trunk/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv	(revision 60603)
@@ -152,4 +152,5 @@
     ${PATH_ROOT}/src/VBox/Runtime/include/internal/lockvalidator.h=>include/internal/lockvalidator.h \
     ${PATH_ROOT}/src/VBox/Runtime/include/internal/magics.h=>include/internal/magics.h \
+    ${PATH_ROOT}/src/VBox/Runtime/include/internal/mem.h=>include/internal/mem.h \
     ${PATH_ROOT}/src/VBox/Runtime/include/internal/memobj.h=>include/internal/memobj.h \
     ${PATH_ROOT}/src/VBox/Runtime/include/internal/string.h=>include/internal/string.h \
@@ -178,4 +179,5 @@
     ${PATH_ROOT}/src/VBox/Runtime/generic/uuid-generic.cpp=>generic/uuid-generic.c \
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \
+    ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-ef-r0drv.cpp=>r0drv/alloc-ef-r0drv.c \
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \
Index: /trunk/src/VBox/Runtime/r0drv/alloc-ef-r0drv.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/alloc-ef-r0drv.cpp	(revision 60602)
+++ /trunk/src/VBox/Runtime/r0drv/alloc-ef-r0drv.cpp	(revision 60603)
@@ -118,5 +118,5 @@
 #ifdef RT_OS_WINDOWS
 # include <Windows.h>
-#else
+#elif !defined(RT_OS_FREEBSD)
 # include <sys/mman.h>
 #endif
@@ -382,5 +382,8 @@
  * This is something which you should call from gdb.
  */
-extern "C" void RTMemDump(void);
+RT_C_DECLS_BEGIN
+void RTMemDump(void);
+RT_C_DECLS_END
+
 void RTMemDump(void)
 {
