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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [itron/] [include/] [itronsys/] [semaphore.h] - Blame information for rev 389

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  COPYRIGHT (c) 1989-1999.
3
 *  On-Line Applications Research Corporation (OAR).
4
 *
5
 *  The license and distribution terms for this file may be
6
 *  found in the file LICENSE in this distribution or at
7
 *  http://www.OARcorp.com/rtems/license.html.
8
 *
9
 *  $Id: semaphore.h,v 1.2 2001-09-27 11:59:12 chris Exp $
10
 */
11
 
12
#ifndef __ITRON_SEMAPHORE_h_
13
#define __ITRON_SEMAPHORE_h_
14
 
15
#ifdef __cplusplus
16
extern "C" {
17
#endif
18
 
19
/*
20
 *  Create Semaphore (cre_sem) Structure
21
 */
22
 
23
typedef struct t_csem {
24
  VP    exinf;    /* extended information */
25
  ATR   sematr;   /* semaphore attributes */
26
  /* Following is the extended function for [level X]. */
27
  INT   isemcnt;   /* initial semaphore count */
28
  INT   maxsem;    /* maximum semaphore count */
29
  /* additional information may be included depending on the implementation */
30
} T_CSEM;
31
 
32
/*
33
 *  sematr - Semaphore Attribute Values
34
 */
35
 
36
#define TA_TFIFO   0x00   /* waiting tasks are handled by FIFO */
37
#define TA_TPRI    0x01   /* waiting tasks are handled by priority */
38
 
39
#define _ITRON_SEMAPHORE_UNUSED_ATTRIBUTES ~(TA_TPRI)
40
 
41
/*
42
 *  Reference Semaphore (ref_sem) Structure
43
 */
44
 
45
typedef struct t_rsem {
46
  VP      exinf;    /* extended information */
47
  BOOL_ID wtsk;     /* indicates whether or not there is a waiting task */
48
  INT     semcnt;   /* current semaphore count */
49
  /* additional information may be included depending on the implementation */
50
} T_RSEM;
51
 
52
/*
53
 *  Semaphore Functions
54
 */
55
 
56
/*
57
 *  cre_sem - Create Semaphore
58
 */
59
 
60
ER cre_sem(
61
  ID semid,
62
  T_CSEM *pk_csem
63
);
64
 
65
/*
66
 *  del_sem - Delete Semaphore
67
 */
68
 
69
ER del_sem(
70
  ID semid
71
);
72
 
73
/*
74
 *  sig_sem - Signal Semaphore
75
 */
76
 
77
ER sig_sem(
78
  ID semid
79
);
80
 
81
/*
82
 *  wai_sem - Wait on Semaphore
83
 */
84
 
85
ER wai_sem(
86
  ID semid
87
);
88
 
89
/*
90
 *  preq_sem - Poll and Request Semaphore
91
 */
92
 
93
ER preq_sem(
94
  ID semid
95
);
96
 
97
/*
98
 *  twai_sem - Wait on Semaphore with Timeout
99
 */
100
 
101
ER twai_sem(
102
  ID semid,
103
  TMO tmout
104
);
105
 
106
/*
107
 *  ref_sem - Reference Semaphore Status
108
 */
109
 
110
ER ref_sem(
111
  ID      semid,
112
  T_RSEM *pk_rsem
113
);
114
 
115
#ifdef __cplusplus
116
}
117
#endif
118
 
119
#endif
120
/* end of include file */
121
 

powered by: WebSVN 2.1.0

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