diff options
Diffstat (limited to 'cpukit/include/rtems/posix/muteximpl.h')
-rw-r--r-- | cpukit/include/rtems/posix/muteximpl.h | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/cpukit/include/rtems/posix/muteximpl.h b/cpukit/include/rtems/posix/muteximpl.h index 3decb6f4ac..8dffea80a5 100644 --- a/cpukit/include/rtems/posix/muteximpl.h +++ b/cpukit/include/rtems/posix/muteximpl.h @@ -1,18 +1,37 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * * @brief Private Inlined Routines for POSIX Mutex's. - * - * This include file contains the static inline implementation of the private + * + * This include file contains the static inline implementation of the private * inlined routines for POSIX mutex's. */ /* COPYRIGHT (c) 1989-2013. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _RTEMS_POSIX_MUTEXIMPL_H @@ -68,7 +87,7 @@ typedef enum { */ extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes; -RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Mutex_Acquire( +static inline Thread_Control *_POSIX_Mutex_Acquire( POSIX_Mutex_Control *the_mutex, Thread_queue_Context *queue_context ) @@ -89,7 +108,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Mutex_Acquire( return executing; } -RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Release( +static inline void _POSIX_Mutex_Release( POSIX_Mutex_Control *the_mutex, Thread_queue_Context *queue_context ) @@ -100,28 +119,28 @@ RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Release( ); } -RTEMS_INLINE_ROUTINE POSIX_Mutex_Protocol _POSIX_Mutex_Get_protocol( +static inline POSIX_Mutex_Protocol _POSIX_Mutex_Get_protocol( unsigned long flags ) { - return flags & POSIX_MUTEX_PROTOCOL_MASK; + return (POSIX_Mutex_Protocol) (flags & POSIX_MUTEX_PROTOCOL_MASK); } -RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_recursive( +static inline bool _POSIX_Mutex_Is_recursive( unsigned long flags ) { return ( flags & POSIX_MUTEX_RECURSIVE ) != 0; } -RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Mutex_Get_owner( +static inline Thread_Control *_POSIX_Mutex_Get_owner( const POSIX_Mutex_Control *the_mutex ) { return the_mutex->Recursive.Mutex.Queue.Queue.owner; } -RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_locked( +static inline bool _POSIX_Mutex_Is_locked( const POSIX_Mutex_Control *the_mutex ) { @@ -136,7 +155,7 @@ Status_Control _POSIX_Mutex_Seize_slow( Thread_queue_Context *queue_context ); -RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Set_owner( +static inline void _POSIX_Mutex_Set_owner( POSIX_Mutex_Control *the_mutex, Thread_Control *owner ) @@ -144,7 +163,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Set_owner( the_mutex->Recursive.Mutex.Queue.Queue.owner = owner; } -RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_owner( +static inline bool _POSIX_Mutex_Is_owner( const POSIX_Mutex_Control *the_mutex, const Thread_Control *the_thread ) @@ -166,7 +185,7 @@ static Status_Control _POSIX_Mutex_Lock_nested( } } -RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Seize( +static inline Status_Control _POSIX_Mutex_Seize( POSIX_Mutex_Control *the_mutex, unsigned long flags, const Thread_queue_Operations *operations, @@ -203,7 +222,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Seize( ); } -RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Surrender( +static inline Status_Control _POSIX_Mutex_Surrender( POSIX_Mutex_Control *the_mutex, const Thread_queue_Operations *operations, Thread_Control *executing, @@ -246,7 +265,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Surrender( return STATUS_SUCCESSFUL; } -RTEMS_INLINE_ROUTINE const Scheduler_Control *_POSIX_Mutex_Get_scheduler( +static inline const Scheduler_Control *_POSIX_Mutex_Get_scheduler( const POSIX_Mutex_Control *the_mutex ) { @@ -257,7 +276,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_POSIX_Mutex_Get_scheduler( #endif } -RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Set_priority( +static inline void _POSIX_Mutex_Set_priority( POSIX_Mutex_Control *the_mutex, Priority_Control priority_ceiling, Thread_queue_Context *queue_context @@ -282,14 +301,14 @@ RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Set_priority( } } -RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Mutex_Get_priority( +static inline Priority_Control _POSIX_Mutex_Get_priority( const POSIX_Mutex_Control *the_mutex ) { return the_mutex->Priority_ceiling.priority; } -RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_set_owner( +static inline Status_Control _POSIX_Mutex_Ceiling_set_owner( POSIX_Mutex_Control *the_mutex, Thread_Control *owner, Thread_queue_Context *queue_context @@ -328,7 +347,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_set_owner( return STATUS_SUCCESSFUL; } -RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_seize( +static inline Status_Control _POSIX_Mutex_Ceiling_seize( POSIX_Mutex_Control *the_mutex, unsigned long flags, Thread_Control *executing, @@ -376,7 +395,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_seize( ); } -RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_surrender( +static inline Status_Control _POSIX_Mutex_Ceiling_surrender( POSIX_Mutex_Control *the_mutex, Thread_Control *executing, Thread_queue_Context *queue_context @@ -446,4 +465,3 @@ bool _POSIX_Mutex_Auto_initialization( POSIX_Mutex_Control *the_mutex ); #endif /* end of include file */ - |