[rtems commit] PR1908: consolidate libqos code and fix installed header location

Gedare Bloom gedare at rtems.org
Mon Apr 23 13:24:23 UTC 2012


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

Author:    Gedare Bloom <gedare at rtems.org>
Date:      Mon Apr 23 09:10:04 2012 -0400

PR1908: consolidate libqos code and fix installed header location

---

 cpukit/Makefile.am                    |    4 +-
 cpukit/configure.ac                   |    1 -
 cpukit/libqos/Makefile.am             |   12 --
 cpukit/libqos/preinstall.am           |   28 -----
 cpukit/libqos/qreslib.h               |  189 +++++++++++++++++++++++++++++-
 cpukit/libqos/qreslib.inl             |  214 ---------------------------------
 cpukit/preinstall.am                  |    4 +
 testsuites/sptests/spqreslib/system.h |    2 +-
 8 files changed, 196 insertions(+), 258 deletions(-)

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 7657166..542d512 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -15,7 +15,6 @@ SUBDIRS += libi2c
 SUBDIRS += libmisc
 SUBDIRS += libmd
 SUBDIRS += libgnat
-SUBDIRS += libqos
 SUBDIRS += wrapup
 
 SUBDIRS += zlib
@@ -166,6 +165,9 @@ include_rtems_HEADERS += libmisc/fb/mw_uid.h
 include_rtems_HEADERS += libmisc/mouse/mouse_parser.h
 include_rtems_HEADERS += libmisc/mouse/serial_mouse.h
 
+## libqos
+include_rtems_HEADERS += libqos/qreslib.h
+
 ## shell
 if LIBSHELL
 include_rtems_HEADERS += libmisc/shell/shell.h
diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index 1066e41..7c5c731 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -380,7 +380,6 @@ librpc/Makefile
 libmisc/Makefile
 libi2c/Makefile
 libmd/Makefile
-libqos/Makefile
 zlib/Makefile
 ftpd/Makefile
 telnetd/Makefile
