source: rtems/c/src/exec/score/include/rtems/score/priority.h @ 3a4ae6c

4.104.114.84.95
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • Property mode set to 100644
File size: 4.5 KB
Line 
1/*  priority.h
2 *
3 *  This include file contains all thread priority manipulation routines.
4 *  This Handler provides mechanisms which can be used to
5 *  initialize and manipulate thread priorities.
6 *
7 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
8 *  On-Line Applications Research Corporation (OAR).
9 *  All rights assigned to U.S. Government, 1994.
10 *
11 *  This material may be reproduced by or for the U.S. Government pursuant
12 *  to the copyright license under the clause at DFARS 252.227-7013.  This
13 *  notice must appear in all copies of this file and its derivatives.
14 *
15 *  $Id$
16 */
17
18#ifndef __PRIORITY_h
19#define __PRIORITY_h
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*
26 *  The following type defines the control block used to manage
27 *  thread priorities.
28 *
29 *  NOTE: Priority 0 is reserved for internal threads only.
30 */
31
32typedef unsigned32 Priority_Control;
33
34#define PRIORITY_MINIMUM      0         /* highest thread priority */
35#define PRIORITY_MAXIMUM      255       /* lowest thread priority */
36
37/*
38 *  The following record defines the information associated with
39 *  each thread to manage its interaction with the priority bit maps.
40 */
41
42typedef struct {
43  Priority_Bit_map_control *minor;        /* addr of minor bit map slot */
44  Priority_Bit_map_control  ready_major;  /* priority bit map ready mask */
45  Priority_Bit_map_control  ready_minor;  /* priority bit map ready mask */
46  Priority_Bit_map_control  block_major;  /* priority bit map block mask */
47  Priority_Bit_map_control  block_minor;  /* priority bit map block mask */
48}   Priority_Information;
49
50/*
51 *  The following data items are the priority bit map.
52 *  Each of the sixteen bits used in the _Priority_Major_bit_map is
53 *  associated with one of the sixteen entries in the _Priority_Bit_map.
54 *  Each bit in the _Priority_Bit_map indicates whether or not there are
55 *  threads ready at a particular priority.  The mapping of
56 *  individual priority levels to particular bits is processor
57 *  dependent as is the value of each bit used to indicate that
58 *  threads are ready at that priority.
59 */
60
61EXTERN volatile Priority_Bit_map_control _Priority_Major_bit_map;
62EXTERN Priority_Bit_map_control _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
63
64/*
65 *  The definition of the Priority_Bit_map_control type is CPU dependent.
66 *
67 */
68
69/*
70 *  _Priority_Handler_initialization
71 *
72 *  DESCRIPTION:
73 *
74 *  This routine performs the initialization necessary for this handler.
75 */
76
77STATIC INLINE void _Priority_Handler_initialization( void );
78
79/*
80 *  _Priority_Is_valid
81 *
82 *  DESCRIPTION:
83 *
84 *  This function returns TRUE if the_priority if valid for a
85 *  user task, and FALSE otherwise.
86 */
87
88STATIC INLINE boolean _Priority_Is_valid (
89  Priority_Control the_priority
90);
91
92/*
93 *  _Priority_Major
94 *
95 *  DESCRIPTION:
96 *
97 *  This function returns the major portion of the_priority.
98 */
99
100STATIC INLINE unsigned32 _Priority_Major (
101  Priority_Control the_priority
102);
103
104/*
105 *  _Priority_Minor
106 *
107 *  DESCRIPTION:
108 *
109 *  This function returns the minor portion of the_priority.
110 */
111
112STATIC INLINE unsigned32 _Priority_Minor (
113  Priority_Control the_priority
114);
115
116/*
117 *  _Priority_Add_to_bit_map
118 *
119 *  DESCRIPTION:
120 *
121 *  This routine uses the_priority_map to update the priority
122 *  bit maps to indicate that a thread has been readied.
123 */
124
125STATIC INLINE void _Priority_Add_to_bit_map (
126  Priority_Information *the_priority_map
127);
128
129/*
130 *  _Priority_Remove_from_bit_map
131 *
132 *  DESCRIPTION:
133 *
134 *  This routine uses the_priority_map to update the priority
135 *  bit maps to indicate that a thread has been removed from the
136 *  ready state.
137 */
138
139STATIC INLINE void _Priority_Remove_from_bit_map (
140  Priority_Information *the_priority_map
141);
142
143/*
144 *  _Priority_Get_highest
145 *
146 *  DESCRIPTION:
147 *
148 *  This function returns the priority of the highest priority
149 *  ready thread.
150 */
151
152STATIC INLINE Priority_Control _Priority_Get_highest( void );
153
154/*
155 *  _Priority_Initialize_information
156 *
157 *  DESCRIPTION:
158 *
159 *  This routine initializes the_priority_map so that it
160 *  contains the information necessary to manage a thread
161 *  at new_priority.
162 */
163
164STATIC INLINE void _Priority_Initialize_information(
165  Priority_Information *the_priority_map,
166  Priority_Control      new_priority
167);
168
169/*
170 *  _Priority_Is_group_empty
171 *
172 *  DESCRIPTION:
173 *
174 *  This function returns TRUE if the priority GROUP is empty, and
175 *  FALSE otherwise.
176 */
177
178STATIC INLINE boolean _Priority_Is_group_empty (
179  Priority_Control      the_priority
180);
181
182#include <rtems/core/priority.inl>
183
184#ifdef __cplusplus
185}
186#endif
187
188#endif
189/* end of include file */
Note: See TracBrowser for help on using the repository browser.