source: rtems/cpukit/rtems/src/semident.c @ eaef4657

4.104.115
Last change on this file since eaef4657 was ce19f1fa, checked in by Joel Sherrill <joel.sherrill@…>, on 01/23/08 at 22:57:43

2008-01-23 Joel Sherrill <joel.sherrill@…>

  • itron/include/rtems/itron/object.h, itron/src/cre_tsk.c, libblock/src/show_bdbuf.c, libmisc/capture/capture-cli.c, libmisc/capture/capture.c, libmisc/monitor/mon-manager.c, libmisc/stackchk/check.c, posix/src/condinit.c, posix/src/keycreate.c, posix/src/mqueuecreatesupp.c, posix/src/mqueuedeletesupp.c, posix/src/mqueuenametoid.c, posix/src/mqueueopen.c, posix/src/mqueueunlink.c, posix/src/mutexinit.c, posix/src/pbarrierinit.c, posix/src/prwlockinit.c, posix/src/pspininit.c, posix/src/pthreadcreate.c, posix/src/pthreadexit.c, posix/src/semaphorecreatesupp.c, posix/src/semaphorenametoid.c, posix/src/timercreate.c, rtems/src/barrierident.c, rtems/src/dpmemident.c, rtems/src/msgqident.c, rtems/src/partident.c, rtems/src/ratemonident.c, rtems/src/regionident.c, rtems/src/semident.c, rtems/src/taskident.c, rtems/src/timerident.c, sapi/src/extensionident.c, score/Makefile.am, score/include/rtems/score/object.h, score/inline/rtems/score/object.inl, score/src/apimutexallocate.c, score/src/objectextendinformation.c, score/src/objectgetnameasstring.c, score/src/objectmp.c, score/src/objectnametoid.c: Convert the Objects_Name type from a simple type to a union of an unsigned 32 bit integer and a pointer. This should help eliminate weird casts between u32 and pointers in various places. The APIs now have to explicitly call _u32 or _string versions of helper routines. This should also simplify things and eliminate the need for ugly casts in some cases.
  • score/src/objectclearname.c, score/src/objectcomparenameraw.c, score/src/objectcomparenamestring.c, score/src/objectcopynameraw.c, score/src/objectcopynamestring.c: Removed.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  Semaphore Manager
3 *
4 *  DESCRIPTION:
5 *
6 *  This package is the implementation of the Semaphore Manager.
7 *  This manager utilizes standard Dijkstra counting semaphores to provide
8 *  synchronization and mutual exclusion capabilities.
9 *
10 *  Directives provided are:
11 *
12 *     + create a semaphore
13 *     + get an ID of a semaphore
14 *     + delete a semaphore
15 *     + acquire a semaphore
16 *     + release a semaphore
17 *
18 *  COPYRIGHT (c) 1989-1999.
19 *  On-Line Applications Research Corporation (OAR).
20 *
21 *  The license and distribution terms for this file may be
22 *  found in the file LICENSE in this distribution or at
23 *  http://www.rtems.com/license/LICENSE.
24 *
25 *  $Id$
26 */
27
28#if HAVE_CONFIG_H
29#include "config.h"
30#endif
31
32#include <rtems/system.h>
33#include <rtems/rtems/status.h>
34#include <rtems/rtems/support.h>
35#include <rtems/rtems/attr.h>
36#include <rtems/score/isr.h>
37#include <rtems/score/object.h>
38#include <rtems/rtems/options.h>
39#include <rtems/rtems/sem.h>
40#include <rtems/score/coremutex.h>
41#include <rtems/score/coresem.h>
42#include <rtems/score/states.h>
43#include <rtems/score/thread.h>
44#include <rtems/score/threadq.h>
45#if defined(RTEMS_MULTIPROCESSING)
46#include <rtems/score/mpci.h>
47#endif
48#include <rtems/score/sysstate.h>
49
50#include <rtems/score/interr.h>
51
52/*PAGE
53 *
54 *  rtems_semaphore_ident
55 *
56 *  This directive returns the system ID associated with
57 *  the semaphore name.
58 *
59 *  Input parameters:
60 *    name - user defined semaphore name
61 *    node - node(s) to be searched
62 *    id   - pointer to semaphore id
63 *
64 *  Output parameters:
65 *    *id              - semaphore id
66 *    RTEMS_SUCCESSFUL - if successful
67 *    error code       - if unsuccessful
68 */
69
70rtems_status_code rtems_semaphore_ident(
71  rtems_name  name,
72  uint32_t    node,
73  rtems_id   *id
74)
75{
76  Objects_Name_or_id_lookup_errors  status;
77
78  status = _Objects_Name_to_id_u32( &_Semaphore_Information, name, node, id );
79
80  return _Status_Object_name_errors_to_status[ status ];
81}
Note: See TracBrowser for help on using the repository browser.