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

4.104.114.84.95
Last change on this file since 60b791ad was 60b791ad, checked in by Joel Sherrill <joel.sherrill@…>, on 02/17/98 at 23:46:28

updated copyright to 1998

  • Property mode set to 100644
File size: 2.7 KB
RevLine 
[ac7d5ef0]1/*  tqdata.h
2 *
3 *  This include file contains all the constants and structures
4 *  needed to declare a thread queue.
5 *
[60b791ad]6 *  COPYRIGHT (c) 1989-1998.
[ac7d5ef0]7 *  On-Line Applications Research Corporation (OAR).
[03f2154e]8 *  Copyright assigned to U.S. Government, 1994.
[ac7d5ef0]9 *
[98e4ebf5]10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
[03f2154e]12 *  http://www.OARcorp.com/rtems/license.html.
[ac7d5ef0]13 *
[da6375b]14 *  $Id$
[ac7d5ef0]15 */
16
[3a4ae6c]17#ifndef __THREAD_QUEUE_DATA_h
18#define __THREAD_QUEUE_DATA_h
[ac7d5ef0]19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
[5e9b32b]24#include <rtems/score/chain.h>
25#include <rtems/score/priority.h>
26#include <rtems/score/states.h>
[ac7d5ef0]27
28/*
29 *  The following enumerated type details all of the disciplines
30 *  supported by the Thread Queue Handler.
31 */
32
33typedef enum {
[3a4ae6c]34  THREAD_QUEUE_DISCIPLINE_FIFO,     /* FIFO queue discipline */
35  THREAD_QUEUE_DISCIPLINE_PRIORITY  /* PRIORITY queue discipline */
[ac7d5ef0]36}   Thread_queue_Disciplines;
37
[4250c8b]38/*
39 *  The following enumerated types indicate what happened while the thread
40 *  queue was in the synchronization window.
41 */
42 
43typedef enum {
[107ce47b]44  THREAD_QUEUE_SYNCHRONIZED,
[4250c8b]45  THREAD_QUEUE_NOTHING_HAPPENED,
46  THREAD_QUEUE_TIMEOUT,
47  THREAD_QUEUE_SATISFIED
[107ce47b]48}  Thread_queue_States;
[4250c8b]49
[ac7d5ef0]50/*
[1a8fde6c]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.
[ac7d5ef0]63 */
64
[1a8fde6c]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
[ac7d5ef0]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;
[107ce47b]75  Thread_queue_States      sync_state; /* alloc/dealloc critical section */
[ac7d5ef0]76  Thread_queue_Disciplines discipline; /* queue discipline               */
77  States_Control           state;      /* state of threads on Thread_q   */
[3a4ae6c]78  unsigned32               timeout_status;
[ac7d5ef0]79}   Thread_queue_Control;
80
[1a8fde6c]81#ifndef __RTEMS_APPLICATION__
[5e9b32b]82#include <rtems/score/tqdata.inl>
[1a8fde6c]83#endif
[ac7d5ef0]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.