PR1908: consolidate libqos code and fix installed header location

This commit is contained in:
Gedare Bloom
2012-04-23 09:26:34 -04:00
parent 4012792168
commit fb78f9170f
8 changed files with 196 additions and 258 deletions
+3 -1
View File
@@ -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
-1
View File
@@ -380,7 +380,6 @@ librpc/Makefile
libmisc/Makefile
libi2c/Makefile
libmd/Makefile
libqos/Makefile
zlib/Makefile
ftpd/Makefile
telnetd/Makefile
-12
View File
@@ -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
-28
View File
@@ -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
+188 -1
View File
@@ -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
}
-214
View File
@@ -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 );
}
+4
View File
@@ -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
+1 -1
View File
@@ -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 */