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 |
---|
22 | extern "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 | |
---|
32 | typedef 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 | |
---|
42 | typedef 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 | |
---|
61 | EXTERN volatile Priority_Bit_map_control _Priority_Major_bit_map; |
---|
62 | EXTERN 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 Bitfield Manipulation Routines |
---|
71 | * |
---|
72 | * NOTE: |
---|
73 | * |
---|
74 | * These may simply be pass throughs to CPU dependent routines. |
---|
75 | */ |
---|
76 | |
---|
77 | #if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) |
---|
78 | |
---|
79 | #define _Priority_Mask( _bit_number ) \ |
---|
80 | _CPU_Priority_Mask( _bit_number ) |
---|
81 | |
---|
82 | #define _Priority_Bits_index( _priority ) \ |
---|
83 | _CPU_Priority_bits_index( _priority ) |
---|
84 | |
---|
85 | #endif |
---|
86 | |
---|
87 | #ifndef __RTEMS_APPLICATION__ |
---|
88 | #include <rtems/score/priority.inl> |
---|
89 | #endif |
---|
90 | |
---|
91 | #ifdef __cplusplus |
---|
92 | } |
---|
93 | #endif |
---|
94 | |
---|
95 | #endif |
---|
96 | /* end of include file */ |
---|