summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threadimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-01-29 09:29:39 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-04 10:06:34 +0100
commit16a41ccbce0631b10332e5ff84040328ebadd1dd (patch)
tree08147f8af55da3daded333c86d631ff9cb79ae6d /cpukit/score/include/rtems/score/threadimpl.h
parentscore: Add _Heap_Size_with_overhead() (diff)
downloadrtems-16a41ccbce0631b10332e5ff84040328ebadd1dd.tar.bz2
score: Add _Thread_Get_maximum_internal_threads()
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index e07b39266d..6eb7a036cb 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -23,7 +23,9 @@
#include <rtems/score/isr.h>
#include <rtems/score/objectimpl.h>
#include <rtems/score/statesimpl.h>
+#include <rtems/score/sysstate.h>
#include <rtems/score/todimpl.h>
+#include <rtems/config.h>
#ifdef __cplusplus
extern "C" {
@@ -592,6 +594,23 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_proxy_blocking (
return (code == THREAD_STATUS_PROXY_BLOCKING);
}
+RTEMS_INLINE_ROUTINE uint32_t _Thread_Get_maximum_internal_threads(void)
+{
+ uint32_t maximum_internal_threads = 0;
+
+ /* Idle threads */
+ maximum_internal_threads += rtems_configuration_get_maximum_processors();
+
+ /* MPCI thread */
+#if defined(RTEMS_MULTIPROCESSING)
+ if ( _System_state_Is_multiprocessing ) {
+ ++maximum_internal_threads;
+ }
+#endif
+
+ return maximum_internal_threads;
+}
+
/**
* This routine allocates an internal thread.
*/