1 | /** |
---|
2 | * @file rtems/score/priority.h |
---|
3 | * |
---|
4 | * This include file contains all thread priority manipulation routines. |
---|
5 | * This Handler provides mechanisms which can be used to |
---|
6 | * initialize and manipulate thread priorities. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2010. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.com/license/LICENSE. |
---|
16 | * |
---|
17 | * $Id$ |
---|
18 | */ |
---|
19 | |
---|
20 | #ifndef _RTEMS_SCORE_PRIORITY_H |
---|
21 | #define _RTEMS_SCORE_PRIORITY_H |
---|
22 | |
---|
23 | /** |
---|
24 | * @defgroup ScorePriority Priority Handler |
---|
25 | * |
---|
26 | * This handler encapsulates functionality which is used to manage |
---|
27 | * thread priorities. At the SuperCore level 256 priority levels |
---|
28 | * are supported with lower numbers representing logically more important |
---|
29 | * threads. The priority level 0 is reserved for internal RTEMS use. |
---|
30 | * Typically it is assigned to threads which defer internal RTEMS |
---|
31 | * actions from an interrupt to thread level to improve interrupt response. |
---|
32 | * Priority level 255 is assigned to the IDLE thread and really should not |
---|
33 | * be used by application threads. The default IDLE thread implementation |
---|
34 | * is an infinite "branch to self" loop which never yields to other threads |
---|
35 | * at the same priority. |
---|
36 | */ |
---|
37 | /**@{*/ |
---|
38 | |
---|
39 | /* |
---|
40 | * Processor specific information. |
---|
41 | */ |
---|
42 | #include <rtems/score/cpu.h> |
---|
43 | |
---|
44 | #ifdef __cplusplus |
---|
45 | extern "C" { |
---|
46 | #endif |
---|
47 | |
---|
48 | /** |
---|
49 | * The following type defines the control block used to manage |
---|
50 | * thread priorities. |
---|
51 | * |
---|
52 | * @note Priority 0 is reserved for internal threads only. |
---|
53 | */ |
---|
54 | typedef uint32_t Priority_Control; |
---|
55 | |
---|
56 | /** This defines the highest (most important) thread priority. */ |
---|
57 | #define PRIORITY_MINIMUM 0 |
---|
58 | |
---|
59 | /** This defines the default lowest (least important) thread priority. */ |
---|
60 | #if defined (CPU_PRIORITY_MAXIMUM) |
---|
61 | #define PRIORITY_DEFAULT_MAXIMUM CPU_PRIORITY_MAXIMUM |
---|
62 | #else |
---|
63 | #define PRIORITY_DEFAULT_MAXIMUM 255 |
---|
64 | #endif |
---|
65 | |
---|
66 | /** This defines the lowest (least important) thread priority. */ |
---|
67 | #define PRIORITY_MAXIMUM rtems_maximum_priority |
---|
68 | |
---|
69 | /** |
---|
70 | * This variable contains the configured number of priorities |
---|
71 | */ |
---|
72 | extern uint8_t rtems_maximum_priority; |
---|
73 | |
---|
74 | #ifndef __RTEMS_APPLICATION__ |
---|
75 | #include <rtems/score/priority.inl> |
---|
76 | #endif |
---|
77 | |
---|
78 | #ifdef __cplusplus |
---|
79 | } |
---|
80 | #endif |
---|
81 | |
---|
82 | /**@}*/ |
---|
83 | |
---|
84 | #endif |
---|
85 | /* end of include file */ |
---|