source: rtems/cpukit/score/src/schedulersimple.c @ 0118ed6

4.115
Last change on this file since 0118ed6 was 0118ed6, checked in by Joel Sherrill <joel.sherrill@…>, on 03/16/11 at 16:32:22

2011-03-16 Jennifer Averett <jennifer.averett@…>

PR 1743/cpu

  • sapi/include/confdefs.h, score/Makefile.am, score/preinstall.am: Add Simple Priority Scheduler as complement to existing Deterministic Priority Scheduler. This scheduler serves both as an example and as a lighter weight implementation for smaller systems.
  • score/include/rtems/score/schedulersimple.h, score/inline/rtems/score/schedulersimple.inl, score/src/schedulersimple.c, score/src/schedulersimpleblock.c, score/src/schedulersimpleenqueue.c, score/src/schedulersimpleenqueuefirst.c, score/src/schedulersimpleextract.c, score/src/schedulersimplereadyqueueenqueue.c, score/src/schedulersimplereadyqueueenqueuefirst.c, score/src/schedulersimpleschedule.c, score/src/schedulersimpleunblock.c, score/src/schedulersimpleyield.c: New files.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  Scheduler Simple Handler / Initialize
3 *  Scheduler Simple Handler / Allocate (Empty Routine)
4 *  Scheduler Simple Handler / Update (Empty Routine)
5 *  Scheduler Simple Handler / Free (Empty Routine)
6 *
7 *  COPYRIGHT (c) 2011.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/system.h>
22#include <rtems/config.h>
23#include <rtems/score/chain.h>
24#include <rtems/score/scheduler.h>
25#include <rtems/score/schedulersimple.h>
26#include <rtems/score/thread.h>
27#include <rtems/score/wkspace.h>
28
29/**
30 * This routine does nothing, and is used as a stub for Schedule allocate
31 *
32 * Note: returns a non-zero value, or else thread initialize thinks the
33 * allocation failed.
34 *
35 * The overhead of a function call will still be imposed.
36 */
37void * _Scheduler_simple_Allocate(
38  Thread_Control *the_thread
39)
40{
41  return (void*)-1; /* maybe pick an appropriate poison value */
42}
43
44
45/**
46 * This routine does nothing, and is used as a stub for Schedule update
47 *
48 * The overhead of a function call will still be imposed.
49 */
50void _Scheduler_simple_Update(
51  Thread_Control *the_thread
52)
53{
54}
55
56/**
57 * This routine does nothing, and is used as a stub for Schedule free
58 *
59 * The overhead of a function call will still be imposed.
60 */
61void _Scheduler_simple_Free(
62  Thread_Control *the_thread
63)
64{
65}
66
67/**
68 * This routine initializes the simple scheduler.
69 */
70void _Scheduler_simple_Initialize ( void )
71{
72  void *f;
73
74  /*
75   * Initialize Ready Queue
76   */
77
78  /* allocate ready queue structures */
79  f = _Workspace_Allocate_or_fatal_error( sizeof(Chain_Control) );
80  _Scheduler.information = f;
81
82  /* initialize ready queue structure */
83  _Chain_Initialize_empty( (Chain_Control *)f );
84}
Note: See TracBrowser for help on using the repository browser.