Changeset 874297f3 in rtems
- Timestamp:
- 04/16/04 10:01:03 (19 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 27138f3
- Parents:
- 1b4f2b30
- Location:
- cpukit/posix
- Files:
-
- 126 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/posix/include/aio.h
r1b4f2b30 r874297f3 16 16 17 17 /* 18 * 6.7.1 Data Definitions for Asynchronous Input and Output, 18 * 6.7.1 Data Definitions for Asynchronous Input and Output, 19 19 * P1003.1b-1993, p. 151 20 20 */ … … 96 96 97 97 /* 98 * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, 98 * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, 99 99 * P1003.1b-1993, p. 162 100 100 */ -
cpukit/posix/include/intr.h
r1b4f2b30 r874297f3 57 57 intr_t intr 58 58 ); 59 59 60 60 int intr_unlock( 61 61 intr_t intr 62 62 ); 63 63 64 64 /* 65 65 * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76 -
cpukit/posix/include/mqueue.h
r1b4f2b30 r874297f3 69 69 const char *msg_ptr, 70 70 size_t msg_len, 71 unsigned int msg_prio 71 unsigned int msg_prio 72 72 ); 73 73 … … 114 114 115 115 /* 116 * 15.2.6 Notify Process that a Message is Available on a Queue, 116 * 15.2.6 Notify Process that a Message is Available on a Queue, 117 117 * P1003.1b-1993, p. 280 118 118 */ -
cpukit/posix/include/rtems/posix/cond.h
r1b4f2b30 r874297f3 13 13 * $Id$ 14 14 */ 15 15 16 16 #ifndef __RTEMS_POSIX_CONDITION_VARIABLES_h 17 17 #define __RTEMS_POSIX_CONDITION_VARIABLES_h 18 18 19 19 #ifdef __cplusplus 20 20 extern "C" { … … 34 34 * Data Structure used to manage a POSIX condition variable 35 35 */ 36 36 37 37 typedef struct { 38 38 Objects_Control Object; … … 46 46 * this class of objects. 47 47 */ 48 48 49 49 POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information; 50 50 … … 54 54 55 55 extern const pthread_condattr_t _POSIX_Condition_variables_Default_attributes; 56 56 57 57 /* 58 58 * _POSIX_Condition_variables_Manager_initialization … … 62 62 * This routine performs the initialization necessary for this manager. 63 63 */ 64 64 65 65 void _POSIX_Condition_variables_Manager_initialization( 66 66 uint32_t maximum_condition_variables 67 67 ); 68 68 69 69 /* 70 70 * _POSIX_Condition_variables_Allocate … … 75 75 * the inactive chain of free condition variable control blocks. 76 76 */ 77 78 RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control * 77 78 RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control * 79 79 _POSIX_Condition_variables_Allocate( void ); 80 80 81 81 /* 82 82 * _POSIX_Condition_variables_Free … … 87 87 * inactive chain of free condition variable control blocks. 88 88 */ 89 89 90 90 RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free ( 91 91 POSIX_Condition_variables_Control *the_condition_variable 92 92 ); 93 93 94 94 /* 95 95 * _POSIX_Condition_variables_Get … … 97 97 * DESCRIPTION: 98 98 * 99 * This function maps condition variable IDs to condition variable control 99 * This function maps condition variable IDs to condition variable control 100 100 * blocks. If ID corresponds to a local condition variable, then it returns 101 101 * the_condition variable control pointer which maps to ID and location … … 105 105 * to OBJECTS_ERROR and the_condition variable is undefined. 106 106 */ 107 107 108 108 #if 0 109 109 RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get ( … … 112 112 ); 113 113 #endif 114 114 115 115 /* 116 116 * _POSIX_Condition_variables_Is_null … … 118 118 * DESCRIPTION: 119 119 * 120 * This function returns TRUE if the_condition variable is NULL 120 * This function returns TRUE if the_condition variable is NULL 121 121 * and FALSE otherwise. 122 122 */ 123 123 124 124 RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null ( 125 125 POSIX_Condition_variables_Control *the_condition_variable … … 164 164 } 165 165 #endif 166 166 167 167 #endif 168 168 /* end of include file */ -
cpukit/posix/include/rtems/posix/intr.h
r1b4f2b30 r874297f3 13 13 * $Id$ 14 14 */ 15 15 16 16 #ifndef __RTEMS_POSIX_KEY_h 17 17 #define __RTEMS_POSIX_KEY_h 18 18 19 19 #ifdef __cplusplus 20 20 extern "C" { … … 34 34 Chain_Control Handlers; 35 35 } POSIX_Interrupt_Control; 36 36 37 37 /* 38 38 * Data Structure used to manage a POSIX Interrupt Handler 39 39 */ 40 40 41 41 typedef struct { 42 42 Objects_Control Object; 43 int is_active; 44 intr_t vector; 43 int is_active; 44 intr_t vector; 45 45 Thread_Control *server; 46 46 int (*handler)( void *area ); … … 52 52 * this class of objects. 53 53 */ 54 54 55 55 POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information; 56 56 … … 60 60 */ 61 61 62 POSIX_EXTERN POSIX_Interrupt_Control 62 POSIX_EXTERN POSIX_Interrupt_Control 63 63 _POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ]; 64 64 65 65 /* 66 66 * _POSIX_Interrupt_Manager_initialization … … 70 70 * This routine performs the initialization necessary for this manager. 71 71 */ 72 73 void _POSIX_Interrupt_Manager_initialization( 72 73 void _POSIX_Interrupt_Manager_initialization( 74 74 uint32_t maximum_interrupt_handlers 75 75 ); 76 76 77 77 /* 78 78 * _POSIX_Interrupt_Allocate … … 83 83 * the inactive chain of free interrupt handler control blocks. 84 84 */ 85 85 86 86 RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control * 87 87 _POSIX_Interrupt_Allocate( void ); 88 88 89 89 /* 90 90 * _POSIX_Interrupt_Free … … 95 95 * inactive chain of free interrupt handler control blocks. 96 96 */ 97 97 98 98 RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free ( 99 99 POSIX_Interrupt_Handler_control *the_intr 100 100 ); 101 101 102 102 /* 103 103 * _POSIX_Interrupt_Get … … 105 105 * DESCRIPTION: 106 106 * 107 * This function maps interrupt handler IDs to interrupt handler control 107 * This function maps interrupt handler IDs to interrupt handler control 108 108 * blocks. If ID corresponds to a local interrupt handler, then it returns 109 109 * the_intr control pointer which maps to ID and location … … 113 113 * to OBJECTS_ERROR and the_intr is undefined. 114 114 */ 115 115 116 116 RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get ( 117 117 Objects_Id id, 118 118 Objects_Locations *location 119 119 ); 120 120 121 121 /* 122 122 * _POSIX_Interrupt_Is_null … … 126 126 * This function returns TRUE if the_intr is NULL and FALSE otherwise. 127 127 */ 128 128 129 129 RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null ( 130 130 POSIX_Interrupt_Handler_control *the_intr 131 131 ); 132 132 133 133 /* 134 134 * _POSIX_Interrupt_Handler … … 138 138 * This function XXX. 139 139 */ 140 140 141 141 void _POSIX_Interrupt_Handler( 142 142 ISR_Vector_number vector … … 148 148 } 149 149 #endif 150 150 151 151 #endif 152 152 /* end of include file */ -
cpukit/posix/include/rtems/posix/key.h
r1b4f2b30 r874297f3 13 13 * $Id$ 14 14 */ 15 15 16 16 #ifndef __RTEMS_POSIX_KEY_h 17 17 #define __RTEMS_POSIX_KEY_h 18 18 19 19 #ifdef __cplusplus 20 20 extern "C" { … … 27 27 * ID of the currently executing thread. 28 28 */ 29 29 30 30 typedef struct { 31 31 Objects_Control Object; … … 39 39 * this class of objects. 40 40 */ 41 41 42 42 POSIX_EXTERN Objects_Information _POSIX_Keys_Information; 43 43 44 44 /* 45 45 * _POSIX_Keys_Manager_initialization … … 49 49 * This routine performs the initialization necessary for this manager. 50 50 */ 51 51 52 52 void _POSIX_Key_Manager_initialization( 53 53 uint32_t maximum_keys 54 54 ); 55 55 56 56 /* 57 57 * _POSIX_Keys_Run_destructors … … 65 65 * run through all the keys and do the destructor action. 66 66 */ 67 67 68 68 void _POSIX_Keys_Run_destructors( 69 69 Thread_Control *thread … … 78 78 * the inactive chain of free keys control blocks. 79 79 */ 80 80 81 81 RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void ); 82 82 83 83 /* 84 84 * _POSIX_Keys_Free … … 89 89 * inactive chain of free keys control blocks. 90 90 */ 91 91 92 92 RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( 93 93 POSIX_Keys_Control *the_key 94 94 ); 95 95 96 96 /* 97 97 * _POSIX_Keys_Get … … 107 107 * to OBJECTS_ERROR and the_key is undefined. 108 108 */ 109 109 110 110 RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get ( 111 111 Objects_Id id, 112 112 Objects_Locations *location 113 113 ); 114 114 115 115 /* 116 116 * _POSIX_Keys_Is_null … … 120 120 * This function returns TRUE if the_key is NULL and FALSE otherwise. 121 121 */ 122 122 123 123 RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null ( 124 124 POSIX_Keys_Control *the_key … … 130 130 } 131 131 #endif 132 132 133 133 #endif 134 134 /* end of include file */ -
cpukit/posix/include/rtems/posix/mqueue.h
r1b4f2b30 r874297f3 13 13 * $Id$ 14 14 */ 15 15 16 16 #ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h 17 17 #define __RTEMS_POSIX_MESSAGE_QUEUE_h 18 18 19 19 #ifdef __cplusplus 20 20 extern "C" { … … 29 29 * Data Structure used to manage a POSIX message queue 30 30 */ 31 31 32 32 typedef struct { 33 33 Objects_Control Object; … … 51 51 * of "file descriptors" associated with the message queues. 52 52 */ 53 53 54 54 POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information; 55 55 POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information_fds; 56 56 57 57 /* 58 58 * _POSIX_Message_queue_Manager_initialization … … 62 62 * This routine performs the initialization necessary for this manager. 63 63 */ 64 64 65 65 void _POSIX_Message_queue_Manager_initialization( 66 66 uint32_t maximum_message_queues 67 67 ); 68 68 69 69 /* 70 70 * … … 76 76 * core message queue. 77 77 */ 78 78 79 79 int _POSIX_Message_queue_Create_support( 80 80 const char *name, … … 91 91 * This routine supports the mq_unlink and mq_close routines by 92 92 * doing most of the work involved with removing a message queue. 93 */ 94 93 */ 94 95 95 void _POSIX_Message_queue_Delete( 96 96 POSIX_Message_queue_Control *the_mq … … 137 137 * the inactive chain of free message queue control blocks. 138 138 */ 139 139 140 140 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void ); 141 141 142 142 /* 143 143 * _POSIX_Message_queue_Free … … 148 148 * inactive chain of free message queue control blocks. 149 149 */ 150 150 151 151 RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free ( 152 152 POSIX_Message_queue_Control *the_mq 153 153 ); 154 154 155 155 /* 156 156 * _POSIX_Message_queue_Get … … 166 166 * to OBJECTS_ERROR and the_mq is undefined. 167 167 */ 168 168 169 169 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get ( 170 170 Objects_Id id, 171 171 Objects_Locations *location 172 172 ); 173 173 174 174 /* 175 175 * _POSIX_Message_queue_Is_null … … 179 179 * This function returns TRUE if the_message_queue is NULL and FALSE otherwise. 180 180 */ 181 181 182 182 RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null ( 183 183 POSIX_Message_queue_Control *the_mq … … 200 200 /* 201 201 * _POSIX_Message_queue_Priority_to_core 202 * 202 * 203 203 * DESCRIPTION: 204 204 * 205 205 * XXX 206 206 */ 207 207 208 208 RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core( 209 209 unsigned int priority … … 212 212 /* 213 213 * _POSIX_Message_queue_Priority_from_core 214 * 214 * 215 215 * DESCRIPTION: 216 216 * 217 217 * XXX 218 218 */ 219 219 220 220 RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( 221 221 CORE_message_queue_Submit_types priority … … 244 244 } 245 245 #endif 246 246 247 247 #endif 248 248 /* end of include file */ -
cpukit/posix/include/rtems/posix/mutex.h
r1b4f2b30 r874297f3 13 13 * $Id$ 14 14 */ 15 15 16 16 #ifndef __RTEMS_POSIX_MUTEX_h 17 17 #define __RTEMS_POSIX_MUTEX_h 18 18 19 19 #ifdef __cplusplus 20 20 extern "C" { … … 27 27 * Data Structure used to manage a POSIX mutex 28 28 */ 29 29 30 30 typedef struct { 31 31 Objects_Control Object; … … 38 38 * this class of objects. 39 39 */ 40 40 41 41 POSIX_EXTERN Objects_Information _POSIX_Mutex_Information; 42 42 … … 46 46 47 47 extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes; 48 48 49 49 /* 50 50 * _POSIX_Mutex_Manager_initialization … … 54 54 * This routine performs the initialization necessary for this manager. 55 55 */ 56 56 57 57 void _POSIX_Mutex_Manager_initialization( 58 58 uint32_t maximum_mutexes 59 59 ); 60 60 61 61 /* 62 62 * _POSIX_Mutex_Allocate … … 67 67 * the inactive chain of free mutexes control blocks. 68 68 */ 69 69 70 70 RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void ); 71 71 72 72 /* 73 73 * _POSIX_Mutex_Free … … 78 78 * inactive chain of free mutexes control blocks. 79 79 */ 80 80 81 81 RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free ( 82 82 POSIX_Mutex_Control *the_mutex 83 83 ); 84 84 85 85 #if 0 86 86 /* … … 97 97 * to OBJECTS_ERROR and the_mutex is undefined. 98 98 */ 99 99 100 100 RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get ( 101 101 Objects_Id *id, 102 102 Objects_Locations *location 103 103 ); 104 104 105 105 /* 106 106 * _POSIX_Mutex_Is_null … … 110 110 * This function returns TRUE if the_mutex is NULL and FALSE otherwise. 111 111 */ 112 112 113 113 RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null ( 114 114 POSIX_Mutex_Control *the_mutex … … 120 120 * 121 121 * DESCRIPTION: 122 * 122 * 123 123 * A support routine which implements guts of the blocking, non-blocking, and 124 124 * timed wait version of mutex lock. … … 153 153 } 154 154 #endif 155 155 156 156 #endif 157 157 /* end of include file */ -
cpukit/posix/include/rtems/posix/posixapi.h
r1b4f2b30 r874297f3 13 13 * $Id$ 14 14 */ 15 15 16 16 #ifndef __POSIX_API_h 17 17 #define __POSIX_API_h 18 18 19 19 #include <rtems/config.h> 20 20 … … 25 25 * XXX 26 26 */ 27 27 28 28 void _POSIX_API_Initialize( 29 29 rtems_configuration_table *configuration_table -
cpukit/posix/include/rtems/posix/priority.h
r1b4f2b30 r874297f3 25 25 26 26 #define POSIX_SCHEDULER_MAXIMUM_PRIORITY (254) 27 27 28 28 #define POSIX_SCHEDULER_MINIMUM_PRIORITY (1) 29 29 -
cpukit/posix/include/rtems/posix/psignal.h
r1b4f2b30 r874297f3 75 75 ); 76 76 77 boolean _POSIX_signals_Unblock_thread( 77 boolean _POSIX_signals_Unblock_thread( 78 78 Thread_Control *the_thread, 79 79 int signo, -
cpukit/posix/include/rtems/posix/pthread.h
r1b4f2b30 r874297f3 13 13 * $Id$ 14 14 */ 15 15 16 16 #ifndef __RTEMS_POSIX_THREADS_h 17 17 #define __RTEMS_POSIX_THREADS_h 18 18 19 19 #ifdef __cplusplus 20 20 extern "C" { … … 30 30 * this class of objects. 31 31 */ 32 32 33 33 POSIX_EXTERN Objects_Information _POSIX_Threads_Information; 34 34 … … 36 36 * These are used to manage the user initialization threads. 37 37 */ 38 39 POSIX_EXTERN posix_initialization_threads_table 38 39 POSIX_EXTERN posix_initialization_threads_table 40 40 *_POSIX_Threads_User_initialization_threads; 41 41 POSIX_EXTERN uint32_t _POSIX_Threads_Number_of_initialization_threads; 42 42 43 43 extern const pthread_attr_t _POSIX_Threads_Default_attributes; 44 44 45 45 /* 46 46 * _POSIX_Threads_Manager_initialization … … 50 50 * This routine performs the initialization necessary for this manager. 51 51 */ 52 52 53 53 void _POSIX_Threads_Manager_initialization( 54 54 uint32_t maximum_pthreads, … … 56 56 posix_initialization_threads_table *user_threads 57 57 ); 58 58 59 59 /* 60 60 * _POSIX_Threads_Allocate … … 65 65 * the inactive chain of free pthread control blocks. 66 66 */ 67 67 68 68 RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ); 69 69 70 70 /* 71 71 * _POSIX_Threads_Free … … 76 76 * inactive chain of free pthread control blocks. 77 77 */ 78 78 79 79 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free( 80 80 Thread_Control *the_pthread 81 81 ); 82 82 83 83 /* 84 84 * _POSIX_Threads_Get … … 94 94 * to OBJECTS_ERROR and the_pthread is undefined. 95 95 */ 96 96 97 97 RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get( 98 98 pthread_t id, 99 99 Objects_Locations *location 100 100 ); 101 101 102 102 /* 103 103 * _POSIX_Threads_Is_null … … 107 107 * This function returns TRUE if the_pthread is NULL and FALSE otherwise. 108 108 */ 109 109 110 110 RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null( 111 111 Thread_Control *the_pthread … … 145 145 } 146 146 #endif 147 147 148 148 #endif 149 149 /* end of include file */ -
cpukit/posix/include/rtems/posix/semaphore.h
r1b4f2b30 r874297f3 13 13 * $Id$ 14 14 */ 15 15 16 16 #ifndef __RTEMS_POSIX_SEMAPHORE_h 17 17 #define __RTEMS_POSIX_SEMAPHORE_h 18 18 19 19 #ifdef __cplusplus 20 20 extern "C" { … … 29 29 * Data Structure used to manage a POSIX semaphore 30 30 */ 31 31 32 32 typedef struct { 33 33 Objects_Control Object; … … 43 43 * this class of objects. 44 44 */ 45 45 46 46 POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information; 47 47 48 48 /* 49 49 * _POSIX_Semaphore_Manager_initialization … … 53 53 * This routine performs the initialization necessary for this manager. 54 54 */ 55 55 56 56 void _POSIX_Semaphore_Manager_initialization( 57 57 uint32_t maximum_semaphorees 58 58 ); 59 59 60 60 /* 61 61 * _POSIX_Semaphore_Allocate … … 66 66 * the inactive chain of free semaphore control blocks. 67 67 */ 68 68 69 69 RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ); 70 70 71 71 /* 72 72 * _POSIX_Semaphore_Free … … 77 77 * inactive chain of free semaphore control blocks. 78 78 */ 79 79 80 80 RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( 81 81 POSIX_Semaphore_Control *the_semaphore 82 82 ); 83 83 84 84 /* 85 85 * _POSIX_Semaphore_Get … … 95 95 * to OBJECTS_ERROR and the_semaphore is undefined. 96 96 */ 97 97 98 98 RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( 99 99 sem_t *id, 100 100 Objects_Locations *location 101 101 ); 102 102 103 103 /* 104 104 * _POSIX_Semaphore_Is_null … … 108 108 * This function returns TRUE if the_semaphore is NULL and FALSE otherwise. 109 109 */ 110 110 111 111 RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null ( 112 112 POSIX_Semaphore_Control *the_semaphore … … 176 176 } 177 177 #endif 178 178 179 179 #endif 180 180 /* end of include file */ -
cpukit/posix/include/rtems/posix/threadsup.h
r1b4f2b30 r874297f3 25 25 #if 0 26 26 /* 27 * POSIX Interrupts 27 * POSIX Interrupts 28 28 */ 29 29 uint32_t interrupts_installed; … … 32 32 33 33 /* 34 * POSIX Cancelability 34 * POSIX Cancelability 35 35 */ 36 36 int cancelability_state; -
cpukit/posix/include/rtems/posix/time.h
r1b4f2b30 r874297f3 14 14 * differences between POSIX API and RTEMS core. 15 15 */ 16 16 17 17 #define POSIX_TIME_SECONDS_1970_THROUGH_1988 \ 18 18 (((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \ … … 23 23 * _POSIX_Timespec_subtract 24 24 */ 25 25 26 26 void _POSIX_Timespec_subtract( 27 27 const struct timespec *the_start, … … 42 42 * _POSIX_Interval_to_timespec 43 43 */ 44 44 45 45 void _POSIX_Interval_to_timespec( 46 46 Watchdog_Interval ticks, -
cpukit/posix/include/sched.h
r1b4f2b30 r874297f3 41 41 42 42 /* 43 * 13.3.3 Set Scheduling Policy and Scheduling Parameters, 43 * 13.3.3 Set Scheduling Policy and Scheduling Parameters, 44 44 * P1003.1b-1993, p. 254 45 45 */ -
cpukit/posix/src/adasupp.c
r1b4f2b30 r874297f3 6 6 #include "config.h" 7 7 #endif 8 8 9 9 #include <assert.h> 10 10 #include <errno.h> … … 22 22 */ 23 23 24 size_t _ada_pthread_minimum_stack_size( void ) 24 size_t _ada_pthread_minimum_stack_size( void ) 25 25 { 26 26 /* 27 27 * Eventually this may need to include a per cpu family calculation 28 28 * but for now, this will do. 29 */ 29 */ 30 30 31 31 return PTHREAD_MINIMUM_STACK_SIZE * 2; -
cpukit/posix/src/adjtime.c
r1b4f2b30 r874297f3 3 3 * 4 4 * I am unaware of the history behind the definition of this service 5 * and don't know if its behavior is covered by any standard. --joel 6 * 5 * and don't know if its behavior is covered by any standard. --joel 6 * 7 7 * $Id$ 8 8 */ … … 22 22 23 23 int adjtime ( struct timeval *delta, struct timeval *olddelta ) 24 { 24 { 25 25 struct timespec ts; 26 26 … … 29 29 olddelta->tv_usec = __adjustment / TOD_MICROSECONDS_PER_SECOND; 30 30 } 31 31 32 32 if ( !delta ) 33 33 return -1; … … 37 37 if ( __adjustment < _TOD_Microseconds_per_tick ) 38 38 return 0; 39 39 40 40 clock_gettime( CLOCK_REALTIME, &ts ); 41 41 42 42 ts.tv_sec += (__adjustment / TOD_MICROSECONDS_PER_SECOND); 43 ts.tv_nsec += (__adjustment % TOD_MICROSECONDS_PER_SECOND) * 43 ts.tv_nsec += (__adjustment % TOD_MICROSECONDS_PER_SECOND) * 44 44 TOD_NANOSECONDS_PER_MICROSECOND; 45 45 -
cpukit/posix/src/aio.c
r1b4f2b30 r874297f3 67 67 /*PAGE 68 68 * 69 * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, 69 * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, 70 70 * P1003.1b-1993, p. 162 71 71 */ -
cpukit/posix/src/alarm.c
r1b4f2b30 r874297f3 29 29 * _POSIX_signals_Alarm_TSR 30 30 */ 31 31 32 32 void _POSIX_signals_Alarm_TSR( 33 33 Objects_Id id, -
cpukit/posix/src/cancel.c
r1b4f2b30 r874297f3 36 36 */ 37 37 38 if ( _ISR_Is_in_progress() ) 38 if ( _ISR_Is_in_progress() ) 39 39 return EPROTO; 40 40 … … 50 50 thread_support->cancelation_requested = 1; 51 51 52 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 52 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 53 53 thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS ) { 54 54 _POSIX_Threads_cancel_run( the_thread ); … … 58 58 return 0; 59 59 } 60 60 61 61 return POSIX_BOTTOM_REACHED(); 62 62 } -
cpukit/posix/src/cancelrun.c
r1b4f2b30 r874297f3 25 25 */ 26 26 27 void _POSIX_Threads_cancel_run( 27 void _POSIX_Threads_cancel_run( 28 28 Thread_Control *the_thread 29 29 ) … … 33 33 POSIX_API_Control *thread_support; 34 34 ISR_Level level; 35 35 36 36 thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 37 37 38 38 handler_stack = &thread_support->Cancellation_Handlers; 39 39 40 40 thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 41 41 42 42 while ( !_Chain_Is_empty( handler_stack ) ) { 43 43 _ISR_Disable( level ); 44 handler = (POSIX_Cancel_Handler_control *) 44 handler = (POSIX_Cancel_Handler_control *) 45 45 _Chain_Tail( handler_stack )->previous; 46 46 _Chain_Extract_unprotected( &handler->Node ); 47 47 _ISR_Enable( level ); 48 48 49 49 (*handler->routine)( handler->arg ); 50 50 -
cpukit/posix/src/cleanuppop.c
r1b4f2b30 r874297f3 33 33 POSIX_API_Control *thread_support; 34 34 ISR_Level level; 35 35 36 36 thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 37 37 38 38 handler_stack = &thread_support->Cancellation_Handlers; 39 39 … … 43 43 return; 44 44 } 45 46 handler = (POSIX_Cancel_Handler_control *) 45 46 handler = (POSIX_Cancel_Handler_control *) 47 47 _Chain_Tail( handler_stack )->previous; 48 48 _Chain_Extract_unprotected( &handler->Node ); 49 49 50 50 _ISR_Enable( level ); 51 51 -
cpukit/posix/src/cleanuppush.c
r1b4f2b30 r874297f3 32 32 Chain_Control *handler_stack; 33 33 POSIX_API_Control *thread_support; 34 34 35 35 if ( !routine ) 36 return; /* XXX what to do really? */ 36 return; /* XXX what to do really? */ 37 37 38 38 _Thread_Disable_dispatch(); … … 41 41 if ( !handler ) { 42 42 _Thread_Enable_dispatch(); 43 return; /* XXX what to do really? */ 43 return; /* XXX what to do really? */ 44 44 } 45 45 -
cpukit/posix/src/clockgetres.c
r1b4f2b30 r874297f3 31 31 if ( !res ) 32 32 rtems_set_errno_and_return_minus_one( EINVAL ); 33 33 34 34 switch ( clock_id ) { 35 35 36 36 /* 37 37 * All time in rtems is based on the same clock tick. … … 47 47 } 48 48 break; 49 49 50 50 default: 51 51 rtems_set_errno_and_return_minus_one( EINVAL ); 52 52 53 53 } 54 54 return 0; -
cpukit/posix/src/clockgettime.c
r1b4f2b30 r874297f3 39 39 40 40 case CLOCK_REALTIME: 41 41 42 42 _ISR_Disable( level ); 43 43 seconds = _TOD_Seconds_since_epoch; 44 44 ticks = _TOD_Current.ticks; 45 45 _ISR_Enable( level ); 46 46 47 47 tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988; 48 tp->tv_nsec = ticks * _TOD_Microseconds_per_tick * 49 TOD_NANOSECONDS_PER_MICROSECOND; 48 tp->tv_nsec = ticks * _TOD_Microseconds_per_tick * 49 TOD_NANOSECONDS_PER_MICROSECOND; 50 50 break; 51 51 -
cpukit/posix/src/clocksettime.c
r1b4f2b30 r874297f3 36 36 37 37 switch ( clock_id ) { 38 38 39 39 case CLOCK_REALTIME: 40 40 (void) gmtime_r( &tp->tv_sec, &split_time ); 41 41 42 42 /* 43 43 * Convert the tm structure format to that used by the TOD Handler … … 58 58 if ( !_TOD_Validate( &tod ) ) 59 59 rtems_set_errno_and_return_minus_one( EINVAL ); 60 60 61 61 /* 62 * We can't use the tp->tv_sec field because it is based on 62 * We can't use the tp->tv_sec field because it is based on 63 63 * a different EPOCH. 64 64 */ … … 69 69 _Thread_Enable_dispatch(); 70 70 break; 71 71 72 72 #ifdef _POSIX_CPUTIME 73 73 case CLOCK_PROCESS_CPUTIME: … … 75 75 break; 76 76 #endif 77 77 78 78 #ifdef _POSIX_THREAD_CPUTIME 79 79 case CLOCK_THREAD_CPUTIME: … … 83 83 default: 84 84 rtems_set_errno_and_return_minus_one( EINVAL ); 85 85 86 86 } 87 87 return 0; -
cpukit/posix/src/cond.c
r1b4f2b30 r874297f3 22 22 * _POSIX_Condition_variables_Manager_initialization 23 23 * 24 * This routine initializes all condition variable manager related data 24 * This routine initializes all condition variable manager related data 25 25 * structures. 26 26 * … … 30 30 * Output parameters: NONE 31 31 */ 32 32 33 33 void _POSIX_Condition_variables_Manager_initialization( 34 34 uint32_t maximum_condition_variables … … 49 49 NULL /* Proxy extraction support callout */ 50 50 #endif 51 ); 51 ); 52 52 } -
cpukit/posix/src/condattrdestroy.c
r1b4f2b30 r874297f3 20 20 /*PAGE 21 21 * 22 * 11.4.1 Condition Variable Initialization Attributes, 22 * 11.4.1 Condition Variable Initialization Attributes, 23 23 * P1003.1c/Draft 10, p. 96 24 24 */ 25 25 26 26 int pthread_condattr_destroy( 27 27 pthread_condattr_t *attr -
cpukit/posix/src/condattrgetpshared.c
r1b4f2b30 r874297f3 20 20 /*PAGE 21 21 * 22 * 11.4.1 Condition Variable Initialization Attributes, 22 * 11.4.1 Condition Variable Initialization Attributes, 23 23 * P1003.1c/Draft 10, p. 96 24 24 */ 25 25 26 26 int pthread_condattr_getpshared( 27 27 const pthread_condattr_t *attr, -
cpukit/posix/src/condattrinit.c
r1b4f2b30 r874297f3 20 20 /*PAGE 21 21 * 22 * 11.4.1 Condition Variable Initialization Attributes, 22 * 11.4.1 Condition Variable Initialization Attributes, 23 23 * P1003.1c/Draft 10, p. 96 24 24 */ 25 25 26 26 int pthread_condattr_init( 27 27 pthread_condattr_t *attr -
cpukit/posix/src/condattrsetpshared.c
r1b4f2b30 r874297f3 20 20 /*PAGE 21 21 * 22 * 11.4.1 Condition Variable Initialization Attributes, 22 * 11.4.1 Condition Variable Initialization Attributes, 23 23 * P1003.1c/Draft 10, p. 96 24 24 */ 25 25 26 26 int pthread_condattr_setpshared( 27 27 pthread_condattr_t *attr, -
cpukit/posix/src/condbroadcast.c
r1b4f2b30 r874297f3 22 22 * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 23 23 */ 24 24 25 25 int pthread_cond_broadcast( 26 26 pthread_cond_t *cond -
cpukit/posix/src/conddefaultattributes.c
r1b4f2b30 r874297f3 22 22 * The default condition variable attributes structure. 23 23 */ 24 24 25 25 const pthread_condattr_t _POSIX_Condition_variables_Default_attributes = { 26 26 TRUE, /* is_initialized */ -
cpukit/posix/src/conddestroy.c
r1b4f2b30 r874297f3 20 20 /*PAGE 21 21 * 22 * 11.4.2 Initializing and Destroying a Condition Variable, 22 * 11.4.2 Initializing and Destroying a Condition Variable, 23 23 * P1003.1c/Draft 10, p. 87 24 24 */ 25 25 26 26 int pthread_cond_destroy( 27 27 pthread_cond_t *cond … … 30 30 register POSIX_Condition_variables_Control *the_cond; 31 31 Objects_Locations location; 32 32 33 33 the_cond = _POSIX_Condition_variables_Get( cond, &location ); 34 34 switch ( location ) { … … 45 45 46 46 case OBJECTS_LOCAL: 47 47 48 48 if ( _Thread_queue_First( &the_cond->Wait_queue ) ) { 49 49 _Thread_Enable_dispatch(); 50 50 return EBUSY; 51 51 } 52 52 53 53 _Objects_Close( 54 54 &_POSIX_Condition_variables_Information, 55 55 &the_cond->Object 56 56 ); 57 57 58 58 _POSIX_Condition_variables_Free( the_cond ); 59 59 60 60 #if defined(RTEMS_MULTIPROCESSING) 61 61 if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) { 62 62 63 63 _Objects_MP_Close( 64 64 &_POSIX_Condition_variables_Information, 65 65 the_cond->Object.id 66 66 ); 67 67 68 68 _POSIX_Condition_variables_MP_Send_process_packet( 69 69 POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE, -
cpukit/posix/src/condinit.c
r1b4f2b30 r874297f3 20 20 /*PAGE 21 21 * 22 * 11.4.2 Initializing and Destroying a Condition Variable, 22 * 11.4.2 Initializing and Destroying a Condition Variable, 23 23 * P1003.1c/Draft 10, p. 87 24 24 */ 25 25 26 26 int pthread_cond_init( 27 27 pthread_cond_t *cond, … … 31 31 POSIX_Condition_variables_Control *the_cond; 32 32 const pthread_condattr_t *the_attr; 33 33 34 34 if ( attr ) the_attr = attr; 35 35 else the_attr = &_POSIX_Condition_variables_Default_attributes; 36 36 37 37 /* 38 38 * XXX: Be careful about attributes when global!!! 39 39 */ 40 40 41 41 if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 42 42 return POSIX_MP_NOT_IMPLEMENTED(); 43 43 44 44 if ( !the_attr->is_initialized ) 45 45 return EINVAL; 46 46 47 47 _Thread_Disable_dispatch(); 48 48 49 49 the_cond = _POSIX_Condition_variables_Allocate(); 50 50 51 51 if ( !the_cond ) { 52 52 _Thread_Enable_dispatch(); 53 53 return ENOMEM; 54 54 } 55 55 56 56 #if defined(RTEMS_MULTIPROCESSING) 57 57 if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && … … 63 63 } 64 64 #endif 65 65 66 66 the_cond->process_shared = the_attr->process_shared; 67 67 … … 81 81 0 82 82 ); 83 83 84 84 *cond = the_cond->Object.id; 85 85 86 86 #if defined(RTEMS_MULTIPROCESSING) 87 87 if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) … … 93 93 ); 94 94 #endif 95 95 96 96 _Thread_Enable_dispatch(); 97 97 -
cpukit/posix/src/condsignal.c
r1b4f2b30 r874297f3 22 22 * 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 23 23 */ 24 24 25 25 int pthread_cond_signal( 26 26 pthread_cond_t *cond -
cpukit/posix/src/condsignalsupp.c
r1b4f2b30 r874297f3 25 25 * wake up version of the "signal" operation. 26 26 */ 27 27 28 28 int _POSIX_Condition_variables_Signal_support( 29 29 pthread_cond_t *cond, … … 34 34 Objects_Locations location; 35 35 Thread_Control *the_thread; 36 36 37 37 the_cond = _POSIX_Condition_variables_Get( cond, &location ); 38 38 switch ( location ) { … … 47 47 return EINVAL; 48 48 case OBJECTS_LOCAL: 49 50 do { 49 50 do { 51 51 the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue ); 52 52 if ( !the_thread ) -
cpukit/posix/src/condtimedwait.c
r1b4f2b30 r874297f3 22 22 * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105 23 23 */ 24 24 25 25 int pthread_cond_timedwait( 26 26 pthread_cond_t *cond, … … 49 49 if ( ( difference.tv_sec < 0 ) || ( ( difference.tv_sec == 0 ) && 50 50 ( difference.tv_nsec < 0 ) ) ) 51 already_timedout = TRUE; 51 already_timedout = TRUE; 52 52 53 53 timeout = _POSIX_Timespec_to_interval( &difference ); -
cpukit/posix/src/condwait.c
r1b4f2b30 r874297f3 22 22 * 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105 23 23 */ 24 24 25 25 int pthread_cond_wait( 26 26 pthread_cond_t *cond, -
cpukit/posix/src/condwaitsupp.c
r1b4f2b30 r874297f3 25 25 * timed wait version of condition variable wait routines. 26 26 */ 27 27 28 28 int _POSIX_Condition_variables_Wait_support( 29 29 pthread_cond_t *cond, … … 37 37 int status; 38 38 int mutex_status; 39 39 40 40 if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 41 41 return EINVAL; … … 55 55 return EINVAL; 56 56 case OBJECTS_LOCAL: 57 57 58 58 if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 59 59 _Thread_Enable_dispatch(); 60 60 return EINVAL; 61 61 } 62 62 63 63 (void) pthread_mutex_unlock( mutex ); 64 64 /* XXX ignore this for now since behavior is undefined … … 71 71 if ( !already_timedout ) { 72 72 the_cond->Mutex = *mutex; 73 73 74 74 _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); 75 75 _Thread_Executing->Wait.return_code = 0; … … 82 82 83 83 /* 84 * Switch ourself out because we blocked as a result of the 84 * Switch ourself out because we blocked as a result of the 85 85 * _Thread_queue_Enqueue. 86 86 */ … … 102 102 if ( mutex_status ) 103 103 return EINVAL; 104 104 105 105 return status; 106 106 } -
cpukit/posix/src/execl.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * execl() - POSIX 1003.1b 3.1.2 3 3 * -
cpukit/posix/src/execle.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * execle() - POSIX 1003.1b 3.1.2 3 3 * -
cpukit/posix/src/execlp.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * execlp() - POSIX 1003.1b 3.1.2 3 3 * -
cpukit/posix/src/execv.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * execv() - POSIX 1003.1b 3.1.2 3 3 * -
cpukit/posix/src/execve.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * execve() - POSIX 1003.1b 3.1.2 3 3 * -
cpukit/posix/src/execvp.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * execvp() - POSIX 1003.1b 3.1.2 3 3 * -
cpukit/posix/src/fork.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * fork() - POSIX 1003.1b 3.1.1 3 3 * -
cpukit/posix/src/intr.c
r1b4f2b30 r874297f3 1 1 /* 2 2 * NOTE: Each task has an interrupt semaphore associated with it. 3 * No matter which interrupt occurs that it has registered, 3 * No matter which interrupt occurs that it has registered, 4 4 * the same semaphore is used. 5 5 * … … 33 33 * This routine performs the initialization necessary for this manager. 34 34 */ 35 36 void _POSIX_Interrupt_Manager_initialization( 35 36 void _POSIX_Interrupt_Manager_initialization( 37 37 uint32_t maximum_interrupt_handlers 38 38 ) … … 59 59 for ( index=0 ; index < CPU_INTERRUPT_NUMBER_OF_VECTORS ; index++ ) { 60 60 the_vector = &_POSIX_Interrupt_Information[ index ]; 61 61 62 62 the_vector->number_installed = 0; 63 63 the_vector->lock_count = 0; … … 84 84 proc_ptr old_handler; 85 85 86 if ( !_ISR_Is_vector_number_valid( intr ) || 86 if ( !_ISR_Is_vector_number_valid( intr ) || 87 87 !_ISR_Is_valid_user_handler( intr_handler ) ) 88 88 return EINVAL; … … 91 91 92 92 the_intr = _POSIX_Interrupt_Allocate(); 93 93 94 94 if ( !the_intr ) { 95 95 _Thread_Enable_dispatch(); … … 124 124 _ISR_Install_vector( 125 125 intr, 126 (proc_ptr) _POSIX_Interrupt_Handler, 126 (proc_ptr) _POSIX_Interrupt_Handler, 127 127 &old_handler 128 128 ); 129 129 130 130 _Objects_Open( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object, 0 ); 131 131 132 132 /* 133 133 * Normally, an Id would be returned here. 134 134 */ 135 136 _Thread_Enable_dispatch(); 137 135 136 _Thread_Enable_dispatch(); 137 138 138 return 0; 139 139 } … … 191 191 return EINVAL; /* XXX should be ENOISR; */ 192 192 } 193 193 194 194 /* 195 195 * OK now we have found the interrupt handler and can do some work. … … 199 199 200 200 the_intr->is_active = FALSE; 201 201 202 202 the_vector->number_installed -= 1; 203 203 … … 214 214 215 215 _POSIX_Interrupt_Free( the_intr ); 216 216 217 217 _Thread_Enable_dispatch(); 218 218 … … 241 241 return 0; 242 242 } 243 243 244 244 /*PAGE 245 245 * … … 252 252 { 253 253 POSIX_Interrupt_Control *the_vector; 254 255 _Thread_Disable_dispatch(); 256 254 255 _Thread_Disable_dispatch(); 256 257 257 the_vector = &_POSIX_Interrupt_Information[ intr ]; 258 258 259 259 if ( !--the_vector->lock_count ) { 260 260 while ( --the_vector->deferred_count ) { … … 262 262 } 263 263 } 264 265 _Thread_Enable_dispatch(); 266 264 265 _Thread_Enable_dispatch(); 266 267 267 return 0; 268 268 } 269 269 270 270 /* 271 271 * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76 … … 291 291 TRUE, 292 292 ticks 293 ); 293 ); 294 294 _Thread_Enable_dispatch(); 295 295 … … 299 299 /*PAGE 300 300 * 301 * _POSIX_Interrupt_Handler 301 * _POSIX_Interrupt_Handler 302 302 * 303 303 */ … … 312 312 Chain_Node *the_node; 313 313 int status; 314 314 315 315 the_vector = &_POSIX_Interrupt_Information[ vector ]; 316 316 317 317 the_node = _Chain_Head( &the_vector->Handlers ); 318 318 319 319 for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) { 320 320 the_intr = (POSIX_Interrupt_Handler_control *) the_node; 321 321 322 322 status = (*the_intr->handler)( (void *) the_intr->user_data_area ); 323 323 -
cpukit/posix/src/key.c
r1b4f2b30 r874297f3 24 24 * This routine performs the initialization necessary for this manager. 25 25 */ 26 26 27 27 void _POSIX_Key_Manager_initialization( 28 28 uint32_t maximum_keys -
cpukit/posix/src/keycreate.c
r1b4f2b30 r874297f3 34 34 35 35 _Thread_Disable_dispatch(); 36 36 37 37 the_key = _POSIX_Keys_Allocate(); 38 38 39 39 if ( !the_key ) { 40 40 _Thread_Enable_dispatch(); … … 56 56 if ( _Objects_Information_table[ the_api ] && 57 57 _Objects_Information_table[ the_api ][ 1 ] ) { 58 bytes_to_allocate = sizeof( void * ) * 58 bytes_to_allocate = sizeof( void * ) * 59 59 (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); 60 60 table = _Workspace_Allocate( bytes_to_allocate ); … … 64 64 the_api-- ) 65 65 _Workspace_Free( the_key->Values[ the_api ] ); 66 66 67 67 _POSIX_Keys_Free( the_key ); 68 68 _Thread_Enable_dispatch(); … … 71 71 72 72 the_key->Values[ the_api ] = table; 73 memset( table, '\0', bytes_to_allocate ); 73 memset( table, '\0', bytes_to_allocate ); 74 74 } else { 75 75 the_key->Values[ the_api ] = NULL; … … 82 82 83 83 _Objects_Open( &_POSIX_Keys_Information, &the_key->Object, 0 ); 84 84 85 85 *key = the_key->Object.id; 86 86 -
cpukit/posix/src/keydelete.c
r1b4f2b30 r874297f3 29 29 Objects_Locations location; 30 30 uint32_t the_api; 31 31 32 32 the_key = _POSIX_Keys_Get( key, &location ); 33 33 switch ( location ) { -
cpukit/posix/src/keygetspecific.c
r1b4f2b30 r874297f3 31 31 Objects_Locations location; 32 32 void *key_data; 33 33 34 34 the_key = _POSIX_Keys_Get( key, &location ); 35 35 switch ( location ) { -
cpukit/posix/src/keyrundestructors.c
r1b4f2b30 r874297f3 50 50 for ( index=1 ; index <= _POSIX_Keys_Information.maximum ; index++ ) { 51 51 52 the_key = (POSIX_Keys_Control *) 52 the_key = (POSIX_Keys_Control *) 53 53 _POSIX_Keys_Information.local_table[ index ]; 54 54 55 55 if ( the_key && the_key->is_active && the_key->destructor ) { 56 56 value = the_key->Values[ pthread_class ][ pthread_index ]; … … 63 63 } 64 64 65 if ( are_all_null == TRUE ) 65 if ( are_all_null == TRUE ) 66 66 return; 67 67 … … 76 76 77 77 if ( iterations >= PTHREAD_DESTRUCTOR_ITERATIONS ) 78 return; 78 return; 79 79 } 80 80 } -
cpukit/posix/src/keysetspecific.c
r1b4f2b30 r874297f3 31 31 uint32_t class; 32 32 Objects_Locations location; 33 33 34 34 the_key = _POSIX_Keys_Get( key, &location ); 35 35 switch ( location ) { -
cpukit/posix/src/killinfo.c
r1b4f2b30 r874297f3 36 36 #define _POSIX_signals_Is_interested( _api, _mask ) \ 37 37 ( ~(_api)->signals_blocked & (_mask) ) 38 38 39 39 int killinfo( 40 40 pid_t pid, … … 58 58 siginfo_t *siginfo; 59 59 POSIX_signals_Siginfo_node *psiginfo; 60 60 61 61 /* 62 62 * Only supported for the "calling process" (i.e. this node). 63 63 */ 64 64 65 65 if ( pid != getpid() ) 66 66 rtems_set_errno_and_return_minus_one( ESRCH ); … … 69 69 * Validate the signal passed if not 0. 70 70 */ 71 71 72 72 if ( sig && !is_valid_signo(sig) ) { 73 73 rtems_set_errno_and_return_minus_one( EINVAL ); … … 83 83 84 84 /* 85 * P1003.1c/Draft 10, p. 33 says that certain signals should always 85 * P1003.1c/Draft 10, p. 33 says that certain signals should always 86 86 * be directed to the executing thread such as those caused by hardware 87 87 * faults. … … 137 137 138 138 the_chain = &_POSIX_signals_Wait_queue.Queues.Priority[ index ]; 139 139 140 140 for ( the_node = the_chain->first ; 141 141 !_Chain_Is_tail( the_chain, the_node ) ; … … 237 237 /* 238 238 * Now the interested thread is blocked. 239 * If the thread we are considering is not, the it becomes the 239 * If the thread we are considering is not, the it becomes the 240 240 * interested thread. 241 241 */ … … 257 257 258 258 /* 259 * Now both threads are blocked and the interested thread is not 259 * Now both threads are blocked and the interested thread is not 260 260 * interruptible. 261 261 * If the thread under consideration is interruptible by a signal, … … 284 284 * + pthread_sigmask() unblocks the signal, 285 285 * + sigprocmask() unblocks the signal, OR 286 * + sigaction() which changes the handler to SIG_IGN. 286 * + sigaction() which changes the handler to SIG_IGN. 287 287 */ 288 288 … … 291 291 292 292 /* 293 * We found a thread which was interested, so now we mark that this 294 * thread needs to do the post context switch extension so it can 293 * We found a thread which was interested, so now we mark that this 294 * thread needs to do the post context switch extension so it can 295 295 * evaluate the signals pending. 296 296 */ 297 297 298 298 process_it: 299 299 300 300 the_thread->do_post_task_switch_extension = TRUE; 301 301 -
cpukit/posix/src/mqueue.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 45 45 * Output parameters: NONE 46 46 */ 47 47 48 48 void _POSIX_Message_queue_Manager_initialization( 49 49 uint32_t maximum_message_queues -
cpukit/posix/src/mqueueclose.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 45 45 POSIX_Message_queue_Control_fd *the_mq_fd; 46 46 Objects_Locations location; 47 47 48 48 the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); 49 49 switch ( location ) { -
cpukit/posix/src/mqueuecreatesupp.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 44 44 * 45 45 * This routine does the actual creation and initialization of 46 * a poxix message queue. 46 * a poxix message queue. 47 47 */ 48 48 49 49 int _POSIX_Message_queue_Create_support( 50 50 const char *name_arg, … … 61 61 62 62 n = strnlen( name_arg, NAME_MAX ); 63 if ( n > NAME_MAX ) 63 if ( n > NAME_MAX ) 64 64 return ENAMETOOLONG; 65 65 66 66 _Thread_Disable_dispatch(); 67 67 68 68 /* 69 69 * There is no real basis for the default values. They will work … … 99 99 } 100 100 #endif 101 101 102 102 the_mq = _POSIX_Message_queue_Allocate(); 103 103 if ( !the_mq ) { … … 105 105 rtems_set_errno_and_return_minus_one( ENFILE ); 106 106 } 107 107 108 108 the_mq->process_shared = pshared; 109 109 the_mq->named = TRUE; … … 123 123 } 124 124 strcpy( name, name_arg ); 125 125 126 126 /* XXX 127 127 * … … 144 144 _Objects_MP_Close( &_POSIX_Message_queue_Information, the_mq->Object.id ); 145 145 #endif 146 146 147 147 _POSIX_Message_queue_Free( the_mq ); 148 148 _Workspace_Free(name); … … 156 156 (char *) name 157 157 ); 158 158 159 159 *message_queue = the_mq; 160 160 161 161 #if 0 && defined(RTEMS_MULTIPROCESSING) 162 162 if ( pshared == PTHREAD_PROCESS_SHARED ) … … 168 168 ); 169 169 #endif 170 170 171 171 _Thread_Enable_dispatch(); 172 172 return 0; -
cpukit/posix/src/mqueuedeletesupp.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 38 38 * _POSIX_Message_queue_Delete 39 39 */ 40 40 41 41 void _POSIX_Message_queue_Delete( 42 42 POSIX_Message_queue_Control *the_mq … … 49 49 50 50 _Objects_Close( &_POSIX_Message_queue_Information, &the_mq->Object ); 51 51 52 52 _CORE_message_queue_Close( 53 53 &the_mq->Message_queue, … … 57 57 58 58 _POSIX_Message_queue_Free( the_mq ); 59 59 60 60 #if 0 && defined(RTEMS_MULTIPROCESSING) 61 61 if ( the_mq->process_shared == PTHREAD_PROCESS_SHARED ) { 62 62 63 63 _Objects_MP_Close( 64 64 &_POSIX_Message_queue_Information, 65 65 the_mq->Object.id 66 66 ); 67 67 68 68 _POSIX_Message_queue_MP_Send_process_packet( 69 69 POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE, … … 74 74 } 75 75 #endif 76 76 77 77 } 78 78 } -
cpukit/posix/src/mqueuegetattr.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 47 47 Objects_Locations location; 48 48 CORE_message_queue_Attributes *the_mq_attr; 49 49 50 50 if ( !mqstat ) 51 51 rtems_set_errno_and_return_minus_one( EINVAL ); … … 65 65 * Return the old values. 66 66 */ 67 67 68 68 the_mq_attr = &the_mq->Message_queue.Attributes; 69 69 70 70 mqstat->mq_flags = the_mq_fd->oflag; 71 71 mqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size; 72 72 mqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages; 73 73 mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages; 74 74 75 75 _Thread_Enable_dispatch(); 76 76 return 0; -
cpukit/posix/src/mqueuenametoid.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 57 57 return ENAMETOOLONG; 58 58 59 status = _Objects_Name_to_id( 59 status = _Objects_Name_to_id( 60 60 &_POSIX_Message_queue_Information, (char *)name, 0, id ); 61 61 -
cpukit/posix/src/mqueuenotify.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 56 56 /*PAGE 57 57 * 58 * 15.2.6 Notify Process that a Message is Available on a Queue, 58 * 15.2.6 Notify Process that a Message is Available on a Queue, 59 59 * P1003.1b-1993, p. 280 60 60 */ … … 68 68 POSIX_Message_queue_Control_fd *the_mq_fd; 69 69 Objects_Locations location; 70 70 71 71 the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); 72 72 switch ( location ) { … … 89 89 90 90 the_mq->notification = *notification; 91 91 92 92 _CORE_message_queue_Set_notify( 93 93 &the_mq->Message_queue, -
cpukit/posix/src/mqueueopen.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 54 54 POSIX_Message_queue_Control_fd *the_mq_fd; 55 55 Objects_Locations location; 56 56 57 57 _Thread_Disable_dispatch(); 58 58 … … 63 63 va_end(arg); 64 64 } 65 65 66 66 the_mq_fd = _POSIX_Message_queue_Allocate_fd(); 67 67 if ( !the_mq_fd ) { … … 79 79 * or some other miscellaneous error on the name. 80 80 */ 81 81 82 82 if ( status ) { 83 83 84 84 /* 85 85 * Unless provided a valid name that did not already exist … … 94 94 95 95 } else { /* name -> ID translation succeeded */ 96 96 97 97 /* 98 98 * Check for existence with creation. … … 121 121 _Thread_Enable_dispatch(); 122 122 return (mqd_t)the_mq_fd->Object.id; 123 123 124 124 } 125 126 /* 125 126 /* 127 127 * At this point, the message queue does not exist and everything has been 128 128 * checked. We should go ahead and create a message queue. 129 129 */ 130 130 131 131 status = _POSIX_Message_queue_Create_support( 132 132 name, … … 135 135 &the_mq 136 136 ); 137 137 138 138 /* 139 139 * errno was set by Create_support, so don't set it again. … … 145 145 return (mqd_t) -1; 146 146 } 147 147 148 148 the_mq_fd->Queue = the_mq; 149 149 _Objects_Open( … … 152 152 NULL 153 153 ); 154 154 155 155 _Thread_Enable_dispatch(); 156 156 -
cpukit/posix/src/mqueuereceive.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure -
cpukit/posix/src/mqueuerecvsupp.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 40 40 * through the layers. 41 41 */ 42 42 43 43 ssize_t _POSIX_Message_queue_Receive_support( 44 44 mqd_t mqdes, … … 53 53 Objects_Locations location; 54 54 uint32_t length_out; 55 55 56 56 the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); 57 57 switch ( location ) { … … 74 74 rtems_set_errno_and_return_minus_one( EMSGSIZE ); 75 75 } 76 76 77 77 /* 78 78 * Now if something goes wrong, we return a "length" of -1 … … 90 90 timeout 91 91 ); 92 92 93 93 _Thread_Enable_dispatch(); 94 94 *msg_prio = -
cpukit/posix/src/mqueuesend.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 44 44 const char *msg_ptr, 45 45 size_t msg_len, 46 unsigned int msg_prio 46 unsigned int msg_prio 47 47 ) 48 48 { -
cpukit/posix/src/mqueuesendsupp.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 38 38 * _POSIX_Message_queue_Send_support 39 39 */ 40 40 41 41 int _POSIX_Message_queue_Send_support( 42 42 mqd_t mqdes, … … 89 89 #endif 90 90 _POSIX_Message_queue_Priority_to_core( msg_prio ), 91 (the_mq_fd->oflag & O_NONBLOCK) ? FALSE : TRUE, 91 (the_mq_fd->oflag & O_NONBLOCK) ? FALSE : TRUE, 92 92 timeout /* no timeout */ 93 93 ); … … 98 98 * If we had to block, then this is where the task returns 99 99 * after it wakes up. The returned status is correct for 100 * non-blocking operations but if we blocked, then we need 100 * non-blocking operations but if we blocked, then we need 101 101 * to look at the status in our TCB. 102 102 */ … … 110 110 rtems_set_errno_and_return_minus_one( 111 111 _POSIX_Message_queue_Translate_core_message_queue_return_code( 112 msg_status 112 msg_status 113 113 ) 114 114 ); -
cpukit/posix/src/mqueuesetattr.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 47 47 CORE_message_queue_Control *the_core_mq; 48 48 Objects_Locations location; 49 49 50 50 if ( !mqstat ) 51 51 rtems_set_errno_and_return_minus_one( EINVAL ); … … 73 73 omqstat->mq_curmsgs = the_core_mq->number_of_pending_messages; 74 74 } 75 75 76 76 the_mq_fd->oflag = mqstat->mq_flags; 77 77 _Thread_Enable_dispatch(); -
cpukit/posix/src/mqueuetimedreceive.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure -
cpukit/posix/src/mqueuetimedsend.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure -
cpukit/posix/src/mqueuetranslatereturncode.c
r1b4f2b30 r874297f3 1 1 /* 2 * POSIX Message Queue Error Translation 2 * POSIX Message Queue Error Translation 3 3 * 4 4 * … … 42 42 * 43 43 */ 44 44 45 45 int _POSIX_Message_queue_Translate_core_message_queue_return_code( 46 46 uint32_t the_message_queue_status … … 82 82 83 83 /* 84 * POSIX Real-Time Extensions add timeouts to send and receive. 84 * POSIX Real-Time Extensions add timeouts to send and receive. 85 85 */ 86 86 case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT: -
cpukit/posix/src/mqueueunlink.c
r1b4f2b30 r874297f3 3 3 * Message_queues to leave the option of having unnamed message 4 4 * queues at a future date. They are currently not part of the 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 5 * POSIX standard but unnamed message_queues are. This is also 6 * the reason for the apparently unnecessary tracking of 7 7 * the process_shared attribute. [In addition to the fact that 8 8 * it would be trivial to add pshared to the mq_attr structure … … 46 46 register POSIX_Message_queue_Control *the_mq; 47 47 Objects_Id the_mq_id; 48 48 49 49 _Thread_Disable_dispatch(); 50 50 … … 68 68 _Objects_Get_index( the_mq_id ) 69 69 ); 70 70 71 71 #if 0 && defined(RTEMS_MULTIPROCESSING) 72 72 if ( the_mq->process_shared == PTHREAD_PROCESS_SHARED ) { … … 75 75 #endif 76 76 77 77 78 78 the_mq->linked = FALSE; 79 79 _Workspace_Free( the_mq->Object.name ); -
cpukit/posix/src/mutex.c
r1b4f2b30 r874297f3 32 32 * Output parameters: NONE 33 33 */ 34 34 35 35 void _POSIX_Mutex_Manager_initialization( 36 36 uint32_t maximum_mutexes -
cpukit/posix/src/mutexattrgetprioceiling.c
r1b4f2b30 r874297f3 25 25 * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 26 26 */ 27 27 28 28 int pthread_mutexattr_getprioceiling( 29 29 const pthread_mutexattr_t *attr, -
cpukit/posix/src/mutexattrgetprotocol.c
r1b4f2b30 r874297f3 25 25 * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 26 26 */ 27 27 28 28 int pthread_mutexattr_getprotocol( 29 29 const pthread_mutexattr_t *attr, -
cpukit/posix/src/mutexattrsetprioceiling.c
r1b4f2b30 r874297f3 25 25 * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 26 26 */ 27 27 28 28 int pthread_mutexattr_setprioceiling( 29 29 pthread_mutexattr_t *attr, -
cpukit/posix/src/mutexattrsetprotocol.c
r1b4f2b30 r874297f3 25 25 * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 26 26 */ 27 27 28 28 int pthread_mutexattr_setprotocol( 29 29 pthread_mutexattr_t *attr, … … 40 40 attr->protocol = protocol; 41 41 return 0; 42 42 43 43 default: 44 44 return EINVAL; -
cpukit/posix/src/mutexdefaultattributes.c
r1b4f2b30 r874297f3 22 22 23 23 /*PAGE 24 * 24 * 25 25 * The default mutex attributes structure. 26 26 */ -
cpukit/posix/src/mutexdestroy.c
r1b4f2b30 r874297f3 32 32 register POSIX_Mutex_Control *the_mutex; 33 33 Objects_Locations location; 34 34 35 35 the_mutex = _POSIX_Mutex_Get( mutex, &location ); 36 36 switch ( location ) { … … 53 53 return EBUSY; 54 54 } 55 55 56 56 _Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object ); 57 57 58 58 _CORE_mutex_Flush( 59 59 &the_mutex->Mutex, … … 65 65 EINVAL 66 66 ); 67 67 68 68 _POSIX_Mutex_Free( the_mutex ); 69 69 70 70 #if defined(RTEMS_MULTIPROCESSING) 71 71 if ( the_mutex->process_shared == PTHREAD_PROCESS_SHARED ) { 72 72 73 73 _Objects_MP_Close( &_POSIX_Mutex_Information, the_mutex->Object.id ); 74 74 75 75 _POSIX_Mutex_MP_Send_process_packet( 76 76 POSIX_MUTEX_MP_ANNOUNCE_DELETE, -
cpukit/posix/src/mutexinit.c
r1b4f2b30 r874297f3 52 52 53 53 /* 54 * This code should eventually be removed. 54 * This code should eventually be removed. 55 55 * 56 56 * Although the POSIX specification says: … … 71 71 */ 72 72 73 73 74 74 #if 0 75 75 /* avoid infinite recursion on call to this routine in _POSIX_Mutex_Get */ … … 90 90 } 91 91 #endif 92 93 if ( !the_attr->is_initialized ) 92 93 if ( !the_attr->is_initialized ) 94 94 return EINVAL; 95 95 … … 104 104 return POSIX_MP_NOT_IMPLEMENTED(); 105 105 #endif 106 106 107 107 /* 108 108 * Determine the discipline of the mutex 109 109 */ 110 110 111 111 switch ( the_attr->protocol ) { 112 112 case PTHREAD_PRIO_NONE: … … 129 129 130 130 the_mutex = _POSIX_Mutex_Allocate(); 131 131 132 132 if ( !the_mutex ) { 133 133 _Thread_Enable_dispatch(); … … 136 136 137 137 #if defined(RTEMS_MULTIPROCESSING) 138 if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && 138 if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && 139 139 !( _Objects_MP_Allocate_and_open( &_POSIX_Mutex_Information, 0, 140 140 the_mutex->Object.id, FALSE ) ) ) { -
cpukit/posix/src/mutexlock.c
r1b4f2b30 r874297f3 24 24 * 25 25 * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 26 * 26 * 27 27 * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 28 28 */ -
cpukit/posix/src/mutexlocksupp.c
r1b4f2b30 r874297f3 38 38 Objects_Locations location; 39 39 ISR_Level level; 40 40 41 41 the_mutex = _POSIX_Mutex_Get_interrupt_disable( mutex, &location, &level ); 42 42 switch ( location ) { -
cpukit/posix/src/mutexsetprioceiling.c
r1b4f2b30 r874297f3 69 69 _CORE_mutex_Surrender( 70 70 &the_mutex->Mutex, 71 the_mutex->Object.id, 71 the_mutex->Object.id, 72 72 #if defined(RTEMS_MULTIPROCESSING) 73 73 _POSIX_Threads_mutex_MP_support -
cpukit/posix/src/mutextimedlock.c
r1b4f2b30 r874297f3 24 24 * 25 25 * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 26 * 26 * 27 27 * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 28 28 */ … … 33 33 ) 34 34 { 35 return _POSIX_Mutex_Lock_support( 35 return _POSIX_Mutex_Lock_support( 36 36 mutex, 37 37 TRUE, -
cpukit/posix/src/mutextrylock.c
r1b4f2b30 r874297f3 24 24 * 25 25 * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 26 * 26 * 27 27 * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 28 28 */ -
cpukit/posix/src/mutexunlock.c
r1b4f2b30 r874297f3 24 24 * 25 25 * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 26 * 26 * 27 27 * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 28 28 */ … … 35 35 Objects_Locations location; 36 36 CORE_mutex_Status status; 37 37 38 38 the_mutex = _POSIX_Mutex_Get( mutex, &location ); 39 39 switch ( location ) { … … 52 52 status = _CORE_mutex_Surrender( 53 53 &the_mutex->Mutex, 54 the_mutex->Object.id, 54 the_mutex->Object.id, 55 55 #if defined(RTEMS_MULTIPROCESSING) 56 56 _POSIX_Threads_mutex_MP_support -
cpukit/posix/src/nanosleep.c
r1b4f2b30 r874297f3 38 38 39 39 /* 40 * Return EAGAIN if the delay interval is negative. 40 * Return EAGAIN if the delay interval is negative. 41 41 * 42 * NOTE: This behavior is beyond the POSIX specification. 42 * NOTE: This behavior is beyond the POSIX specification. 43 43 * FSU pthreads shares this behavior. 44 44 */ … … 52 52 if ( the_rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) 53 53 rtems_set_errno_and_return_minus_one( EINVAL ); 54 54 55 55 ticks = _POSIX_Timespec_to_interval( the_rqtp ); 56 56 … … 65 65 _Thread_Enable_dispatch(); 66 66 if ( rmtp ) { 67 rmtp->tv_sec = 0; 68 rmtp->tv_nsec = 0; 67 rmtp->tv_sec = 0; 68 rmtp->tv_nsec = 0; 69 69 } 70 70 return 0; 71 71 } 72 72 73 73 _Thread_Disable_dispatch(); 74 74 _Thread_Set_state( … … 88 88 89 89 if ( rmtp ) { 90 ticks -= 90 ticks -= 91 91 _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; 92 92 -
cpukit/posix/src/posixintervaltotimespec.c
r1b4f2b30 r874297f3 23 23 * _POSIX_Interval_to_timespec 24 24 */ 25 25 26 26 void _POSIX_Interval_to_timespec( 27 27 Watchdog_Interval ticks, … … 34 34 35 35 time->tv_sec = usecs / TOD_MICROSECONDS_PER_SECOND; 36 time->tv_nsec = (usecs % TOD_MICROSECONDS_PER_SECOND) * 36 time->tv_nsec = (usecs % TOD_MICROSECONDS_PER_SECOND) * 37 37 TOD_NANOSECONDS_PER_MICROSECOND; 38 38 } -
cpukit/posix/src/posixtimespecsubtract.c
r1b4f2b30 r874297f3 33 33 struct timespec *start = &start_struct; 34 34 uint32_t nsecs_per_sec = TOD_NANOSECONDS_PER_SECOND; 35 35 36 36 if (end->tv_nsec < start->tv_nsec) { 37 37 int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec + 1; … … 39 39 start->tv_sec += seconds; 40 40 } 41 41 42 42 if (end->tv_nsec - start->tv_nsec > nsecs_per_sec) { 43 43 int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec; … … 45 45 start->tv_sec -= seconds; 46 46 } 47 47 48 48 result->tv_sec = end->tv_sec - start->tv_sec; 49 49 result->tv_nsec = end->tv_nsec - start->tv_nsec; -
cpukit/posix/src/posixtimespectointerval.c
r1b4f2b30 r874297f3 30 30 Watchdog_Interval ticks; 31 31 32 ticks = (time->tv_sec * TOD_MICROSECONDS_PER_SECOND) / 32 ticks = (time->tv_sec * TOD_MICROSECONDS_PER_SECOND) / 33 33 _TOD_Microseconds_per_tick; 34 34 35 ticks += (time->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) / 35 ticks += (time->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) / 36 36 _TOD_Microseconds_per_tick; 37 37 -
cpukit/posix/src/psignal.c
r1b4f2b30 r874297f3 108 108 * restart the loop if a signal handler was invoked. 109 109 * 110 * The first thing done is to check there are any signals to be 110 * The first thing done is to check there are any signals to be 111 111 * processed at all. No point in doing this loop otherwise. 112 112 */ … … 114 114 restart: 115 115 _ISR_Disable( level ); 116 if ( !(~api->signals_blocked & 116 if ( !(~api->signals_blocked & 117 117 (api->signals_pending | _POSIX_signals_Pending)) ) { 118 118 _ISR_Enable( level ); … … 137 137 if ( _POSIX_signals_Check_signal( api, signo, FALSE ) ) 138 138 goto restart; 139 139 140 140 if ( _POSIX_signals_Check_signal( api, signo, TRUE ) ) 141 141 goto restart; … … 164 164 ); 165 165 166 memcpy( 166 memcpy( 167 167 _POSIX_signals_Vectors, 168 168 _POSIX_signals_Default_vectors, 169 169 sizeof( _POSIX_signals_Vectors ) 170 170 ); 171 171 172 172 /* 173 173 * Initialize the set of pending signals for the entire process … … 179 179 * Initialize the queue we use to block for signals 180 180 */ 181 181 182 182 _Thread_queue_Initialize( 183 183 &_POSIX_signals_Wait_queue, … … 189 189 /* XXX status codes */ 190 190 191 /* 191 /* 192 192 * Allocate the siginfo pools. 193 193 */ -
cpukit/posix/src/psignalchecksignal.c
r1b4f2b30 r874297f3 46 46 * Since we made a union of these, only one test is necessary but this is 47 47 * safer. 48 */ 48 */ 49 49 50 50 assert( _POSIX_signals_Vectors[ signo ].sa_handler || 51 51 _POSIX_signals_Vectors[ signo ].sa_sigaction ); 52 52 53 53 /* 54 54 * Just to prevent sending a signal which is currently being ignored. … … 87 87 * Restore the previous set of blocked signals 88 88 */ 89 89 90 90 api->signals_blocked = saved_signals_blocked; 91 91 -
cpukit/posix/src/psignalclearsignals.c
r1b4f2b30 r874297f3 28 28 * _POSIX_signals_Clear_signals 29 29 */ 30 30 31 31 boolean _POSIX_signals_Clear_signals( 32 32 POSIX_API_Control *api, … … 42 42 boolean do_callout; 43 43 POSIX_signals_Siginfo_node *psiginfo; 44 44 45 45 mask = signo_to_mask( signo ); 46 46 47 47 do_callout = FALSE; 48 48 49 49 /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK 50 50 * insures that no signals are blocked and all are checked. … … 58 58 /* XXX this is not right for siginfo type signals yet */ 59 59 /* XXX since they can't be cleared the same way */ 60 60 61 61 _ISR_Disable( level ); 62 62 if ( is_global ) { … … 86 86 } 87 87 _ISR_Enable( level ); 88 return do_callout; 88 return do_callout; 89 89 } -
cpukit/posix/src/psignalsetprocesssignals.c
r1b4f2b30 r874297f3 28 28 * _POSIX_signals_Set_process_signals 29 29 */ 30 30 31 31 void _POSIX_signals_Set_process_signals( 32 32 sigset_t mask … … 34 34 { 35 35 ISR_Level level; 36 36 37 37 _ISR_Disable( level ); 38 38 if ( !_POSIX_signals_Pending ) -
cpukit/posix/src/psignalunblockthread.c
r1b4f2b30 r874297f3 31 31 32 32 /* XXX this routine could probably be cleaned up */ 33 boolean _POSIX_signals_Unblock_thread( 33 boolean _POSIX_signals_Unblock_thread( 34 34 Thread_Control *the_thread, 35 35 int signo, … … 63 63 *the_info = *info; 64 64 } 65 65 66 66 _Thread_queue_Extract_with_proxy( the_thread ); 67 67 return TRUE; -
cpukit/posix/src/pthread.c
r1b4f2b30 r874297f3 30 30 * The default pthreads attributes structure. 31 31 * 32 * NOTE: Be careful .. if the default attribute set changes, 32 * NOTE: Be careful .. if the default attribute set changes, 33 33 * _POSIX_Threads_Initialize_user_threads will need to be examined. 34 34 * 35 35 */ 36 36 37 37 const pthread_attr_t _POSIX_Threads_Default_attributes = { 38 38 TRUE, /* is_initialized */ … … 77 77 78 78 the_thread->cpu_time_budget = ticks; 79 79 80 80 new_priority = _POSIX_Priority_To_core( api->ss_high_priority ); 81 81 the_thread->real_priority = new_priority; … … 129 129 * XXX 130 130 */ 131 131 132 132 boolean _POSIX_Threads_Create_extension( 133 133 Thread_Control *executing, … … 137 137 POSIX_API_Control *api; 138 138 POSIX_API_Control *executing_api; 139 139 140 140 api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); 141 141 142 142 if ( !api ) 143 143 return FALSE; 144 144 145 145 created->API_Extensions[ THREAD_API_POSIX ] = api; 146 146 147 147 /* XXX check all fields are touched */ 148 148 api->Attributes = _POSIX_Threads_Default_attributes; … … 150 150 api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy; 151 151 api->schedparam = _POSIX_Threads_Default_attributes.schedparam; 152 api->schedparam.sched_priority = 152 api->schedparam.sched_priority = 153 153 _POSIX_Priority_From_core( created->current_priority ); 154 155 /* 154 155 /* 156 156 * POSIX 1003.1 1996, 18.2.2.2 157 157 */ … … 181 181 0 182 182 ); 183 183 184 184 _Watchdog_Initialize( 185 185 &api->Sporadic_timer, … … 196 196 * _POSIX_Threads_Delete_extension 197 197 */ 198 198 199 199 User_extensions_routine _POSIX_Threads_Delete_extension( 200 200 Thread_Control *executing, … … 207 207 208 208 api = deleted->API_Extensions[ THREAD_API_POSIX ]; 209 209 210 210 /* 211 211 * Run the POSIX cancellation handlers … … 217 217 * Wakeup all the tasks which joined with this one 218 218 */ 219 219 220 220 value_ptr = (void **) deleted->Wait.return_argument; 221 221 222 222 while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 223 223 *(void **)the_thread->Wait.return_argument = value_ptr; 224 224 225 225 if ( api->schedpolicy == SCHED_SPORADIC ) 226 226 (void) _Watchdog_Remove( &api->Sporadic_timer ); … … 235 235 * _POSIX_Threads_Exitted_extension 236 236 */ 237 237 238 238 User_extensions_routine _POSIX_Threads_Exitted_extension( 239 239 Thread_Control *executing … … 254 254 * Output parameters: NONE 255 255 */ 256 256 257 257 void _POSIX_Threads_Initialize_user_threads( void ) 258 258 { … … 263 263 pthread_t thread_id; 264 264 pthread_attr_t attr; 265 265 266 266 user_threads = _POSIX_Threads_User_initialization_threads; 267 267 maximum = _POSIX_Threads_Number_of_initialization_threads; … … 269 269 if ( !user_threads || maximum == 0 ) 270 270 return; 271 271 272 272 /* 273 273 * Be careful .. if the default attribute set changes, this may need to. 274 274 * 275 275 * Setting the attributes explicitly is critical, since we don't want 276 * to inherit the idle tasks attributes. 276 * to inherit the idle tasks attributes. 277 277 */ 278 278 … … 280 280 status = pthread_attr_init( &attr ); 281 281 assert( !status ); 282 282 283 283 status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 284 284 assert( !status ); … … 308 308 _POSIX_signals_Post_switch_extension, /* post switch */ 309 309 }; 310 310 311 311 User_extensions_Control _POSIX_Threads_User_extensions = { 312 312 { NULL, NULL }, … … 322 322 } 323 323 }; 324 324 325 325 /*PAGE 326 326 * … … 334 334 * Output parameters: NONE 335 335 */ 336 336 337 337 void _POSIX_Threads_Manager_initialization( 338 338 uint32_t maximum_pthreads, 339 339 uint32_t number_of_initialization_threads, 340 340 posix_initialization_threads_table *user_threads 341 342 ) 343 { 344 _POSIX_Threads_Number_of_initialization_threads = 341 342 ) 343 { 344 _POSIX_Threads_Number_of_initialization_threads = 345 345 number_of_initialization_threads; 346 346 _POSIX_Threads_User_initialization_threads = user_threads; … … 374 374 * Add all the extensions for this API 375 375 */ 376 376 377 377 _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions ); 378 378 379 379 _API_extensions_Add( &_POSIX_Threads_API_extensions ); 380 380 381 381 382 382 /* 383 383 * If we supported MP, then here we would ... 384 384 * Register the MP Process Packet routine. 385 385 */ 386 387 } 386 387 } -
cpukit/posix/src/pthreadatfork.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * pthread_atfork() - POSIX 1003.1b 3.1.3 3 3 * -
cpukit/posix/src/pthreadcreate.c
r1b4f2b30 r874297f3 66 66 * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread 67 67 * inherits scheduling attributes from the creating thread. If it is 68 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the 68 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the 69 69 * attributes structure. 70 70 */ … … 75 75 schedpolicy = api->schedpolicy; 76 76 schedparam = api->schedparam; 77 break; 77 break; 78 78 79 79 case PTHREAD_EXPLICIT_SCHED: 80 80 schedpolicy = the_attr->schedpolicy; 81 81 schedparam = the_attr->schedparam; 82 break; 82 break; 83 83 84 84 default: … … 87 87 88 88 /* 89 * Check the contentionscope since rtems only supports PROCESS wide 89 * Check the contentionscope since rtems only supports PROCESS wide 90 90 * contention (i.e. no system wide contention). 91 91 */ … … 100 100 if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 101 101 return EINVAL; 102 102 103 103 core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 104 104 105 105 /* 106 106 * Set the core scheduling policy information. … … 114 114 budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 115 115 break; 116 116 117 117 case SCHED_FIFO: 118 118 budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; … … 126 126 budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 127 127 budget_callout = _POSIX_Threads_Sporadic_budget_callout; 128 128 129 129 if ( _POSIX_Timespec_to_interval( &schedparam.ss_replenish_period ) < 130 130 _POSIX_Timespec_to_interval( &schedparam.ss_initial_budget ) ) … … 141 141 142 142 /* 143 * Currently all POSIX threads are floating point if the hardware 143 * Currently all POSIX threads are floating point if the hardware 144 144 * supports it. 145 145 */ … … 155 155 * Disable dispatch for protection 156 156 */ 157 157 158 158 _Thread_Disable_dispatch(); 159 159 160 160 /* 161 161 * Allocate the thread control block. … … 174 174 * Initialize the core thread for this task. 175 175 */ 176 176 177 177 status = _Thread_Initialize( 178 178 &_POSIX_Threads_Information, … … 188 188 NULL /* posix threads don't have a name */ 189 189 ); 190 190 191 191 if ( !status ) { 192 192 _POSIX_Threads_Free( the_thread ); … … 199 199 */ 200 200 201 201 202 202 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 203 203 -
cpukit/posix/src/pthreadkill.c
r1b4f2b30 r874297f3 38 38 rtems_set_errno_and_return_minus_one( EINVAL ); 39 39 40 /* commented out when posix timers added 40 /* commented out when posix timers added 41 41 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) 42 42 rtems_set_errno_and_return_minus_one( ENOSYS ); -
cpukit/posix/src/pthreadsetschedparam.c
r1b4f2b30 r874297f3 1 1 /* 2 * 13.5.2 Dynamic Thread Scheduling Parameters Access, 2 * 13.5.2 Dynamic Thread Scheduling Parameters Access, 3 3 * P1003.1c/Draft 10, p. 124 4 4 * … … 36 36 Thread_CPU_budget_algorithm_callout budget_callout; 37 37 Objects_Locations location; 38 38 39 39 /* 40 40 * Check all the parameters … … 54 54 budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 55 55 break; 56 56 57 57 case SCHED_FIFO: 58 58 budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 59 59 break; 60 60 61 61 case SCHED_RR: 62 62 budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 63 63 break; 64 64 65 65 case SCHED_SPORADIC: 66 66 budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 67 67 budget_callout = _POSIX_Threads_Sporadic_budget_callout; 68 68 69 69 if ( _POSIX_Timespec_to_interval( ¶m->ss_replenish_period ) < 70 70 _POSIX_Timespec_to_interval( ¶m->ss_initial_budget ) ) 71 71 return EINVAL; 72 72 73 73 if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) ) 74 74 return EINVAL; 75 75 76 76 break; 77 77 78 78 default: 79 79 return EINVAL; … … 115 115 ); 116 116 break; 117 117 118 118 case SCHED_SPORADIC: 119 119 api->ss_high_priority = api->schedparam.sched_priority; -
cpukit/posix/src/pthreadsigmask.c
r1b4f2b30 r874297f3 42 42 if ( oset ) 43 43 *oset = api->signals_blocked; 44 44 45 45 if ( !set ) 46 46 return 0; … … 64 64 /* XXX evaluate the new set */ 65 65 66 if ( ~api->signals_blocked & 66 if ( ~api->signals_blocked & 67 67 (api->signals_pending | _POSIX_signals_Pending) ) { 68 68 _Thread_Executing->do_post_task_switch_extension = TRUE; -
cpukit/posix/src/ptimer.c
r1b4f2b30 r874297f3 6 6 #include "config.h" 7 7 #endif 8 8 9 9 #include <assert.h> 10 10 #include <time.h> … … 74 74 * _POSIX_Timer_Manager_initialization 75 75 * 76 * Description: Initialize the internal structure in which the data of all 76 * Description: Initialize the internal structure in which the data of all 77 77 * the timers are stored 78 78 * ***************************************************************************/ … … 89 89 max_timers * sizeof(POSIX_Timer_Control) ); 90 90 91 /* 91 /* 92 92 * Initialize all the timers 93 93 */ -
cpukit/posix/src/ptimer1.c
r1b4f2b30 r874297f3 6 6 #include "config.h" 7 7 #endif 8 8 9 9 #include <assert.h> 10 10 #include <time.h> … … 40 40 /*****************************/ 41 41 42 /* ************ 42 /* ************ 43 43 * Constants 44 * ************/ 44 * ************/ 45 45 46 46 /* … … 49 49 50 50 /* 51 * Data for the signals 51 * Data for the signals 52 52 */ 53 53 … … 59 59 * TIMER_INITIALIZE_S 60 60 * 61 * Description: Initialize the data of a timer 61 * Description: Initialize the data of a timer 62 62 * ***************************************************************************/ 63 63 … … 67 67 * _POSIX_Timer_Manager_initialization 68 68 * 69 * Description: Initialize the internal structure in which the data of all 69 * Description: Initialize the internal structure in which the data of all 70 70 * the timers are stored 71 71 * ***************************************************************************/ … … 74 74 75 75 /* *************************************************************************** 76 * FIRST_FREE_POSITION_F 76 * FIRST_FREE_POSITION_F 77 77 * 78 78 * Description: Returns the first free position in the table of timers. 79 * If there is not a free position, it returns NO_MORE_TIMERS_C 79 * If there is not a free position, it returns NO_MORE_TIMERS_C 80 80 * ***************************************************************************/ 81 81 … … 89 89 } 90 90 } 91 91 92 92 /* The function reaches this point only if all the position are occupied */ 93 93 … … 96 96 97 97 /* *************************************************************************** 98 * TIMER_POSITION_F 98 * TIMER_POSITION_F 99 99 * 100 100 * Description: Returns the position in the table of timers in which the … … 126 126 127 127 /* *************************************************************************** 128 * COPY_ITIMERSPEC_S 128 * COPY_ITIMERSPEC_S 129 129 * 130 * Description: Does a copy of a variable of type struct itimerspec 130 * Description: Does a copy of a variable of type struct itimerspec 131 131 * ***************************************************************************/ 132 132 133 void COPY_ITIMERSPEC_S ( const struct itimerspec *source, 133 void COPY_ITIMERSPEC_S ( const struct itimerspec *source, 134 134 struct itimerspec *target ) 135 135 { … … 143 143 144 144 /* *************************************************************************** 145 * ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S 145 * ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S 146 146 * 147 * Description: This function converts the data of a structure itimerspec 148 * into structure rtems_time_of_day 147 * Description: This function converts the data of a structure itimerspec 148 * into structure rtems_time_of_day 149 149 * ***************************************************************************/ 150 150 151 void ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S 151 void ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S 152 152 ( const struct itimerspec *itimer, rtems_time_of_day *rtems_time ) 153 153 { … … 155 155 156 156 /* The leap years and the months with 28, 29 or 31 days have not been 157 * considerated. It will be made in the future */ 157 * considerated. It will be made in the future */ 158 158 159 159 seconds = itimer->it_value.tv_sec; … … 183 183 184 184 /* *************************************************************************** 185 * FIRE_TIMER_S 185 * FIRE_TIMER_S 186 186 * 187 187 * Description: This is the operation that is ran when a timer expires … … 189 189 190 190 191 rtems_timer_service_routine FIRE_TIMER_S (rtems_id timer, void *data) 192 { 193 int timer_pos; /* Position in the table of the timer that 191 rtems_timer_service_routine FIRE_TIMER_S (rtems_id timer, void *data) 192 { 193 int timer_pos; /* Position in the table of the timer that 194 194 * has expirated */ 195 195 rtems_status_code return_v; /* Return value of rtems_timer_fire_after */ 196 196 int sig_number; /* Number of the signal to send */ 197 197 198 199 /* The position of the table of timers that contains the data of the 198 199 /* The position of the table of timers that contains the data of the 200 200 * expired timer will be stored in "timer_pos". In theory a timer can not 201 * expire if it has not been created or has been deleted */ 201 * expire if it has not been created or has been deleted */ 202 202 203 203 timer_pos = TIMER_POSITION_F(timer); … … 212 212 /* The timer must be reprogrammed */ 213 213 214 return_v = rtems_timer_fire_after ( timer, 215 timer_struct[timer_pos].ticks, 216 FIRE_TIMER_S, 214 return_v = rtems_timer_fire_after ( timer, 215 timer_struct[timer_pos].ticks, 216 FIRE_TIMER_S, 217 217 NULL ); 218 218 219 /* Stores the time when the timer was started again */ 219 /* Stores the time when the timer was started again */ 220 220 221 221 timer_struct[timer_pos].time = _TOD_Current; 222 222 223 223 /* The state has not to be actualized, because nothing modifies it */ 224 224 … … 227 227 } else { 228 228 /* Indicates that the timer is stopped */ 229 229 230 230 timer_struct[timer_pos].state = STATE_CREATE_STOP_C; 231 231 232 232 } 233 233 234 /* 234 /* 235 235 * The sending of the signal to the process running the handling function 236 236 * specified for that signal is simulated … … 242 242 timer_struct[timer_pos].inf.sigev_signo ) ) { 243 243 /* XXX error handling */ 244 } 244 } 245 245 246 246 /* … … 253 253 } 254 254 255 /* ********************************************************************* 255 /* ********************************************************************* 256 256 * 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264 257 257 * ********************************************************************/ … … 272 272 int timer_pos; /* Position in the table of timers */ 273 273 274 /* 274 /* 275 275 * The data of the structure evp are checked in order to verify if they 276 * are coherent. 276 * are coherent. 277 277 */ 278 278 279 279 if (evp != NULL) { 280 280 /* The structure has data */ 281 if ( ( evp->sigev_notify != SIGEV_NONE ) && 281 if ( ( evp->sigev_notify != SIGEV_NONE ) && 282 282 ( evp->sigev_notify != SIGEV_SIGNAL ) ) { 283 283 /* The value of the field sigev_notify is not valid */ … … 285 285 } 286 286 } 287 287 288 288 /* 289 289 * A timer is created using the primitive rtems_timer_create … … 293 293 294 294 switch (return_v) { 295 case RTEMS_SUCCESSFUL : 295 case RTEMS_SUCCESSFUL : 296 296 297 297 /* 298 298 * The timer has been created properly 299 299 */ 300 300 301 301 /* Obtains the first free position in the table of timers */ 302 302 … … 304 304 305 305 if ( timer_pos == NO_MORE_TIMERS_C ) { 306 /* There is not position for another timers in spite of RTEMS 306 /* There is not position for another timers in spite of RTEMS 307 307 * supports it. It will necessaty to increase the structure used */ 308 308 … … 320 320 /* NEW VERSION*/ 321 321 timer_struct[timer_pos].thread_id = pthread_self (); 322 322 323 323 if ( evp != NULL ) { 324 324 timer_struct[timer_pos].inf.sigev_notify = evp->sigev_notify; … … 345 345 /* There has been created too much timers for the same process */ 346 346 rtems_set_errno_and_return_minus_one( EAGAIN ); 347 347 348 348 default : 349 349 … … 351 351 * Does nothing. It only returns the error without assigning a value 352 352 * to errno. In theory, it can not happen because the call to 353 * rtems_timer_create can not return other different value. 353 * rtems_timer_create can not return other different value. 354 354 */ 355 355 … … 357 357 } 358 358 359 /* 360 * The next sentence is used to avoid singular situations 359 /* 360 * The next sentence is used to avoid singular situations 361 361 */ 362 362 … … 372 372 ) 373 373 { 374 374 375 375 /* 376 376 * IDEA: This function must probably stop the timer first and then delete it … … 378 378 * It will have to do a call to rtems_timer_cancel and then another 379 379 * call to rtems_timer_delete. 380 * The call to rtems_timer_delete will be probably unnecessary, 380 * The call to rtems_timer_delete will be probably unnecessary, 381 381 * because rtems_timer_delete stops the timer before deleting it. 382 382 */ … … 430 430 int timer_pos; /* Position of the timer in the table */ 431 431 rtems_time_of_day rtems_time; /* Time in RTEMS */ 432 432 433 433 434 434 /* First the position in the table of timers is obtained */ … … 449 449 450 450 /* If the function reaches this point, then it will be necessary to do 451 * something with the structure of times of the timer: to stop, start 451 * something with the structure of times of the timer: to stop, start 452 452 * or start it again */ 453 453 … … 469 469 470 470 /* Indicates that the timer is created and stopped */ 471 471 472 472 timer_struct[timer_pos].state = STATE_CREATE_STOP_C; 473 473 … … 477 477 } 478 478 479 /* 479 /* 480 480 * If the function reaches this point, then the timer will have to be 481 * initialized with new values: to start it or start it again 481 * initialized with new values: to start it or start it again 482 482 */ 483 483 484 484 /* First, it verifies if the structure "value" is correct */ 485 485 … … 494 494 * ticks, to use it in the calls to RTEMS */ 495 495 496 /* It is also necessary to take in account if the time is absolute 496 /* It is also necessary to take in account if the time is absolute 497 497 * or relative */ 498 498 … … 514 514 /* The timer has been started and is running */ 515 515 516 /* Actualizes the data of the structure and 516 /* Actualizes the data of the structure and 517 517 * returns the old ones in "ovalue" */ 518 518 … … 521 521 522 522 timer_struct[timer_pos].timer_data = *value; 523 523 524 524 /* It indicates that the time is running */ 525 525 … … 550 550 default: break; 551 551 552 552 553 553 } 554 554 555 555 break; 556 556 … … 562 562 /* First, it converts from seconds and nanoseconds to ticks */ 563 563 564 /* The form in which this operation is done can produce a lost 564 /* The form in which this operation is done can produce a lost 565 565 * of precision of 1 second */ 566 566 567 567 /* This is the process to convert from nanoseconds to ticks 568 568 * 569 * There is a tick every 10 miliseconds, then the nanoseconds are 569 * There is a tick every 10 miliseconds, then the nanoseconds are 570 570 * divided between 10**7. The result of this operation will be the 571 * number of ticks 571 * number of ticks 572 572 */ 573 573 574 timer_struct[timer_pos].ticks = 574 timer_struct[timer_pos].ticks = 575 575 ( SEC_TO_TICKS_C * value->it_value.tv_sec ) + 576 576 ( value->it_value.tv_nsec / (NSEC_PER_SEC_C / SEC_TO_TICKS_C)); 577 577 578 return_v = rtems_timer_fire_after ( timerid, 579 timer_struct[timer_pos].ticks, 580 FIRE_TIMER_S, 578 return_v = rtems_timer_fire_after ( timerid, 579 timer_struct[timer_pos].ticks, 580 FIRE_TIMER_S, 581 581 NULL ); 582 582 … … 586 586 /* The timer has been started and is running */ 587 587 588 /* Actualizes the data of the structure and 588 /* Actualizes the data of the structure and 589 589 * returns the old ones in "ovalue" */ 590 590 … … 593 593 594 594 timer_struct[timer_pos].timer_data = *value; 595 595 596 596 /* It indicates that the time is running */ 597 597 … … 601 601 602 602 timer_struct[timer_pos].time = _TOD_Current; 603 603 604 604 return 0; 605 605 … … 608 608 case RTEMS_INVALID_ID: 609 609 610 /* The timer identifier is not correct. In theory, this 611 * situation can not occur, but the solution is easy */ 610 /* The timer identifier is not correct. In theory, this 611 * situation can not occur, but the solution is easy */ 612 612 613 613 rtems_set_errno_and_return_minus_one( EINVAL ); … … 621 621 622 622 /* 623 * I do not know if errno must be actualized 623 * I do not know if errno must be actualized 624 624 * 625 625 * errno = EINVAL; … … 628 628 rtems_set_errno_and_return_minus_one( EINVAL ); 629 629 break; 630 630 631 631 default: break; 632 632 } … … 636 636 default: break; 637 637 638 /* It does nothing, although it will be probably necessary to 638 /* It does nothing, although it will be probably necessary to 639 639 * return an error */ 640 640 } … … 659 659 { 660 660 661 /* 661 /* 662 662 * IDEA: This function does not use functions of RTEMS to the handle 663 663 * of timers. It uses some functions for managing the time. … … 665 665 * A possible form to do this is the following: 666 666 * 667 * - When a timer is initialized, the value of the time in 667 * - When a timer is initialized, the value of the time in 668 668 * that moment is stored. 669 669 * - When this function is called, it returns the difference 670 670 * between the current time and the initialization time. 671 671 */ 672 672 673 673 rtems_time_of_day current_time; 674 674 int timer_pos; … … 678 678 uint32_t ticks; 679 679 uint32_t nanosec; 680 680 681 681 682 682 /* Reads the current time */ … … 687 687 688 688 if ( timer_pos == BAD_TIMER_C ) { 689 /* The timer identifier is erroneus */ 689 /* The timer identifier is erroneus */ 690 690 rtems_set_errno_and_return_minus_one( EINVAL ); 691 691 } … … 702 702 minutes = current_time.minute - timer_struct[timer_pos].time.minute; 703 703 } 704 704 705 705 if ( current_time.second < timer_struct[timer_pos].time.second ) { 706 706 seconds = 60 - timer_struct[timer_pos].time.second + current_time.second; 707 707 minutes--; 708 708 } else { 709 seconds = current_time.second - timer_struct[timer_pos].time.second; 709 seconds = current_time.second - timer_struct[timer_pos].time.second; 710 710 } 711 711 … … 714 714 seconds--; 715 715 } else { 716 ticks = current_time.ticks - timer_struct[timer_pos].time.ticks; 716 ticks = current_time.ticks - timer_struct[timer_pos].time.ticks; 717 717 } 718 718 … … 720 720 seconds = hours * 60 * 60 + 721 721 minutes * 60 + 722 seconds; 722 seconds; 723 723 724 724 nanosec = ticks * 10 * /* msec */ … … 726 726 1000; /* nanosec */ 727 727 728 728 729 729 /* Calculates the time left before the timer finishes */ 730 731 value->it_value.tv_sec = 730 731 value->it_value.tv_sec = 732 732 timer_struct[timer_pos].timer_data.it_value.tv_sec - seconds; 733 734 value->it_value.tv_nsec = 733 734 value->it_value.tv_nsec = 735 735 timer_struct[timer_pos].timer_data.it_value.tv_nsec - nanosec; 736 736 737 737 738 value->it_interval.tv_sec = 738 value->it_interval.tv_sec = 739 739 timer_struct[timer_pos].timer_data.it_interval.tv_sec; 740 value->it_interval.tv_nsec = 740 value->it_interval.tv_nsec = 741 741 timer_struct[timer_pos].timer_data.it_interval.tv_nsec; 742 742 743 743 744 744 return 0; … … 761 761 /* 762 762 * IDEA: This function must count the times the timer expires. 763 * 763 * 764 764 * The expiration of a timer must increase by one a counter. 765 * After the signal handler associated to the timer finishs 765 * After the signal handler associated to the timer finishs 766 766 * its execution, FIRE_TIMER_S will have to set this counter to 0. 767 767 */ -
cpukit/posix/src/sched.c
r1b4f2b30 r874297f3 47 47 /*PAGE 48 48 * 49 * 13.3.3 Set Scheduling Policy and Scheduling Parameters, 49 * 13.3.3 Set Scheduling Policy and Scheduling Parameters, 50 50 * P1003.1b-1993, p. 254 51 51 */ … … 87 87 case SCHED_SPORADIC: 88 88 break; 89 89 90 90 default: 91 91 rtems_set_errno_and_return_minus_one( EINVAL ); … … 110 110 case SCHED_SPORADIC: 111 111 break; 112 112 113 113 default: 114 114 rtems_set_errno_and_return_minus_one( EINVAL ); -
cpukit/posix/src/semaphore.c
r1b4f2b30 r874297f3 32 32 * Output parameters: NONE 33 33 */ 34 34 35 35 void _POSIX_Semaphore_Manager_initialization( 36 36 uint32_t maximum_semaphores -
cpukit/posix/src/semaphorecreatesupp.c
r1b4f2b30 r874297f3 42 42 43 43 _Thread_Disable_dispatch(); 44 44 45 45 /* Sharing semaphores among processes is not currently supported */ 46 46 if (pshared != 0) { … … 50 50 51 51 if ( name ) { 52 if( strlen(name) > PATH_MAX ) { 52 if( strlen(name) > PATH_MAX ) { 53 53 _Thread_Enable_dispatch(); 54 54 rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); … … 57 57 58 58 the_semaphore = _POSIX_Semaphore_Allocate(); 59 59 60 60 if ( !the_semaphore ) { 61 61 _Thread_Enable_dispatch(); 62 62 rtems_set_errno_and_return_minus_one( ENOSPC ); 63 63 } 64 64 65 65 #if defined(RTEMS_MULTIPROCESSING) 66 66 if ( pshared == PTHREAD_PROCESS_SHARED && … … 72 72 } 73 73 #endif 74 74 75 75 the_semaphore->process_shared = pshared; 76 76 … … 80 80 the_semaphore->linked = TRUE; 81 81 } 82 else 82 else 83 83 the_semaphore->named = FALSE; 84 84 85 85 the_sem_attr = &the_semaphore->Semaphore.Attributes; 86 86 87 87 /* 88 * POSIX does not appear to specify what the discipline for 89 * blocking tasks on this semaphore should be. It could somehow 88 * POSIX does not appear to specify what the discipline for 89 * blocking tasks on this semaphore should be. It could somehow 90 90 * be derived from the current scheduling policy. One 91 * thing is certain, no matter what we decide, it won't be 91 * thing is certain, no matter what we decide, it won't be 92 92 * the same as all other POSIX implementations. :) 93 93 */ … … 106 106 * Make the semaphore available for use. 107 107 */ 108 108 109 109 _Objects_Open( 110 110 &_POSIX_Semaphore_Information, … … 112 112 (char *) name 113 113 ); 114 114 115 115 *the_sem = the_semaphore; 116 116 117 117 #if defined(RTEMS_MULTIPROCESSING) 118 118 if ( pshared == PTHREAD_PROCESS_SHARED ) … … 124 124 ); 125 125 #endif 126 126 127 127 _Thread_Enable_dispatch(); 128 128 return 0; -
cpukit/posix/src/semaphoredeletesupp.c
r1b4f2b30 r874297f3 32 32 if ( !the_semaphore->linked && !the_semaphore->open_count ) { 33 33 _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 34 34 35 35 _CORE_semaphore_Flush( 36 36 &the_semaphore->Semaphore, -
cpukit/posix/src/semaphorenametoid.c
r1b4f2b30 r874297f3 42 42 return EINVAL; 43 43 44 status = _Objects_Name_to_id( 44 status = _Objects_Name_to_id( 45 45 &_POSIX_Semaphore_Information, (char *)name, 0, (Objects_Id*)id ); 46 46 -
cpukit/posix/src/semaphorewaitsupp.c
r1b4f2b30 r874297f3 34 34 register POSIX_Semaphore_Control *the_semaphore; 35 35 Objects_Locations location; 36 36 37 37 the_semaphore = _POSIX_Semaphore_Get( sem, &location ); 38 38 switch ( location ) { -
cpukit/posix/src/semclose.c
r1b4f2b30 r874297f3 25 25 * 26 26 * sem_close 27 * 27 * 28 28 * Routine to close a semaphore that has been opened or initialized. 29 * 29 * 30 30 * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224 31 31 */ … … 37 37 register POSIX_Semaphore_Control *the_semaphore; 38 38 Objects_Locations location; 39 39 40 40 the_semaphore = _POSIX_Semaphore_Get( sem, &location ); 41 41 switch ( location ) { -
cpukit/posix/src/semdestroy.c
r1b4f2b30 r874297f3 32 32 register POSIX_Semaphore_Control *the_semaphore; 33 33 Objects_Locations location; 34 34 35 35 the_semaphore = _POSIX_Semaphore_Get( sem, &location ); 36 36 switch ( location ) { … … 50 50 rtems_set_errno_and_return_minus_one( EINVAL ); 51 51 } 52 52 53 53 _POSIX_Semaphore_Delete( the_semaphore ); 54 54 _Thread_Enable_dispatch(); -
cpukit/posix/src/semgetvalue.c
r1b4f2b30 r874297f3 33 33 register POSIX_Semaphore_Control *the_semaphore; 34 34 Objects_Locations location; 35 35 36 36 the_semaphore = _POSIX_Semaphore_Get( sem, &location ); 37 37 switch ( location ) { -
cpukit/posix/src/seminit.c
r1b4f2b30 r874297f3 37 37 if ( !sem ) 38 38 rtems_set_errno_and_return_minus_one( EINVAL ); 39 39 40 40 status = _POSIX_Semaphore_Create_support( 41 41 NULL, … … 44 44 &the_semaphore 45 45 ); 46 46 47 47 if ( status != -1 ) 48 48 *sem = the_semaphore->Object.id; -
cpukit/posix/src/semopen.c
r1b4f2b30 r874297f3 24 24 * 25 25 * sem_open 26 * 26 * 27 27 * Opens a named semaphore. Used in conjunction with the sem_close 28 28 * and sem_unlink commands. … … 30 30 * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221 31 31 * 32 * NOTE: When oflag is O_CREAT, then optional third and fourth 32 * NOTE: When oflag is O_CREAT, then optional third and fourth 33 33 * parameters must be present. 34 34 */ … … 49 49 POSIX_Semaphore_Control *the_semaphore; 50 50 Objects_Locations location; 51 51 52 52 _Thread_Disable_dispatch(); 53 53 … … 60 60 61 61 status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 62 62 63 63 /* 64 64 * If the name to id translation worked, then the semaphore exists … … 79 79 rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 80 80 } 81 } else { 81 } else { 82 82 83 83 /* … … 96 96 return (sem_t *)&the_semaphore->Object.id; 97 97 98 } 99 100 /* 98 } 99 100 /* 101 101 * At this point, the semaphore does not exist and everything has been 102 102 * checked. We should go ahead and create a semaphore. … … 109 109 &the_semaphore 110 110 ); 111 111 112 112 /* 113 113 * errno was set by Create_support, so don't set it again. -
cpukit/posix/src/sempost.c
r1b4f2b30 r874297f3 32 32 register POSIX_Semaphore_Control *the_semaphore; 33 33 Objects_Locations location; 34 34 35 35 the_semaphore = _POSIX_Semaphore_Get( sem, &location ); 36 36 switch ( location ) { -
cpukit/posix/src/semunlink.c
r1b4f2b30 r874297f3 24 24 * 25 25 * sem_unlink 26 * 26 * 27 27 * Unlinks a named semaphore, sem_close must also be called to remove 28 28 * the semaphore. … … 38 38 register POSIX_Semaphore_Control *the_semaphore; 39 39 sem_t the_semaphore_id; 40 40 41 41 _Thread_Disable_dispatch(); 42 42 … … 60 60 _Objects_Get_index( the_semaphore_id ) 61 61 ); 62 62 63 63 #if defined(RTEMS_MULTIPROCESSING) 64 64 if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) { -
cpukit/posix/src/setcancelstate.c
r1b4f2b30 r874297f3 24 24 */ 25 25 26 int pthread_setcancelstate( 26 int pthread_setcancelstate( 27 27 int state, 28 28 int *oldstate … … 37 37 */ 38 38 39 if ( _ISR_Is_in_progress() ) 39 if ( _ISR_Is_in_progress() ) 40 40 return EPROTO; 41 41 … … 47 47 48 48 thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 49 49 50 50 _Thread_Disable_dispatch(); 51 51 *oldstate = thread_support->cancelability_state; 52 52 thread_support->cancelability_state = state; 53 54 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 53 54 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 55 55 thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 56 56 thread_support->cancelation_requested ) 57 57 _POSIX_Threads_cancel_run( _Thread_Executing ); 58 58 _Thread_Enable_dispatch(); 59 59 60 60 return 0; 61 61 } -
cpukit/posix/src/setcanceltype.c
r1b4f2b30 r874297f3 30 30 { 31 31 POSIX_API_Control *thread_support; 32 32 33 33 /* 34 34 * Don't even think about deleting a resource from an ISR. … … 37 37 */ 38 38 39 if ( _ISR_Is_in_progress() ) 39 if ( _ISR_Is_in_progress() ) 40 40 return EPROTO; 41 41 42 42 if ( !oldtype ) 43 43 return EINVAL; 44 44 45 45 if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS ) 46 46 return EINVAL; 47 47 48 48 thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 49 49 … … 52 52 thread_support->cancelability_type = type; 53 53 54 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 54 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 55 55 thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 56 56 thread_support->cancelation_requested ) -
cpukit/posix/src/sigaction.c
r1b4f2b30 r874297f3 48 48 if ( !is_valid_signo(sig) ) 49 49 rtems_set_errno_and_return_minus_one( EINVAL ); 50 51 /* 50 51 /* 52 52 * Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references. 53 53 * … … 58 58 if ( sig == SIGKILL ) 59 59 rtems_set_errno_and_return_minus_one( EINVAL ); 60 60 61 61 /* 62 62 * Evaluate the new action structure and set the global signal vector … … 84 84 * No need to evaluate or dispatch because: 85 85 * 86 * + If we were ignoring the signal before, none could be pending 86 * + If we were ignoring the signal before, none could be pending 87 87 * now (signals not posted when SIG_IGN). 88 88 * + If we are now ignoring a signal that was previously pending, -
cpukit/posix/src/sigtimedwait.c
r1b4f2b30 r874297f3 61 61 int signo; 62 62 ISR_Level level; 63 63 64 64 /* 65 65 * Error check parameters before disabling interrupts. … … 125 125 the_thread->Wait.option = *set; 126 126 the_thread->Wait.return_argument = the_info; 127 _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); 127 _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); 128 128 _ISR_Enable( level ); 129 _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 129 _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 130 130 _Thread_Enable_dispatch(); 131 131 -
cpukit/posix/src/testcancel.c
r1b4f2b30 r874297f3 34 34 */ 35 35 36 if ( _ISR_Is_in_progress() ) 36 if ( _ISR_Is_in_progress() ) 37 37 return; 38 38 39 39 thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 40 40 41 41 _Thread_Disable_dispatch(); 42 42 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && -
cpukit/posix/src/time.c
r1b4f2b30 r874297f3 42 42 43 43 seconds_since_epoch = _TOD_Seconds_since_epoch; 44 44 45 45 seconds_since_epoch += POSIX_TIME_SECONDS_1970_THROUGH_1988; 46 46 -
cpukit/posix/src/ualarm.c
r1b4f2b30 r874297f3 30 30 * _POSIX_signals_Ualarm_TSR 31 31 */ 32 32 33 33 void _POSIX_signals_Ualarm_TSR( 34 34 Objects_Id id, … … 74 74 */ 75 75 76 76 77 77 ticks = the_timer->initial - 78 78 ((the_timer->stop_time - the_timer->start_time) / -
cpukit/posix/src/wait.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * waitpid() - POSIX 1003.1b 3.2.1 3 3 * -
cpukit/posix/src/waitpid.c
r1b4f2b30 r874297f3 1 /* 1 /* 2 2 * waitpid() - POSIX 1003.1 3.2.1 3 3 *
Note: See TracChangeset
for help on using the changeset viewer.