source: rtems/cpukit/itron/include/itronsys/semaphore.h @ 6df1f64

4.104.114.84.95
Last change on this file since 6df1f64 was 6df1f64, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/28/05 at 11:07:14

New header guards.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/**
2 * @file itronsys/semaphore.h
3 */
4
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.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef _ITRONSYS_SEMAPHORE_H
17#define _ITRONSYS_SEMAPHORE_H
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/*
24 *  Create Semaphore (cre_sem) Structure
25 */
26
27typedef struct t_csem {
28  VP    exinf;    /* extended information */
29  ATR   sematr;   /* semaphore attributes */
30  /* Following is the extended function for [level X]. */
31  INT   isemcnt;   /* initial semaphore count */
32  INT   maxsem;    /* maximum semaphore count */
33  /* additional information may be included depending on the implementation */
34} T_CSEM;
35
36/*
37 *  sematr - Semaphore Attribute Values
38 */
39
40#define TA_TFIFO   0x00   /* waiting tasks are handled by FIFO */
41#define TA_TPRI    0x01   /* waiting tasks are handled by priority */
42
43#define _ITRON_SEMAPHORE_UNUSED_ATTRIBUTES ~(TA_TPRI)
44
45/*
46 *  Reference Semaphore (ref_sem) Structure
47 */
48
49typedef struct t_rsem {
50  VP      exinf;    /* extended information */
51  BOOL_ID wtsk;     /* indicates whether or not there is a waiting task */
52  INT     semcnt;   /* current semaphore count */
53  /* additional information may be included depending on the implementation */
54} T_RSEM;
55
56/*
57 *  Semaphore Functions
58 */
59
60/*
61 *  cre_sem - Create Semaphore
62 */
63
64ER cre_sem(
65  ID semid,
66  T_CSEM *pk_csem
67);
68
69/*
70 *  del_sem - Delete Semaphore
71 */
72
73ER del_sem(
74  ID semid
75);
76
77/*
78 *  sig_sem - Signal Semaphore
79 */
80
81ER sig_sem(
82  ID semid
83);
84
85/*
86 *  wai_sem - Wait on Semaphore
87 */
88
89ER wai_sem(
90  ID semid
91);
92
93/*
94 *  preq_sem - Poll and Request Semaphore
95 */
96
97ER preq_sem(
98  ID semid
99);
100
101/*
102 *  twai_sem - Wait on Semaphore with Timeout
103 */
104
105ER twai_sem(
106  ID semid,
107  TMO tmout
108);
109
110/*
111 *  ref_sem - Reference Semaphore Status
112 */
113
114ER ref_sem(
115  ID      semid,
116  T_RSEM *pk_rsem
117);
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif
124/* end of include file */
Note: See TracBrowser for help on using the repository browser.