diff --git a/cpukit/libqos/Makefile.am b/cpukit/libqos/Makefile.am
deleted file mode 100644
index 3223dcd..0000000
--- a/cpukit/libqos/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-##
-## $Id$
-##
-
-include $(top_srcdir)/automake/multilib.am
-include $(top_srcdir)/automake/compile.am
-
-include_HEADERS = qreslib.h
-include_HEADERS += qreslib.inl
-
-include $(srcdir)/preinstall.am
-include $(top_srcdir)/automake/local.am
diff --git a/cpukit/libqos/preinstall.am b/cpukit/libqos/preinstall.am
deleted file mode 100644
index 9b48932..0000000
--- a/cpukit/libqos/preinstall.am
+++ /dev/null
@@ -1,28 +0,0 @@
-## Automatically generated by ampolish3 - Do not edit
-
-if AMPOLISH3
-$(srcdir)/preinstall.am: Makefile.am
-	$(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
-endif
-
-PREINSTALL_DIRS =
-DISTCLEANFILES = $(PREINSTALL_DIRS)
-
-all-am: $(PREINSTALL_FILES)
-
-PREINSTALL_FILES =
-CLEANFILES = $(PREINSTALL_FILES)
-
-$(PROJECT_INCLUDE)/$(dirstamp):
-	@$(MKDIR_P) $(PROJECT_INCLUDE)
-	@: > $(PROJECT_INCLUDE)/$(dirstamp)
-PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
-
-$(PROJECT_INCLUDE)/qreslib.h: qreslib.h $(PROJECT_INCLUDE)/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/qreslib.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/qreslib.h
-
-$(PROJECT_INCLUDE)/qreslib.inl: qreslib.inl $(PROJECT_INCLUDE)/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/qreslib.inl
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/qreslib.inl
-
diff --git a/cpukit/libqos/qreslib.h b/cpukit/libqos/qreslib.h
index 22bbd3e..59bbbc3 100644
--- a/cpukit/libqos/qreslib.h
+++ b/cpukit/libqos/qreslib.h
@@ -71,7 +71,194 @@ typedef struct {
   uint32_t Q;
 } qres_params_t;
 
-#include <qreslib.inl>
+/**
+ *  @brief qres init
+ *
+ *  Initializes the QoS RES library.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_init ( void )
+{
+  return _Scheduler_CBS_Initialize();
+}
+
+/**
+ *  @brief qres cleanup
+ *
+ *  Cleanup resources associated to the QoS RES Library.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_cleanup ( void )
+{
+  return _Scheduler_CBS_Cleanup();
+}
+
+/**
+ *  @brief qres create server
+ *
+ *  Create a new server with specified parameters.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_create_server (
+  qres_params_t *params,
+  qres_sid_t    *server_id
+)
+{
+  return _Scheduler_CBS_Create_server(
+             (Scheduler_CBS_Parameters *) params,
+             NULL,
+             server_id
+         );
+}
+
+/**
+ *  @brief qres attach thread
+ *
+ *  Attach a task to an already existing server.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_attach_thread (
+  qres_sid_t server_id,
+  pid_t      pid,
+  tid_t      task_id
+)
+{
+  return _Scheduler_CBS_Attach_thread( server_id, task_id );
+}
+
+/**
+ *  @brief qres detach thread
+ *
+ *  Detach from the QoS Server.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_detach_thread (
+  qres_sid_t server_id,
+  pid_t      pid,
+  tid_t      task_id
+)
+{
+  return _Scheduler_CBS_Detach_thread( server_id, task_id );
+}
+
+/**
+ *  @brief qres destroy server
+ *
+ *  Detach all tasks from a server and destroy it.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_destroy_server (
+  qres_sid_t server_id
+)
+{
+  return _Scheduler_CBS_Destroy_server( server_id );
+}
+
+/**
+ *  @brief qres get server id
+ *
+ *  Get a thread server id, or QOS_E_NOT_FOUND if it is not
+ *  attached to any server.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_get_sid (
+  pid_t       pid,
+  tid_t       task_id,
+  qres_sid_t *server_id
+)
+{
+  return _Scheduler_CBS_Get_server_id( task_id, server_id );
+}
+
+/**
+ *  @brief qres get params
+ *
+ *  Retrieve QoS scheduling parameters.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_get_params (
+  qres_sid_t     server_id,
+  qres_params_t *params
+)
+{
+  return _Scheduler_CBS_Get_parameters(
+             server_id,
+             (Scheduler_CBS_Parameters *) params
+         );
+}
+
+/**
+ *  @brief qres set params
+ *
+ *  Change QoS scheduling parameters.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_set_params (
+  qres_sid_t     server_id,
+  qres_params_t *params
+)
+{
+  return _Scheduler_CBS_Set_parameters(
+             server_id,
+             (Scheduler_CBS_Parameters *) params
+         );
+}
+
+/**
+ *  @brief qres get execution time
+ *
+ *  Retrieve time info relative to the current server.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_get_exec_time (
+  qres_sid_t    server_id,
+  qres_time_t  *exec_time,
+  qres_atime_t *abs_time
+)
+{
+  return _Scheduler_CBS_Get_execution_time( server_id, exec_time, abs_time );
+}
+
+/**
+ *  @brief qres get current budget
+ *
+ *  Retrieve remaining budget for the current server instance.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_get_curr_budget (
+  qres_sid_t   server_id,
+  qres_time_t *current_budget
+)
+{
+  return _Scheduler_CBS_Get_remaining_budget( server_id, current_budget );
+}
+
+/**
+ *  @brief qres get approved budget
+ *
+ *  Retrieve the budget that has been approved for the subsequent
+ *  server instances.
+ *
+ *  @return status code.
+ */
+RTEMS_INLINE_ROUTINE qos_rv qres_get_appr_budget (
+  qres_sid_t   server_id,
+  qres_time_t *appr_budget
+)
+{
+  return _Scheduler_CBS_Get_approved_budget( server_id, appr_budget );
+}
 
 #ifdef __cplusplus
 }
