[rtems commit] score: Merge wkspace API into one file

Sebastian Huber sebh at rtems.org
Tue Jul 23 15:14:21 UTC 2013


Module:    rtems
Branch:    master
Commit:    1cb75cc4c2683b9287f3e91e46b5185fce65780a
Changeset: http://git.rtems.org/rtems/commit/?id=1cb75cc4c2683b9287f3e91e46b5185fce65780a

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jul 23 15:32:50 2013 +0200

score: Merge wkspace API into one file

---

 cpukit/libmisc/capture/capture.c            |   19 +++++++-------
 cpukit/score/Makefile.am                    |    1 -
 cpukit/score/include/rtems/score/wkspace.h  |   20 ++++++---------
 cpukit/score/inline/rtems/score/wkspace.inl |   35 ---------------------------
 cpukit/score/preinstall.am                  |    4 ---
 5 files changed, 17 insertions(+), 62 deletions(-)

diff --git a/cpukit/libmisc/capture/capture.c b/cpukit/libmisc/capture/capture.c
index c31a079..1acfc0d 100644
--- a/cpukit/libmisc/capture/capture.c
+++ b/cpukit/libmisc/capture/capture.c
@@ -30,8 +30,6 @@
 
 #include "capture.h"
 #include <rtems/score/states.inl>
-#include <rtems/score/wkspace.h>
-#include <rtems/score/wkspace.inl>
 
 /*
  * These events are always recorded and are not part of the
@@ -347,9 +345,9 @@ rtems_capture_create_control (rtems_name name, rtems_id id)
 
   if (control == NULL)
   {
-    control = _Workspace_Allocate (sizeof (rtems_capture_control_t));
+    bool ok = rtems_workspace_allocate (sizeof (*control), (void **) &control);
 
-    if (control == NULL)
+    if (!ok)
     {
       capture_flags |= RTEMS_CAPTURE_NO_MEMORY;
       return NULL;
@@ -398,10 +396,11 @@ rtems_capture_create_capture_task (rtems_tcb* new_task)
   rtems_capture_task_t*    task;
   rtems_capture_control_t* control;
   rtems_name               name;
+  bool                     ok;
 
-  task = _Workspace_Allocate (sizeof (rtems_capture_task_t));
+  ok = rtems_workspace_allocate (sizeof (*task), (void **) &task);
 
-  if (task == NULL)
+  if (!ok)
   {
     capture_flags |= RTEMS_CAPTURE_NO_MEMORY;
     return NULL;
@@ -492,7 +491,7 @@ rtems_capture_destroy_capture_task (rtems_capture_task_t* task)
 
     rtems_interrupt_enable (level);
 
-    _Workspace_Free (task);
+    rtems_workspace_free (task);
   }
 }
 
@@ -1105,7 +1104,7 @@ rtems_capture_close (void)
   {
     rtems_capture_task_t* delete = task;
     task = task->forw;
-    _Workspace_Free (delete);
+    rtems_workspace_free (delete);
   }
 
   capture_tasks = NULL;
@@ -1116,7 +1115,7 @@ rtems_capture_close (void)
   {
     rtems_capture_control_t* delete = control;
     control = control->next;
-    _Workspace_Free (delete);
+    rtems_workspace_free (delete);
   }
 
   capture_controls = NULL;
@@ -1306,7 +1305,7 @@ rtems_capture_watch_del (rtems_name name, rtems_id id)
 
       rtems_interrupt_enable (level);
 
-      _Workspace_Free (control);
+      rtems_workspace_free (control);
 
       control = *prev_control;
 
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index eee4ce3..d174c37 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -106,7 +106,6 @@ include_rtems_score_HEADERS += inline/rtems/score/thread.inl
 include_rtems_score_HEADERS += inline/rtems/score/threadq.inl
 include_rtems_score_HEADERS += inline/rtems/score/tod.inl
 include_rtems_score_HEADERS += inline/rtems/score/tqdata.inl
-include_rtems_score_HEADERS += inline/rtems/score/wkspace.inl
 
 if HAS_MP
 ## We only build multiprocessing related files if HAS_MP was defined
diff --git a/cpukit/score/include/rtems/score/wkspace.h b/cpukit/score/include/rtems/score/wkspace.h
index 91059f7..7adf9df 100644
--- a/cpukit/score/include/rtems/score/wkspace.h
+++ b/cpukit/score/include/rtems/score/wkspace.h
@@ -20,6 +20,13 @@
 #ifndef _RTEMS_SCORE_WKSPACE_H
 #define _RTEMS_SCORE_WKSPACE_H
 
+#include <rtems/score/heap.h>
+#include <rtems/score/interr.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  *  @defgroup ScoreWorkspace Workspace Handler
  *
@@ -30,13 +37,6 @@
  */
 /**@{*/
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <rtems/score/heap.h>
-#include <rtems/score/interr.h>
-
 /**
  *  @brief Executive workspace control.
  *
@@ -117,15 +117,11 @@ char *_Workspace_String_duplicate(
   size_t len
 );
 
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/wkspace.inl>
-#endif
+/**@}*/
 
 #ifdef __cplusplus
 }
 #endif
 
-/**@}*/
-
 #endif
 /* end of include file */
diff --git a/cpukit/score/inline/rtems/score/wkspace.inl b/cpukit/score/inline/rtems/score/wkspace.inl
deleted file mode 100644
index 16679c8..0000000
--- a/cpukit/score/inline/rtems/score/wkspace.inl
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * @file
- *
- * @brief Inlined Routines Associated with the RAM Workspace
- *
- * This include file contains the bodies of the routines which contains
- * information related to the RAM Workspace.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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_WKSPACE_H
-# error "Never use <rtems/score/wkspace.inl> directly; include <rtems/score/wkspace.h> instead."
-#endif
-
-#ifndef _RTEMS_SCORE_WKSPACE_INL
-#define _RTEMS_SCORE_WKSPACE_INL
-
-/**
- *  @addtogroup ScoreWorkspace
- *
- *  @{
- */
-
-/** @} */
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index cb21cbd..73d088c 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -355,10 +355,6 @@ $(PROJECT_INCLUDE)/rtems/score/tqdata.inl: inline/rtems/score/tqdata.inl $(PROJE
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/tqdata.inl
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/tqdata.inl
 
-$(PROJECT_INCLUDE)/rtems/score/wkspace.inl: inline/rtems/score/wkspace.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/wkspace.inl
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/wkspace.inl
-
 if HAS_MP
 $(PROJECT_INCLUDE)/rtems/score/mppkt.inl: inline/rtems/score/mppkt.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/mppkt.inl




More information about the vc mailing list