source: rtems/cpukit/itron/macros/rtems/itron/semaphore.inl @ c4a3f1e

Last change on this file since c4a3f1e was c4a3f1e, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:46:52

2003-09-04 Joel Sherrill <joel@…>

  • include/itron.h, include/itronsys/eventflags.h, include/itronsys/fmempool.h, include/itronsys/intr.h, include/itronsys/mbox.h, include/itronsys/msgbuffer.h, include/itronsys/network.h, include/itronsys/port.h, include/itronsys/semaphore.h, include/itronsys/status.h, include/itronsys/sysmgmt.h, include/itronsys/task.h, include/itronsys/time.h, include/itronsys/types.h, include/itronsys/vmempool.h, include/rtems/itron/config.h, include/rtems/itron/eventflags.h, include/rtems/itron/fmempool.h, include/rtems/itron/intr.h, include/rtems/itron/itronapi.h, include/rtems/itron/mbox.h, include/rtems/itron/msgbuffer.h, include/rtems/itron/network.h, include/rtems/itron/object.h, include/rtems/itron/port.h, include/rtems/itron/semaphore.h, include/rtems/itron/sysmgmt.h, include/rtems/itron/task.h, include/rtems/itron/time.h, include/rtems/itron/vmempool.h, inline/rtems/itron/eventflags.inl, inline/rtems/itron/fmempool.inl, inline/rtems/itron/intr.inl, inline/rtems/itron/mbox.inl, inline/rtems/itron/msgbuffer.inl, inline/rtems/itron/network.inl, inline/rtems/itron/port.inl, inline/rtems/itron/semaphore.inl, inline/rtems/itron/sysmgmt.inl, inline/rtems/itron/task.inl, inline/rtems/itron/time.inl, inline/rtems/itron/vmempool.inl, macros/rtems/itron/eventflags.inl, macros/rtems/itron/fmempool.inl, macros/rtems/itron/intr.inl, macros/rtems/itron/mbox.inl, macros/rtems/itron/msgbuffer.inl, macros/rtems/itron/network.inl, macros/rtems/itron/port.inl, macros/rtems/itron/semaphore.inl, macros/rtems/itron/sysmgmt.inl, macros/rtems/itron/task.inl, macros/rtems/itron/time.inl, macros/rtems/itron/vmempool.inl, src/can_wup.c, src/chg_pri.c, src/cre_mbf.c, src/cre_mbx.c, src/cre_sem.c, src/cre_tsk.c, src/del_mbf.c, src/del_mbx.c, src/del_sem.c, src/del_tsk.c, src/dis_dsp.c, src/ena_dsp.c, src/eventflags.c, src/exd_tsk.c, src/ext_tsk.c, src/fmempool.c, src/frsm_tsk.c, src/get_tid.c, src/itronintr.c, src/itronsem.c, src/itrontime.c, src/mbox.c, src/mboxtranslatereturncode.c, src/msgbuffer.c, src/msgbuffertranslatereturncode.c, src/network.c, src/port.c, src/prcv_mbf.c, src/prcv_mbx.c, src/preq_sem.c, src/psnd_mbf.c, src/rcv_mbf.c, src/rcv_mbx.c, src/ref_mbf.c, src/ref_mbx.c, src/ref_sem.c, src/ref_tsk.c, src/rel_wai.c, src/rot_rdq.c, src/rsm_tsk.c, src/sig_sem.c, src/slp_tsk.c, src/snd_mbf.c, src/snd_mbx.c, src/sta_tsk.c, src/sus_tsk.c, src/sysmgmt.c, src/task.c, src/ter_tsk.c, src/trcv_mbf.c, src/trcv_mbx.c, src/tslp_tsk.c, src/tsnd_mbf.c, src/twai_sem.c, src/vmempool.c, src/wai_sem.c, src/wup_tsk.c: URL for license changed.
  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
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.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#ifndef __ITRON_SEMAPHORE_inl_
13#define __ITRON_SEMAPHORE_inl_
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/*
20 *  _ITRON_Semaphore_Allocate
21 */
22
23#define _ITRON_Semaphore_Allocate( _semid ) \
24  (ITRON_Semaphore_Control *)_ITRON_Objects_Allocate_by_index( \
25    &_ITRON_Semaphore_Information, \
26    (_semid), \
27    sizeof(ITRON_Semaphore_Control) \
28  )
29
30/*
31 *  _ITRON_Semaphore_Clarify_allocation_id_error
32 */
33
34#define _ITRON_Semaphore_Clarify_allocation_id_error( _id ) \
35  _ITRON_Objects_Clarify_allocation_id_error( \
36      &_ITRON_Semaphore_Information, (_id) )
37
38/*
39 *  _ITRON_Semaphore_Clarify_get_id_error
40 */
41
42#define _ITRON_Semaphore_Clarify_get_id_error( _id ) \
43 _ITRON_Objects_Clarify_get_id_error( &_ITRON_Semaphore_Information, (_id) )
44
45/*
46 *  _ITRON_Semaphore_Free
47 */
48
49#define _ITRON_Semaphore_Free( _the_semaphore ) \
50 _ITRON_Objects_Free( &_ITRON_Semaphore_Information, &(_the_semaphore)->Object )
51
52/*PAGE
53 *
54 *  _ITRON_Semaphore_Get
55 */
56
57#define _ITRON_Semaphore_Get( _id, _location ) \
58  (ITRON_Semaphore_Control *) \
59    _ITRON_Objects_Get( &_ITRON_Semaphore_Information, (_id), (_location) )
60
61/*PAGE
62 *
63 *  _ITRON_Semaphore_Is_null
64 */
65
66#define _ITRON_Semaphore_Is_null( _the_semaphore ) \
67  ( (_the_semaphore) == NULL )
68
69/*
70 *  _ITRON_Semaphore_Translate_core_semaphore_return_code
71 */
72
73/* XXX fix me */
74static  ER _ITRON_Semaphore_Translate_core_semaphore_return_code (
75  unsigned32 the_semaphore_status
76)
77{
78/* XXX need to be able to return "E_RLWAI" */
79  switch ( the_semaphore_status ) {
80    case  CORE_SEMAPHORE_STATUS_SUCCESSFUL:
81      return E_OK;
82    case CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT:
83      return E_TMOUT;
84    case CORE_SEMAPHORE_WAS_DELETED:
85      return E_DLT;
86    case CORE_SEMAPHORE_TIMEOUT:
87      return E_TMOUT;
88    case CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED:
89      return E_QOVR;
90    case THREAD_STATUS_PROXY_BLOCKING:
91      return THREAD_STATUS_PROXY_BLOCKING;
92  }
93  return E_OK;   /* unreached - only to remove warnings */
94}
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif
101/* end of include file */
102
Note: See TracBrowser for help on using the repository browser.