source: rtems/cpukit/score/include/rtems/score/prioritybitmap.h @ 23bbc43

4.115
Last change on this file since 23bbc43 was a55e305, checked in by Joel Sherrill <joel.sherrill@…>, on 07/29/10 at 17:52:10

2010-07-29 Gedare Bloom <giddyup44@…>

PR 1635/cpukit

  • sapi/src/exinit.c, score/Makefile.am, score/preinstall.am, score/include/rtems/score/bitfield.h, score/include/rtems/score/priority.h, score/include/rtems/score/thread.h, score/inline/rtems/score/priority.inl, score/inline/rtems/score/thread.inl, score/src/threadchangepriority.c, score/src/threadclearstate.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: Refactoring of priority handling, to isolate the bitmap implementation of priorities in the supercore so that priority management is a little more modular. This change is in anticipation of scheduler implementations that can select how they manage tracking priority levels / finding the highest priority ready task. Note that most of the changes here are simple renaming, to clarify the use of the bitmap-based priority management.
  • score/include/rtems/score/prioritybitmap.h, score/inline/rtems/score/prioritybitmap.inl: New files.
  • Property mode set to 100644
File size: 3.2 KB
Line 
1/**
2 *  @file  rtems/score/prioritybitmap.h
3 *
4 *  This include file contains all thread priority manipulation routines for
5 *  the bit map priority queue implementation.
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2010.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#ifndef _RTEMS_SCORE_PRIORITYBITMAP_H
20#define _RTEMS_SCORE_PRIORITYBITMAP_H
21
22/**
23 *  @addtogroup ScorePriority
24 * 
25 */
26/**@{*/
27
28/*
29 * Processor specific information.
30 */
31#include <rtems/score/cpu.h>
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#include <rtems/score/priority.h>
39
40/*
41 * TODO:
42 * These should only be instantiated if using the bit map handler.  The
43 * logical place for this is in confdefs.h when a scheduler that uses the
44 * bit map handler is configured.
45 */
46
47/**
48 *  Each sixteen bit entry in this array is associated with one of
49 *  the sixteen entries in the Priority Bit map.
50 */
51SCORE_EXTERN volatile Priority_bit_map_Control _Priority_Major_bit_map;
52
53/** Each bit in the Priority Bitmap indicates whether or not there are
54 *  threads ready at a particular priority.  The mapping of
55 *  individual priority levels to particular bits is processor
56 *  dependent as is the value of each bit used to indicate that
57 *  threads are ready at that priority.
58 */
59SCORE_EXTERN Priority_bit_map_Control
60               _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
61
62/*
63 *  The definition of the Priority_bit_map_Control type is CPU dependent.
64 *
65 */
66
67/**
68 *  The following record defines the information associated with
69 *  each thread to manage its interaction with the priority bit maps.
70 */
71typedef struct {
72  /** This is the address of minor bit map slot. */
73  Priority_bit_map_Control *minor;
74  /** This is the priority bit map ready mask. */
75  Priority_bit_map_Control  ready_major;
76  /** This is the priority bit map ready mask. */
77  Priority_bit_map_Control  ready_minor;
78  /** This is the priority bit map block mask. */
79  Priority_bit_map_Control  block_major;
80  /** This is the priority bit map block mask. */
81  Priority_bit_map_Control  block_minor;
82} Priority_bit_map_Information;
83
84
85#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
86/**
87 *  This method returns the priority bit mask for the specified major
88 *  or minor bit number.
89 *
90 *  @param[in] _bit_number is the bit number for which we need a mask
91 *
92 *  @return the priority bit mask
93 *
94 *  @note This may simply be a pass through to a CPU dependent implementation.
95 */
96#define _Priority_Mask( _bit_number ) \
97  _CPU_Priority_Mask( _bit_number )
98#endif
99
100#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
101/**
102 *  This method returns the bit index position for the specified priority.
103 *
104 *  @param[in] _priority is the priority for which we need the index.
105 *
106 *  @return This method returns the array index into the priority bit map.
107 *
108 *  @note This may simply be a pass through to a CPU dependent implementation.
109 */
110#define _Priority_Bits_index( _priority ) \
111  _CPU_Priority_bits_index( _priority )
112#endif
113
114#ifndef __RTEMS_APPLICATION__
115#include <rtems/score/prioritybitmap.inl>
116#endif
117
118#ifdef __cplusplus
119}
120#endif
121
122/**@}*/
123
124#endif
125/* end of include file */
Note: See TracBrowser for help on using the repository browser.