1 | /** |
---|
2 | * @file rtems/posix/semaphore.inl |
---|
3 | */ |
---|
4 | |
---|
5 | /* rtems/posix/semaphore.inl |
---|
6 | * |
---|
7 | * This include file contains the static inline implementation of the private |
---|
8 | * inlined routines for POSIX Semaphores. |
---|
9 | * |
---|
10 | * COPYRIGHT (c) 1989-1999. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.com/license/LICENSE. |
---|
16 | * |
---|
17 | * $Id$ |
---|
18 | */ |
---|
19 | |
---|
20 | #ifndef _RTEMS_POSIX_SEMAPHORE_INL |
---|
21 | #define _RTEMS_POSIX_SEMAPHORE_INL |
---|
22 | |
---|
23 | /*PAGE |
---|
24 | * |
---|
25 | * _POSIX_Semaphore_Allocate |
---|
26 | */ |
---|
27 | |
---|
28 | RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) |
---|
29 | { |
---|
30 | return (POSIX_Semaphore_Control *) |
---|
31 | _Objects_Allocate( &_POSIX_Semaphore_Information ); |
---|
32 | } |
---|
33 | |
---|
34 | /*PAGE |
---|
35 | * |
---|
36 | * _POSIX_Semaphore_Free |
---|
37 | */ |
---|
38 | |
---|
39 | RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( |
---|
40 | POSIX_Semaphore_Control *the_semaphore |
---|
41 | ) |
---|
42 | { |
---|
43 | _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); |
---|
44 | } |
---|
45 | |
---|
46 | /*PAGE |
---|
47 | * |
---|
48 | * _POSIX_Semaphore_Namespace_remove |
---|
49 | */ |
---|
50 | |
---|
51 | RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Namespace_remove ( |
---|
52 | POSIX_Semaphore_Control *the_semaphore |
---|
53 | ) |
---|
54 | { |
---|
55 | _Objects_Namespace_remove( |
---|
56 | &_POSIX_Semaphore_Information, &the_semaphore->Object ); |
---|
57 | } |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | /*PAGE |
---|
62 | * |
---|
63 | * _POSIX_Semaphore_Get |
---|
64 | */ |
---|
65 | |
---|
66 | RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( |
---|
67 | sem_t *id, |
---|
68 | Objects_Locations *location |
---|
69 | ) |
---|
70 | { |
---|
71 | return (POSIX_Semaphore_Control *) |
---|
72 | _Objects_Get( &_POSIX_Semaphore_Information, *id, location ); |
---|
73 | } |
---|
74 | |
---|
75 | /*PAGE |
---|
76 | * |
---|
77 | * _POSIX_Semaphore_Is_null |
---|
78 | */ |
---|
79 | |
---|
80 | RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null ( |
---|
81 | POSIX_Semaphore_Control *the_semaphore |
---|
82 | ) |
---|
83 | { |
---|
84 | return !the_semaphore; |
---|
85 | } |
---|
86 | |
---|
87 | #endif |
---|
88 | /* end of include file */ |
---|
89 | |
---|