mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 12:29:17 +08:00
Remove stray white spaces.
This commit is contained in:
@@ -15,7 +15,7 @@ extern "C" {
|
||||
#if defined(_POSIX_ASYNCHRONOUS_IO)
|
||||
|
||||
/*
|
||||
* 6.7.1 Data Definitions for Asynchronous Input and Output,
|
||||
* 6.7.1 Data Definitions for Asynchronous Input and Output,
|
||||
* P1003.1b-1993, p. 151
|
||||
*/
|
||||
|
||||
@@ -95,7 +95,7 @@ int aio_error(
|
||||
);
|
||||
|
||||
/*
|
||||
* 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
|
||||
* 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
|
||||
* P1003.1b-1993, p. 162
|
||||
*/
|
||||
|
||||
|
||||
@@ -56,11 +56,11 @@ int intr_release(
|
||||
int intr_lock(
|
||||
intr_t intr
|
||||
);
|
||||
|
||||
|
||||
int intr_unlock(
|
||||
intr_t intr
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
|
||||
*/
|
||||
|
||||
@@ -68,7 +68,7 @@ int mq_send(
|
||||
mqd_t mqdes,
|
||||
const char *msg_ptr,
|
||||
size_t msg_len,
|
||||
unsigned int msg_prio
|
||||
unsigned int msg_prio
|
||||
);
|
||||
|
||||
#if defined(_POSIX_TIMEOUTS)
|
||||
@@ -113,7 +113,7 @@ int mq_timedreceive( /* XXX: should this be ssize_t */
|
||||
#if defined(_POSIX_REALTIME_SIGNALS)
|
||||
|
||||
/*
|
||||
* 15.2.6 Notify Process that a Message is Available on a Queue,
|
||||
* 15.2.6 Notify Process that a Message is Available on a Queue,
|
||||
* P1003.1b-1993, p. 280
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_h
|
||||
#define __RTEMS_POSIX_CONDITION_VARIABLES_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -33,7 +33,7 @@ extern "C" {
|
||||
/*
|
||||
* Data Structure used to manage a POSIX condition variable
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int process_shared;
|
||||
@@ -45,7 +45,7 @@ typedef struct {
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information;
|
||||
|
||||
/*
|
||||
@@ -53,7 +53,7 @@ POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information;
|
||||
*/
|
||||
|
||||
extern const pthread_condattr_t _POSIX_Condition_variables_Default_attributes;
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Manager_initialization
|
||||
*
|
||||
@@ -61,11 +61,11 @@ extern const pthread_condattr_t _POSIX_Condition_variables_Default_attributes;
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Condition_variables_Manager_initialization(
|
||||
uint32_t maximum_condition_variables
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Allocate
|
||||
*
|
||||
@@ -74,10 +74,10 @@ void _POSIX_Condition_variables_Manager_initialization(
|
||||
* This function allocates a condition variable control block from
|
||||
* the inactive chain of free condition variable control blocks.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
|
||||
_POSIX_Condition_variables_Allocate( void );
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Free
|
||||
*
|
||||
@@ -86,17 +86,17 @@ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
|
||||
* This routine frees a condition variable control block to the
|
||||
* inactive chain of free condition variable control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
|
||||
POSIX_Condition_variables_Control *the_condition_variable
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Get
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function maps condition variable IDs to condition variable control
|
||||
* This function maps condition variable IDs to condition variable control
|
||||
* blocks. If ID corresponds to a local condition variable, then it returns
|
||||
* the_condition variable control pointer which maps to ID and location
|
||||
* is set to OBJECTS_LOCAL. if the condition variable ID is global and
|
||||
@@ -104,23 +104,23 @@ RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
|
||||
* and the_condition variable is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_condition variable is undefined.
|
||||
*/
|
||||
|
||||
|
||||
#if 0
|
||||
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
|
||||
Objects_Id *id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Condition_variables_Is_null
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function returns TRUE if the_condition variable is NULL
|
||||
* This function returns TRUE if the_condition variable is NULL
|
||||
* and FALSE otherwise.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
|
||||
POSIX_Condition_variables_Control *the_condition_variable
|
||||
);
|
||||
@@ -163,6 +163,6 @@ int _POSIX_Condition_variables_Wait_support(
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_POSIX_KEY_h
|
||||
#define __RTEMS_POSIX_KEY_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -33,15 +33,15 @@ typedef struct {
|
||||
int deferred_count;
|
||||
Chain_Control Handlers;
|
||||
} POSIX_Interrupt_Control;
|
||||
|
||||
|
||||
/*
|
||||
* Data Structure used to manage a POSIX Interrupt Handler
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int is_active;
|
||||
intr_t vector;
|
||||
int is_active;
|
||||
intr_t vector;
|
||||
Thread_Control *server;
|
||||
int (*handler)( void *area );
|
||||
volatile void *user_data_area;
|
||||
@@ -51,7 +51,7 @@ typedef struct {
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information;
|
||||
|
||||
/*
|
||||
@@ -59,9 +59,9 @@ POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information;
|
||||
* interrupt handlers installed on each vector.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN POSIX_Interrupt_Control
|
||||
POSIX_EXTERN POSIX_Interrupt_Control
|
||||
_POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ];
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Manager_initialization
|
||||
*
|
||||
@@ -69,11 +69,11 @@ POSIX_EXTERN POSIX_Interrupt_Control
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Interrupt_Manager_initialization(
|
||||
|
||||
void _POSIX_Interrupt_Manager_initialization(
|
||||
uint32_t maximum_interrupt_handlers
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Allocate
|
||||
*
|
||||
@@ -82,10 +82,10 @@ void _POSIX_Interrupt_Manager_initialization(
|
||||
* This function allocates a interrupt handler control block from
|
||||
* the inactive chain of free interrupt handler control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
|
||||
_POSIX_Interrupt_Allocate( void );
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Free
|
||||
*
|
||||
@@ -94,17 +94,17 @@ RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control *
|
||||
* This routine frees a interrupt handler control block to the
|
||||
* inactive chain of free interrupt handler control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
|
||||
POSIX_Interrupt_Handler_control *the_intr
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Get
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This function maps interrupt handler IDs to interrupt handler control
|
||||
* This function maps interrupt handler IDs to interrupt handler control
|
||||
* blocks. If ID corresponds to a local interrupt handler, then it returns
|
||||
* the_intr control pointer which maps to ID and location
|
||||
* is set to OBJECTS_LOCAL. if the interrupt handler ID is global and
|
||||
@@ -112,12 +112,12 @@ RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free (
|
||||
* and the_intr is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_intr is undefined.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Is_null
|
||||
*
|
||||
@@ -125,11 +125,11 @@ RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get (
|
||||
*
|
||||
* This function returns TRUE if the_intr is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
|
||||
POSIX_Interrupt_Handler_control *the_intr
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Interrupt_Handler
|
||||
*
|
||||
@@ -137,7 +137,7 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null (
|
||||
*
|
||||
* This function XXX.
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Interrupt_Handler(
|
||||
ISR_Vector_number vector
|
||||
);
|
||||
@@ -147,6 +147,6 @@ void _POSIX_Interrupt_Handler(
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_POSIX_KEY_h
|
||||
#define __RTEMS_POSIX_KEY_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -26,7 +26,7 @@ extern "C" {
|
||||
* NOTE: The Values is a table indexed by the index portion of the
|
||||
* ID of the currently executing thread.
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
boolean is_active;
|
||||
@@ -38,9 +38,9 @@ typedef struct {
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Keys_Information;
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Manager_initialization
|
||||
*
|
||||
@@ -48,11 +48,11 @@ POSIX_EXTERN Objects_Information _POSIX_Keys_Information;
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Key_Manager_initialization(
|
||||
uint32_t maximum_keys
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Run_destructors
|
||||
*
|
||||
@@ -64,7 +64,7 @@ void _POSIX_Key_Manager_initialization(
|
||||
* NOTE: This is the routine executed when a thread exits to
|
||||
* run through all the keys and do the destructor action.
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Keys_Run_destructors(
|
||||
Thread_Control *thread
|
||||
);
|
||||
@@ -77,9 +77,9 @@ void _POSIX_Keys_Run_destructors(
|
||||
* This function allocates a keys control block from
|
||||
* the inactive chain of free keys control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Free
|
||||
*
|
||||
@@ -88,11 +88,11 @@ RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
|
||||
* This routine frees a keys control block to the
|
||||
* inactive chain of free keys control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
|
||||
POSIX_Keys_Control *the_key
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Get
|
||||
*
|
||||
@@ -106,12 +106,12 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
|
||||
* and the_key is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_key is undefined.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Keys_Is_null
|
||||
*
|
||||
@@ -119,7 +119,7 @@ RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
|
||||
*
|
||||
* This function returns TRUE if the_key is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
|
||||
POSIX_Keys_Control *the_key
|
||||
);
|
||||
@@ -129,6 +129,6 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null (
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h
|
||||
#define __RTEMS_POSIX_MESSAGE_QUEUE_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -28,7 +28,7 @@ extern "C" {
|
||||
/*
|
||||
* Data Structure used to manage a POSIX message queue
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int process_shared;
|
||||
@@ -50,10 +50,10 @@ typedef struct {
|
||||
* this class of objects. The second item is used to manage the set
|
||||
* of "file descriptors" associated with the message queues.
|
||||
*/
|
||||
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information;
|
||||
POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information_fds;
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Manager_initialization
|
||||
*
|
||||
@@ -61,11 +61,11 @@ POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information_fds;
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Message_queue_Manager_initialization(
|
||||
uint32_t maximum_message_queues
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* _POSIX_Message_queue_Create_support
|
||||
@@ -75,7 +75,7 @@ void _POSIX_Message_queue_Manager_initialization(
|
||||
* This routine performs the creation of a message queue utilizing the
|
||||
* core message queue.
|
||||
*/
|
||||
|
||||
|
||||
int _POSIX_Message_queue_Create_support(
|
||||
const char *name,
|
||||
int pshared,
|
||||
@@ -90,8 +90,8 @@ int _POSIX_Message_queue_Create_support(
|
||||
*
|
||||
* This routine supports the mq_unlink and mq_close routines by
|
||||
* doing most of the work involved with removing a message queue.
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
void _POSIX_Message_queue_Delete(
|
||||
POSIX_Message_queue_Control *the_mq
|
||||
);
|
||||
@@ -136,9 +136,9 @@ int _POSIX_Message_queue_Send_support(
|
||||
* This function allocates a message queue control block from
|
||||
* the inactive chain of free message queue control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Free
|
||||
*
|
||||
@@ -147,11 +147,11 @@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate(
|
||||
* This routine frees a message queue control block to the
|
||||
* inactive chain of free message queue control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
|
||||
POSIX_Message_queue_Control *the_mq
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Get
|
||||
*
|
||||
@@ -165,12 +165,12 @@ RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
|
||||
* and the_message queue is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_mq is undefined.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
|
||||
Objects_Id id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Is_null
|
||||
*
|
||||
@@ -178,7 +178,7 @@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
|
||||
*
|
||||
* This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
|
||||
POSIX_Message_queue_Control *the_mq
|
||||
);
|
||||
@@ -199,24 +199,24 @@ int _POSIX_Message_queue_Name_to_id(
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Priority_to_core
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core(
|
||||
unsigned int priority
|
||||
);
|
||||
|
||||
/*
|
||||
* _POSIX_Message_queue_Priority_from_core
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
|
||||
CORE_message_queue_Submit_types priority
|
||||
);
|
||||
@@ -243,6 +243,6 @@ int _POSIX_Message_queue_Translate_core_message_queue_return_code(
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_POSIX_MUTEX_h
|
||||
#define __RTEMS_POSIX_MUTEX_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -26,7 +26,7 @@ extern "C" {
|
||||
/*
|
||||
* Data Structure used to manage a POSIX mutex
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int process_shared;
|
||||
@@ -37,7 +37,7 @@ typedef struct {
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Mutex_Information;
|
||||
|
||||
/*
|
||||
@@ -45,7 +45,7 @@ POSIX_EXTERN Objects_Information _POSIX_Mutex_Information;
|
||||
*/
|
||||
|
||||
extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes;
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_Manager_initialization
|
||||
*
|
||||
@@ -53,11 +53,11 @@ extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes;
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Mutex_Manager_initialization(
|
||||
uint32_t maximum_mutexes
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_Allocate
|
||||
*
|
||||
@@ -66,9 +66,9 @@ void _POSIX_Mutex_Manager_initialization(
|
||||
* This function allocates a mutexes control block from
|
||||
* the inactive chain of free mutexes control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_Free
|
||||
*
|
||||
@@ -77,11 +77,11 @@ RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
|
||||
* This routine frees a mutexes control block to the
|
||||
* inactive chain of free mutexes control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
|
||||
POSIX_Mutex_Control *the_mutex
|
||||
);
|
||||
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* _POSIX_Mutex_Get
|
||||
@@ -96,12 +96,12 @@ RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
|
||||
* and the_mutex is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_mutex is undefined.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
|
||||
Objects_Id *id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Mutex_Is_null
|
||||
*
|
||||
@@ -109,7 +109,7 @@ RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
|
||||
*
|
||||
* This function returns TRUE if the_mutex is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
|
||||
POSIX_Mutex_Control *the_mutex
|
||||
);
|
||||
@@ -119,7 +119,7 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
|
||||
* _POSIX_Mutex_Lock_support
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
*
|
||||
* A support routine which implements guts of the blocking, non-blocking, and
|
||||
* timed wait version of mutex lock.
|
||||
*/
|
||||
@@ -152,6 +152,6 @@ int _POSIX_Mutex_From_core_mutex_status(
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __POSIX_API_h
|
||||
#define __POSIX_API_h
|
||||
|
||||
|
||||
#include <rtems/config.h>
|
||||
|
||||
/*PAGE
|
||||
@@ -24,7 +24,7 @@
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_API_Initialize(
|
||||
rtems_configuration_table *configuration_table
|
||||
);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#define POSIX_SCHEDULER_MAXIMUM_PRIORITY (254)
|
||||
|
||||
|
||||
#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1)
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
|
||||
|
||||
@@ -74,7 +74,7 @@ void _POSIX_signals_Post_switch_extension(
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
boolean _POSIX_signals_Unblock_thread(
|
||||
boolean _POSIX_signals_Unblock_thread(
|
||||
Thread_Control *the_thread,
|
||||
int signo,
|
||||
siginfo_t *info
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_POSIX_THREADS_h
|
||||
#define __RTEMS_POSIX_THREADS_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -29,19 +29,19 @@ extern "C" {
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Threads_Information;
|
||||
|
||||
/*
|
||||
* These are used to manage the user initialization threads.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN posix_initialization_threads_table
|
||||
|
||||
POSIX_EXTERN posix_initialization_threads_table
|
||||
*_POSIX_Threads_User_initialization_threads;
|
||||
POSIX_EXTERN uint32_t _POSIX_Threads_Number_of_initialization_threads;
|
||||
|
||||
extern const pthread_attr_t _POSIX_Threads_Default_attributes;
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Manager_initialization
|
||||
*
|
||||
@@ -49,13 +49,13 @@ extern const pthread_attr_t _POSIX_Threads_Default_attributes;
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Threads_Manager_initialization(
|
||||
uint32_t maximum_pthreads,
|
||||
uint32_t number_of_initialization_threads,
|
||||
posix_initialization_threads_table *user_threads
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Allocate
|
||||
*
|
||||
@@ -64,9 +64,9 @@ void _POSIX_Threads_Manager_initialization(
|
||||
* This function allocates a pthread control block from
|
||||
* the inactive chain of free pthread control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void );
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Free
|
||||
*
|
||||
@@ -75,11 +75,11 @@ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void );
|
||||
* This routine frees a pthread control block to the
|
||||
* inactive chain of free pthread control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
|
||||
Thread_Control *the_pthread
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Get
|
||||
*
|
||||
@@ -93,12 +93,12 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free(
|
||||
* and the_pthread is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_pthread is undefined.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get(
|
||||
pthread_t id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Threads_Is_null
|
||||
*
|
||||
@@ -106,7 +106,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get(
|
||||
*
|
||||
* This function returns TRUE if the_pthread is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null(
|
||||
Thread_Control *the_pthread
|
||||
);
|
||||
@@ -144,6 +144,6 @@ void _POSIX_Threads_Sporadic_budget_TSR(
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_POSIX_SEMAPHORE_h
|
||||
#define __RTEMS_POSIX_SEMAPHORE_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -28,7 +28,7 @@ extern "C" {
|
||||
/*
|
||||
* Data Structure used to manage a POSIX semaphore
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Objects_Control Object;
|
||||
int process_shared;
|
||||
@@ -42,9 +42,9 @@ typedef struct {
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information;
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Manager_initialization
|
||||
*
|
||||
@@ -52,11 +52,11 @@ POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information;
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Semaphore_Manager_initialization(
|
||||
uint32_t maximum_semaphorees
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Allocate
|
||||
*
|
||||
@@ -65,9 +65,9 @@ void _POSIX_Semaphore_Manager_initialization(
|
||||
* This function allocates a semaphore control block from
|
||||
* the inactive chain of free semaphore control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Free
|
||||
*
|
||||
@@ -76,11 +76,11 @@ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
|
||||
* This routine frees a semaphore control block to the
|
||||
* inactive chain of free semaphore control blocks.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
|
||||
POSIX_Semaphore_Control *the_semaphore
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Get
|
||||
*
|
||||
@@ -94,12 +94,12 @@ RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
|
||||
* and the_semaphore is undefined. Otherwise, location is set
|
||||
* to OBJECTS_ERROR and the_semaphore is undefined.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
|
||||
sem_t *id,
|
||||
Objects_Locations *location
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _POSIX_Semaphore_Is_null
|
||||
*
|
||||
@@ -107,7 +107,7 @@ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
|
||||
*
|
||||
* This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
|
||||
*/
|
||||
|
||||
|
||||
RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
|
||||
POSIX_Semaphore_Control *the_semaphore
|
||||
);
|
||||
@@ -175,6 +175,6 @@ int _POSIX_Semaphore_Name_to_id(
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -24,14 +24,14 @@ typedef struct {
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* POSIX Interrupts
|
||||
* POSIX Interrupts
|
||||
*/
|
||||
uint32_t interrupts_installed;
|
||||
CORE_semaphore_Control Interrupt_Semaphore;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* POSIX Cancelability
|
||||
* POSIX Cancelability
|
||||
*/
|
||||
int cancelability_state;
|
||||
int cancelability_type;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* Seconds from January 1, 1970 to January 1, 1988. Used to account for
|
||||
* differences between POSIX API and RTEMS core.
|
||||
*/
|
||||
|
||||
|
||||
#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
|
||||
(((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
|
||||
(4 * TOD_SECONDS_PER_DAY))
|
||||
@@ -22,7 +22,7 @@
|
||||
*
|
||||
* _POSIX_Timespec_subtract
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Timespec_subtract(
|
||||
const struct timespec *the_start,
|
||||
const struct timespec *end,
|
||||
@@ -41,7 +41,7 @@ Watchdog_Interval _POSIX_Timespec_to_interval(
|
||||
*
|
||||
* _POSIX_Interval_to_timespec
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Interval_to_timespec(
|
||||
Watchdog_Interval ticks,
|
||||
struct timespec *time
|
||||
|
||||
@@ -40,7 +40,7 @@ int sched_getparam(
|
||||
);
|
||||
|
||||
/*
|
||||
* 13.3.3 Set Scheduling Policy and Scheduling Parameters,
|
||||
* 13.3.3 Set Scheduling Policy and Scheduling Parameters,
|
||||
* P1003.1b-1993, p. 254
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
@@ -21,12 +21,12 @@
|
||||
* allocate enough stack for Ada tasks.
|
||||
*/
|
||||
|
||||
size_t _ada_pthread_minimum_stack_size( void )
|
||||
size_t _ada_pthread_minimum_stack_size( void )
|
||||
{
|
||||
/*
|
||||
* Eventually this may need to include a per cpu family calculation
|
||||
* but for now, this will do.
|
||||
*/
|
||||
*/
|
||||
|
||||
return PTHREAD_MINIMUM_STACK_SIZE * 2;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* adjustime() function - required by NTP
|
||||
*
|
||||
* I am unaware of the history behind the definition of this service
|
||||
* and don't know if its behavior is covered by any standard. --joel
|
||||
*
|
||||
* and don't know if its behavior is covered by any standard. --joel
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
static long __adjustment = 0;
|
||||
|
||||
int adjtime ( struct timeval *delta, struct timeval *olddelta )
|
||||
{
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
if ( olddelta ) {
|
||||
olddelta->tv_sec = __adjustment / TOD_MICROSECONDS_PER_SECOND;
|
||||
olddelta->tv_usec = __adjustment / TOD_MICROSECONDS_PER_SECOND;
|
||||
}
|
||||
|
||||
|
||||
if ( !delta )
|
||||
return -1;
|
||||
|
||||
@@ -36,11 +36,11 @@ int adjtime ( struct timeval *delta, struct timeval *olddelta )
|
||||
/* too small to account for */
|
||||
if ( __adjustment < _TOD_Microseconds_per_tick )
|
||||
return 0;
|
||||
|
||||
|
||||
clock_gettime( CLOCK_REALTIME, &ts );
|
||||
|
||||
ts.tv_sec += (__adjustment / TOD_MICROSECONDS_PER_SECOND);
|
||||
ts.tv_nsec += (__adjustment % TOD_MICROSECONDS_PER_SECOND) *
|
||||
ts.tv_nsec += (__adjustment % TOD_MICROSECONDS_PER_SECOND) *
|
||||
TOD_NANOSECONDS_PER_MICROSECOND;
|
||||
|
||||
/* if adjustment is too much positive */
|
||||
|
||||
@@ -66,7 +66,7 @@ int aio_error(
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
|
||||
* 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
|
||||
* P1003.1b-1993, p. 162
|
||||
*/
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Watchdog_Control _POSIX_signals_Alarm_timer;
|
||||
*
|
||||
* _POSIX_signals_Alarm_TSR
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_signals_Alarm_TSR(
|
||||
Objects_Id id,
|
||||
void *argument
|
||||
|
||||
@@ -35,7 +35,7 @@ int pthread_cancel(
|
||||
* Don't even think about deleting a resource from an ISR.
|
||||
*/
|
||||
|
||||
if ( _ISR_Is_in_progress() )
|
||||
if ( _ISR_Is_in_progress() )
|
||||
return EPROTO;
|
||||
|
||||
the_thread = _POSIX_Threads_Get( thread, &location );
|
||||
@@ -49,7 +49,7 @@ int pthread_cancel(
|
||||
|
||||
thread_support->cancelation_requested = 1;
|
||||
|
||||
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
|
||||
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
|
||||
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS ) {
|
||||
_POSIX_Threads_cancel_run( the_thread );
|
||||
}
|
||||
@@ -57,6 +57,6 @@ int pthread_cancel(
|
||||
_Thread_Enable_dispatch();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return POSIX_BOTTOM_REACHED();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
void _POSIX_Threads_cancel_run(
|
||||
void _POSIX_Threads_cancel_run(
|
||||
Thread_Control *the_thread
|
||||
)
|
||||
{
|
||||
@@ -32,20 +32,20 @@ void _POSIX_Threads_cancel_run(
|
||||
Chain_Control *handler_stack;
|
||||
POSIX_API_Control *thread_support;
|
||||
ISR_Level level;
|
||||
|
||||
|
||||
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
|
||||
handler_stack = &thread_support->Cancellation_Handlers;
|
||||
|
||||
|
||||
thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE;
|
||||
|
||||
while ( !_Chain_Is_empty( handler_stack ) ) {
|
||||
_ISR_Disable( level );
|
||||
handler = (POSIX_Cancel_Handler_control *)
|
||||
handler = (POSIX_Cancel_Handler_control *)
|
||||
_Chain_Tail( handler_stack )->previous;
|
||||
_Chain_Extract_unprotected( &handler->Node );
|
||||
_ISR_Enable( level );
|
||||
|
||||
|
||||
(*handler->routine)( handler->arg );
|
||||
|
||||
_Workspace_Free( handler );
|
||||
|
||||
@@ -32,9 +32,9 @@ void pthread_cleanup_pop(
|
||||
Chain_Control *handler_stack;
|
||||
POSIX_API_Control *thread_support;
|
||||
ISR_Level level;
|
||||
|
||||
|
||||
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
|
||||
handler_stack = &thread_support->Cancellation_Handlers;
|
||||
|
||||
_ISR_Disable( level );
|
||||
@@ -42,11 +42,11 @@ void pthread_cleanup_pop(
|
||||
_ISR_Enable( level );
|
||||
return;
|
||||
}
|
||||
|
||||
handler = (POSIX_Cancel_Handler_control *)
|
||||
|
||||
handler = (POSIX_Cancel_Handler_control *)
|
||||
_Chain_Tail( handler_stack )->previous;
|
||||
_Chain_Extract_unprotected( &handler->Node );
|
||||
|
||||
|
||||
_ISR_Enable( level );
|
||||
|
||||
tmp_handler = *handler;
|
||||
|
||||
@@ -31,16 +31,16 @@ void pthread_cleanup_push(
|
||||
POSIX_Cancel_Handler_control *handler;
|
||||
Chain_Control *handler_stack;
|
||||
POSIX_API_Control *thread_support;
|
||||
|
||||
|
||||
if ( !routine )
|
||||
return; /* XXX what to do really? */
|
||||
return; /* XXX what to do really? */
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
|
||||
|
||||
if ( !handler ) {
|
||||
_Thread_Enable_dispatch();
|
||||
return; /* XXX what to do really? */
|
||||
return; /* XXX what to do really? */
|
||||
}
|
||||
|
||||
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
|
||||
|
||||
@@ -30,9 +30,9 @@ int clock_getres(
|
||||
{
|
||||
if ( !res )
|
||||
rtems_set_errno_and_return_minus_one( EINVAL );
|
||||
|
||||
|
||||
switch ( clock_id ) {
|
||||
|
||||
|
||||
/*
|
||||
* All time in rtems is based on the same clock tick.
|
||||
*/
|
||||
@@ -46,10 +46,10 @@ int clock_getres(
|
||||
/* _POSIX_Interval_to_timespec( _TOD_Microseconds_per_tick, res ); */
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
rtems_set_errno_and_return_minus_one( EINVAL );
|
||||
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -38,15 +38,15 @@ int clock_gettime(
|
||||
switch ( clock_id ) {
|
||||
|
||||
case CLOCK_REALTIME:
|
||||
|
||||
|
||||
_ISR_Disable( level );
|
||||
seconds = _TOD_Seconds_since_epoch;
|
||||
ticks = _TOD_Current.ticks;
|
||||
_ISR_Enable( level );
|
||||
|
||||
|
||||
tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988;
|
||||
tp->tv_nsec = ticks * _TOD_Microseconds_per_tick *
|
||||
TOD_NANOSECONDS_PER_MICROSECOND;
|
||||
tp->tv_nsec = ticks * _TOD_Microseconds_per_tick *
|
||||
TOD_NANOSECONDS_PER_MICROSECOND;
|
||||
break;
|
||||
|
||||
#ifdef _POSIX_CPUTIME
|
||||
|
||||
@@ -35,10 +35,10 @@ int clock_settime(
|
||||
assert( tp );
|
||||
|
||||
switch ( clock_id ) {
|
||||
|
||||
|
||||
case CLOCK_REALTIME:
|
||||
(void) gmtime_r( &tp->tv_sec, &split_time );
|
||||
|
||||
|
||||
/*
|
||||
* Convert the tm structure format to that used by the TOD Handler
|
||||
*
|
||||
@@ -57,9 +57,9 @@ int clock_settime(
|
||||
|
||||
if ( !_TOD_Validate( &tod ) )
|
||||
rtems_set_errno_and_return_minus_one( EINVAL );
|
||||
|
||||
|
||||
/*
|
||||
* We can't use the tp->tv_sec field because it is based on
|
||||
* We can't use the tp->tv_sec field because it is based on
|
||||
* a different EPOCH.
|
||||
*/
|
||||
|
||||
@@ -68,13 +68,13 @@ int clock_settime(
|
||||
_TOD_Set( &tod, seconds );
|
||||
_Thread_Enable_dispatch();
|
||||
break;
|
||||
|
||||
|
||||
#ifdef _POSIX_CPUTIME
|
||||
case CLOCK_PROCESS_CPUTIME:
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _POSIX_THREAD_CPUTIME
|
||||
case CLOCK_THREAD_CPUTIME:
|
||||
return POSIX_NOT_IMPLEMENTED();
|
||||
@@ -82,7 +82,7 @@ int clock_settime(
|
||||
#endif
|
||||
default:
|
||||
rtems_set_errno_and_return_minus_one( EINVAL );
|
||||
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* _POSIX_Condition_variables_Manager_initialization
|
||||
*
|
||||
* This routine initializes all condition variable manager related data
|
||||
* This routine initializes all condition variable manager related data
|
||||
* structures.
|
||||
*
|
||||
* Input parameters:
|
||||
@@ -29,7 +29,7 @@
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Condition_variables_Manager_initialization(
|
||||
uint32_t maximum_condition_variables
|
||||
)
|
||||
@@ -48,5 +48,5 @@ void _POSIX_Condition_variables_Manager_initialization(
|
||||
FALSE, /* TRUE if this is a global object class */
|
||||
NULL /* Proxy extraction support callout */
|
||||
#endif
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* P1003.1c/Draft 10, p. 96
|
||||
*/
|
||||
|
||||
|
||||
int pthread_condattr_destroy(
|
||||
pthread_condattr_t *attr
|
||||
)
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* P1003.1c/Draft 10, p. 96
|
||||
*/
|
||||
|
||||
|
||||
int pthread_condattr_getpshared(
|
||||
const pthread_condattr_t *attr,
|
||||
int *pshared
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* P1003.1c/Draft 10, p. 96
|
||||
*/
|
||||
|
||||
|
||||
int pthread_condattr_init(
|
||||
pthread_condattr_t *attr
|
||||
)
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* 11.4.1 Condition Variable Initialization Attributes,
|
||||
* P1003.1c/Draft 10, p. 96
|
||||
*/
|
||||
|
||||
|
||||
int pthread_condattr_setpshared(
|
||||
pthread_condattr_t *attr,
|
||||
int pshared
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
|
||||
*/
|
||||
|
||||
|
||||
int pthread_cond_broadcast(
|
||||
pthread_cond_t *cond
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* The default condition variable attributes structure.
|
||||
*/
|
||||
|
||||
|
||||
const pthread_condattr_t _POSIX_Condition_variables_Default_attributes = {
|
||||
TRUE, /* is_initialized */
|
||||
PTHREAD_PROCESS_PRIVATE /* process_shared */
|
||||
|
||||
@@ -19,17 +19,17 @@
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.2 Initializing and Destroying a Condition Variable,
|
||||
* 11.4.2 Initializing and Destroying a Condition Variable,
|
||||
* P1003.1c/Draft 10, p. 87
|
||||
*/
|
||||
|
||||
|
||||
int pthread_cond_destroy(
|
||||
pthread_cond_t *cond
|
||||
)
|
||||
{
|
||||
register POSIX_Condition_variables_Control *the_cond;
|
||||
Objects_Locations location;
|
||||
|
||||
|
||||
the_cond = _POSIX_Condition_variables_Get( cond, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_REMOTE:
|
||||
@@ -44,27 +44,27 @@ int pthread_cond_destroy(
|
||||
|
||||
|
||||
case OBJECTS_LOCAL:
|
||||
|
||||
|
||||
if ( _Thread_queue_First( &the_cond->Wait_queue ) ) {
|
||||
_Thread_Enable_dispatch();
|
||||
return EBUSY;
|
||||
}
|
||||
|
||||
|
||||
_Objects_Close(
|
||||
&_POSIX_Condition_variables_Information,
|
||||
&the_cond->Object
|
||||
);
|
||||
|
||||
|
||||
_POSIX_Condition_variables_Free( the_cond );
|
||||
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) {
|
||||
|
||||
|
||||
_Objects_MP_Close(
|
||||
&_POSIX_Condition_variables_Information,
|
||||
the_cond->Object.id
|
||||
);
|
||||
|
||||
|
||||
_POSIX_Condition_variables_MP_Send_process_packet(
|
||||
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE,
|
||||
the_cond->Object.id,
|
||||
|
||||
+14
-14
@@ -19,10 +19,10 @@
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 11.4.2 Initializing and Destroying a Condition Variable,
|
||||
* 11.4.2 Initializing and Destroying a Condition Variable,
|
||||
* P1003.1c/Draft 10, p. 87
|
||||
*/
|
||||
|
||||
|
||||
int pthread_cond_init(
|
||||
pthread_cond_t *cond,
|
||||
const pthread_condattr_t *attr
|
||||
@@ -30,29 +30,29 @@ int pthread_cond_init(
|
||||
{
|
||||
POSIX_Condition_variables_Control *the_cond;
|
||||
const pthread_condattr_t *the_attr;
|
||||
|
||||
|
||||
if ( attr ) the_attr = attr;
|
||||
else the_attr = &_POSIX_Condition_variables_Default_attributes;
|
||||
|
||||
|
||||
/*
|
||||
* XXX: Be careful about attributes when global!!!
|
||||
*/
|
||||
|
||||
|
||||
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
|
||||
return POSIX_MP_NOT_IMPLEMENTED();
|
||||
|
||||
|
||||
if ( !the_attr->is_initialized )
|
||||
return EINVAL;
|
||||
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
|
||||
the_cond = _POSIX_Condition_variables_Allocate();
|
||||
|
||||
|
||||
if ( !the_cond ) {
|
||||
_Thread_Enable_dispatch();
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED &&
|
||||
!( _Objects_MP_Allocate_and_open( &_POSIX_Condition_variables_Information,
|
||||
@@ -62,7 +62,7 @@ int pthread_cond_init(
|
||||
return EAGAIN;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
the_cond->process_shared = the_attr->process_shared;
|
||||
|
||||
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
|
||||
@@ -80,9 +80,9 @@ int pthread_cond_init(
|
||||
&the_cond->Object,
|
||||
0
|
||||
);
|
||||
|
||||
|
||||
*cond = the_cond->Object.id;
|
||||
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
|
||||
_POSIX_Condition_variables_MP_Send_process_packet(
|
||||
@@ -92,7 +92,7 @@ int pthread_cond_init(
|
||||
0 /* Not used */
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* 11.4.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101
|
||||
*/
|
||||
|
||||
|
||||
int pthread_cond_signal(
|
||||
pthread_cond_t *cond
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
* A support routine which implements guts of the broadcast and single task
|
||||
* wake up version of the "signal" operation.
|
||||
*/
|
||||
|
||||
|
||||
int _POSIX_Condition_variables_Signal_support(
|
||||
pthread_cond_t *cond,
|
||||
boolean is_broadcast
|
||||
@@ -33,7 +33,7 @@ int _POSIX_Condition_variables_Signal_support(
|
||||
register POSIX_Condition_variables_Control *the_cond;
|
||||
Objects_Locations location;
|
||||
Thread_Control *the_thread;
|
||||
|
||||
|
||||
the_cond = _POSIX_Condition_variables_Get( cond, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_REMOTE:
|
||||
@@ -46,8 +46,8 @@ int _POSIX_Condition_variables_Signal_support(
|
||||
case OBJECTS_ERROR:
|
||||
return EINVAL;
|
||||
case OBJECTS_LOCAL:
|
||||
|
||||
do {
|
||||
|
||||
do {
|
||||
the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue );
|
||||
if ( !the_thread )
|
||||
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
|
||||
*/
|
||||
|
||||
|
||||
int pthread_cond_timedwait(
|
||||
pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex,
|
||||
@@ -48,7 +48,7 @@ int pthread_cond_timedwait(
|
||||
|
||||
if ( ( difference.tv_sec < 0 ) || ( ( difference.tv_sec == 0 ) &&
|
||||
( difference.tv_nsec < 0 ) ) )
|
||||
already_timedout = TRUE;
|
||||
already_timedout = TRUE;
|
||||
|
||||
timeout = _POSIX_Timespec_to_interval( &difference );
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* 11.4.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105
|
||||
*/
|
||||
|
||||
|
||||
int pthread_cond_wait(
|
||||
pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
* A support routine which implements guts of the blocking, non-blocking, and
|
||||
* timed wait version of condition variable wait routines.
|
||||
*/
|
||||
|
||||
|
||||
int _POSIX_Condition_variables_Wait_support(
|
||||
pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex,
|
||||
@@ -36,7 +36,7 @@ int _POSIX_Condition_variables_Wait_support(
|
||||
Objects_Locations location;
|
||||
int status;
|
||||
int mutex_status;
|
||||
|
||||
|
||||
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
|
||||
return EINVAL;
|
||||
}
|
||||
@@ -54,12 +54,12 @@ int _POSIX_Condition_variables_Wait_support(
|
||||
case OBJECTS_ERROR:
|
||||
return EINVAL;
|
||||
case OBJECTS_LOCAL:
|
||||
|
||||
|
||||
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
|
||||
_Thread_Enable_dispatch();
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
|
||||
(void) pthread_mutex_unlock( mutex );
|
||||
/* XXX ignore this for now since behavior is undefined
|
||||
if ( mutex_status ) {
|
||||
@@ -70,7 +70,7 @@ int _POSIX_Condition_variables_Wait_support(
|
||||
|
||||
if ( !already_timedout ) {
|
||||
the_cond->Mutex = *mutex;
|
||||
|
||||
|
||||
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
|
||||
_Thread_Executing->Wait.return_code = 0;
|
||||
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
|
||||
@@ -81,7 +81,7 @@ int _POSIX_Condition_variables_Wait_support(
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
/*
|
||||
* Switch ourself out because we blocked as a result of the
|
||||
* Switch ourself out because we blocked as a result of the
|
||||
* _Thread_queue_Enqueue.
|
||||
*/
|
||||
|
||||
@@ -101,7 +101,7 @@ int _POSIX_Condition_variables_Wait_support(
|
||||
mutex_status = pthread_mutex_lock( mutex );
|
||||
if ( mutex_status )
|
||||
return EINVAL;
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
return POSIX_BOTTOM_REACHED();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* execl() - POSIX 1003.1b 3.1.2
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* execle() - POSIX 1003.1b 3.1.2
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* execlp() - POSIX 1003.1b 3.1.2
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* execv() - POSIX 1003.1b 3.1.2
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* execve() - POSIX 1003.1b 3.1.2
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* execvp() - POSIX 1003.1b 3.1.2
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* fork() - POSIX 1003.1b 3.1.1
|
||||
*
|
||||
* $Id$
|
||||
|
||||
+26
-26
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* NOTE: Each task has an interrupt semaphore associated with it.
|
||||
* No matter which interrupt occurs that it has registered,
|
||||
* No matter which interrupt occurs that it has registered,
|
||||
* the same semaphore is used.
|
||||
*
|
||||
* This whole interrupt scheme may have been eliminated in a later draft.
|
||||
@@ -32,8 +32,8 @@
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Interrupt_Manager_initialization(
|
||||
|
||||
void _POSIX_Interrupt_Manager_initialization(
|
||||
uint32_t maximum_interrupt_handlers
|
||||
)
|
||||
{
|
||||
@@ -58,7 +58,7 @@ void _POSIX_Interrupt_Manager_initialization(
|
||||
|
||||
for ( index=0 ; index < CPU_INTERRUPT_NUMBER_OF_VECTORS ; index++ ) {
|
||||
the_vector = &_POSIX_Interrupt_Information[ index ];
|
||||
|
||||
|
||||
the_vector->number_installed = 0;
|
||||
the_vector->lock_count = 0;
|
||||
the_vector->deferred_count = 0;
|
||||
@@ -83,14 +83,14 @@ int intr_capture(
|
||||
POSIX_API_Thread_Support_Control *thread_support;
|
||||
proc_ptr old_handler;
|
||||
|
||||
if ( !_ISR_Is_vector_number_valid( intr ) ||
|
||||
if ( !_ISR_Is_vector_number_valid( intr ) ||
|
||||
!_ISR_Is_valid_user_handler( intr_handler ) )
|
||||
return EINVAL;
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
the_intr = _POSIX_Interrupt_Allocate();
|
||||
|
||||
|
||||
if ( !the_intr ) {
|
||||
_Thread_Enable_dispatch();
|
||||
return ENOMEM;
|
||||
@@ -123,18 +123,18 @@ int intr_capture(
|
||||
if ( !the_vector->number_installed++ )
|
||||
_ISR_Install_vector(
|
||||
intr,
|
||||
(proc_ptr) _POSIX_Interrupt_Handler,
|
||||
(proc_ptr) _POSIX_Interrupt_Handler,
|
||||
&old_handler
|
||||
);
|
||||
|
||||
_Objects_Open( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object, 0 );
|
||||
|
||||
|
||||
/*
|
||||
* Normally, an Id would be returned here.
|
||||
*/
|
||||
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ int intr_release(
|
||||
_Thread_Enable_dispatch();
|
||||
return EINVAL; /* XXX should be ENOISR; */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* OK now we have found the interrupt handler and can do some work.
|
||||
*/
|
||||
@@ -198,7 +198,7 @@ int intr_release(
|
||||
_Chain_Extract( &the_intr->Object.Node );
|
||||
|
||||
the_intr->is_active = FALSE;
|
||||
|
||||
|
||||
the_vector->number_installed -= 1;
|
||||
|
||||
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
|
||||
@@ -213,7 +213,7 @@ int intr_release(
|
||||
_Objects_Close( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object );
|
||||
|
||||
_POSIX_Interrupt_Free( the_intr );
|
||||
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
return 0;
|
||||
@@ -240,7 +240,7 @@ int intr_lock(
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
|
||||
@@ -251,22 +251,22 @@ int intr_unlock(
|
||||
)
|
||||
{
|
||||
POSIX_Interrupt_Control *the_vector;
|
||||
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
|
||||
the_vector = &_POSIX_Interrupt_Information[ intr ];
|
||||
|
||||
|
||||
if ( !--the_vector->lock_count ) {
|
||||
while ( --the_vector->deferred_count ) {
|
||||
_POSIX_Interrupt_Handler( intr );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
|
||||
*/
|
||||
@@ -290,7 +290,7 @@ int intr_timed_wait(
|
||||
0, /* XXX does id=0 hurt in this case? */
|
||||
TRUE,
|
||||
ticks
|
||||
);
|
||||
);
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
return _Thread_Executing->Wait.return_code; /* XXX should be POSIX */
|
||||
@@ -298,7 +298,7 @@ int intr_timed_wait(
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _POSIX_Interrupt_Handler
|
||||
* _POSIX_Interrupt_Handler
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -311,14 +311,14 @@ void _POSIX_Interrupt_Handler(
|
||||
POSIX_API_Thread_Support_Control *thread_support;
|
||||
Chain_Node *the_node;
|
||||
int status;
|
||||
|
||||
|
||||
the_vector = &_POSIX_Interrupt_Information[ vector ];
|
||||
|
||||
|
||||
the_node = _Chain_Head( &the_vector->Handlers );
|
||||
|
||||
|
||||
for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) {
|
||||
the_intr = (POSIX_Interrupt_Handler_control *) the_node;
|
||||
|
||||
|
||||
status = (*the_intr->handler)( (void *) the_intr->user_data_area );
|
||||
|
||||
switch ( status ) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
|
||||
void _POSIX_Key_Manager_initialization(
|
||||
uint32_t maximum_keys
|
||||
)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user