summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-22 14:51:25 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-22 16:35:07 +0100
commit3be0c9afa328510da0c4c0dc6de82fb8359307f8 (patch)
treea958dfda3bce2d4867aa7139644498ef1a882f23 /cpukit/score/include
parentscore: Avoid superfluous loads (diff)
downloadrtems-3be0c9afa328510da0c4c0dc6de82fb8359307f8.tar.bz2
score: Add and use <rtems/score/userextimpl.h>
This file contains the parts of <rtems/score/userext.h> that are only necessary for the RTEMS implementation.
Diffstat (limited to 'cpukit/score/include')
-rw-r--r--cpukit/score/include/rtems/score/userext.h195
-rw-r--r--cpukit/score/include/rtems/score/userextimpl.h235
2 files changed, 235 insertions, 195 deletions
diff --git a/cpukit/score/include/rtems/score/userext.h b/cpukit/score/include/rtems/score/userext.h
index b182e86172..6071d7ab3b 100644
--- a/cpukit/score/include/rtems/score/userext.h
+++ b/cpukit/score/include/rtems/score/userext.h
@@ -231,201 +231,6 @@ typedef struct {
User_extensions_Table Callouts;
} User_extensions_Control;
-/**
- * @brief List of active extensions.
- */
-extern Chain_Control _User_extensions_List;
-
-/**
- * @brief List of active task switch extensions.
- */
-extern Chain_Control _User_extensions_Switches_list;
-
-/**
- * @name Extension Maintainance
- *
- * @{
- */
-
-void _User_extensions_Handler_initialization( void );
-
-void _User_extensions_Add_set(
- User_extensions_Control *extension
-);
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set(
- User_extensions_Control *extension
-)
-{
- _User_extensions_Add_set( extension );
-}
-
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table(
- User_extensions_Control *extension,
- const User_extensions_Table *extension_table
-)
-{
- extension->Callouts = *extension_table;
-
- _User_extensions_Add_set( extension );
-}
-
-void _User_extensions_Remove_set(
- User_extensions_Control *extension
-);
-
-/**
- * @brief User extension visitor.
- *
- * @param[in, out] executing The currently executing thread.
- * @param[in, out] arg The argument passed to _User_extensions_Iterate().
- * @param[in] callouts The current callouts.
- */
-typedef void (*User_extensions_Visitor)(
- Thread_Control *executing,
- void *arg,
- const User_extensions_Table *callouts
-);
-
-typedef struct {
- Thread_Control *created;
- bool ok;
-} User_extensions_Thread_create_context;
-
-void _User_extensions_Thread_create_visitor(
- Thread_Control *executing,
- void *arg,
- const User_extensions_Table *callouts
-);
-
-void _User_extensions_Thread_delete_visitor(
- Thread_Control *executing,
- void *arg,
- const User_extensions_Table *callouts
-);
-
-void _User_extensions_Thread_start_visitor(
- Thread_Control *executing,
- void *arg,
- const User_extensions_Table *callouts
-);
-
-void _User_extensions_Thread_restart_visitor(
- Thread_Control *executing,
- void *arg,
- const User_extensions_Table *callouts
-);
-
-void _User_extensions_Thread_begin_visitor(
- Thread_Control *executing,
- void *arg,
- const User_extensions_Table *callouts
-);
-
-void _User_extensions_Thread_exitted_visitor(
- Thread_Control *executing,
- void *arg,
- const User_extensions_Table *callouts
-);
-
-typedef struct {
- Internal_errors_Source source;
- bool is_internal;
- Internal_errors_t error;
-} User_extensions_Fatal_context;
-
-void _User_extensions_Fatal_visitor(
- Thread_Control *executing,
- void *arg,
- const User_extensions_Table *callouts
-);
-
-/**
- * @brief Iterates through all user extensions and calls the visitor for each.
- *
- * @param[in, out] arg The argument passed to the visitor.
- * @param[in] visitor The visitor for each extension.
- */
-void _User_extensions_Iterate(
- void *arg,
- User_extensions_Visitor visitor
-);
-
-/** @} */
-
-/**
- * @name Extension Callout Dispatcher
- *
- * @{
- */
-
-static inline bool _User_extensions_Thread_create( Thread_Control *created )
-{
- User_extensions_Thread_create_context ctx = { created, true };
-
- _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor );
-
- return ctx.ok;
-}
-
-static inline void _User_extensions_Thread_delete( Thread_Control *deleted )
-{
- _User_extensions_Iterate(
- deleted,
- _User_extensions_Thread_delete_visitor
- );
-}
-
-static inline void _User_extensions_Thread_start( Thread_Control *started )
-{
- _User_extensions_Iterate(
- started,
- _User_extensions_Thread_start_visitor
- );
-}
-
-static inline void _User_extensions_Thread_restart( Thread_Control *restarted )
-{
- _User_extensions_Iterate(
- restarted,
- _User_extensions_Thread_restart_visitor
- );
-}
-
-static inline void _User_extensions_Thread_begin( Thread_Control *executing )
-{
- _User_extensions_Iterate(
- executing,
- _User_extensions_Thread_begin_visitor
- );
-}
-
-void _User_extensions_Thread_switch(
- Thread_Control *executing,
- Thread_Control *heir
-);
-
-static inline void _User_extensions_Thread_exitted( Thread_Control *executing )
-{
- _User_extensions_Iterate(
- executing,
- _User_extensions_Thread_exitted_visitor
- );
-}
-
-static inline void _User_extensions_Fatal(
- Internal_errors_Source source,
- bool is_internal,
- Internal_errors_t error
-)
-{
- User_extensions_Fatal_context ctx = { source, is_internal, error };
-
- _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
-}
-
-/** @} */
-
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/score/include/rtems/score/userextimpl.h b/cpukit/score/include/rtems/score/userextimpl.h
new file mode 100644
index 0000000000..665278e24e
--- /dev/null
+++ b/cpukit/score/include/rtems/score/userextimpl.h
@@ -0,0 +1,235 @@
+/**
+ * @file
+ *
+ * @ingroup ScoreUserExt
+ *
+ * @brief User Extension Handler API.
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef _RTEMS_SCORE_USEREXTIMPL_H
+#define _RTEMS_SCORE_USEREXTIMPL_H
+
+#include <rtems/score/userext.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup ScoreUserExt
+ *
+ * @{
+ */
+
+/**
+ * @brief List of active extensions.
+ */
+extern Chain_Control _User_extensions_List;
+
+/**
+ * @brief List of active task switch extensions.
+ */
+extern Chain_Control _User_extensions_Switches_list;
+
+/**
+ * @name Extension Maintainance
+ *
+ * @{
+ */
+
+void _User_extensions_Handler_initialization( void );
+
+void _User_extensions_Add_set(
+ User_extensions_Control *extension
+);
+
+RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set(
+ User_extensions_Control *extension
+)
+{
+ _User_extensions_Add_set( extension );
+}
+
+RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table(
+ User_extensions_Control *extension,
+ const User_extensions_Table *extension_table
+)
+{
+ extension->Callouts = *extension_table;
+
+ _User_extensions_Add_set( extension );
+}
+
+void _User_extensions_Remove_set(
+ User_extensions_Control *extension
+);
+
+/**
+ * @brief User extension visitor.
+ *
+ * @param[in, out] executing The currently executing thread.
+ * @param[in, out] arg The argument passed to _User_extensions_Iterate().
+ * @param[in] callouts The current callouts.
+ */
+typedef void (*User_extensions_Visitor)(
+ Thread_Control *executing,
+ void *arg,
+ const User_extensions_Table *callouts
+);
+
+typedef struct {
+ Thread_Control *created;
+ bool ok;
+} User_extensions_Thread_create_context;
+
+void _User_extensions_Thread_create_visitor(
+ Thread_Control *executing,
+ void *arg,
+ const User_extensions_Table *callouts
+);
+
+void _User_extensions_Thread_delete_visitor(
+ Thread_Control *executing,
+ void *arg,
+ const User_extensions_Table *callouts
+);
+
+void _User_extensions_Thread_start_visitor(
+ Thread_Control *executing,
+ void *arg,
+ const User_extensions_Table *callouts
+);
+
+void _User_extensions_Thread_restart_visitor(
+ Thread_Control *executing,
+ void *arg,
+ const User_extensions_Table *callouts
+);
+
+void _User_extensions_Thread_begin_visitor(
+ Thread_Control *executing,
+ void *arg,
+ const User_extensions_Table *callouts
+);
+
+void _User_extensions_Thread_exitted_visitor(
+ Thread_Control *executing,
+ void *arg,
+ const User_extensions_Table *callouts
+);
+
+typedef struct {
+ Internal_errors_Source source;
+ bool is_internal;
+ Internal_errors_t error;
+} User_extensions_Fatal_context;
+
+void _User_extensions_Fatal_visitor(
+ Thread_Control *executing,
+ void *arg,
+ const User_extensions_Table *callouts
+);
+
+/**
+ * @brief Iterates through all user extensions and calls the visitor for each.
+ *
+ * @param[in, out] arg The argument passed to the visitor.
+ * @param[in] visitor The visitor for each extension.
+ */
+void _User_extensions_Iterate(
+ void *arg,
+ User_extensions_Visitor visitor
+);
+
+/** @} */
+
+/**
+ * @name Extension Callout Dispatcher
+ *
+ * @{
+ */
+
+static inline bool _User_extensions_Thread_create( Thread_Control *created )
+{
+ User_extensions_Thread_create_context ctx = { created, true };
+
+ _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor );
+
+ return ctx.ok;
+}
+
+static inline void _User_extensions_Thread_delete( Thread_Control *deleted )
+{
+ _User_extensions_Iterate(
+ deleted,
+ _User_extensions_Thread_delete_visitor
+ );
+}
+
+static inline void _User_extensions_Thread_start( Thread_Control *started )
+{
+ _User_extensions_Iterate(
+ started,
+ _User_extensions_Thread_start_visitor
+ );
+}
+
+static inline void _User_extensions_Thread_restart( Thread_Control *restarted )
+{
+ _User_extensions_Iterate(
+ restarted,
+ _User_extensions_Thread_restart_visitor
+ );
+}
+
+static inline void _User_extensions_Thread_begin( Thread_Control *executing )
+{
+ _User_extensions_Iterate(
+ executing,
+ _User_extensions_Thread_begin_visitor
+ );
+}
+
+void _User_extensions_Thread_switch(
+ Thread_Control *executing,
+ Thread_Control *heir
+);
+
+static inline void _User_extensions_Thread_exitted( Thread_Control *executing )
+{
+ _User_extensions_Iterate(
+ executing,
+ _User_extensions_Thread_exitted_visitor
+ );
+}
+
+static inline void _User_extensions_Fatal(
+ Internal_errors_Source source,
+ bool is_internal,
+ Internal_errors_t error
+)
+{
+ User_extensions_Fatal_context ctx = { source, is_internal, error };
+
+ _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
+}
+
+/** @} */
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */