diff options
author | Juli Mallett <jmallett@FreeBSD.org> | 2012-11-24 02:00:29 +0000 |
---|---|---|
committer | Juli Mallett <jmallett@FreeBSD.org> | 2012-11-24 02:00:29 +0000 |
commit | 01a310bd57bef731668d5d467c06b9646dbf28ba (patch) | |
tree | c9de71813dcf22952c3cd3b22c52e9537fe277e4 /sys/contrib/octeon-sdk | |
parent | 4063f925556a9c3464e5ee2e31ffd7ec45aeb424 (diff) | |
download | src-01a310bd57bef731668d5d467c06b9646dbf28ba.tar.gz src-01a310bd57bef731668d5d467c06b9646dbf28ba.zip |
o) Add support for specifying a model of Octeon to target at compile-time,
reducing the number of runtime checks done by the SDK code.
o) Group board/CPU information at early startup by subject matter, so that e.g.
CPU information is adjacent to CPU information and board information is
adjacent to board information.
Notes
Notes:
svn path=/head/; revision=243469
Diffstat (limited to 'sys/contrib/octeon-sdk')
-rw-r--r-- | sys/contrib/octeon-sdk/octeon-model.c | 12 | ||||
-rw-r--r-- | sys/contrib/octeon-sdk/octeon-model.h | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/sys/contrib/octeon-sdk/octeon-model.c b/sys/contrib/octeon-sdk/octeon-model.c index d93bf4ea24eb..ac314e4014f8 100644 --- a/sys/contrib/octeon-sdk/octeon-model.c +++ b/sys/contrib/octeon-sdk/octeon-model.c @@ -60,20 +60,24 @@ #include "cvmx-warn.h" #endif -#if defined(CVMX_BUILD_FOR_LINUX_USER) || defined(CVMX_BUILD_FOR_STANDALONE) +#if defined(CVMX_BUILD_FOR_LINUX_USER) || defined(CVMX_BUILD_FOR_STANDALONE) || defined(CVMX_BUILD_FOR_FREEBSD_KERNEL) +#if !defined(CVMX_BUILD_FOR_FREEBSD_KERNEL) #include <octeon-app-init.h> +#endif #include "cvmx-sysinfo.h" /** * This function checks to see if the software is compatible with the * chip it is running on. This is called in the application startup code * and does not need to be called directly by the application. - * Does not return if software is incompatible. + * Does not return if software is incompatible, unless compiled for the + * FreeBSD kernel, in which case it returns -1. * * @param chip_id chip id that the software is being run on. * * @return 0: runtime checking or exact version match * 1: chip is newer revision than compiled for, but software will run properly. + * -1: software is incompatible */ int octeon_model_version_check(uint32_t chip_id __attribute__ ((unused))) { @@ -91,7 +95,11 @@ int octeon_model_version_check(uint32_t chip_id __attribute__ ((unused))) " Expecting ID=0x%08x, Chip is 0x%08x\n", (OCTEON_MODEL & 0xffffff), (unsigned int)chip_id); if ((OCTEON_MODEL & 0xffffff) > chip_id) printf("Refusing to run on older revision than program was compiled for.\n"); +#if !defined(CVMX_BUILD_FOR_FREEBSD_KERNEL) exit(-1); +#else + return(-1); +#endif } else { diff --git a/sys/contrib/octeon-sdk/octeon-model.h b/sys/contrib/octeon-sdk/octeon-model.h index 8be809eb65ac..271fca208ae8 100644 --- a/sys/contrib/octeon-sdk/octeon-model.h +++ b/sys/contrib/octeon-sdk/octeon-model.h @@ -317,7 +317,7 @@ extern "C" { ))) #ifndef OCTEON_IS_MODEL -#if defined(USE_RUNTIME_MODEL_CHECKS) || defined(__U_BOOT__) || (defined(__linux__) && defined(__KERNEL__)) || defined(CVMX_BUILD_FOR_TOOLCHAIN) || (defined(__FreeBSD__) && defined(_KERNEL)) +#if defined(USE_RUNTIME_MODEL_CHECKS) || defined(__U_BOOT__) || (defined(__linux__) && defined(__KERNEL__)) || defined(CVMX_BUILD_FOR_TOOLCHAIN) || (defined(__FreeBSD__) && defined(_KERNEL) && !defined(OCTEON_MODEL)) /* NOTE: This for internal use only!!!!! */ static inline int __octeon_is_model_runtime__(uint32_t model) @@ -359,6 +359,7 @@ static inline int __octeon_is_model_runtime__(uint32_t model) #endif #endif +int octeon_model_version_check(uint32_t chip_id); const char *octeon_model_get_string(uint32_t chip_id); const char *octeon_model_get_string_buffer(uint32_t chip_id, char * buffer); |