summaryrefslogtreecommitdiffstats
path: root/sys/contrib/octeon-sdk
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2012-11-24 02:55:05 +0000
committerjmallett <jmallett@FreeBSD.org>2012-11-24 02:55:05 +0000
commit4eee13b05f0d46c3c647bda0f40f62785b22ec70 (patch)
tree0efe51cb9997033ac188ca7032b8a0f8b249cdbc /sys/contrib/octeon-sdk
parentaedea296bd5a1c40049bf0307386e7aaa867740c (diff)
downloadFreeBSD-src-4eee13b05f0d46c3c647bda0f40f62785b22ec70.zip
FreeBSD-src-4eee13b05f0d46c3c647bda0f40f62785b22ec70.tar.gz
o) Have the FreeBSD kernel option "INVARIANTS" trickle down into the Simple
Executive code where similar invariant knobs exist. o) Make the Simple Executive's warning function print "WARNING: " on the same line as the warning it is displaying, rather than on a separate line.
Diffstat (limited to 'sys/contrib/octeon-sdk')
-rw-r--r--sys/contrib/octeon-sdk/cvmx-pow.h20
-rw-r--r--sys/contrib/octeon-sdk/cvmx-warn.c4
-rw-r--r--sys/contrib/octeon-sdk/cvmx.h19
3 files changed, 38 insertions, 5 deletions
diff --git a/sys/contrib/octeon-sdk/cvmx-pow.h b/sys/contrib/octeon-sdk/cvmx-pow.h
index a5771c6..f70eaf6 100644
--- a/sys/contrib/octeon-sdk/cvmx-pow.h
+++ b/sys/contrib/octeon-sdk/cvmx-pow.h
@@ -80,9 +80,23 @@
extern "C" {
#endif
-/* Default to having all POW constancy checks turned on */
-#ifndef CVMX_ENABLE_POW_CHECKS
-#define CVMX_ENABLE_POW_CHECKS 1
+#if defined(__FreeBSD__) && defined(_KERNEL)
+ /*
+ * For the FreeBSD kernel, have POW consistency checks depend on
+ * the setting of INVARIANTS.
+ */
+ #ifndef CVMX_ENABLE_POW_CHECKS
+ #ifdef INVARIANTS
+ #define CVMX_ENABLE_POW_CHECKS 1
+ #else
+ #define CVMX_ENABLE_POW_CHECKS 0
+ #endif
+ #endif
+#else
+ /* Default to having all POW constancy checks turned on */
+ #ifndef CVMX_ENABLE_POW_CHECKS
+ #define CVMX_ENABLE_POW_CHECKS 1
+ #endif
#endif
/**
diff --git a/sys/contrib/octeon-sdk/cvmx-warn.c b/sys/contrib/octeon-sdk/cvmx-warn.c
index 4f1464a..7b0b3fd 100644
--- a/sys/contrib/octeon-sdk/cvmx-warn.c
+++ b/sys/contrib/octeon-sdk/cvmx-warn.c
@@ -77,7 +77,11 @@ void cvmx_warn(const char *format, ...)
printk("WARNING:");
vprintk(format, args);
#else
+#ifdef CVMX_BUILD_FOR_FREEBSD_KERNEL
+ printf("WARNING: ");
+#else
printf("WARNING:\n");
+#endif
vprintf(format, args);
#endif
va_end(args);
diff --git a/sys/contrib/octeon-sdk/cvmx.h b/sys/contrib/octeon-sdk/cvmx.h
index 0b92bc3..3cde2f4 100644
--- a/sys/contrib/octeon-sdk/cvmx.h
+++ b/sys/contrib/octeon-sdk/cvmx.h
@@ -53,13 +53,28 @@
/* Control whether simple executive applications use 1-1 TLB mappings to access physical
** memory addresses. This must be disabled to allow large programs that use more than
** the 0x10000000 - 0x20000000 virtual address range.
+**
+** The FreeBSD kernel ifdefs elsewhere should mean that this is never even checked,
+** and so does not need to be defined.
*/
+#if !defined(__FreeBSD__) || !defined(_KERNEL)
#ifndef CVMX_USE_1_TO_1_TLB_MAPPINGS
#define CVMX_USE_1_TO_1_TLB_MAPPINGS 1
#endif
+#endif
-#ifndef CVMX_ENABLE_PARAMETER_CHECKING
-#define CVMX_ENABLE_PARAMETER_CHECKING 1
+#if defined(__FreeBSD__) && defined(_KERNEL)
+ #ifndef CVMX_ENABLE_PARAMETER_CHECKING
+ #ifdef INVARIANTS
+ #define CVMX_ENABLE_PARAMETER_CHECKING 1
+ #else
+ #define CVMX_ENABLE_PARAMETER_CHECKING 0
+ #endif
+ #endif
+#else
+ #ifndef CVMX_ENABLE_PARAMETER_CHECKING
+ #define CVMX_ENABLE_PARAMETER_CHECKING 1
+ #endif
#endif
#ifndef CVMX_ENABLE_DEBUG_PRINTS
OpenPOWER on IntegriCloud