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