1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
Index: src/nvcore/nvcore.h
===================================================================
--- src/nvcore/nvcore.h (revision 906)
+++ src/nvcore/nvcore.h (revision 907)
@@ -38,6 +38,9 @@
#if defined POSH_OS_LINUX
# define NV_OS_LINUX 1
# define NV_OS_UNIX 1
+#elif defined POSH_OS_FREEBSD
+# define NV_OS_FREEBSD 1
+# define NV_OS_UNIX 1
#elif defined POSH_OS_CYGWIN32
# define NV_OS_CYGWIN 1
#elif defined POSH_OS_MINGW
@@ -161,7 +164,7 @@
#elif NV_CC_GNUC
# if NV_OS_LINUX
# include "DefsGnucLinux.h"
-# elif NV_OS_DARWIN
+# elif NV_OS_DARWIN || NV_OS_FREEBSD
# include "DefsGnucDarwin.h"
# elif NV_OS_MINGW
# include "DefsGnucWin32.h"
Index: src/nvcore/Debug.cpp
===================================================================
--- src/nvcore/Debug.cpp (revision 906)
+++ src/nvcore/Debug.cpp (revision 907)
@@ -34,7 +34,7 @@
# endif
#endif
-#if NV_OS_DARWIN
+#if NV_OS_DARWIN || NV_OS_FREEBSD
# include <unistd.h> // getpid
# include <sys/types.h>
# include <sys/sysctl.h> // sysctl
@@ -199,6 +199,14 @@
return (void *) ucp->uc_mcontext->ss.eip;
# endif
# endif
+# elif NV_OS_FREEBSD
+# if NV_CPU_X86_64
+ ucontext_t * ucp = (ucontext_t *)secret;
+ return (void *)ucp->uc_mcontext.mc_rip;
+# elif NV_CPU_X86
+ ucontext_t * ucp = (ucontext_t *)secret;
+ return (void *)ucp->uc_mcontext.mc_eip;
+# endif
# else
# if NV_CPU_X86_64
// #define REG_RIP REG_INDEX(rip) // seems to be 16
Index: src/nvmath/nvmath.h
===================================================================
--- src/nvmath/nvmath.h (revision 906)
+++ src/nvmath/nvmath.h (revision 907)
@@ -115,7 +115,7 @@
{
#if NV_OS_WIN32
return _finite(f) != 0;
-#elif NV_OS_DARWIN
+#elif NV_OS_DARWIN || NV_OS_FREEBSD
return isfinite(f);
#elif NV_OS_LINUX
return finitef(f);
@@ -130,7 +130,7 @@
{
#if NV_OS_WIN32
return _isnan(f) != 0;
-#elif NV_OS_DARWIN
+#elif NV_OS_DARWIN || NV_OS_FREEBSD
return isnan(f);
#elif NV_OS_LINUX
return isnanf(f);
|