source:
rtems/cpukit/rtems/src/semident.c
@
17bbadd
Last change on this file since 17bbadd was 17bbadd, checked in by Joel Sherrill <joel.sherrill@…>, on 05/06/04 at 19:20:04 | |
---|---|
|
|
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 | #include <rtems/system.h> |
29 | #include <rtems/rtems/status.h> |
30 | #include <rtems/rtems/support.h> |
31 | #include <rtems/rtems/attr.h> |
32 | #include <rtems/score/isr.h> |
33 | #include <rtems/score/object.h> |
34 | #include <rtems/rtems/options.h> |
35 | #include <rtems/rtems/sem.h> |
36 | #include <rtems/score/coremutex.h> |
37 | #include <rtems/score/coresem.h> |
38 | #include <rtems/score/states.h> |
39 | #include <rtems/score/thread.h> |
40 | #include <rtems/score/threadq.h> |
41 | #if defined(RTEMS_MULTIPROCESSING) |
42 | #include <rtems/score/mpci.h> |
43 | #endif |
44 | #include <rtems/score/sysstate.h> |
45 | |
46 | #include <rtems/score/interr.h> |
47 | |
48 | /*PAGE |
49 | * |
50 | * rtems_semaphore_ident |
51 | * |
52 | * This directive returns the system ID associated with |
53 | * the semaphore name. |
54 | * |
55 | * Input parameters: |
56 | * name - user defined semaphore name |
57 | * node - node(s) to be searched |
58 | * id - pointer to semaphore id |
59 | * |
60 | * Output parameters: |
61 | * *id - semaphore id |
62 | * RTEMS_SUCCESSFUL - if successful |
63 | * error code - if unsuccessful |
64 | */ |
65 | |
66 | rtems_status_code rtems_semaphore_ident( |
67 | rtems_name name, |
68 | unsigned32 node, |
69 | Objects_Id *id |
70 | ) |
71 | { |
72 | Objects_Name_to_id_errors status; |
73 | |
74 | status = _Objects_Name_to_id( |
75 | &_Semaphore_Information, |
76 | (Objects_Name) name, |
77 | node, |
78 | id |
79 | ); |
80 | |
81 | return _Status_Object_name_errors_to_status[ status ]; |
82 | } |
Note: See TracBrowser
for help on using the repository browser.