From ac7d5ef06a6d6e8d84abbd1f0b82162725f98326 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 11 May 1995 17:39:37 +0000 Subject: Initial revision --- cpukit/rtems/inline/rtems/rtems/asr.inl | 105 ++++++++++++++++++ cpukit/rtems/inline/rtems/rtems/attr.inl | 125 +++++++++++++++++++++ cpukit/rtems/inline/rtems/rtems/dpmem.inl | 75 +++++++++++++ cpukit/rtems/inline/rtems/rtems/event.inl | 30 +++++ cpukit/rtems/inline/rtems/rtems/eventset.inl | 71 ++++++++++++ cpukit/rtems/inline/rtems/rtems/message.inl | 160 +++++++++++++++++++++++++++ cpukit/rtems/inline/rtems/rtems/modes.inl | 136 +++++++++++++++++++++++ cpukit/rtems/inline/rtems/rtems/options.inl | 47 ++++++++ cpukit/rtems/inline/rtems/rtems/part.inl | 157 ++++++++++++++++++++++++++ cpukit/rtems/inline/rtems/rtems/ratemon.inl | 113 +++++++++++++++++++ cpukit/rtems/inline/rtems/rtems/region.inl | 101 +++++++++++++++++ cpukit/rtems/inline/rtems/rtems/sem.inl | 73 ++++++++++++ cpukit/rtems/inline/rtems/rtems/status.inl | 60 ++++++++++ cpukit/rtems/inline/rtems/rtems/tasks.inl | 90 +++++++++++++++ cpukit/rtems/inline/rtems/rtems/timer.inl | 112 +++++++++++++++++++ 15 files changed, 1455 insertions(+) create mode 100644 cpukit/rtems/inline/rtems/rtems/asr.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/attr.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/dpmem.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/event.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/eventset.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/message.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/modes.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/options.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/part.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/ratemon.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/region.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/sem.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/status.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/tasks.inl create mode 100644 cpukit/rtems/inline/rtems/rtems/timer.inl (limited to 'cpukit/rtems/inline/rtems') diff --git a/cpukit/rtems/inline/rtems/rtems/asr.inl b/cpukit/rtems/inline/rtems/rtems/asr.inl new file mode 100644 index 0000000000..a2da1ae311 --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/asr.inl @@ -0,0 +1,105 @@ +/* inline/asr.inl + * + * This include file contains the implemenation of all routines + * associated with the asynchronous signal handler which are inlined. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __INLINE_ASR_inl +#define __INLINE_ASR_inl + +#include + +/*PAGE + * + * _ASR_Initialize + * + */ + +STATIC INLINE void _ASR_Initialize ( + ASR_Information *information +) +{ + information->handler = NULL; + information->mode_set = RTEMS_DEFAULT_MODES; + information->signals_posted = 0; + information->signals_pending = 0; + information->nest_level = 0; +} + +/*PAGE + * + * _ASR_Swap_signals + * + */ + +STATIC INLINE void _ASR_Swap_signals ( + ASR_Information *information +) +{ + rtems_signal_set _signals; + ISR_Level _level; + + _ISR_Disable( _level ); + _signals = information->signals_pending; + information->signals_pending = information->signals_posted; + information->signals_posted = _signals; + _ISR_Enable( _level ); +} + +/*PAGE + * + * _ASR_Is_null_handler + * + */ + +STATIC INLINE boolean _ASR_Is_null_handler ( + rtems_asr_entry asr_handler +) +{ + return asr_handler == NULL; +} + +/*PAGE + * + * _ASR_Are_signals_pending + * + */ + +STATIC INLINE boolean _ASR_Are_signals_pending ( + ASR_Information *information +) +{ + return information->signals_posted != 0; +} + +/*PAGE + * + * _ASR_Post_signals + * + */ + +STATIC INLINE void _ASR_Post_signals( + rtems_signal_set signals, + rtems_signal_set *signal_set +) +{ + ISR_Level _level; + + _ISR_Disable( _level ); + *signal_set |= signals; + _ISR_Enable( _level ); +} + + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/attr.inl b/cpukit/rtems/inline/rtems/rtems/attr.inl new file mode 100644 index 0000000000..c657a08211 --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/attr.inl @@ -0,0 +1,125 @@ +/* inline/attr.inl + * + * This include file contains all of the inlined routines associated + * with attributes. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __INLINE_ATTRIBUTES_inl +#define __INLINE_ATTRIBUTES_inl + +/*PAGE + * + * _Attributes_Set + */ + +STATIC INLINE rtems_attribute _Attributes_Set ( + rtems_attribute new_attributes, + rtems_attribute attribute_set +) +{ + return attribute_set | new_attributes; +} + +/*PAGE + * + * _Attributes_Clear + */ + +STATIC INLINE rtems_attribute _Attributes_Clear ( + rtems_attribute attribute_set, + rtems_attribute mask +) +{ + return attribute_set & ~mask; +} + +/*PAGE + * + * _Attributes_Is_floating_point + * + */ + +STATIC INLINE boolean _Attributes_Is_floating_point( + rtems_attribute attribute_set +) +{ + return ( attribute_set & RTEMS_FLOATING_POINT ); +} + +/*PAGE + * + * _Attributes_Is_global + * + */ + +STATIC INLINE boolean _Attributes_Is_global( + rtems_attribute attribute_set +) +{ + return ( attribute_set & RTEMS_GLOBAL ); +} + +/*PAGE + * + * _Attributes_Is_priority + * + */ + +STATIC INLINE boolean _Attributes_Is_priority( + rtems_attribute attribute_set +) +{ + return ( attribute_set & RTEMS_PRIORITY ); +} + +/*PAGE + * + * _Attributes_Is_limit + * + */ + +STATIC INLINE boolean _Attributes_Is_limit( + rtems_attribute attribute_set +) +{ + return ( attribute_set & RTEMS_LIMIT ); +} + +/*PAGE + * + * _Attributes_Is_binary_semaphore + * + */ + +STATIC INLINE boolean _Attributes_Is_binary_semaphore( + rtems_attribute attribute_set +) +{ + return ( attribute_set & RTEMS_BINARY_SEMAPHORE ); +} + +/*PAGE + * + * _Attributes_Is_inherit_priority + * + */ + +STATIC INLINE boolean _Attributes_Is_inherit_priority( + rtems_attribute attribute_set +) +{ + return ( attribute_set & RTEMS_INHERIT_PRIORITY ); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/dpmem.inl b/cpukit/rtems/inline/rtems/rtems/dpmem.inl new file mode 100644 index 0000000000..829ec5ab07 --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/dpmem.inl @@ -0,0 +1,75 @@ +/* inline/dpmem.inl + * + * This include file contains the inline routine used in conjunction + * with the Dual Ported Memory Manager + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __INLINE_DPMEM_inl +#define __INLINE_DPMEM_inl + + +/*PAGE + * + * _Dual_ported_memory_Allocate + * + */ + +STATIC INLINE Dual_ported_memory_Control + *_Dual_ported_memory_Allocate ( void ) +{ + return (Dual_ported_memory_Control *) + _Objects_Allocate( &_Dual_ported_memory_Information ); +} + +/*PAGE + * + * _Dual_ported_memory_Free + * + */ + +STATIC INLINE void _Dual_ported_memory_Free ( + Dual_ported_memory_Control *the_port +) +{ + _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object ); +} + +/*PAGE + * + * _Dual_ported_memory_Get + * + */ + +STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (Dual_ported_memory_Control *) + _Objects_Get( &_Dual_ported_memory_Information, id, location ); +} + +/*PAGE + * + * _Dual_ported_memory_Is_null + */ + +STATIC INLINE boolean _Dual_ported_memory_Is_null( + Dual_ported_memory_Control *the_port +) +{ + return ( the_port == NULL ); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/event.inl b/cpukit/rtems/inline/rtems/rtems/event.inl new file mode 100644 index 0000000000..2f2f480001 --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/event.inl @@ -0,0 +1,30 @@ +/* inline/event.inl + * + * This include file contains the static inline implementation of + * macros for the Event Manager. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __MACROS_EVENT_inl +#define __MACROS_EVENT_inl + +/* + * Event_Manager_initialization + */ + +STATIC INLINE void _Event_Manager_initialization( void ) +{ + _Event_Sync = FALSE; +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/eventset.inl b/cpukit/rtems/inline/rtems/rtems/eventset.inl new file mode 100644 index 0000000000..b38c61de1a --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/eventset.inl @@ -0,0 +1,71 @@ +/* inline/eventset.inl + * + * This include file contains the information pertaining to event sets. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __INLINE_EVENT_SET_inl +#define __INLINE_EVENT_SET_inl + +/*PAGE + * + * _Event_sets_Is_empty + */ + +STATIC INLINE boolean _Event_sets_Is_empty( + rtems_event_set the_event_set +) +{ + return ( the_event_set == 0 ); +} + +/*PAGE + * + * _Event_sets_Post + */ + +STATIC INLINE void _Event_sets_Post( + rtems_event_set the_new_events, + rtems_event_set *the_event_set +) +{ + *the_event_set |= the_new_events; +} + +/*PAGE + * + * _Event_sets_Get + */ + +STATIC INLINE rtems_event_set _Event_sets_Get( + rtems_event_set the_event_set, + rtems_event_set the_event_condition +) +{ + return ( the_event_set & the_event_condition ); +} + +/*PAGE + * + * _Event_sets_Clear + */ + +STATIC INLINE rtems_event_set _Event_sets_Clear( + rtems_event_set the_event_set, + rtems_event_set the_mask +) +{ + return ( the_event_set & ~(the_mask) ); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/message.inl b/cpukit/rtems/inline/rtems/rtems/message.inl new file mode 100644 index 0000000000..ee8d5f6cb1 --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/message.inl @@ -0,0 +1,160 @@ +/* message.inl + * + * This include file contains the static inline implementation of all + * inlined routines in the Message Manager. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __MESSAGE_QUEUE_inl +#define __MESSAGE_QUEUE_inl + +/*PAGE + * + * _Message_queue_Copy_buffer + * + */ + +STATIC INLINE void _Message_queue_Copy_buffer ( + Message_queue_Buffer *source, + Message_queue_Buffer *destination +) +{ + *destination = *source; +} + +/*PAGE + * + * _Message_queue_Allocate_message_buffer + * + */ + +STATIC INLINE Message_queue_Buffer_control * + _Message_queue_Allocate_message_buffer ( void ) +{ + return (Message_queue_Buffer_control *) + _Chain_Get( &_Message_queue_Inactive_messages ); +} + +/*PAGE + * + * _Message_queue_Free_message_buffer + * + */ + +STATIC INLINE void _Message_queue_Free_message_buffer ( + Message_queue_Buffer_control *the_message +) +{ + _Chain_Append( &_Message_queue_Inactive_messages, &the_message->Node ); +} + +/*PAGE + * + * _Message_queue_Get_pending_message + * + */ + +STATIC INLINE + Message_queue_Buffer_control *_Message_queue_Get_pending_message ( + Message_queue_Control *the_message_queue +) +{ + return (Message_queue_Buffer_control *) + _Chain_Get_unprotected( &the_message_queue->Pending_messages ); +} + +/*PAGE + * + * _Message_queue_Append + * + */ + +STATIC INLINE void _Message_queue_Append ( + Message_queue_Control *the_message_queue, + Message_queue_Buffer_control *the_message +) +{ + _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node ); +} + +/*PAGE + * + * _Message_queue_Prepend + * + */ + +STATIC INLINE void _Message_queue_Prepend ( + Message_queue_Control *the_message_queue, + Message_queue_Buffer_control *the_message +) +{ + _Chain_Prepend( + &the_message_queue->Pending_messages, + &the_message->Node + ); +} + +/*PAGE + * + * _Message_queue_Is_null + * + */ + +STATIC INLINE boolean _Message_queue_Is_null ( + Message_queue_Control *the_message_queue +) +{ + return ( the_message_queue == NULL ); +} + +/*PAGE + * + * _Message_queue_Allocate + * + */ + +STATIC INLINE Message_queue_Control *_Message_queue_Allocate ( void ) +{ + return (Message_queue_Control *) + _Objects_Allocate( &_Message_queue_Information ); +} + +/*PAGE + * + * _Message_queue_Free + * + */ + +STATIC INLINE void _Message_queue_Free ( + Message_queue_Control *the_message_queue +) +{ + _Objects_Free( &_Message_queue_Information, &the_message_queue->Object ); +} + +/*PAGE + * + * _Message_queue_Get + * + */ + +STATIC INLINE Message_queue_Control *_Message_queue_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (Message_queue_Control *) + _Objects_Get( &_Message_queue_Information, id, location ); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/modes.inl b/cpukit/rtems/inline/rtems/rtems/modes.inl new file mode 100644 index 0000000000..6331a18a3a --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/modes.inl @@ -0,0 +1,136 @@ +/* modes.inl + * + * This include file contains the static inline implementation of the + * inlined routines in the Mode Handler + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __MODES_inl +#define __MODES_inl + +/*PAGE + * + * RTEMS_INTERRUPT_LEVEL + */ + +STATIC INLINE unsigned32 RTEMS_INTERRUPT_LEVEL ( + rtems_mode mode_set +) +{ + return mode_set & RTEMS_INTERRUPT_MASK; +} + +/*PAGE + * + * _Modes_Mask_changed + * + */ + +STATIC INLINE boolean _Modes_Mask_changed ( + rtems_mode mode_set, + rtems_mode masks +) +{ + return ( mode_set & masks ); +} + +/*PAGE + * + * _Modes_Is_asr_disabled + * + */ + +STATIC INLINE boolean _Modes_Is_asr_disabled ( + rtems_mode mode_set +) +{ + return ( mode_set & RTEMS_ASR_MASK ); +} + +/*PAGE + * + * _Modes_Is_preempt + * + */ + +STATIC INLINE boolean _Modes_Is_preempt ( + rtems_mode mode_set +) +{ + return ( ( mode_set & RTEMS_PREEMPT_MASK ) == RTEMS_PREEMPT ); +} + +/*PAGE + * + * _Modes_Is_timeslice + * + */ + +STATIC INLINE boolean _Modes_Is_timeslice ( + rtems_mode mode_set +) +{ + return ((mode_set & (RTEMS_TIMESLICE_MASK|RTEMS_PREEMPT_MASK)) == + (RTEMS_TIMESLICE|RTEMS_PREEMPT) ); +} + +/*PAGE + * + * _Modes_Get_interrupt_level + * + */ + +STATIC INLINE ISR_Level _Modes_Get_interrupt_level ( + rtems_mode mode_set +) +{ + return ( mode_set & RTEMS_INTERRUPT_MASK ); +} + +/*PAGE + * + * _Modes_Set_interrupt_level + * + */ + +STATIC INLINE void _Modes_Set_interrupt_level ( + rtems_mode mode_set +) +{ + _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); +} + +/*PAGE + * + * _Modes_Change + * + */ + +STATIC INLINE void _Modes_Change ( + rtems_mode old_mode_set, + rtems_mode new_mode_set, + rtems_mode mask, + rtems_mode *out_mode_set, + rtems_mode *changed +) +{ + rtems_mode _out_mode; + + _out_mode = old_mode_set; + _out_mode &= ~mask; + _out_mode |= new_mode_set & mask; + *changed = _out_mode ^ old_mode_set; + *out_mode_set = _out_mode; +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/options.inl b/cpukit/rtems/inline/rtems/rtems/options.inl new file mode 100644 index 0000000000..b3c7312010 --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/options.inl @@ -0,0 +1,47 @@ +/* options.inl + * + * This file contains the static inline implementation of the inlined + * routines from the Options Handler. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __OPTIONS_inl +#define __OPTIONS_inl + +/*PAGE + * + * _Options_Is_no_wait + * + */ + +STATIC INLINE boolean _Options_Is_no_wait ( + rtems_option option_set +) +{ + return (option_set & RTEMS_NO_WAIT); +} + +/*PAGE + * + * _Options_Is_any + * + */ + +STATIC INLINE boolean _Options_Is_any ( + rtems_option option_set +) +{ + return (option_set & RTEMS_EVENT_ANY); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/part.inl b/cpukit/rtems/inline/rtems/rtems/part.inl new file mode 100644 index 0000000000..78f86dcefc --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/part.inl @@ -0,0 +1,157 @@ +/* part.inl + * + * This file contains the macro implementation of all inlined routines + * in the Partition Manager. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __PARTITION_inl +#define __PARTITION_inl + +/*PAGE + * + * _Partition_Allocate_buffer + * + */ + +STATIC INLINE void *_Partition_Allocate_buffer ( + Partition_Control *the_partition +) +{ + return _Chain_Get( &the_partition->Memory ); +} + +/*PAGE + * + * _Partition_Free_buffer + * + */ + +STATIC INLINE void _Partition_Free_buffer ( + Partition_Control *the_partition, + Chain_Node *the_buffer +) +{ + _Chain_Append( &the_partition->Memory, the_buffer ); +} + +/*PAGE + * + * _Partition_Is_buffer_on_boundary + * + */ + +STATIC INLINE boolean _Partition_Is_buffer_on_boundary ( + void *the_buffer, + Partition_Control *the_partition +) +{ + unsigned32 offset; + + offset = (unsigned32) _Addresses_Subtract( + the_buffer, + the_partition->starting_address + ); + + return ((offset % the_partition->buffer_size) == 0); +} + +/*PAGE + * + * _Partition_Is_buffer_valid + * + */ + +STATIC INLINE boolean _Partition_Is_buffer_valid ( + Chain_Node *the_buffer, + Partition_Control *the_partition +) +{ + void *starting; + void *ending; + + starting = the_partition->starting_address; + ending = _Addresses_Add_offset( starting, the_partition->length ); + + return ( + _Addresses_Is_in_range( the_buffer, starting, ending ) && + _Partition_Is_buffer_on_boundary( the_buffer, the_partition ) + ); +} + +/*PAGE + * + * _Partition_Is_buffer_size_aligned + * + */ + +STATIC INLINE boolean _Partition_Is_buffer_size_aligned ( + unsigned32 buffer_size +) +{ + return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0); +} + +/*PAGE + * + * _Partition_Allocate + * + */ + +STATIC INLINE Partition_Control *_Partition_Allocate ( void ) +{ + return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); +} + +/*PAGE + * + * _Partition_Free + * + */ + +STATIC INLINE void _Partition_Free ( + Partition_Control *the_partition +) +{ + _Objects_Free( &_Partition_Information, &the_partition->Object ); +} + +/*PAGE + * + * _Partition_Get + * + */ + +STATIC INLINE Partition_Control *_Partition_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (Partition_Control *) + _Objects_Get( &_Partition_Information, id, location ); +} + +/*PAGE + * + * _Partition_Is_null + * + */ + +STATIC INLINE boolean _Partition_Is_null ( + Partition_Control *the_partition +) +{ + return ( the_partition == NULL ); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/ratemon.inl b/cpukit/rtems/inline/rtems/rtems/ratemon.inl new file mode 100644 index 0000000000..b748f919b3 --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/ratemon.inl @@ -0,0 +1,113 @@ +/* ratemon.inl + * + * This file contains the static inline implementation of the inlined + * routines in the Rate Monotonic Manager. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __RATE_MONOTONIC_inl +#define __RATE_MONOTONIC_inl + +/*PAGE + * + * _Rate_monotonic_Allocate + * + */ + +STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void ) +{ + return (Rate_monotonic_Control *) + _Objects_Allocate( &_Rate_monotonic_Information ); +} + +/*PAGE + * + * _Rate_monotonic_Free + * + */ + +STATIC INLINE void _Rate_monotonic_Free ( + Rate_monotonic_Control *the_period +) +{ + _Objects_Free( &_Rate_monotonic_Information, &the_period->Object ); +} + +/*PAGE + * + * _Rate_monotonic_Get + * + */ + +STATIC INLINE Rate_monotonic_Control *_Rate_monotonic_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (Rate_monotonic_Control *) + _Objects_Get( &_Rate_monotonic_Information, id, location ); +} + +/*PAGE + * + * _Rate_monotonic_Is_active + * + */ + +STATIC INLINE boolean _Rate_monotonic_Is_active ( + Rate_monotonic_Control *the_period +) +{ + return (the_period->state == RATE_MONOTONIC_ACTIVE); +} + +/*PAGE + * + * _Rate_monotonic_Is_inactive + * + */ + +STATIC INLINE boolean _Rate_monotonic_Is_inactive ( + Rate_monotonic_Control *the_period +) +{ + return (the_period->state == RATE_MONOTONIC_INACTIVE); +} + +/*PAGE + * + * _Rate_monotonic_Is_expired + * + */ + +STATIC INLINE boolean _Rate_monotonic_Is_expired ( + Rate_monotonic_Control *the_period +) +{ + return (the_period->state == RATE_MONOTONIC_EXPIRED); +} + +/*PAGE + * + * _Rate_monotonic_Is_null + * + */ + +STATIC INLINE boolean _Rate_monotonic_Is_null ( + Rate_monotonic_Control *the_period +) +{ + return (the_period == NULL); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/region.inl b/cpukit/rtems/inline/rtems/rtems/region.inl new file mode 100644 index 0000000000..5a0e4da1bf --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/region.inl @@ -0,0 +1,101 @@ +/* region.inl + * + * This file contains the macro implementation of the inlined + * routines from the Region Manager. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __REGION_inl +#define __REGION_inl + +/*PAGE + * + * _Region_Allocate + * + */ + +STATIC INLINE Region_Control *_Region_Allocate( void ) +{ + return (Region_Control *) _Objects_Allocate( &_Region_Information ); +} + +/*PAGE + * + * _Region_Free + * + */ + +STATIC INLINE void _Region_Free ( + Region_Control *the_region +) +{ + _Objects_Free( &_Region_Information, &the_region->Object ); +} + +/*PAGE + * + * _Region_Get + * + */ + +STATIC INLINE Region_Control *_Region_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (Region_Control *) + _Objects_Get( &_Region_Information, id, location ); +} + +/*PAGE + * + * _Region_Allocate_segment + * + */ + +STATIC INLINE void *_Region_Allocate_segment ( + Region_Control *the_region, + unsigned32 size +) +{ + return _Heap_Allocate( &the_region->Memory, size ); +} + +/*PAGE + * + * _Region_Free_segment + * + */ + +STATIC INLINE boolean _Region_Free_segment ( + Region_Control *the_region, + void *the_segment +) +{ + return _Heap_Free( &the_region->Memory, the_segment ); +} + +/*PAGE + * + * _Region_Is_null + * + */ + +STATIC INLINE boolean _Region_Is_null ( + Region_Control *the_region +) +{ + return ( the_region == NULL ); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/sem.inl b/cpukit/rtems/inline/rtems/rtems/sem.inl new file mode 100644 index 0000000000..518684a97a --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/sem.inl @@ -0,0 +1,73 @@ +/* sem.inl + * + * This file contains the static inlin implementation of the inlined + * routines from the Semaphore Manager. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __SEMAPHORE_inl +#define __SEMAPHORE_inl + +/*PAGE + * + * _Semaphore_Allocate + * + */ + +STATIC INLINE Semaphore_Control *_Semaphore_Allocate( void ) +{ + return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information ); +} + +/*PAGE + * + * _Semaphore_Free + * + */ + +STATIC INLINE void _Semaphore_Free ( + Semaphore_Control *the_semaphore +) +{ + _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); +} + +/*PAGE + * + * _Semaphore_Get + * + */ + +STATIC INLINE Semaphore_Control *_Semaphore_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (Semaphore_Control *) + _Objects_Get( &_Semaphore_Information, id, location ); +} + +/*PAGE + * + * _Semaphore_Is_null + * + */ + +STATIC INLINE boolean _Semaphore_Is_null ( + Semaphore_Control *the_semaphore +) +{ + return ( the_semaphore == NULL ); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/status.inl b/cpukit/rtems/inline/rtems/rtems/status.inl new file mode 100644 index 0000000000..bd158e535b --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/status.inl @@ -0,0 +1,60 @@ +/* inline/status.inl + * + * This include file contains the implementations of the inlined + * routines for the status package. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __INLINE_STATUS_inl +#define __INLINE_STATUS_inl + +/*PAGE + * + * rtems_is_status_successful + * + */ + +STATIC INLINE boolean rtems_is_status_successful( + rtems_status_code code +) +{ + return (code == RTEMS_SUCCESSFUL); +} + +/*PAGE + * + * rtems_are_statuses_equal + * + */ + +STATIC INLINE boolean rtems_are_statuses_equal( + rtems_status_code code1, + rtems_status_code code2 +) +{ + return (code1 == code2); +} + +/* + * _Status_Is_proxy_blocking + * + */ + +STATIC INLINE boolean _Status_Is_proxy_blocking ( + rtems_status_code code +) +{ + return (code == RTEMS_PROXY_BLOCKING); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/tasks.inl b/cpukit/rtems/inline/rtems/rtems/tasks.inl new file mode 100644 index 0000000000..d5df18831a --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/tasks.inl @@ -0,0 +1,90 @@ +/* tasks.inl + * + * This file contains the static inline implementation of all inlined + * routines in the with RTEMS Tasks Manager. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __RTEMS_TASKS_inl +#define __RTEMS_TASKS_inl + +/*PAGE + * + * _RTEMS_tasks_Allocate + * + */ + +STATIC INLINE Thread_Control *_RTEMS_tasks_Allocate( void ) +{ + return (Thread_Control *) _Objects_Allocate( &_Thread_Information ); +} + +/*PAGE + * + * _RTEMS_tasks_Free + * + */ + +STATIC INLINE void _RTEMS_tasks_Free ( + Thread_Control *the_task +) +{ + _Objects_Free( &_Thread_Information, &the_task->Object ); +} + +/*PAGE + * + * _RTEMS_tasks_Cancel_wait + * + */ + +STATIC INLINE void _RTEMS_tasks_Cancel_wait( + Thread_Control *the_thread +) +{ + States_Control state; + States_Control remote_state; + + state = the_thread->current_state; + + if ( _States_Is_waiting_on_thread_queue( state ) ) { + if ( _States_Is_waiting_for_rpc_reply( state ) && + _States_Is_locally_blocked( state ) ) { + remote_state = _States_Clear( + STATES_WAITING_FOR_RPC_REPLY | STATES_TRANSIENT, + state + ); + + switch ( remote_state ) { + + case STATES_WAITING_FOR_BUFFER: + _Partition_MP_Send_extract_proxy( the_thread ); + break; + case STATES_WAITING_FOR_SEGMENT: + _Region_MP_Send_extract_proxy( the_thread ); + break; + case STATES_WAITING_FOR_SEMAPHORE: + _Semaphore_MP_Send_extract_proxy( the_thread ); + break; + case STATES_WAITING_FOR_MESSAGE: + _Message_queue_MP_Send_extract_proxy( the_thread ); + break; + } + } + _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); + } + else if ( _Watchdog_Is_active( &the_thread->Timer ) ) + (void) _Watchdog_Remove( &the_thread->Timer ); +} + +#endif +/* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/timer.inl b/cpukit/rtems/inline/rtems/rtems/timer.inl new file mode 100644 index 0000000000..7af3b9fa3d --- /dev/null +++ b/cpukit/rtems/inline/rtems/rtems/timer.inl @@ -0,0 +1,112 @@ +/* timer.inl + * + * This file contains the static inline implementation of the inlined routines + * from the Timer Manager. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __TIMER_inl +#define __TIMER_inl + +/*PAGE + * + * _Timer_Allocate + * + */ + +STATIC INLINE Timer_Control *_Timer_Allocate( void ) +{ + return (Timer_Control *) _Objects_Allocate( &_Timer_Information ); +} + +/*PAGE + * + * _Timer_Free + * + */ + +STATIC INLINE void _Timer_Free ( + Timer_Control *the_timer +) +{ + _Objects_Free( &_Timer_Information, &the_timer->Object ); +} + +/*PAGE + * + * _Timer_Get + * + */ + +STATIC INLINE Timer_Control *_Timer_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (Timer_Control *) + _Objects_Get( &_Timer_Information, id, location ); +} + +/*PAGE + * + * _Timer_Is_interval_class + * + */ + +STATIC INLINE boolean _Timer_Is_interval_class ( + Timer_Classes the_class +) +{ + return ( the_class == TIMER_INTERVAL ); +} + +/*PAGE + * + * _Timer_Is_time_of_day_class + * + */ + +STATIC INLINE boolean _Timer_Is_timer_of_day_class ( + Timer_Classes the_class +) +{ + return ( the_class == TIMER_TIME_OF_DAY ); +} + +/*PAGE + * + * _Timer_Is_dormant_class + * + */ + +STATIC INLINE boolean _Timer_Is_dormant_class ( + Timer_Classes the_class +) +{ + return ( the_class == TIMER_DORMANT ); +} + +/*PAGE + * + * _Timer_Is_null + * + */ + +STATIC INLINE boolean _Timer_Is_null ( + Timer_Control *the_timer +) +{ + return ( the_timer == NULL ); +} + +#endif +/* end of include file */ -- cgit v1.2.3