diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-05-17 19:31:26 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-05-17 19:31:26 +0000 |
commit | f7494add383ab65724f5f784e006370dc5e08a26 (patch) | |
tree | 9c5418d6c6357ae8dec33d184b2ef64d04f1b6ec | |
parent | 2011-05-17 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-schedsim-f7494add383ab65724f5f784e006370dc5e08a26.tar.bz2 |
2011-05-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure.ac: Merge and update code. Simulators for Deterministic
Priority and SMP Simple Schedulers now work.
* acinclude.m4: New file.
-rw-r--r-- | schedsim/ChangeLog | 6 | ||||
-rw-r--r-- | schedsim/acinclude.m4 | 61 | ||||
-rw-r--r-- | schedsim/configure.ac | 142 |
3 files changed, 208 insertions, 1 deletions
diff --git a/schedsim/ChangeLog b/schedsim/ChangeLog index 8341283..0b0bc94 100644 --- a/schedsim/ChangeLog +++ b/schedsim/ChangeLog @@ -1,3 +1,9 @@ +2011-05-17 Joel Sherrill <joel.sherrill@oarcorp.com> + + * configure.ac: Merge and update code. Simulators for Deterministic + Priority and SMP Simple Schedulers now work. + * acinclude.m4: New file. + 2011-04-07 Joel Sherrill <joel.sherrill@oarcorp.com> * README: New file. diff --git a/schedsim/acinclude.m4 b/schedsim/acinclude.m4 new file mode 100644 index 0000000..da6084d --- /dev/null +++ b/schedsim/acinclude.m4 @@ -0,0 +1,61 @@ +# RTEMS_CPUOPT(NAME,CONDITION,VALUE,EXPLANATION) + +AC_DEFUN([_RTEMS_CPUOPT_INIT],[ +AC_BEFORE([_RTEMS_CPUOPT]) +cat >>cpuopts.tmp <<\_ACEOF +/** + * @file rtems/score/cpuopts.h + */ + +/* target cpu dependent options file */ +/* automatically generated -- DO NOT EDIT!! */ +#ifndef _RTEMS_SCORE_CPUOPTS_H +#define _RTEMS_SCORE_CPUOPTS_H +_ACEOF +]) + +AC_DEFUN([RTEMS_CPUOPT],[ +AC_REQUIRE([_RTEMS_CPUOPT_INIT]) +AC_BEFORE([_RTEMS_CPUOPT_FINI]) + if $2; then +cat >>cpuopts.tmp <<_ACEOF + +/* $4 */ +#define $1 $3 +_ACEOF +## FIXME: Duplicate the define to the autoheader +## Sanity check - Should be removed in future + AC_DEFINE_UNQUOTED([$1],[$3],[$4]) + else +cat >>cpuopts.tmp <<\_ACEOF + +/* $4 */ +/* #undef $1 */ +_ACEOF + fi +]) + +AC_DEFUN([_RTEMS_CPUOPT_FINI],[ +cat >>cpuopts.tmp <<\_ACEOF + +#endif /* _RTEMS_SCORE_CPUOPTS_H */ +_ACEOF + +AS_MKDIR_P(score/include/rtems/score) +AS_IF([test -f score/include/rtems/score/cpuopts.h], +[ + AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null], + [ + AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged]) + rm -f cpuopts.tmp + ],[ + AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) + rm -f score/include/rtems/score/cpuopts.h + mv cpuopts.tmp score/include/rtems/score/cpuopts.h + ]) +],[ + AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) + rm -f score/include/rtems/score/cpuopts.h + mv cpuopts.tmp score/include/rtems/score/cpuopts.h +]) +]) diff --git a/schedsim/configure.ac b/schedsim/configure.ac index fd3e922..8b71deb 100644 --- a/schedsim/configure.ac +++ b/schedsim/configure.ac @@ -12,6 +12,11 @@ RTEMS_CANONICAL_TARGET_CPU AM_INIT_AUTOMAKE([no-define foreign 1.11.1]) AM_MAINTAINER_MODE +RTEMS_ENABLE_MULTIPROCESSING +RTEMS_ENABLE_POSIX +RTEMS_ENABLE_RTEMS_DEBUG +RTEMS_ENABLE_NETWORKING + AC_PROG_RANLIB # FIXME: Hack to enforce gnu99 on systems with GCC which do not default to gnu99 AC_PROG_CC_C99 @@ -33,8 +38,142 @@ if test ! -d ${rtems_srcdir}/cpukit; then AC_MSG_ERROR([RTEMS Source Directory ${rtems_srcdir}/cpukit Does Not Exist]) fi -AC_SUBST(rtems_srcdir) +RTEMS_CHECK_MULTIPROCESSING +RTEMS_CHECK_POSIX_API +RTEMS_CHECK_NETWORKING +RTEMS_CHECK_SMP + +rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"` +rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"` +rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"` + +## This is needed to generate the field offsets of the per CPU +## data structure so they can be accessed from assembly code. +AC_CHECK_SIZEOF([void *]) + +_RTEMS_CPUOPT_INIT + +RTEMS_CPUOPT([RTEMS_DEBUG], + [test x"${enable_rtems_debug}" = x"yes"], + [1], + [if RTEMS_DEBUG is enabled]) + +RTEMS_CPUOPT([RTEMS_MULTIPROCESSING], + [test x"$enable_multiprocessing" = xyes], + [1], + [if multiprocessing is enabled]) + +RTEMS_CPUOPT([RTEMS_NEWLIB], + [test x"$RTEMS_USE_NEWLIB" = xyes], + [1], + [if using newlib]) + +RTEMS_CPUOPT([RTEMS_POSIX_API], + [test x"$rtems_cv_HAS_POSIX_API" = xyes], + [1], + [if posix api is supported]) + +RTEMS_CPUOPT([RTEMS_SMP], + [test x"$RTEMS_HAS_SMP" = xyes], + [1], + [if SMP is enabled]) + +RTEMS_CPUOPT([RTEMS_NETWORKING], + [test x"$rtems_cv_HAS_NETWORKING" = xyes], + [1], + [if networking is enabled]) + +RTEMS_CPUOPT([RTEMS_VERSION], + [true], + ["]_RTEMS_VERSION["], + [RTEMS version string]) + +RTEMS_CPUOPT([__RTEMS_USE_TICKS_FOR_STATISTICS__], + [test x"${USE_TICKS_FOR_STATISTICS}" = x"1"], + [1], + [disable nanosecond granularity for statistics]) + +RTEMS_CPUOPT([__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__], + [test x"${USE_TICKS_FOR_CPU_USAGE_STATISTICS}" = x"1"], + [1], + [disable nanosecond granularity for cpu usage statistics]) + +RTEMS_CPUOPT([__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__], + [test x"${USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS}" = x"1"], + [1], + [disable nanosecond granularity for period statistics]) + +## This improves both the size and coverage analysis. +RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__], + [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"], + [1], + [disable inlining _Thread_Enable_dispatch]) + +## This improves both the size and coverage analysis. +RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__], + [test x"${RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE}" = x"1"], + [1], + [disable inlining _Thread_Enable_dispatch]) + +## This improves both the size and coverage analysis. +RTEMS_CPUOPT([__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__], + [test x"${RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY}" = x"1"], + [1], + [disable inlining _Thread_queue_Enqueue_priority]) + +## This gives the same behavior as 4.8 and older +RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__], + [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"], + [1], + [disable strict order mutex]) + +## Deactivate ada bindings +RTEMS_CPUOPT([__RTEMS_ADA__], + [test x"${enable_ada}" = x"yes"], + [1], + [Define to 1 if ada/gnat bindings are built-in]) + +RTEMS_CPUOPT([RTEMS_SCHEDSIM], + [true], + [1], + [defined to indicate building RTEMS Scheduler Simulator]) + +## Then we propagate a private copy of the value into cpuopts.h +## so it is always available to the RTEMS header files. + +RTEMS_CPUOPT([__RTEMS_SIZEOF_VOID_P__], + [true], + [$ac_cv_sizeof_void_p], + [Size of a void * pointer]) + +RTEMS_CPUOPT([__RTEMS_MAJOR__], + [true], + [$rtems_major], + [major version portion of an RTEMS release]) + +RTEMS_CPUOPT([__RTEMS_MINOR__], + [true], + [$rtems_minor], + [minor version portion of an RTEMS release]) + +RTEMS_CPUOPT([__RTEMS_REVISION__], + [true], + [$rtems_revision], + [revision version portion of an RTEMS release]) + +_RTEMS_CPUOPT_FINI + +AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"]) +AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes") + +AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" ) +AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"]) + +AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes") +AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes") + +AC_SUBST(rtems_srcdir) AC_SUBST(program_prefix) # Explicitly list all Makefiles here @@ -44,5 +183,6 @@ rtems/Makefile shell/Makefile shell/shared/Makefile shell/schedsim_priority/Makefile +shell/schedsim_smpsimple/Makefile ]) AC_OUTPUT |