source: rtems/c/src/exec/score/headers/tqdata.h @ c53eb2c3

4.104.114.84.95
Last change on this file since c53eb2c3 was c53eb2c3, checked in by Mark Johannes <Mark.Johannes@…>, on 08/13/96 at 20:46:10

removed count from Thread_queue_Control

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