source: rtems/cpukit/score/include/rtems/score/tqdata.h @ a85d8ec

4.104.114.84.95
Last change on this file since a85d8ec was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*  tqdata.h
2 *
3 *  This include file contains all the constants and structures
4 *  needed to declare a thread queue.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#ifndef __THREAD_QUEUE_DATA_h
17#define __THREAD_QUEUE_DATA_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <rtems/score/chain.h>
24#include <rtems/score/priority.h>
25#include <rtems/score/states.h>
26
27/*
28 *  The following enumerated type details all of the disciplines
29 *  supported by the Thread Queue Handler.
30 */
31
32typedef enum {
33  THREAD_QUEUE_DISCIPLINE_FIFO,     /* FIFO queue discipline */
34  THREAD_QUEUE_DISCIPLINE_PRIORITY  /* PRIORITY queue discipline */
35}   Thread_queue_Disciplines;
36
37/*
38 *  The following enumerated types indicate what happened while the thread
39 *  queue was in the synchronization window.
40 */
41 
42typedef enum {
43  THREAD_QUEUE_SYNCHRONIZED,
44  THREAD_QUEUE_NOTHING_HAPPENED,
45  THREAD_QUEUE_TIMEOUT,
46  THREAD_QUEUE_SATISFIED
47}  Thread_queue_States;
48
49/*
50 *  The following constants are used to manage the priority queues.
51 *
52 *  There are four chains used to maintain a priority -- each chain
53 *  manages a distinct set of task priorities.  The number of chains
54 *  is determined by TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS.
55 *  The following set must be consistent. 
56 *
57 *  The set below configures 4 headers -- each contains 64 priorities.
58 *  Header x manages priority range (x*64) through ((x*64)+63).  If
59 *  the priority is more than half way through the priority range it
60 *  is in, then the search is performed from the rear of the chain.
61 *  This halves the search time to find the insertion point.
62 */
63
64#define TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS 4   
65#define TASK_QUEUE_DATA_PRIORITIES_PER_HEADER      64
66#define TASK_QUEUE_DATA_REVERSE_SEARCH_MASK        0x20
67
68typedef struct {
69  union {
70    Chain_Control Fifo;                /* FIFO discipline list           */
71    Chain_Control Priority[TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS];
72                                       /* priority discipline list       */
73  } Queues;
74  Thread_queue_States      sync_state; /* alloc/dealloc critical section */
75  Thread_queue_Disciplines discipline; /* queue discipline               */
76  States_Control           state;      /* state of threads on Thread_q   */
77  unsigned32               timeout_status;
78}   Thread_queue_Control;
79
80#ifndef __RTEMS_APPLICATION__
81#include <rtems/score/tqdata.inl>
82#endif
83
84#ifdef __cplusplus
85}
86#endif
87
88#endif
89/* end of include file */
Note: See TracBrowser for help on using the repository browser.