diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 609772c32c..d27ce3ab76 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -179,6 +179,7 @@ libscore_a_SOURCES += src/objectallocate.c src/objectclose.c \ ## SCHEDULER_C_FILES libscore_a_SOURCES += src/scheduler.c +libscore_a_SOURCES += src/schedulerdefaultallocatefree.c libscore_a_SOURCES += src/schedulerdefaultreleasejob.c libscore_a_SOURCES += src/schedulerdefaulttick.c libscore_a_SOURCES += src/schedulerdefaultstartidle.c diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index 1b2ac8fff8..deefd9de01 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -125,6 +125,26 @@ typedef struct { */ extern Scheduler_Control _Scheduler; +/** + * @brief Returns an arbitrary non-NULL value. + * + * @param[in] thread Unused. + * + * @return An arbitrary non-NULL value. + */ +void *_Scheduler_default_Allocate( + Thread_Control *thread +); + +/** + * @brief Does nothing. + * + * @param[in] thread Unused. + */ +void _Scheduler_default_Free( + Thread_Control *thread +); + /** * @brief Does nothing. * diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h index b4f7345e2c..97c9e84f7f 100644 --- a/cpukit/score/include/rtems/score/schedulersimple.h +++ b/cpukit/score/include/rtems/score/schedulersimple.h @@ -42,8 +42,8 @@ extern "C" { _Scheduler_simple_Yield, /* yield entry point */ \ _Scheduler_simple_Block, /* block entry point */ \ _Scheduler_simple_Unblock, /* unblock entry point */ \ - _Scheduler_simple_Allocate, /* allocate entry point */ \ - _Scheduler_simple_Free, /* free entry point */ \ + _Scheduler_default_Allocate, /* allocate entry point */ \ + _Scheduler_default_Free, /* free entry point */ \ _Scheduler_simple_Update, /* update entry point */ \ _Scheduler_simple_Enqueue, /* enqueue entry point */ \ _Scheduler_simple_Enqueue_first, /* enqueue_first entry point */ \ @@ -149,23 +149,6 @@ void _Scheduler_simple_Enqueue_first( Thread_Control *the_thread ); -/** - * @brief Return empty placeholder for the simple scheduler. - * - * This routine is a place holder for any memeory allocation needed - * by the scheduler. For the simple scheduler the routine is an empty - * place holder. - * - * @param[in] the_thread is the thread the scheduler is allocating - * management memory for - * - * @retval this routine returns -1 since this is just an empty placeholder - * and the return value may be defined differently by each scheduler. - */ -void *_Scheduler_simple_Allocate( - Thread_Control *the_thread -); - /** * @brief Stub for simple schedule update. * @@ -178,18 +161,6 @@ void _Scheduler_simple_Update( Thread_Control *the_thread ); -/** - * @brief Stub for simple schedule free. - * - * This routine does nothing, and is used as a stub for Schedule free - * The overhead of a function call will still be imposed. - * - * @param[in] the_thread is the thread to be blocked - */ -void _Scheduler_simple_Free( - Thread_Control *the_thread -); - /** * _Scheduler_simple_Ready_queue_enqueue * diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h index c21b9d492e..20462ebe74 100644 --- a/cpukit/score/include/rtems/score/schedulersimplesmp.h +++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h @@ -64,8 +64,8 @@ typedef struct { _Scheduler_simple_smp_Yield, \ _Scheduler_simple_smp_Extract, \ _Scheduler_simple_smp_Enqueue_priority_fifo, \ - _Scheduler_simple_Allocate, \ - _Scheduler_simple_Free, \ + _Scheduler_default_Allocate, \ + _Scheduler_default_Free, \ _Scheduler_simple_Update, \ _Scheduler_simple_smp_Enqueue_priority_fifo, \ _Scheduler_simple_smp_Enqueue_priority_lifo, \ diff --git a/cpukit/score/src/schedulerdefaultallocatefree.c b/cpukit/score/src/schedulerdefaultallocatefree.c new file mode 100644 index 0000000000..37f0981038 --- /dev/null +++ b/cpukit/score/src/schedulerdefaultallocatefree.c @@ -0,0 +1,38 @@ +/** + * @file + * + * @brief Scheduler Default Allocate and Release Operation + * + * @ingroup ScoreScheduler + */ + +/* + * 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. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +void *_Scheduler_default_Allocate( + Thread_Control *thread +) +{ + ( void ) thread; + + return ( void * )-1; /* maybe pick an appropriate poison value */ +} + +void _Scheduler_default_Free( + Thread_Control *thread +) +{ + ( void ) thread; +} diff --git a/cpukit/score/src/schedulersimple.c b/cpukit/score/src/schedulersimple.c index 84ffb7465a..bd6fe31b8b 100644 --- a/cpukit/score/src/schedulersimple.c +++ b/cpukit/score/src/schedulersimple.c @@ -23,25 +23,12 @@ #include #include -void * _Scheduler_simple_Allocate( - Thread_Control *the_thread -) -{ - return (void*)-1; /* maybe pick an appropriate poison value */ -} - void _Scheduler_simple_Update( Thread_Control *the_thread ) { } -void _Scheduler_simple_Free( - Thread_Control *the_thread -) -{ -} - void _Scheduler_simple_Initialize ( void ) { void *f;