source: rtems/cpukit/score/src/schedulerpriority.c @ 0faa9dad

4.115
Last change on this file since 0faa9dad was 0faa9dad, checked in by Joel Sherrill <joel.sherrill@…>, on 11/24/10 at 15:51:28

2010-11-24 Gedare Bloom <giddyup44@…>

PR 1647/cpukit

  • posix/src/nanosleep.c, posix/src/sched_yield.c, rtems/src/taskwakeafter.c, sapi/include/confdefs.h, sapi/include/rtems/config.h, sapi/src/exinit.c, score/Makefile.am, score/preinstall.am, score/include/rtems/score/prioritybitmap.h, score/include/rtems/score/thread.h, score/inline/rtems/score/thread.inl, score/src/thread.c, score/src/threadchangepriority.c, score/src/threadclearstate.c, score/src/threadclose.c, score/src/threadinitialize.c, score/src/threadready.c, score/src/threadresume.c, score/src/threadsetpriority.c, score/src/threadsetstate.c, score/src/threadsettransient.c, score/src/threadsuspend.c, score/src/threadtickletimeslice.c: Refactor scheduler out of thread handler to facilitate alternate scheduler implementations.
  • score/src/threadyieldprocessor.c: Removed.
  • score/src/schedulerprioritythreadschedulerupdate.c, score/src/schedulerprioritythreadschedulerfree.c, score/src/schedulerpriorityblock.c, score/src/scheduler.c, score/src/schedulerprioritythreadschedulerallocate.c, score/src/schedulerpriorityunblock.c, score/src/schedulerpriority.c, score/src/schedulerpriorityyield.c, score/include/rtems/score/schedulerpriority.h, score/include/rtems/score/scheduler.h, score/inline/rtems/score/scheduler.inl, score/inline/rtems/score/schedulerpriority.inl: New files.
  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 *  Scheduler Handler
3 *
4 *  Copyright (C) 2010 Gedare Bloom.
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 *
10 *  $Id$
11 */
12
13#if HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <rtems/system.h>
18#include <rtems/config.h>
19#include <rtems/score/chain.h>
20#include <rtems/score/isr.h>
21#include <rtems/score/object.h>
22#include <rtems/score/scheduler.h>
23#include <rtems/score/schedulerpriority.h>
24#include <rtems/score/states.h>
25#include <rtems/score/thread.h>
26
27/* Instantiate any global variables needed by the priority scheduler */
28volatile Priority_bit_map_Control _Priority_Major_bit_map;
29
30Priority_bit_map_Control          _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
31
32/*
33 *  _Scheduler_priority_Initialize
34 *
35 * Initializes the scheduler for priority scheduling.
36 *
37 *  Input parameters:
38 *    the_scheduler - pointer to scheduler control
39 *
40 *  Output parameters: NONE
41 */
42
43void _Scheduler_priority_Initialize (
44    Scheduler_Control       *the_scheduler
45)
46{
47  /* the operations table is a jump table to redirect generic scheduler
48   * function calls to scheduler implementation specific functions.  The
49   * main purpose of scheduler initialization is to set up the jump table
50   * for the scheduler.  Every scheduler implementation provides its own
51   * scheduler operations table.
52   */
53  the_scheduler->operations.schedule           = &_Scheduler_priority_Schedule;
54  the_scheduler->operations.yield              = &_Scheduler_priority_Yield;
55  the_scheduler->operations.block              = &_Scheduler_priority_Block;
56  the_scheduler->operations.unblock            = &_Scheduler_priority_Unblock;
57  the_scheduler->operations.scheduler_allocate =
58      &_Scheduler_priority_Thread_scheduler_allocate;
59  the_scheduler->operations.scheduler_free     =
60      &_Scheduler_priority_Thread_scheduler_free;
61  the_scheduler->operations.scheduler_update   =
62      &_Scheduler_priority_Thread_scheduler_update;
63
64  _Scheduler_priority_Ready_queue_initialize( the_scheduler );
65  _Priority_bit_map_Handler_initialization( );
66}
Note: See TracBrowser for help on using the repository browser.