source: rtems/c/src/exec/score/headers/priority.h @ 60b791ad

4.104.114.84.95
Last change on this file since 60b791ad was 60b791ad, checked in by Joel Sherrill <joel.sherrill@…>, on 02/17/98 at 23:46:28

updated copyright to 1998

  • Property mode set to 100644
File size: 2.7 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-1998.
8 *  On-Line Applications Research Corporation (OAR).
9 *  Copyright assigned to U.S. Government, 1994.
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.OARcorp.com/rtems/license.html.
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
61SCORE_EXTERN volatile Priority_Bit_map_control _Priority_Major_bit_map;
62SCORE_EXTERN Priority_Bit_map_control
63               _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
64
65/*
66 *  The definition of the Priority_Bit_map_control type is CPU dependent.
67 *
68 */
69
70/*
71 *  Priority Bitfield Manipulation Routines
72 *
73 *  NOTE:
74 *
75 *  These may simply be pass throughs to CPU dependent routines.
76 */
77 
78#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
79
80#define _Priority_Mask( _bit_number ) \
81  _CPU_Priority_Mask( _bit_number )
82 
83#define _Priority_Bits_index( _priority ) \
84  _CPU_Priority_bits_index( _priority )
85
86#endif
87 
88#ifndef __RTEMS_APPLICATION__
89#include <rtems/score/priority.inl>
90#endif
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif
97/* end of include file */
Note: See TracBrowser for help on using the repository browser.