OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [score/] [include/] [rtems/] [score/] [tqdata.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  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
 *  tqdata.h,v 1.16 1999/11/17 17:50:37 joel Exp
14
 */
15
 
16
#ifndef __THREAD_QUEUE_DATA_h
17
#define __THREAD_QUEUE_DATA_h
18
 
19
#ifdef __cplusplus
20
extern "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
 
32
typedef 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
 
42
typedef 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
 
68
typedef 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 */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.