diff --git a/cpukit/libqos/qreslib.inl b/cpukit/libqos/qreslib.inl
deleted file mode 100644
index 094d1e6..0000000
--- a/cpukit/libqos/qreslib.inl
+++ /dev/null
@@ -1,214 +0,0 @@
-/**
- * @file qreslib.inl
- *
- *  This include file contains all the constants and structures associated
- *  with the QoS RES library.
- *
- * @note The library is available only together with CBS scheduler.
- */
-
-/*
- *  Copyright (C) 2011 Petr Benes.
- *  Copyright (C) 2011 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.
- *
- *  $Id$
- */
-
-#ifndef _QRESLIB_H
-# error "Never use <qreslib.inl> directly; include <qreslib.h> instead."
-#endif
-
-#include <rtems/score/schedulercbs.h>
-
-/**
- *  @brief qres init
- *
- *  Initializes the QoS RES library.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_init ( void )
-{
-  return _Scheduler_CBS_Initialize();
-}
-
-/**
- *  @brief qres cleanup
- *
- *  Cleanup resources associated to the QoS RES Library.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_cleanup ( void )
-{
-  return _Scheduler_CBS_Cleanup();
-}
-
-/**
- *  @brief qres create server
- *
- *  Create a new server with specified parameters.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_create_server (
-  qres_params_t *params,
-  qres_sid_t    *server_id
-)
-{
-  return _Scheduler_CBS_Create_server(
-             (Scheduler_CBS_Parameters *) params,
-             NULL,
-             server_id
-         );
-}
-
-/**
- *  @brief qres attach thread
- *
- *  Attach a task to an already existing server.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_attach_thread (
-  qres_sid_t server_id,
-  pid_t      pid,
-  tid_t      task_id
-)
-{
-  return _Scheduler_CBS_Attach_thread( server_id, task_id );
-}
-
-/**
- *  @brief qres detach thread
- *
- *  Detach from the QoS Server.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_detach_thread (
-  qres_sid_t server_id,
-  pid_t      pid,
-  tid_t      task_id
-)
-{
-  return _Scheduler_CBS_Detach_thread( server_id, task_id );
-}
-
-/**
- *  @brief qres destroy server
- *
- *  Detach all tasks from a server and destroy it.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_destroy_server (
-  qres_sid_t server_id
-)
-{
-  return _Scheduler_CBS_Destroy_server( server_id );
-}
-
-/**
- *  @brief qres get server id
- *
- *  Get a thread server id, or QOS_E_NOT_FOUND if it is not
- *  attached to any server.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_get_sid (
-  pid_t       pid,
-  tid_t       task_id,
-  qres_sid_t *server_id
-)
-{
-  return _Scheduler_CBS_Get_server_id( task_id, server_id );
-}
-
-/**
- *  @brief qres get params
- *
- *  Retrieve QoS scheduling parameters.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_get_params (
-  qres_sid_t     server_id,
-  qres_params_t *params
-)
-{
-  return _Scheduler_CBS_Get_parameters(
-             server_id,
-             (Scheduler_CBS_Parameters *) params
-         );
-}
-
-/**
- *  @brief qres set params
- *
- *  Change QoS scheduling parameters.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_set_params (
-  qres_sid_t     server_id,
-  qres_params_t *params
-)
-{
-  return _Scheduler_CBS_Set_parameters(
-             server_id,
-             (Scheduler_CBS_Parameters *) params
-         );
-}
-
-/**
- *  @brief qres get execution time
- *
- *  Retrieve time info relative to the current server.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_get_exec_time (
-  qres_sid_t    server_id,
-  qres_time_t  *exec_time,
-  qres_atime_t *abs_time
-)
-{
-  return _Scheduler_CBS_Get_execution_time( server_id, exec_time, abs_time );
-}
-
-/**
- *  @brief qres get current budget
- *
- *  Retrieve remaining budget for the current server instance.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_get_curr_budget (
-  qres_sid_t   server_id,
-  qres_time_t *current_budget
-)
-{
-  return _Scheduler_CBS_Get_remaining_budget( server_id, current_budget );
-}
-
-/**
- *  @brief qres get approved budget
- *
- *  Retrieve the budget that has been approved for the subsequent
- *  server instances.
- *
- *  @return status code.
- */
-RTEMS_INLINE_ROUTINE qos_rv qres_get_appr_budget (
-  qres_sid_t   server_id,
-  qres_time_t *appr_budget
-)
-{
-  return _Scheduler_CBS_Get_approved_budget( server_id, appr_budget );
-}
diff --git a/cpukit/preinstall.am b/cpukit/preinstall.am
index 8671a8c..f6d24bb 100644
--- a/cpukit/preinstall.am
+++ b/cpukit/preinstall.am
@@ -337,6 +337,10 @@ $(PROJECT_INCLUDE)/rtems/serial_mouse.h: libmisc/mouse/serial_mouse.h $(PROJECT_
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/serial_mouse.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/serial_mouse.h
 
+$(PROJECT_INCLUDE)/rtems/qreslib.h: libqos/qreslib.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/qreslib.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/qreslib.h
+
 if LIBSHELL
 $(PROJECT_INCLUDE)/rtems/shell.h: libmisc/shell/shell.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/shell.h
diff --git a/testsuites/sptests/spqreslib/system.h b/testsuites/sptests/spqreslib/system.h
index f99b5f4..1f22968 100644
--- a/testsuites/sptests/spqreslib/system.h
+++ b/testsuites/sptests/spqreslib/system.h
@@ -48,7 +48,7 @@ rtems_task Task_Periodic(
 #include <rtems/rtems/clock.h>
 #include <rtems/score/isr.h>
 #include <rtems/rtems/intr.h>
-#include <qreslib.h>
+#include <rtems/qreslib.h>
 
 /* global variables */
 




More information about the vc mailing list