From 5e9b32b439627068a0292370fe595220dbfc95a0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 26 Sep 1995 19:27:15 +0000 Subject: posix support initially added --- cpukit/score/cpu/hppa1.1/cpu.c | 4 +- cpukit/score/cpu/i386/asm.h | 2 +- cpukit/score/cpu/i386/cpu.c | 4 +- cpukit/score/cpu/i386/rtems/asm.h | 2 +- cpukit/score/cpu/i960/asm.h | 2 +- cpukit/score/cpu/i960/cpu.c | 2 +- cpukit/score/cpu/m68k/asm.h | 2 +- cpukit/score/cpu/m68k/cpu.c | 2 +- cpukit/score/cpu/m68k/rtems/asm.h | 2 +- cpukit/score/cpu/no_cpu/asm.h | 2 +- cpukit/score/cpu/no_cpu/cpu.c | 4 +- cpukit/score/cpu/no_cpu/cpu_asm.c | 2 +- cpukit/score/cpu/no_cpu/rtems/asm.h | 2 +- cpukit/score/cpu/unix/cpu.c | 4 +- cpukit/score/include/rtems/score/address.h | 2 +- cpukit/score/include/rtems/score/apiext.h | 2 +- cpukit/score/include/rtems/score/chain.h | 4 +- cpukit/score/include/rtems/score/context.h | 2 +- cpukit/score/include/rtems/score/coremsg.h | 66 +++++++++++++++++++++------- cpukit/score/include/rtems/score/coremutex.h | 10 ++--- cpukit/score/include/rtems/score/coresem.h | 10 ++--- cpukit/score/include/rtems/score/heap.h | 2 +- cpukit/score/include/rtems/score/isr.h | 9 +++- cpukit/score/include/rtems/score/mpci.h | 14 +++--- cpukit/score/include/rtems/score/mppkt.h | 8 ++-- cpukit/score/include/rtems/score/object.h | 48 ++++++++++++-------- cpukit/score/include/rtems/score/objectmp.h | 2 +- cpukit/score/include/rtems/score/priority.h | 2 +- cpukit/score/include/rtems/score/stack.h | 2 +- cpukit/score/include/rtems/score/states.h | 44 ++++++++++--------- cpukit/score/include/rtems/score/sysstate.h | 2 +- cpukit/score/include/rtems/score/thread.h | 29 ++++++------ cpukit/score/include/rtems/score/threadmp.h | 2 +- cpukit/score/include/rtems/score/threadq.h | 14 ++++-- cpukit/score/include/rtems/score/tod.h | 8 ++-- cpukit/score/include/rtems/score/tqdata.h | 9 ++-- cpukit/score/include/rtems/score/userext.h | 8 ++-- cpukit/score/include/rtems/score/watchdog.h | 4 +- cpukit/score/include/rtems/score/wkspace.h | 6 +-- cpukit/score/include/rtems/system.h | 2 +- cpukit/score/inline/rtems/score/coremsg.inl | 28 ++++++++++++ cpukit/score/inline/rtems/score/heap.inl | 2 +- cpukit/score/inline/rtems/score/priority.inl | 2 +- cpukit/score/inline/rtems/score/tqdata.inl | 13 ++++++ cpukit/score/macros/rtems/score/coremsg.inl | 22 ++++++++++ cpukit/score/macros/rtems/score/heap.inl | 2 +- cpukit/score/macros/rtems/score/priority.inl | 2 +- cpukit/score/macros/rtems/score/tqdata.inl | 9 ++++ cpukit/score/macros/rtems/score/watchdog.inl | 2 +- cpukit/score/src/apiext.c | 2 +- cpukit/score/src/chain.c | 6 +-- cpukit/score/src/coremsg.c | 17 +++---- cpukit/score/src/coremutex.c | 10 ++--- cpukit/score/src/coresem.c | 12 ++--- cpukit/score/src/coretod.c | 8 ++-- cpukit/score/src/heap.c | 4 +- cpukit/score/src/interr.c | 6 +-- cpukit/score/src/isr.c | 8 ++-- cpukit/score/src/mpci.c | 24 +++++----- cpukit/score/src/object.c | 12 ++--- cpukit/score/src/objectmp.c | 10 ++--- cpukit/score/src/thread.c | 20 ++++----- cpukit/score/src/threadmp.c | 8 ++-- cpukit/score/src/threadq.c | 14 +++--- cpukit/score/src/userext.c | 2 +- cpukit/score/src/watchdog.c | 4 +- cpukit/score/src/wkspace.c | 4 +- 67 files changed, 368 insertions(+), 232 deletions(-) (limited to 'cpukit/score') diff --git a/cpukit/score/cpu/hppa1.1/cpu.c b/cpukit/score/cpu/hppa1.1/cpu.c index 3fb36ec00b..f132033595 100644 --- a/cpukit/score/cpu/hppa1.1/cpu.c +++ b/cpukit/score/cpu/hppa1.1/cpu.c @@ -18,8 +18,8 @@ */ #include -#include -#include +#include +#include void hppa_external_interrupt_initialize(void); void hppa_external_interrupt_enable(unsigned32); diff --git a/cpukit/score/cpu/i386/asm.h b/cpukit/score/cpu/i386/asm.h index aac1ba9dbe..e317161043 100644 --- a/cpukit/score/cpu/i386/asm.h +++ b/cpukit/score/cpu/i386/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include +#include /* * Recent versions of GNU cpp define variables which indicate the diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c index e23313a9ad..917cf042a9 100644 --- a/cpukit/score/cpu/i386/cpu.c +++ b/cpukit/score/cpu/i386/cpu.c @@ -14,8 +14,8 @@ */ #include -#include -#include +#include +#include /* _CPU_Initialize * diff --git a/cpukit/score/cpu/i386/rtems/asm.h b/cpukit/score/cpu/i386/rtems/asm.h index aac1ba9dbe..e317161043 100644 --- a/cpukit/score/cpu/i386/rtems/asm.h +++ b/cpukit/score/cpu/i386/rtems/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include +#include /* * Recent versions of GNU cpp define variables which indicate the diff --git a/cpukit/score/cpu/i960/asm.h b/cpukit/score/cpu/i960/asm.h index 73a8b3a641..803f42f649 100644 --- a/cpukit/score/cpu/i960/asm.h +++ b/cpukit/score/cpu/i960/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include +#include /* * Recent versions of GNU cpp define variables which indicate the diff --git a/cpukit/score/cpu/i960/cpu.c b/cpukit/score/cpu/i960/cpu.c index 9be7b7e07f..e55a400c40 100644 --- a/cpukit/score/cpu/i960/cpu.c +++ b/cpukit/score/cpu/i960/cpu.c @@ -20,7 +20,7 @@ #endif #include -#include +#include /* _CPU_Initialize * diff --git a/cpukit/score/cpu/m68k/asm.h b/cpukit/score/cpu/m68k/asm.h index 7a25b6c298..4ce90c1b58 100644 --- a/cpukit/score/cpu/m68k/asm.h +++ b/cpukit/score/cpu/m68k/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include +#include /* * Recent versions of GNU cpp define variables which indicate the diff --git a/cpukit/score/cpu/m68k/cpu.c b/cpukit/score/cpu/m68k/cpu.c index 4c28fbc286..f57fae6685 100644 --- a/cpukit/score/cpu/m68k/cpu.c +++ b/cpukit/score/cpu/m68k/cpu.c @@ -13,7 +13,7 @@ */ #include -#include +#include /* _CPU_Initialize * diff --git a/cpukit/score/cpu/m68k/rtems/asm.h b/cpukit/score/cpu/m68k/rtems/asm.h index 7a25b6c298..4ce90c1b58 100644 --- a/cpukit/score/cpu/m68k/rtems/asm.h +++ b/cpukit/score/cpu/m68k/rtems/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include +#include /* * Recent versions of GNU cpp define variables which indicate the diff --git a/cpukit/score/cpu/no_cpu/asm.h b/cpukit/score/cpu/no_cpu/asm.h index ca0ff95e35..66d98be652 100644 --- a/cpukit/score/cpu/no_cpu/asm.h +++ b/cpukit/score/cpu/no_cpu/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include +#include /* * Recent versions of GNU cpp define variables which indicate the diff --git a/cpukit/score/cpu/no_cpu/cpu.c b/cpukit/score/cpu/no_cpu/cpu.c index 2745e983a4..fafed97667 100644 --- a/cpukit/score/cpu/no_cpu/cpu.c +++ b/cpukit/score/cpu/no_cpu/cpu.c @@ -14,8 +14,8 @@ */ #include -#include -#include +#include +#include /* _CPU_Initialize * diff --git a/cpukit/score/cpu/no_cpu/cpu_asm.c b/cpukit/score/cpu/no_cpu/cpu_asm.c index 0d7622d15f..7b87a5ffba 100644 --- a/cpukit/score/cpu/no_cpu/cpu_asm.c +++ b/cpukit/score/cpu/no_cpu/cpu_asm.c @@ -24,7 +24,7 @@ */ #include -#include +#include /* #include "cpu_asm.h> */ /* diff --git a/cpukit/score/cpu/no_cpu/rtems/asm.h b/cpukit/score/cpu/no_cpu/rtems/asm.h index ca0ff95e35..66d98be652 100644 --- a/cpukit/score/cpu/no_cpu/rtems/asm.h +++ b/cpukit/score/cpu/no_cpu/rtems/asm.h @@ -31,7 +31,7 @@ */ #define ASM -#include +#include /* * Recent versions of GNU cpp define variables which indicate the diff --git a/cpukit/score/cpu/unix/cpu.c b/cpukit/score/cpu/unix/cpu.c index a1994da5ae..daff56a1de 100644 --- a/cpukit/score/cpu/unix/cpu.c +++ b/cpukit/score/cpu/unix/cpu.c @@ -17,8 +17,8 @@ */ #include -#include -#include +#include +#include #include #include diff --git a/cpukit/score/include/rtems/score/address.h b/cpukit/score/include/rtems/score/address.h index 4877206801..be056f220a 100644 --- a/cpukit/score/include/rtems/score/address.h +++ b/cpukit/score/include/rtems/score/address.h @@ -97,7 +97,7 @@ STATIC INLINE boolean _Addresses_Is_in_range ( void *limit ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/apiext.h b/cpukit/score/include/rtems/score/apiext.h index 07ac4b4a93..594c71d25c 100644 --- a/cpukit/score/include/rtems/score/apiext.h +++ b/cpukit/score/include/rtems/score/apiext.h @@ -17,7 +17,7 @@ #ifndef __API_EXTENSIONS_h #define __API_EXTENSIONS_h -#include +#include /* * The control structure which defines the points at which an API diff --git a/cpukit/score/include/rtems/score/chain.h b/cpukit/score/include/rtems/score/chain.h index 35ac4dfa80..1d6c8f1db4 100644 --- a/cpukit/score/include/rtems/score/chain.h +++ b/cpukit/score/include/rtems/score/chain.h @@ -21,7 +21,7 @@ extern "C" { #endif -#include +#include /* * This is used to manage each element (node) which is placed @@ -422,7 +422,7 @@ STATIC INLINE boolean _Chain_Is_null_node( Chain_Node *the_node ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/context.h b/cpukit/score/include/rtems/score/context.h index 58e497ae88..b3a423bb47 100644 --- a/cpukit/score/include/rtems/score/context.h +++ b/cpukit/score/include/rtems/score/context.h @@ -20,7 +20,7 @@ extern "C" { #endif -#include +#include /* * The following constant defines the number of bytes required diff --git a/cpukit/score/include/rtems/score/coremsg.h b/cpukit/score/include/rtems/score/coremsg.h index 109d792c78..737004aeb8 100644 --- a/cpukit/score/include/rtems/score/coremsg.h +++ b/cpukit/score/include/rtems/score/coremsg.h @@ -21,10 +21,10 @@ extern "C" { #endif -#include -#include -#include -#include +#include +#include +#include +#include /* * The following type defines the callout which the API provides @@ -109,20 +109,30 @@ typedef struct { CORE_message_queue_Disciplines discipline; } CORE_message_queue_Attributes; +/* + * The following defines the type for a Notification handler. A notification + * handler is invoked when the message queue makes a 0->1 transition on + * pending messages. + */ + +typedef void (*CORE_message_queue_Notify_Handler)( void * ); + /* * The following defines the control block used to manage each * counting message_queue. */ typedef struct { - Thread_queue_Control Wait_queue; - CORE_message_queue_Attributes Attributes; - unsigned32 maximum_pending_messages; - unsigned32 number_of_pending_messages; - unsigned32 maximum_message_size; - Chain_Control Pending_messages; - CORE_message_queue_Buffer *message_buffers; - Chain_Control Inactive_messages; + Thread_queue_Control Wait_queue; + CORE_message_queue_Attributes Attributes; + unsigned32 maximum_pending_messages; + unsigned32 number_of_pending_messages; + unsigned32 maximum_message_size; + Chain_Control Pending_messages; + CORE_message_queue_Buffer *message_buffers; + CORE_message_queue_Notify_Handler notify_handler; + void *notify_argument; + Chain_Control Inactive_messages; } CORE_message_queue_Control; /* @@ -389,15 +399,41 @@ STATIC INLINE void _CORE_message_queue_Prepend ( * * DESCRIPTION: * - * This function places the_message at the rear of the outstanding - * messages on the_message_queue. + * This function returns TRUE if the_message_queue is TRUE and FALSE otherwise. */ STATIC INLINE boolean _CORE_message_queue_Is_null ( CORE_message_queue_Control *the_message_queue ); -#include +/* + * _CORE_message_queue_Is_notify_enabled + * + * DESCRIPTION: + * + * This function returns TRUE if notification is enabled on this message + * queue and FALSE otherwise. + */ + +STATIC INLINE boolean _CORE_message_queue_Is_notify_enabled ( + CORE_message_queue_Control *the_message_queue +); + +/* + * _CORE_message_queue_Set_notify + * + * DESCRIPTION: + * + * This routine initializes the notification information for the_message_queue. + */ + +STATIC INLINE void _CORE_message_queue_Set_notify ( + CORE_message_queue_Control *the_message_queue, + CORE_message_queue_Notify_Handler the_handler, + void *the_argument +); + +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h index 0682bbc1ea..2e8d16a0c1 100644 --- a/cpukit/score/include/rtems/score/coremutex.h +++ b/cpukit/score/include/rtems/score/coremutex.h @@ -23,10 +23,10 @@ extern "C" { #endif -#include -#include -#include -#include +#include +#include +#include +#include /* * The following type defines the callout which the API provides @@ -236,7 +236,7 @@ STATIC INLINE boolean _CORE_mutex_Is_nesting_allowed( CORE_mutex_Attributes *the_attribute ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/coresem.h b/cpukit/score/include/rtems/score/coresem.h index 0fcd8cd0b9..cf40da4783 100644 --- a/cpukit/score/include/rtems/score/coresem.h +++ b/cpukit/score/include/rtems/score/coresem.h @@ -23,10 +23,10 @@ extern "C" { #endif -#include -#include -#include -#include +#include +#include +#include +#include /* * The following type defines the callout which the API provides @@ -168,7 +168,7 @@ STATIC INLINE boolean _CORE_semaphore_Is_priority( CORE_semaphore_Attributes *the_attribute ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h index b0a2d57f39..affd52cd73 100644 --- a/cpukit/score/include/rtems/score/heap.h +++ b/cpukit/score/include/rtems/score/heap.h @@ -396,7 +396,7 @@ STATIC INLINE unsigned32 _Heap_Build_flag ( unsigned32 in_use_flag ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/isr.h b/cpukit/score/include/rtems/score/isr.h index 4bbc3c7aff..2409ed394a 100644 --- a/cpukit/score/include/rtems/score/isr.h +++ b/cpukit/score/include/rtems/score/isr.h @@ -49,6 +49,13 @@ typedef void ISR_Handler; typedef ISR_Handler ( *ISR_Handler_entry )( ISR_Vector_number ); +/* + * This constant promotes out the number of vectors supported by + * the current CPU being used. + */ + +#define ISR_NUMBER_OF_VECTORS CPU_INTERRUPT_NUMBER_OF_VECTORS + /* * The following is TRUE if signals have been sent to the currently * executing thread by an ISR handler. @@ -239,7 +246,7 @@ void _ISR_Handler( void ); void _ISR_Dispatch( void ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/mpci.h b/cpukit/score/include/rtems/score/mpci.h index 67246d8d46..8f115e8fba 100644 --- a/cpukit/score/include/rtems/score/mpci.h +++ b/cpukit/score/include/rtems/score/mpci.h @@ -21,13 +21,13 @@ extern "C" { #endif -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* * The following defines the node number used when a broadcast is desired. diff --git a/cpukit/score/include/rtems/score/mppkt.h b/cpukit/score/include/rtems/score/mppkt.h index 32cbc7e0e9..8ed1ab1fab 100644 --- a/cpukit/score/include/rtems/score/mppkt.h +++ b/cpukit/score/include/rtems/score/mppkt.h @@ -25,9 +25,9 @@ extern "C" { #endif -#include -#include -#include +#include +#include +#include /* * The following enumerated type defines the packet classes. @@ -114,7 +114,7 @@ STATIC INLINE boolean _Mp_packet_Is_null ( MP_packet_Prefix *the_packet ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h index c64b15d786..4366eb1b88 100644 --- a/cpukit/score/include/rtems/score/object.h +++ b/cpukit/score/include/rtems/score/object.h @@ -23,7 +23,7 @@ extern "C" { #endif -#include +#include /* * The following type defines the control block used to manage @@ -78,21 +78,30 @@ typedef unsigned32 Objects_Id; */ typedef enum { - OBJECTS_NO_CLASS = 0, - OBJECTS_INTERNAL_THREADS = 1, - OBJECTS_RTEMS_TASKS = 2, - OBJECTS_RTEMS_TIMERS = 3, - OBJECTS_RTEMS_SEMAPHORES = 4, - OBJECTS_RTEMS_MESSAGE_QUEUES = 5, - OBJECTS_RTEMS_PARTITIONS = 6, - OBJECTS_RTEMS_REGIONS = 7, - OBJECTS_RTEMS_PORTS = 8, - OBJECTS_RTEMS_PERIODS = 9, - OBJECTS_RTEMS_EXTENSIONS = 10 + OBJECTS_NO_CLASS = 0, + OBJECTS_INTERNAL_THREADS = 1, + OBJECTS_RTEMS_TASKS = 2, + OBJECTS_POSIX_THREADS = 3, + OBJECTS_RTEMS_TIMERS = 4, + OBJECTS_RTEMS_SEMAPHORES = 5, + OBJECTS_RTEMS_MESSAGE_QUEUES = 6, + OBJECTS_RTEMS_PARTITIONS = 7, + OBJECTS_RTEMS_REGIONS = 8, + OBJECTS_RTEMS_PORTS = 9, + OBJECTS_RTEMS_PERIODS = 10, + OBJECTS_RTEMS_EXTENSIONS = 11, + OBJECTS_POSIX_KEYS = 12, + OBJECTS_POSIX_INTERRUPTS = 13, + OBJECTS_POSIX_MESSAGE_QUEUES = 14, + OBJECTS_POSIX_MUTEXES = 15, + OBJECTS_POSIX_SEMAPHORES = 16, + OBJECTS_POSIX_CONDITION_VARIABLES = 17 } Objects_Classes; - -#define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS -#define OBJECTS_CLASSES_LAST OBJECTS_RTEMS_EXTENSIONS + +#define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS +#define OBJECTS_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES +#define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_INTERNAL_THREADS +#define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_POSIX_THREADS /* * This enumerated type lists the locations which may be returned @@ -208,8 +217,9 @@ void _Objects_Handler_initialization( * SUPPORTS_GLOBAL is TRUE if the object class supports global * objects, and FALSE otherwise. Maximum indicates the number * of objects required in this class and size indicates the size - * in bytes of each control block for this object class. - * + * in bytes of each control block for this object class. The + * name length and string designator are also set. In addition, + * the class may be a task, therefore this information is also included. */ void _Objects_Initialize_information ( @@ -544,8 +554,8 @@ STATIC INLINE void _Objects_Close( Objects_Control *the_object ); -#include -#include +#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/objectmp.h b/cpukit/score/include/rtems/score/objectmp.h index 324cc59472..dbd468e169 100644 --- a/cpukit/score/include/rtems/score/objectmp.h +++ b/cpukit/score/include/rtems/score/objectmp.h @@ -176,7 +176,7 @@ void _Objects_MP_Is_remote ( EXTERN unsigned32 _Objects_MP_Maximum_global_objects; EXTERN Chain_Control _Objects_MP_Inactive_global_objects; -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/priority.h b/cpukit/score/include/rtems/score/priority.h index 8f681c0ce1..6639d56e0a 100644 --- a/cpukit/score/include/rtems/score/priority.h +++ b/cpukit/score/include/rtems/score/priority.h @@ -179,7 +179,7 @@ STATIC INLINE boolean _Priority_Is_group_empty ( Priority_Control the_priority ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/stack.h b/cpukit/score/include/rtems/score/stack.h index 2a41bcf89f..a054dae3df 100644 --- a/cpukit/score/include/rtems/score/stack.h +++ b/cpukit/score/include/rtems/score/stack.h @@ -85,7 +85,7 @@ STATIC INLINE unsigned32 _Stack_Adjust_size ( unsigned32 size ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/states.h b/cpukit/score/include/rtems/score/states.h index 3f7c4a7e99..a120cadae3 100644 --- a/cpukit/score/include/rtems/score/states.h +++ b/cpukit/score/include/rtems/score/states.h @@ -32,26 +32,28 @@ typedef unsigned32 States_Control; * be used to compose and manipulate a thread's state. */ -#define STATES_ALL_SET 0xffff /* all states */ -#define STATES_READY 0x0000 /* ready to run */ -#define STATES_DORMANT 0x0001 /* created but not started */ -#define STATES_SUSPENDED 0x0002 /* waiting to be resumed */ -#define STATES_TRANSIENT 0x0004 /* thread in transition */ -#define STATES_DELAYING 0x0008 /* wait for timeout */ -#define STATES_WAITING_FOR_BUFFER 0x0010 /* wait for partition buffer */ -#define STATES_WAITING_FOR_SEGMENT 0x0020 /* wait for region segment */ -#define STATES_WAITING_FOR_MESSAGE 0x0040 /* wait for message */ -#define STATES_WAITING_FOR_EVENT 0x0080 /* wait for event */ -#define STATES_WAITING_FOR_SEMAPHORE 0x0100 /* wait for semaphore */ -#define STATES_WAITING_FOR_MUTEX 0x0200 /* wait for mutex */ -#define STATES_WAITING_FOR_TIME 0x0400 /* wait for specific TOD */ -#define STATES_WAITING_FOR_RPC_REPLY 0x0800 /* wait for rpc reply */ -#define STATES_WAITING_FOR_PERIOD 0x1000 /* rate monotonic delay */ - -#define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_BUFFER | \ - STATES_WAITING_FOR_SEGMENT | \ - STATES_WAITING_FOR_MESSAGE | \ - STATES_WAITING_FOR_MUTEX | \ +#define STATES_ALL_SET 0xffff /* all states */ +#define STATES_READY 0x0000 /* ready to run */ +#define STATES_DORMANT 0x0001 /* created not started */ +#define STATES_SUSPENDED 0x0002 /* waiting for resume */ +#define STATES_TRANSIENT 0x0004 /* thread in transition */ +#define STATES_DELAYING 0x0008 /* wait for timeout */ +#define STATES_WAITING_FOR_TIME 0x0010 /* wait for TOD */ +#define STATES_WAITING_FOR_BUFFER 0x0020 +#define STATES_WAITING_FOR_SEGMENT 0x0040 +#define STATES_WAITING_FOR_MESSAGE 0x0080 +#define STATES_WAITING_FOR_EVENT 0x0100 +#define STATES_WAITING_FOR_SEMAPHORE 0x0200 +#define STATES_WAITING_FOR_MUTEX 0x0400 +#define STATES_WAITING_FOR_CONDITION_VARIABLE 0x0800 +#define STATES_WAITING_FOR_RPC_REPLY 0x1000 +#define STATES_WAITING_FOR_PERIOD 0x2000 + +#define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_BUFFER | \ + STATES_WAITING_FOR_SEGMENT | \ + STATES_WAITING_FOR_MESSAGE | \ + STATES_WAITING_FOR_MUTEX | \ + STATES_WAITING_FOR_CONDITION_VARIABLE | \ STATES_WAITING_FOR_SEMAPHORE ) #define STATES_WAITING_ON_THREAD_QUEUE \ @@ -342,7 +344,7 @@ STATIC INLINE boolean _States_Are_set ( States_Control mask ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/sysstate.h b/cpukit/score/include/rtems/score/sysstate.h index 59d6c955e9..11b5018705 100644 --- a/cpukit/score/include/rtems/score/sysstate.h +++ b/cpukit/score/include/rtems/score/sysstate.h @@ -152,7 +152,7 @@ STATIC INLINE boolean _System_state_Is_failed ( System_state_Codes state ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 823a4e6760..c485671e75 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -21,16 +21,16 @@ extern "C" { #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * The following defines the "return type" of a thread. @@ -130,11 +130,12 @@ typedef struct { */ typedef enum { - THREAD_API_RTEMS + THREAD_API_RTEMS, + THREAD_API_POSIX, } Thread_APIs; #define THREAD_API_FIRST THREAD_API_RTEMS -#define THREAD_API_LAST THREAD_API_RTEMS +#define THREAD_API_LAST THREAD_API_POSIX typedef struct { Objects_Control Object; @@ -757,8 +758,8 @@ STATIC INLINE boolean _Thread_Is_proxy_blocking ( unsigned32 code ); -#include -#include +#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/threadmp.h b/cpukit/score/include/rtems/score/threadmp.h index 89b8e3d597..4afc965381 100644 --- a/cpukit/score/include/rtems/score/threadmp.h +++ b/cpukit/score/include/rtems/score/threadmp.h @@ -104,7 +104,7 @@ EXTERN Thread_Control *_Thread_MP_Receive; EXTERN Chain_Control _Thread_MP_Active_proxies; EXTERN Chain_Control _Thread_MP_Inactive_proxies; -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/threadq.h b/cpukit/score/include/rtems/score/threadq.h index a9fb29bb57..6a074daf16 100644 --- a/cpukit/score/include/rtems/score/threadq.h +++ b/cpukit/score/include/rtems/score/threadq.h @@ -21,11 +21,17 @@ extern "C" { #endif -#include +#include -#include -#include -#include +#include +#include +#include + +/* + * Constant for indefinite wait. + */ + +#define THREAD_QUEUE_WAIT_FOREVER WATCHDOG_NO_TIMEOUT /* * The following type defines the callout used when a remote task diff --git a/cpukit/score/include/rtems/score/tod.h b/cpukit/score/include/rtems/score/tod.h index 6c2882a3c5..89ff118c33 100644 --- a/cpukit/score/include/rtems/score/tod.h +++ b/cpukit/score/include/rtems/score/tod.h @@ -21,8 +21,8 @@ extern "C" { #endif -#include -#include +#include +#include /* * The following constants are related to the time of day. @@ -37,6 +37,8 @@ extern "C" { TOD_MINUTES_PER_HOUR * \ TOD_HOURS_PER_DAY) +#define TOD_SECONDS_PER_NON_LEAP_YEAR (365 * TOD_SECONDS_PER_DAY) + #define TOD_MICROSECONDS_PER_SECOND 1000000 #define TOD_MILLISECONDS_PER_SECOND 1000 @@ -290,7 +292,7 @@ void _TOD_Tickle( #define TOD_MILLISECONDS_TO_TICKS(_ms) \ (TOD_MILLISECONDS_TO_MICROSECONDS(_ms) / _TOD_Microseconds_per_tick) -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/tqdata.h b/cpukit/score/include/rtems/score/tqdata.h index 128c4183a3..790f31e317 100644 --- a/cpukit/score/include/rtems/score/tqdata.h +++ b/cpukit/score/include/rtems/score/tqdata.h @@ -21,9 +21,9 @@ extern "C" { #endif -#include -#include -#include +#include +#include +#include /* * The following enumerated type details all of the disciplines @@ -52,6 +52,7 @@ typedef struct { Thread_queue_Disciplines discipline; /* queue discipline */ States_Control state; /* state of threads on Thread_q */ unsigned32 timeout_status; + unsigned32 count; } Thread_queue_Control; /* @@ -81,7 +82,7 @@ STATIC INLINE boolean _Thread_queue_Is_reverse_search ( Priority_Control the_priority ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/userext.h b/cpukit/score/include/rtems/score/userext.h index 2808b3566e..424871e895 100644 --- a/cpukit/score/include/rtems/score/userext.h +++ b/cpukit/score/include/rtems/score/userext.h @@ -22,9 +22,9 @@ extern "C" { #endif -#include -#include -#include +#include +#include +#include /* * The following records defines the User Extension Table. @@ -285,7 +285,7 @@ void _User_extensions_Fatal ( unsigned32 the_error ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h index 7e871c8881..4fc2849343 100644 --- a/cpukit/score/include/rtems/score/watchdog.h +++ b/cpukit/score/include/rtems/score/watchdog.h @@ -22,7 +22,7 @@ extern "C" { #endif -#include +#include /* * The following type defines the control block used to manage @@ -408,7 +408,7 @@ void _Watchdog_Tickle ( Chain_Control *header ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/wkspace.h b/cpukit/score/include/rtems/score/wkspace.h index a262761d68..ee2eb2d04f 100644 --- a/cpukit/score/include/rtems/score/wkspace.h +++ b/cpukit/score/include/rtems/score/wkspace.h @@ -22,8 +22,8 @@ extern "C" { #endif -#include -#include +#include +#include /* * The following is used to manage the Workspace. @@ -87,7 +87,7 @@ STATIC INLINE boolean _Workspace_Free( void *block ); -#include +#include #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/system.h b/cpukit/score/include/rtems/system.h index 037fe93e66..22ae606342 100644 --- a/cpukit/score/include/rtems/system.h +++ b/cpukit/score/include/rtems/system.h @@ -76,7 +76,7 @@ extern "C" { typedef void * proc_ptr; -#include /* processor specific information */ +#include /* processor specific information */ /* * Define NULL diff --git a/cpukit/score/inline/rtems/score/coremsg.inl b/cpukit/score/inline/rtems/score/coremsg.inl index d1b5429947..6431979dd3 100644 --- a/cpukit/score/inline/rtems/score/coremsg.inl +++ b/cpukit/score/inline/rtems/score/coremsg.inl @@ -181,6 +181,34 @@ STATIC INLINE boolean _CORE_message_queue_Is_null ( return ( the_message_queue == NULL ); } +/*PAGE + * + * _CORE_message_queue_Is_notify_enabled + * + */ + +STATIC INLINE boolean _CORE_message_queue_Is_notify_enabled ( + CORE_message_queue_Control *the_message_queue +) +{ + return (the_message_queue->notify_handler != NULL); +} + +/*PAGE + * + * _CORE_message_queue_Set_notify + * + */ + +STATIC INLINE void _CORE_message_queue_Set_notify ( + CORE_message_queue_Control *the_message_queue, + CORE_message_queue_Notify_Handler the_handler, + void *the_argument +) +{ + the_message_queue->notify_handler = the_handler; + the_message_queue->notify_argument = the_argument; +} #endif /* end of include file */ diff --git a/cpukit/score/inline/rtems/score/heap.inl b/cpukit/score/inline/rtems/score/heap.inl index b3e04a1deb..c32226852e 100644 --- a/cpukit/score/inline/rtems/score/heap.inl +++ b/cpukit/score/inline/rtems/score/heap.inl @@ -17,7 +17,7 @@ #ifndef __HEAP_inl #define __HEAP_inl -#include +#include /*PAGE * diff --git a/cpukit/score/inline/rtems/score/priority.inl b/cpukit/score/inline/rtems/score/priority.inl index 0ecd3c64a4..64a6c1cf66 100644 --- a/cpukit/score/inline/rtems/score/priority.inl +++ b/cpukit/score/inline/rtems/score/priority.inl @@ -17,7 +17,7 @@ #ifndef __PRIORITY_inl #define __PRIORITY_inl -#include +#include /*PAGE * diff --git a/cpukit/score/inline/rtems/score/tqdata.inl b/cpukit/score/inline/rtems/score/tqdata.inl index 3168d058f5..89b0241a3e 100644 --- a/cpukit/score/inline/rtems/score/tqdata.inl +++ b/cpukit/score/inline/rtems/score/tqdata.inl @@ -43,5 +43,18 @@ STATIC INLINE boolean _Thread_queue_Is_reverse_search ( return ( the_priority & 0x20 ); } +/*PAGE + * + * _Thread_queue_Get_number_waiting + * + */ + +STATIC INLINE unsigned32 _Thread_queue_Get_number_waiting ( + Thread_queue_Control *the_thread_queue +) +{ + return ( the_thread_queue->count ); +} + #endif /* end of include file */ diff --git a/cpukit/score/macros/rtems/score/coremsg.inl b/cpukit/score/macros/rtems/score/coremsg.inl index 877d737afd..d69c599d9f 100644 --- a/cpukit/score/macros/rtems/score/coremsg.inl +++ b/cpukit/score/macros/rtems/score/coremsg.inl @@ -117,5 +117,27 @@ _id, _api_message_queue_mp_support ) \ #define _CORE_message_queue_Is_null( _the_message_queue ) \ ( (_the_message_queue) == NULL ) +/*PAGE + * + * _CORE_message_queue_Is_notify_enabled + * + */ + +#define _CORE_message_queue_Is_notify_enabled( _the_message_queue ) \ + ( (_the_message_queue)->notify_handler != NULL ) + +/*PAGE + * + * _CORE_message_queue_Set_notify + * + */ + +#define _CORE_message_queue_Set_notify( \ + _the_message_queue, _the_handler, _the_argument ) \ + do { \ + (_the_message_queue->notify_handler = (_the_handler); \ + (_the_message_queue->notify_argument = (_the_argument); \ + } while ( 0 ) + #endif /* end of include file */ diff --git a/cpukit/score/macros/rtems/score/heap.inl b/cpukit/score/macros/rtems/score/heap.inl index f04d69cdb6..47df055100 100644 --- a/cpukit/score/macros/rtems/score/heap.inl +++ b/cpukit/score/macros/rtems/score/heap.inl @@ -17,7 +17,7 @@ #ifndef __HEAP_inl #define __HEAP_inl -#include +#include /*PAGE * diff --git a/cpukit/score/macros/rtems/score/priority.inl b/cpukit/score/macros/rtems/score/priority.inl index d78e2a0628..3db8aee4fa 100644 --- a/cpukit/score/macros/rtems/score/priority.inl +++ b/cpukit/score/macros/rtems/score/priority.inl @@ -17,7 +17,7 @@ #ifndef __PRIORITY_inl #define __PRIORITY_inl -#include +#include /*PAGE * diff --git a/cpukit/score/macros/rtems/score/tqdata.inl b/cpukit/score/macros/rtems/score/tqdata.inl index 5f657c1a94..c0d7ee8e5e 100644 --- a/cpukit/score/macros/rtems/score/tqdata.inl +++ b/cpukit/score/macros/rtems/score/tqdata.inl @@ -35,5 +35,14 @@ #define _Thread_queue_Is_reverse_search( _the_priority ) \ ( (_the_priority) & 0x20 ) +/*PAGE + * + * _Thread_queue_Get_number_waiting + * + */ + +#define _Thread_queue_Get_number_waiting( _the_thread_queue ) \ + ( (_the_thread_queue)->count ) + #endif /* end of include file */ diff --git a/cpukit/score/macros/rtems/score/watchdog.inl b/cpukit/score/macros/rtems/score/watchdog.inl index 15023722c6..a8a061b144 100644 --- a/cpukit/score/macros/rtems/score/watchdog.inl +++ b/cpukit/score/macros/rtems/score/watchdog.inl @@ -17,7 +17,7 @@ #ifndef __WATCHDOG_inl #define __WATCHDOG_inl -#include +#include /*PAGE * diff --git a/cpukit/score/src/apiext.c b/cpukit/score/src/apiext.c index 60de0540f9..68d80bed07 100644 --- a/cpukit/score/src/apiext.c +++ b/cpukit/score/src/apiext.c @@ -15,7 +15,7 @@ #include -#include +#include /*PAGE * diff --git a/cpukit/score/src/chain.c b/cpukit/score/src/chain.c index 3cea8ea90f..5ef56ed5ad 100644 --- a/cpukit/score/src/chain.c +++ b/cpukit/score/src/chain.c @@ -18,9 +18,9 @@ */ #include -#include -#include -#include +#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/coremsg.c b/cpukit/score/src/coremsg.c index e7e37ec474..0b7a88b1b9 100644 --- a/cpukit/score/src/coremsg.c +++ b/cpukit/score/src/coremsg.c @@ -19,14 +19,14 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include /*PAGE * @@ -63,6 +63,7 @@ boolean _CORE_message_queue_Initialize( the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; the_message_queue->maximum_message_size = maximum_message_size; + _CORE_message_queue_Set_notify( the_message_queue, NULL, NULL ); /* * round size up to multiple of a ptr for chain init diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c index ea2b5773e1..321b4da5ed 100644 --- a/cpukit/score/src/coremutex.c +++ b/cpukit/score/src/coremutex.c @@ -18,11 +18,11 @@ */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/coresem.c b/cpukit/score/src/coresem.c index e7e1705f3c..e9d44369d5 100644 --- a/cpukit/score/src/coresem.c +++ b/cpukit/score/src/coresem.c @@ -19,12 +19,12 @@ */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c index ab464664f6..06f30654cc 100644 --- a/cpukit/score/src/coretod.c +++ b/cpukit/score/src/coretod.c @@ -14,10 +14,10 @@ */ #include -#include -#include -#include -#include +#include +#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/heap.c b/cpukit/score/src/heap.c index 37ed035af2..2380678209 100644 --- a/cpukit/score/src/heap.c +++ b/cpukit/score/src/heap.c @@ -14,8 +14,8 @@ #include -#include -#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/interr.c b/cpukit/score/src/interr.c index 028e3cdb19..04a77fbe37 100644 --- a/cpukit/score/src/interr.c +++ b/cpukit/score/src/interr.c @@ -13,9 +13,9 @@ */ #include -#include -#include -#include +#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/isr.c b/cpukit/score/src/isr.c index b87bf9f249..afc4cdcf38 100644 --- a/cpukit/score/src/isr.c +++ b/cpukit/score/src/isr.c @@ -14,10 +14,10 @@ */ #include -#include -#include -#include -#include +#include +#include +#include +#include /* _ISR_Handler_initialization * diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c index 8910661f09..7887fe355e 100644 --- a/cpukit/score/src/mpci.c +++ b/cpukit/score/src/mpci.c @@ -14,18 +14,18 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include /*PAGE * diff --git a/cpukit/score/src/object.c b/cpukit/score/src/object.c index 0fbe287842..4f672086fe 100644 --- a/cpukit/score/src/object.c +++ b/cpukit/score/src/object.c @@ -14,12 +14,12 @@ */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/objectmp.c b/cpukit/score/src/objectmp.c index 890442a744..7546c33585 100644 --- a/cpukit/score/src/objectmp.c +++ b/cpukit/score/src/objectmp.c @@ -14,10 +14,10 @@ */ #include -#include -#include -#include -#include +#include +#include +#include +#include /*PAGE * @@ -133,9 +133,7 @@ void _Objects_MP_Close ( _Chain_Extract( the_node ); _Objects_MP_Free_global_object( the_object ); - return; - } } diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c index a22f52af2d..d384b75788 100644 --- a/cpukit/score/src/thread.c +++ b/cpukit/score/src/thread.c @@ -14,16 +14,16 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/threadmp.c b/cpukit/score/src/threadmp.c index fe346c0b9c..31f7e5ff62 100644 --- a/cpukit/score/src/threadmp.c +++ b/cpukit/score/src/threadmp.c @@ -14,10 +14,10 @@ */ #include -#include -#include -#include -#include +#include +#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c index d6b8029a22..ef38258d2b 100644 --- a/cpukit/score/src/threadq.c +++ b/cpukit/score/src/threadq.c @@ -14,13 +14,13 @@ */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/userext.c b/cpukit/score/src/userext.c index 6730e81219..6261220d58 100644 --- a/cpukit/score/src/userext.c +++ b/cpukit/score/src/userext.c @@ -15,7 +15,7 @@ */ #include -#include +#include /*PAGE * diff --git a/cpukit/score/src/watchdog.c b/cpukit/score/src/watchdog.c index 53a405d725..9b2c165ee8 100644 --- a/cpukit/score/src/watchdog.c +++ b/cpukit/score/src/watchdog.c @@ -14,8 +14,8 @@ */ #include -#include -#include +#include +#include /*PAGE * diff --git a/cpukit/score/src/wkspace.c b/cpukit/score/src/wkspace.c index f4be68651c..f168e91d62 100644 --- a/cpukit/score/src/wkspace.c +++ b/cpukit/score/src/wkspace.c @@ -17,8 +17,8 @@ */ #include -#include -#include +#include +#include /*PAGE * -- cgit v1.2.3