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 |
---|
35 | extern "C" { |
---|
36 | #endif |
---|
37 | |
---|
38 | #include <rtems/score/priority.h> |
---|
39 | |
---|
40 | |
---|
41 | /* |
---|
42 | * The Priority_bit_map_Control variables are instantiated only |
---|
43 | * if using the bit map handler. |
---|
44 | */ |
---|
45 | |
---|
46 | /** |
---|
47 | * Each sixteen bit entry in this array is associated with one of |
---|
48 | * the sixteen entries in the Priority Bit map. |
---|
49 | */ |
---|
50 | extern volatile Priority_bit_map_Control _Priority_Major_bit_map; |
---|
51 | |
---|
52 | /** Each bit in the Priority Bitmap indicates whether or not there are |
---|
53 | * threads ready at a particular priority. The mapping of |
---|
54 | * individual priority levels to particular bits is processor |
---|
55 | * dependent as is the value of each bit used to indicate that |
---|
56 | * threads are ready at that priority. |
---|
57 | */ |
---|
58 | extern Priority_bit_map_Control |
---|
59 | _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT; |
---|
60 | |
---|
61 | /* |
---|
62 | * The definition of the Priority_bit_map_Control type is CPU dependent. |
---|
63 | * |
---|
64 | */ |
---|
65 | |
---|
66 | /** |
---|
67 | * The following record defines the information associated with |
---|
68 | * each thread to manage its interaction with the priority bit maps. |
---|
69 | */ |
---|
70 | typedef struct { |
---|
71 | /** This is the address of minor bit map slot. */ |
---|
72 | Priority_bit_map_Control *minor; |
---|
73 | /** This is the priority bit map ready mask. */ |
---|
74 | Priority_bit_map_Control ready_major; |
---|
75 | /** This is the priority bit map ready mask. */ |
---|
76 | Priority_bit_map_Control ready_minor; |
---|
77 | /** This is the priority bit map block mask. */ |
---|
78 | Priority_bit_map_Control block_major; |
---|
79 | /** This is the priority bit map block mask. */ |
---|
80 | Priority_bit_map_Control block_minor; |
---|
81 | } Priority_bit_map_Information; |
---|
82 | |
---|
83 | |
---|
84 | #if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) |
---|
85 | /** |
---|
86 | * This method returns the priority bit mask for the specified major |
---|
87 | * or minor bit number. |
---|
88 | * |
---|
89 | * @param[in] _bit_number is the bit number for which we need a mask |
---|
90 | * |
---|
91 | * @return the priority bit mask |
---|
92 | * |
---|
93 | * @note This may simply be a pass through to a CPU dependent implementation. |
---|
94 | */ |
---|
95 | #define _Priority_Mask( _bit_number ) \ |
---|
96 | _CPU_Priority_Mask( _bit_number ) |
---|
97 | #endif |
---|
98 | |
---|
99 | #if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) |
---|
100 | /** |
---|
101 | * This method returns the bit index position for the specified priority. |
---|
102 | * |
---|
103 | * @param[in] _priority is the priority for which we need the index. |
---|
104 | * |
---|
105 | * @return This method returns the array index into the priority bit map. |
---|
106 | * |
---|
107 | * @note This may simply be a pass through to a CPU dependent implementation. |
---|
108 | */ |
---|
109 | #define _Priority_Bits_index( _priority ) \ |
---|
110 | _CPU_Priority_bits_index( _priority ) |
---|
111 | #endif |
---|
112 | |
---|
113 | #ifndef __RTEMS_APPLICATION__ |
---|
114 | #include <rtems/score/prioritybitmap.inl> |
---|
115 | #endif |
---|
116 | |
---|
117 | #ifdef __cplusplus |
---|
118 | } |
---|
119 | #endif |
---|
120 | |
---|
121 | /**@}*/ |
---|
122 | |
---|
123 | #endif |
---|
124 | /* end of include file */ |
---|