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_H |
---|
21 | # error "Never use <rtems/posix/semaphore.inl> directly; include <rtems/posix/semaphore.h> instead." |
---|
22 | #endif |
---|
23 | |
---|
24 | #ifndef _RTEMS_POSIX_SEMAPHORE_INL |
---|
25 | #define _RTEMS_POSIX_SEMAPHORE_INL |
---|
26 | |
---|
27 | /*PAGE |
---|
28 | * |
---|
29 | * _POSIX_Semaphore_Allocate |
---|
30 | */ |
---|
31 | |
---|
32 | RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) |
---|
33 | { |
---|
34 | return (POSIX_Semaphore_Control *) |
---|
35 | _Objects_Allocate( &_POSIX_Semaphore_Information ); |
---|
36 | } |
---|
37 | |
---|
38 | /*PAGE |
---|
39 | * |
---|
40 | * _POSIX_Semaphore_Free |
---|
41 | */ |
---|
42 | |
---|
43 | RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( |
---|
44 | POSIX_Semaphore_Control *the_semaphore |
---|
45 | ) |
---|
46 | { |
---|
47 | _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); |
---|
48 | } |
---|
49 | |
---|
50 | /*PAGE |
---|
51 | * |
---|
52 | * _POSIX_Semaphore_Namespace_remove |
---|
53 | */ |
---|
54 | |
---|
55 | RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Namespace_remove ( |
---|
56 | POSIX_Semaphore_Control *the_semaphore |
---|
57 | ) |
---|
58 | { |
---|
59 | _Objects_Namespace_remove( |
---|
60 | &_POSIX_Semaphore_Information, &the_semaphore->Object ); |
---|
61 | } |
---|
62 | |
---|
63 | |
---|
64 | |
---|
65 | /*PAGE |
---|
66 | * |
---|
67 | * _POSIX_Semaphore_Get |
---|
68 | */ |
---|
69 | |
---|
70 | RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( |
---|
71 | sem_t *id, |
---|
72 | Objects_Locations *location |
---|
73 | ) |
---|
74 | { |
---|
75 | return (POSIX_Semaphore_Control *) |
---|
76 | _Objects_Get( &_POSIX_Semaphore_Information, *id, location ); |
---|
77 | } |
---|
78 | |
---|
79 | /*PAGE |
---|
80 | * |
---|
81 | * _POSIX_Semaphore_Is_null |
---|
82 | */ |
---|
83 | |
---|
84 | RTEMS_INLINE_ROUTINE bool _POSIX_Semaphore_Is_null ( |
---|
85 | POSIX_Semaphore_Control *the_semaphore |
---|
86 | ) |
---|
87 | { |
---|
88 | return !the_semaphore; |
---|
89 | } |
---|
90 | |
---|
91 | #endif |
---|
92 | /* end of include file */ |
---|
93 | |
---|