URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/or1k/trunk/rtems-20020807/cpukit/posix
- from Rev 1028 to Rev 1765
- ↔ Reverse comparison
Rev 1028 → Rev 1765
/include/rtems/posix/posixapi.h
0,0 → 1,33
/* |
* POSIX API Support |
* |
* NOTE: |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* posixapi.h,v 1.5 1999/11/17 17:50:22 joel Exp |
*/ |
|
#ifndef __POSIX_API_h |
#define __POSIX_API_h |
|
#include <rtems/config.h> |
|
/*PAGE |
* |
* _POSIX_API_Initialize |
* |
* XXX |
*/ |
|
void _POSIX_API_Initialize( |
rtems_configuration_table *configuration_table |
); |
|
#endif |
/* end of include file */ |
/include/rtems/posix/psignal.h
0,0 → 1,121
/* |
* psignal.h,v 1.9 1999/11/02 18:00:13 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_SIGNALS_h |
#define __RTEMS_POSIX_SIGNALS_h |
|
#include <rtems/posix/pthread.h> |
|
/* |
* Currently 32 signals numbered 1-32 are defined |
*/ |
|
#define SIGNAL_EMPTY_MASK 0x00000000 |
#define SIGNAL_ALL_MASK 0xffffffff |
|
#define signo_to_mask( _sig ) (1 << ((_sig) - 1)) |
|
#define is_valid_signo( _sig ) \ |
((_sig) >= 1 && (_sig) <= 32 ) |
|
#define _States_Is_interruptible_signal( _states ) \ |
( ((_states) & \ |
(STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \ |
(STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) |
|
#define SIGACTION_TERMINATE \ |
{ 0, SIGNAL_ALL_MASK, {_POSIX_signals_Abnormal_termination_handler} } |
#define SIGACTION_IGNORE \ |
{ 0, SIGNAL_ALL_MASK, {SIG_IGN} } |
#define SIGACTION_STOP \ |
{ 0, SIGNAL_ALL_MASK, {_POSIX_signals_Stop_handler} } |
#define SIGACTION_CONTINUE \ |
{ 0, SIGNAL_ALL_MASK, {_POSIX_signals_Continue_handler} } |
|
#define SIG_ARRAY_MAX (SIGRTMAX + 1) |
|
/* |
* Variables |
*/ |
|
extern sigset_t _POSIX_signals_Pending; |
|
extern struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ]; |
|
extern struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ]; |
|
extern Watchdog_Control _POSIX_signals_Alarm_timer; |
|
extern Thread_queue_Control _POSIX_signals_Wait_queue; |
|
extern Chain_Control _POSIX_signals_Inactive_siginfo; |
|
extern Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ]; |
|
/* |
* POSIX internal siginfo structure |
*/ |
|
typedef struct { |
Chain_Node Node; |
siginfo_t Info; |
} POSIX_signals_Siginfo_node; |
|
/* |
* Internal routines |
*/ |
|
void _POSIX_signals_Manager_Initialization( |
int maximum_queued_signals |
); |
|
void _POSIX_signals_Post_switch_extension( |
Thread_Control *the_thread |
); |
|
boolean _POSIX_signals_Unblock_thread( |
Thread_Control *the_thread, |
int signo, |
siginfo_t *info |
); |
|
boolean _POSIX_signals_Check_signal( |
POSIX_API_Control *api, |
int signo, |
boolean is_global |
); |
|
boolean _POSIX_signals_Clear_signals( |
POSIX_API_Control *api, |
int signo, |
siginfo_t *info, |
boolean is_global, |
boolean check_blocked |
); |
|
int killinfo( |
pid_t pid, |
int sig, |
const union sigval *value |
); |
|
void _POSIX_signals_Set_process_signals( |
sigset_t mask |
); |
|
void _POSIX_signals_Clear_process_signals( |
sigset_t mask |
); |
|
/* |
* Default signal handlers |
*/ |
|
#define _POSIX_signals_Stop_handler NULL |
#define _POSIX_signals_Continue_handler NULL |
|
void _POSIX_signals_Abnormal_termination_handler( int signo ); |
|
#endif |
/* end of file */ |
/include/rtems/posix/mqueuemp.h
0,0 → 1,160
/* mqueuemp.h |
* |
* This include file contains all the constants and structures associated |
* with the Multiprocessing Support in the POSIX Message Queue Manager. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* mqueuemp.h,v 1.6 1999/11/17 17:50:21 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_MP_h |
#define __RTEMS_POSIX_MESSAGE_QUEUE_MP_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/score/mppkt.h> |
#include <rtems/score/object.h> |
#include <rtems/score/thread.h> |
#include <rtems/score/watchdog.h> |
|
/* |
* The following enumerated type defines the list of |
* remote message queue operations. |
*/ |
|
typedef enum { |
POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0, |
POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1, |
POSIX_MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2, |
POSIX_MESSAGE_QUEUE_MP_OBTAIN_REQUEST = 3, |
POSIX_MESSAGE_QUEUE_MP_OBTAIN_RESPONSE = 4, |
POSIX_MESSAGE_QUEUE_MP_RELEASE_REQUEST = 5, |
POSIX_MESSAGE_QUEUE_MP_RELEASE_RESPONSE = 6, |
} POSIX_Message_queue_MP_Remote_operations; |
|
/* |
* The following data structure defines the packet used to perform |
* remote message queue operations. |
*/ |
|
typedef struct { |
MP_packet_Prefix Prefix; |
POSIX_Message_queue_MP_Remote_operations operation; |
Objects_Name name; |
boolean wait; /* XXX options */ |
Objects_Id proxy_id; |
} POSIX_Message_queue_MP_Packet; |
|
/* |
* _POSIX_Message_queue_MP_Send_process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* process operation can be performed on another node. |
*/ |
|
void _POSIX_Message_queue_MP_Send_process_packet ( |
POSIX_Message_queue_MP_Remote_operations operation, |
Objects_Id mq_id, |
Objects_Name name, |
Objects_Id proxy_id |
); |
|
/* |
* _POSIX_Message_queue_MP_Send_request_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive operation can be initiated on another node. |
*/ |
|
int _POSIX_Message_queue_MP_Send_request_packet ( |
POSIX_Message_queue_MP_Remote_operations operation, |
Objects_Id mq_id, |
boolean wait, /* XXX options */ |
Watchdog_Interval timeout |
); |
|
/* |
* _POSIX_Message_queue_MP_Send_response_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive can be performed on another node. |
*/ |
|
void _POSIX_Message_queue_MP_Send_response_packet ( |
POSIX_Message_queue_MP_Remote_operations operation, |
Objects_Id mq_id, |
Thread_Control *the_thread |
); |
|
/* |
* |
* _POSIX_Message_queue_MP_Process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs the actions specific to this package for |
* the request from another node. |
*/ |
|
void _POSIX_Message_queue_MP_Process_packet ( |
MP_packet_Prefix *the_packet_prefix |
); |
|
/* |
* _POSIX_Message_queue_MP_Send_object_was_deleted |
* |
* DESCRIPTION: |
* |
* This routine is invoked indirectly by the thread queue |
* when a proxy has been removed from the thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Message_queue_MP_Send_object_was_deleted ( |
Thread_Control *the_proxy |
); |
|
/* |
* _POSIX_Message_queue_MP_Send_extract_proxy |
* |
* DESCRIPTION: |
* |
* This routine is invoked when a task is deleted and it |
* has a proxy which must be removed from a thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Message_queue_MP_Send_extract_proxy ( |
Thread_Control *the_thread |
); |
|
/* |
* _POSIX_Message_queue_MP_Get_packet |
* |
* DESCRIPTION: |
* |
* This function is used to obtain a message queue mp packet. |
*/ |
|
POSIX_Message_queue_MP_Packet *_POSIX_Message_queue_MP_Get_packet ( void ); |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of file */ |
/include/rtems/posix/time.h
0,0 → 1,50
/* |
* |
* |
* time.h,v 1.5 1996/09/17 21:26:25 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_TIME_h |
#define __RTEMS_POSIX_TIME_h |
|
#include <rtems/score/tod.h> |
|
/* |
* 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)) |
|
/*PAGE |
* |
* _POSIX_Timespec_subtract |
*/ |
|
void _POSIX_Timespec_subtract( |
const struct timespec *the_start, |
const struct timespec *end, |
struct timespec *result |
); |
|
/* |
* _POSIX_Timespec_to_interval |
*/ |
|
Watchdog_Interval _POSIX_Timespec_to_interval( |
const struct timespec *time |
); |
|
/*PAGE |
* |
* _POSIX_Interval_to_timespec |
*/ |
|
void _POSIX_Interval_to_timespec( |
Watchdog_Interval ticks, |
struct timespec *time |
); |
|
#endif |
/include/rtems/posix/mutexmp.h
0,0 → 1,173
/* mutexmp.h |
* |
* This include file contains all the constants and structures associated |
* with the Multiprocessing Support in the POSIX Mutex Manager. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* mutexmp.h,v 1.7 1999/11/29 15:44:57 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_MUTEX_MP_h |
#define __RTEMS_POSIX_MUTEX_MP_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/score/mppkt.h> |
#include <rtems/score/object.h> |
#include <rtems/score/thread.h> |
#include <rtems/score/watchdog.h> |
|
/* |
* The following enumerated type defines the list of |
* remote mutex operations. |
*/ |
|
typedef enum { |
POSIX_MUTEX_MP_ANNOUNCE_CREATE = 0, |
POSIX_MUTEX_MP_ANNOUNCE_DELETE = 1, |
POSIX_MUTEX_MP_EXTRACT_PROXY = 2, |
POSIX_MUTEX_MP_OBTAIN_REQUEST = 3, |
POSIX_MUTEX_MP_OBTAIN_RESPONSE = 4, |
POSIX_MUTEX_MP_RELEASE_REQUEST = 5, |
POSIX_MUTEX_MP_RELEASE_RESPONSE = 6, |
} POSIX_Mutex_MP_Remote_operations; |
|
/* |
* The following data structure defines the packet used to perform |
* remote mutex operations. |
*/ |
|
typedef struct { |
MP_packet_Prefix Prefix; |
POSIX_Mutex_MP_Remote_operations operation; |
Objects_Name name; |
boolean wait; /* XXX options */ |
Objects_Id proxy_id; |
} POSIX_Mutex_MP_Packet; |
|
/* |
* _POSIX_Mutex_MP_Send_process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* process operation can be performed on another node. |
*/ |
|
void _POSIX_Mutex_MP_Send_process_packet ( |
POSIX_Mutex_MP_Remote_operations operation, |
Objects_Id mutex_id, |
Objects_Name name, |
Objects_Id proxy_id |
); |
|
/* |
* _POSIX_Mutex_MP_Send_request_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive operation can be initiated on another node. |
*/ |
|
int _POSIX_Mutex_MP_Send_request_packet ( |
POSIX_Mutex_MP_Remote_operations operation, |
Objects_Id mutex_id, |
boolean wait, /* XXX options */ |
Watchdog_Interval timeout |
); |
|
/* |
* _POSIX_Mutex_MP_Send_response_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive can be performed on another node. |
*/ |
|
void _POSIX_Mutex_MP_Send_response_packet ( |
POSIX_Mutex_MP_Remote_operations operation, |
Objects_Id mutex_id, |
Thread_Control *the_thread |
); |
|
/* |
* |
* _POSIX_Mutex_MP_Process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs the actions specific to this package for |
* the request from another node. |
*/ |
|
void _POSIX_Mutex_MP_Process_packet ( |
MP_packet_Prefix *the_packet_prefix |
); |
|
/* |
* _POSIX_Mutex_MP_Send_object_was_deleted |
* |
* DESCRIPTION: |
* |
* This routine is invoked indirectly by the thread queue |
* when a proxy has been removed from the thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Mutex_MP_Send_object_was_deleted ( |
Thread_Control *the_proxy |
); |
|
/* |
* _POSIX_Mutex_MP_Send_extract_proxy |
* |
* DESCRIPTION: |
* |
* This routine is invoked when a task is deleted and it |
* has a proxy which must be removed from a thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Mutex_MP_Send_extract_proxy ( |
Thread_Control *the_thread |
); |
|
/* |
* _POSIX_Threads_mutex_MP_support |
* |
* DESCRIPTION: |
* |
* This routine XXX |
*/ |
|
void _POSIX_Threads_mutex_MP_support( |
Thread_Control *the_thread, |
Objects_Id id |
); |
|
/* |
* _POSIX_Mutex_MP_Get_packet |
* |
* DESCRIPTION: |
* |
* This function is used to obtain a mutex mp packet. |
*/ |
|
POSIX_Mutex_MP_Packet *_POSIX_Mutex_MP_Get_packet ( void ); |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of file */ |
/include/rtems/posix/threadsup.h
0,0 → 1,45
/* threadsup.h |
* |
* threadsup.h,v 1.17 2000/10/31 16:33:48 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_THREAD_SUPPORT_h |
#define __RTEMS_POSIX_THREAD_SUPPORT_h |
|
#include <sys/signal.h> |
#include <rtems/score/coresem.h> |
#include <rtems/score/tqdata.h> |
|
typedef struct { |
pthread_attr_t Attributes; |
int detachstate; |
Thread_queue_Control Join_List; |
int schedpolicy; |
struct sched_param schedparam; |
int ss_high_priority; |
Watchdog_Control Sporadic_timer; |
|
sigset_t signals_blocked; |
sigset_t signals_pending; |
|
#if 0 |
/* |
* POSIX Interrupts |
*/ |
unsigned32 interrupts_installed; |
CORE_semaphore_Control Interrupt_Semaphore; |
#endif |
|
/* |
* POSIX Cancelability |
*/ |
int cancelability_state; |
int cancelability_type; |
int cancelation_requested; |
Chain_Control Cancellation_Handlers; |
|
} POSIX_API_Control; |
|
#endif |
/* end of include file */ |
|
/include/rtems/posix/ptimer.h
0,0 → 1,91
/* rtems/posix/ptimer.h |
* |
* This include file contains all the private support information for |
* POSIX timers. |
* |
* COPYRIGHT (c) 1998. |
|
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* ptimer.h,v 1.0 1998/03/31 16:21:16 |
*/ |
|
#ifndef __RTEMS_POSIX_TIMERS_h |
#define __RTEMS_POSIX_TIMERS_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/posix/config.h> |
|
/* |
* _POSIX_Timers_Manager_initialization |
* |
* DESCRIPTION: |
* |
* This routine performs the initialization necessary for this manager. |
*/ |
|
void _POSIX_Timer_Manager_initialization ( int max_timers ); |
|
/* |
* 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264 |
* |
* timer_create |
*/ |
|
int timer_create( |
clockid_t clock_id, |
struct sigevent *evp, |
timer_t *timerid |
); |
|
/* |
* 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266 |
*/ |
|
int timer_delete( |
timer_t timerid |
); |
|
/* |
* 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 |
* |
* timer_settime |
*/ |
|
int timer_settime( |
timer_t timerid, |
int flags, |
const struct itimerspec *value, |
struct itimerspec *ovalue |
); |
|
/* |
* 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 |
* |
* timer_gettime |
*/ |
|
int timer_gettime( |
timer_t timerid, |
struct itimerspec *value |
); |
|
/* |
* 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 |
* |
* timer_getoverrun |
* |
*/ |
|
int timer_getoverrun( |
timer_t timerid |
); |
|
#endif |
|
/include/rtems/posix/mqueue.h
0,0 → 1,249
/* rtems/posix/mqueue.h |
* |
* This include file contains all the private support information for |
* POSIX Message Queues. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* mqueue.h,v 1.15 2002/04/26 23:39:01 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h |
#define __RTEMS_POSIX_MESSAGE_QUEUE_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <signal.h> |
|
#include <rtems/score/coremsg.h> |
#include <rtems/score/object.h> |
|
/* |
* Data Structure used to manage a POSIX message queue |
*/ |
|
typedef struct { |
Objects_Control Object; |
int process_shared; |
boolean named; |
boolean linked; |
unsigned32 open_count; |
CORE_message_queue_Control Message_queue; |
struct sigevent notification; |
} POSIX_Message_queue_Control; |
|
typedef struct { |
Objects_Control Object; |
POSIX_Message_queue_Control *Queue; |
int oflag; |
} POSIX_Message_queue_Control_fd; |
|
/* |
* The following defines the information control block used to manage |
* 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 |
* |
* DESCRIPTION: |
* |
* This routine performs the initialization necessary for this manager. |
*/ |
|
void _POSIX_Message_queue_Manager_initialization( |
unsigned32 maximum_message_queues |
); |
|
/* |
* |
* _POSIX_Message_queue_Create_support |
* |
* DESCRIPTION: |
* |
* 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, |
struct mq_attr *attr, |
POSIX_Message_queue_Control **message_queue |
); |
|
/* |
* _POSIX_Message_queue_Delete |
* |
* DESCRIPTION: |
* |
* 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 |
); |
|
/* |
* _POSIX_Message_queue_Receive_support |
* |
* DESCRIPTION: |
* |
* This routine supports the various flavors of receiving a message. |
*/ |
|
ssize_t _POSIX_Message_queue_Receive_support( |
mqd_t mqdes, |
char *msg_ptr, |
size_t msg_len, |
unsigned int *msg_prio, |
Watchdog_Interval timeout |
); |
|
/* |
* _POSIX_Message_queue_Send_support |
* |
* DESCRIPTION: |
* |
* This routine posts a message to a specified message queue. |
*/ |
|
int _POSIX_Message_queue_Send_support( |
mqd_t mqdes, |
const char *msg_ptr, |
unsigned32 msg_len, |
unsigned32 msg_prio, |
Watchdog_Interval timeout |
); |
|
/* |
* _POSIX_Message_queue_Allocate |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* This function maps message queue IDs to message queue control blocks. |
* If ID corresponds to a local message queue, then it returns |
* the_mq control pointer which maps to ID and location |
* is set to OBJECTS_LOCAL. if the message queue ID is global and |
* resides on a remote node, then location is set to OBJECTS_REMOTE, |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
); |
|
/* |
* _POSIX_Message_queue_Name_to_id |
* |
* DESCRIPTION: |
* |
* This routine looks up the specified name for a message queue and returns the |
* id of the message queue associated with it. |
*/ |
|
int _POSIX_Message_queue_Name_to_id( |
const char *name, |
Objects_Id *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 |
); |
|
/*PAGE |
* |
* _POSIX_Message_queue_Translate_core_message_queue_return_code |
* |
* DESCRIPTION: |
* |
* XXX |
*/ |
|
int _POSIX_Message_queue_Translate_core_message_queue_return_code( |
unsigned32 the_message_queue_status |
); |
|
|
#include <rtems/posix/mqueue.inl> |
#if defined(RTEMS_MULTIPROCESSING) |
#include <rtems/posix/mqueuemp.h> |
#endif |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of include file */ |
|
/include/rtems/posix/mutex.h
0,0 → 1,158
/* rtems/posix/mutex.h |
* |
* This include file contains all the private support information for |
* POSIX mutex's. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* mutex.h,v 1.13 2000/12/01 18:57:36 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_MUTEX_h |
#define __RTEMS_POSIX_MUTEX_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/score/coremutex.h> |
#include <pthread.h> |
|
/* |
* Data Structure used to manage a POSIX mutex |
*/ |
|
typedef struct { |
Objects_Control Object; |
int process_shared; |
CORE_mutex_Control Mutex; |
} POSIX_Mutex_Control; |
|
/* |
* The following defines the information control block used to manage |
* this class of objects. |
*/ |
|
POSIX_EXTERN Objects_Information _POSIX_Mutex_Information; |
|
/* |
* The default mutex attributes structure. |
*/ |
|
extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes; |
|
/* |
* _POSIX_Mutex_Manager_initialization |
* |
* DESCRIPTION: |
* |
* This routine performs the initialization necessary for this manager. |
*/ |
|
void _POSIX_Mutex_Manager_initialization( |
unsigned32 maximum_mutexes |
); |
|
/* |
* _POSIX_Mutex_Allocate |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* This function maps mutexes IDs to mutexes control blocks. |
* If ID corresponds to a local mutexes, then it returns |
* the_mutex control pointer which maps to ID and location |
* is set to OBJECTS_LOCAL. if the mutexes ID is global and |
* resides on a remote node, then location is set to OBJECTS_REMOTE, |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
); |
#endif |
|
/* |
* _POSIX_Mutex_Lock_support |
* |
* DESCRIPTION: |
* |
* A support routine which implements guts of the blocking, non-blocking, and |
* timed wait version of mutex lock. |
*/ |
|
int _POSIX_Mutex_Lock_support( |
pthread_mutex_t *mutex, |
boolean blocking, |
Watchdog_Interval timeout |
); |
|
/* |
* _POSIX_Mutex_From_core_mutex_status |
* |
* DESCRIPTION: |
* |
* A support routine which converts core mutex status codes into the |
* appropriate POSIX status values. |
*/ |
|
int _POSIX_Mutex_From_core_mutex_status( |
CORE_mutex_Status status |
); |
|
|
#include <rtems/posix/mutex.inl> |
#if defined(RTEMS_MULTIPROCESSING) |
#include <rtems/posix/mutexmp.h> |
#endif |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of include file */ |
|
/include/rtems/posix/config.h
0,0 → 1,62
/* config.h |
* |
* This include file contains the table of user defined configuration |
* parameters specific for the POSIX API. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* config.h,v 1.14 1999/11/17 17:50:21 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_CONFIGURATION_h |
#define __RTEMS_POSIX_CONFIGURATION_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
/* |
* XXX |
* |
* The following records define the Configuration Table. The |
* information contained in this table is required in all |
* RTEMS systems, whether single or multiprocessor. This |
* table primarily defines the following: |
* |
* + required number of each object type |
*/ |
|
/* |
* For now, we are only allowing the user to specify the entry point |
* and stack size for POSIX initialization threads. |
*/ |
|
typedef struct { |
void *(*thread_entry)(void *); |
int stack_size; |
} posix_initialization_threads_table; |
|
typedef struct { |
int maximum_threads; |
int maximum_mutexes; |
int maximum_condition_variables; |
int maximum_keys; |
int maximum_timers; |
int maximum_queued_signals; |
int maximum_message_queues; |
int maximum_semaphores; |
int number_of_initialization_threads; |
posix_initialization_threads_table *User_initialization_threads_table; |
} posix_api_configuration_table; |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of include file */ |
/include/rtems/posix/intr.h
0,0 → 1,153
/* rtems/posix/intr.h |
* |
* This include file contains all the private support information for |
* POSIX Interrupt Manager. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* intr.h,v 1.9 1999/11/17 17:50:21 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_KEY_h |
#define __RTEMS_POSIX_KEY_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/score/isr.h> |
#include <rtems/score/object.h> |
|
/* |
* Data Structure used to manage each POSIX Interrupt Vector |
*/ |
|
typedef struct { |
int number_installed; |
int lock_count; |
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; |
Thread_Control *server; |
int (*handler)( void *area ); |
volatile void *user_data_area; |
} POSIX_Interrupt_Handler_control; |
|
/* |
* The following defines the information control block used to manage |
* this class of objects. |
*/ |
|
POSIX_EXTERN Objects_Information _POSIX_Interrupt_Handlers_Information; |
|
/* |
* The following is an array which is used to manage the set of |
* interrupt handlers installed on each vector. |
*/ |
|
POSIX_EXTERN POSIX_Interrupt_Control |
_POSIX_Interrupt_Information[ ISR_NUMBER_OF_VECTORS ]; |
|
/* |
* _POSIX_Interrupt_Manager_initialization |
* |
* DESCRIPTION: |
* |
* This routine performs the initialization necessary for this manager. |
*/ |
|
void _POSIX_Interrupt_Manager_initialization( |
unsigned32 maximum_interrupt_handlers |
); |
|
/* |
* _POSIX_Interrupt_Allocate |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
* 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 |
* resides on a remote node, then location is set to OBJECTS_REMOTE, |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* This function XXX. |
*/ |
|
void _POSIX_Interrupt_Handler( |
ISR_Vector_number vector |
); |
|
#include <rtems/posix/intr.inl> |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of include file */ |
|
/include/rtems/posix/condmp.h
0,0 → 1,161
/* condmp.h |
* |
* This include file contains all the constants and structures associated |
* with the Multiprocessing Support in the POSIX Condition Variable Manager. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* condmp.h,v 1.6 1999/11/17 17:50:21 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_MP_h |
#define __RTEMS_POSIX_CONDITION_VARIABLES_MP_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/score/mppkt.h> |
#include <rtems/score/object.h> |
#include <rtems/score/thread.h> |
#include <rtems/score/watchdog.h> |
|
/* |
* The following enumerated type defines the list of |
* remote condition variable operations. |
*/ |
|
typedef enum { |
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE = 0, |
POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_DELETE = 1, |
POSIX_CONDITION_VARIABLES_MP_EXTRACT_PROXY = 2, |
POSIX_CONDITION_VARIABLES_MP_OBTAIN_REQUEST = 3, |
POSIX_CONDITION_VARIABLES_MP_OBTAIN_RESPONSE = 4, |
POSIX_CONDITION_VARIABLES_MP_RELEASE_REQUEST = 5, |
POSIX_CONDITION_VARIABLES_MP_RELEASE_RESPONSE = 6, |
} POSIX_Condition_variables_MP_Remote_operations; |
|
/* |
* The following data structure defines the packet used to perform |
* remote condition variable operations. |
*/ |
|
typedef struct { |
MP_packet_Prefix Prefix; |
POSIX_Condition_variables_MP_Remote_operations operation; |
Objects_Name name; |
boolean wait; /* XXX options */ |
Objects_Id proxy_id; |
} POSIX_Condition_variables_MP_Packet; |
|
/* |
* _POSIX_Condition_variables_MP_Send_process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* process operation can be performed on another node. |
*/ |
|
void _POSIX_Condition_variables_MP_Send_process_packet ( |
POSIX_Condition_variables_MP_Remote_operations operation, |
Objects_Id condition_variables_id, |
Objects_Name name, |
Objects_Id proxy_id |
); |
|
/* |
* _POSIX_Condition_variables_MP_Send_request_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive operation can be initiated on another node. |
*/ |
|
int _POSIX_Condition_variables_MP_Send_request_packet ( |
POSIX_Condition_variables_MP_Remote_operations operation, |
Objects_Id condition_variables_id, |
boolean wait, /* XXX options */ |
Watchdog_Interval timeout |
); |
|
/* |
* _POSIX_Condition_variables_MP_Send_response_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive can be performed on another node. |
*/ |
|
void _POSIX_Condition_variables_MP_Send_response_packet ( |
POSIX_Condition_variables_MP_Remote_operations operation, |
Objects_Id condition_variables_id, |
Thread_Control *the_thread |
); |
|
/* |
* |
* _POSIX_Condition_variables_MP_Process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs the actions specific to this package for |
* the request from another node. |
*/ |
|
void _POSIX_Condition_variables_MP_Process_packet ( |
MP_packet_Prefix *the_packet_prefix |
); |
|
/* |
* _POSIX_Condition_variables_MP_Send_object_was_deleted |
* |
* DESCRIPTION: |
* |
* This routine is invoked indirectly by the thread queue |
* when a proxy has been removed from the thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Condition_variables_MP_Send_object_was_deleted ( |
Thread_Control *the_proxy |
); |
|
/* |
* _POSIX_Condition_variables_MP_Send_extract_proxy |
* |
* DESCRIPTION: |
* |
* This routine is invoked when a task is deleted and it |
* has a proxy which must be removed from a thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Condition_variables_MP_Send_extract_proxy ( |
Thread_Control *the_thread |
); |
|
/* |
* _POSIX_Condition_variables_MP_Get_packet |
* |
* DESCRIPTION: |
* |
* This function is used to obtain a condition variable mp packet. |
*/ |
|
POSIX_Condition_variables_MP_Packet |
*_POSIX_Condition_variables_MP_Get_packet ( void ); |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of file */ |
/include/rtems/posix/semaphoremp.h
0,0 → 1,160
/* semaphoremp.h |
* |
* This include file contains all the constants and structures associated |
* with the Multiprocessing Support in the POSIX Semaphore Manager. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* semaphoremp.h,v 1.7 1999/11/29 15:44:57 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_SEMAPHORE_MP_h |
#define __RTEMS_POSIX_SEMAPHORE_MP_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/score/mppkt.h> |
#include <rtems/score/object.h> |
#include <rtems/score/thread.h> |
#include <rtems/score/watchdog.h> |
|
/* |
* The following enumerated type defines the list of |
* remote semaphore operations. |
*/ |
|
typedef enum { |
POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE = 0, |
POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE = 1, |
POSIX_SEMAPHORE_MP_EXTRACT_PROXY = 2, |
POSIX_SEMAPHORE_MP_OBTAIN_REQUEST = 3, |
POSIX_SEMAPHORE_MP_OBTAIN_RESPONSE = 4, |
POSIX_SEMAPHORE_MP_RELEASE_REQUEST = 5, |
POSIX_SEMAPHORE_MP_RELEASE_RESPONSE = 6, |
} POSIX_Semaphore_MP_Remote_operations; |
|
/* |
* The following data structure defines the packet used to perform |
* remote semaphore operations. |
*/ |
|
typedef struct { |
MP_packet_Prefix Prefix; |
POSIX_Semaphore_MP_Remote_operations operation; |
Objects_Name name; |
boolean wait; /* XXX options */ |
Objects_Id proxy_id; |
} POSIX_Semaphore_MP_Packet; |
|
/* |
* _POSIX_Semaphore_MP_Send_process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* process operation can be performed on another node. |
*/ |
|
void _POSIX_Semaphore_MP_Send_process_packet( |
POSIX_Semaphore_MP_Remote_operations operation, |
Objects_Id semaphore_id, |
Objects_Name name, |
Objects_Id proxy_id |
); |
|
/* |
* _POSIX_Semaphore_MP_Send_request_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive operation can be initiated on another node. |
*/ |
|
int _POSIX_Semaphore_MP_Send_request_packet( |
POSIX_Semaphore_MP_Remote_operations operation, |
Objects_Id semaphore_id, |
boolean wait, /* XXX options */ |
Watchdog_Interval timeout |
); |
|
/* |
* _POSIX_Semaphore_MP_Send_response_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive can be performed on another node. |
*/ |
|
void _POSIX_Semaphore_MP_Send_response_packet( |
POSIX_Semaphore_MP_Remote_operations operation, |
Objects_Id semaphore_id, |
Thread_Control *the_thread |
); |
|
/* |
* |
* _POSIX_Semaphore_MP_Process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs the actions specific to this package for |
* the request from another node. |
*/ |
|
void _POSIX_Semaphore_MP_Process_packet( |
MP_packet_Prefix *the_packet_prefix |
); |
|
/* |
* _POSIX_Semaphore_MP_Send_object_was_deleted |
* |
* DESCRIPTION: |
* |
* This routine is invoked indirectly by the thread queue |
* when a proxy has been removed from the thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Semaphore_MP_Send_object_was_deleted( |
Thread_Control *the_proxy |
); |
|
/* |
* _POSIX_Semaphore_MP_Send_extract_proxy |
* |
* DESCRIPTION: |
* |
* This routine is invoked when a task is deleted and it |
* has a proxy which must be removed from a thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Semaphore_MP_Send_extract_proxy( |
Thread_Control *the_thread |
); |
|
/* |
* _POSIX_Semaphore_MP_Get_packet |
* |
* DESCRIPTION: |
* |
* This function is used to obtain a semaphore mp packet. |
*/ |
|
POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet( void ); |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of file */ |
/include/rtems/posix/timer.h
0,0 → 1,71
/* |
* timer.h,v 1.4 2000/08/25 17:15:44 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_TIMERS_h |
#define __RTEMS_POSIX_TIMERS_h |
|
/* ************ |
* Constants |
* ************/ |
|
#define STATE_FREE_C 0x01 /* Free position of the table of timers */ |
#define STATE_CREATE_NEW_C 0x02 /* Created timer but not running */ |
#define STATE_CREATE_RUN_C 0x03 /* Created timer and running */ |
#define STATE_CREATE_STOP_C 0x04 /* Created, ran and stopped timer */ |
#define MAX_NSEC_C 1000000000 /* Maximum number of nsec allowed */ |
#define MIN_NSEC_C 0 /* Minimum number of nsec allowew */ |
#define TIMER_RELATIVE_C 0 /* Indicates that the fire time is |
* relative to the current one */ |
#define SEC_TO_TICKS_C _TOD_Ticks_per_second /* Number of ticks in a second*/ |
#define NSEC_PER_SEC_C 1000000000 /* Nanoseconds in a second */ |
|
#define NO_MORE_TIMERS_C 11 /* There is not available timers */ |
#define BAD_TIMER_C 11 /* The timer does not exist in the table */ |
|
#define SECONDS_PER_YEAR_C ( 360 * 24 * 60 * 60 ) |
#define SECONDS_PER_MONTH_C ( 30 * 24 * 60 * 60 ) |
#define SECONDS_PER_DAY_C ( 24 * 60 * 60 ) |
#define SECONDS_PER_HOUR_C ( 60 * 60 ) |
#define SECONDS_PER_MINUTE_C ( 60 ) |
|
|
/* |
* Data for a timer |
*/ |
|
typedef struct { |
Objects_Control Object; |
Watchdog_Control Ticker; |
|
pthread_t thread_id; /* Thread identifier */ |
char state; /* State of the timer */ |
struct sigevent inf; /* Information associated to the timer */ |
timer_t timer_id; /* Created timer identifier */ |
struct itimerspec timer_data; /* Timing data of the timer */ |
unsigned32 ticks; /* Number of ticks of the initialization */ |
unsigned32 overrun; /* Number of expirations of the timer */ |
rtems_time_of_day time; /* Time in which the timer was started */ |
} POSIX_Timer_Control; |
|
/* |
* Array of Timers |
*/ |
|
extern int timer_max; |
extern POSIX_Timer_Control *timer_struct; |
|
/* |
* The following defines the information control block used to manage |
* this class of objects. |
*/ |
|
RTEMS_EXTERN Objects_Information _POSIX_Timer_Information; |
|
#ifndef __RTEMS_APPLICATION__ |
#include <rtems/posix/timer.inl> |
#endif |
|
#endif |
/* end of include file */ |
|
/include/rtems/posix/priority.h
0,0 → 1,44
/* |
* |
* |
* priority.h,v 1.5 1997/04/15 18:02:12 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_PRIORITY_h |
#define __RTEMS_POSIX_PRIORITY_h |
|
#include <rtems/score/priority.h> |
|
/* |
* 1003.1b-1993,2.2.2.80 definition of priority, p. 19 |
* |
* "Numericallly higher values represent higher priorities." |
* |
* Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API. |
* |
* There are only 254 posix priority levels since a task at priority level |
* 255 would never run because of the RTEMS idle task. This is necessary |
* because GNAT maps the lowest Ada task priority to the lowest thread |
* priority. The lowest priority Ada task should get to run, so there is |
* a fundamental conflict with having 255 priorities. |
*/ |
|
#define POSIX_SCHEDULER_MAXIMUM_PRIORITY (254) |
|
#define POSIX_SCHEDULER_MINIMUM_PRIORITY (1) |
|
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid( |
int priority |
); |
|
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( |
int priority |
); |
|
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core( |
Priority_Control priority |
); |
|
#include <rtems/posix/priority.inl> |
|
#endif |
/include/rtems/posix/cond.h
0,0 → 1,169
/* rtems/posix/cond.h |
* |
* This include file contains all the private support information for |
* POSIX condition variables. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* cond.h,v 1.12 2000/12/01 22:05:32 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_h |
#define __RTEMS_POSIX_CONDITION_VARIABLES_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/score/object.h> |
#include <rtems/score/threadq.h> |
|
/* |
* Constant to indicate condition variable does not currently have |
* a mutex assigned to it. |
*/ |
|
#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0 |
|
/* |
* Data Structure used to manage a POSIX condition variable |
*/ |
|
typedef struct { |
Objects_Control Object; |
int process_shared; |
pthread_mutex_t Mutex; |
Thread_queue_Control Wait_queue; |
} POSIX_Condition_variables_Control; |
|
/* |
* The following defines the information control block used to manage |
* this class of objects. |
*/ |
|
POSIX_EXTERN Objects_Information _POSIX_Condition_variables_Information; |
|
/* |
* The default condition variable attributes structure. |
*/ |
|
extern const pthread_condattr_t _POSIX_Condition_variables_Default_attributes; |
|
/* |
* _POSIX_Condition_variables_Manager_initialization |
* |
* DESCRIPTION: |
* |
* This routine performs the initialization necessary for this manager. |
*/ |
|
void _POSIX_Condition_variables_Manager_initialization( |
unsigned32 maximum_condition_variables |
); |
|
/* |
* _POSIX_Condition_variables_Allocate |
* |
* DESCRIPTION: |
* |
* 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 * |
_POSIX_Condition_variables_Allocate( void ); |
|
/* |
* _POSIX_Condition_variables_Free |
* |
* DESCRIPTION: |
* |
* 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 |
* 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 |
* resides on a remote node, then location is set to OBJECTS_REMOTE, |
* 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 |
* and FALSE otherwise. |
*/ |
|
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null ( |
POSIX_Condition_variables_Control *the_condition_variable |
); |
|
/* |
* _POSIX_Condition_variables_Signal_support |
* |
* DESCRIPTION: |
* |
* 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 |
); |
|
/* |
* _POSIX_Condition_variables_Wait_support |
* |
* DESCRIPTION: |
* |
* 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, |
Watchdog_Interval timeout, |
boolean already_timedout |
); |
|
#include <rtems/posix/cond.inl> |
#if defined(RTEMS_MULTIPROCESSING) |
#include <rtems/posix/condmp.h> |
#endif |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of include file */ |
|
/include/rtems/posix/semaphore.h
0,0 → 1,181
/* rtems/posix/semaphore.h |
* |
* This include file contains all the private support information for |
* POSIX Semaphores. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* semaphore.h,v 1.13 2001/01/22 13:46:28 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_SEMAPHORE_h |
#define __RTEMS_POSIX_SEMAPHORE_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <semaphore.h> |
#include <rtems/score/coresem.h> |
|
#define SEM_FAILED (sem_t *) -1 |
|
/* |
* Data Structure used to manage a POSIX semaphore |
*/ |
|
typedef struct { |
Objects_Control Object; |
int process_shared; |
boolean named; |
boolean linked; |
unsigned32 open_count; |
CORE_semaphore_Control Semaphore; |
} POSIX_Semaphore_Control; |
|
/* |
* 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 |
* |
* DESCRIPTION: |
* |
* This routine performs the initialization necessary for this manager. |
*/ |
|
void _POSIX_Semaphore_Manager_initialization( |
unsigned32 maximum_semaphorees |
); |
|
/* |
* _POSIX_Semaphore_Allocate |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* This function maps semaphore IDs to semaphore control blocks. |
* If ID corresponds to a local semaphore, then it returns |
* the_semaphore control pointer which maps to ID and location |
* is set to OBJECTS_LOCAL. if the semaphore ID is global and |
* resides on a remote node, then location is set to OBJECTS_REMOTE, |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
); |
|
/* |
* _POSIX_Semaphore_Create_support |
* |
* DESCRIPTION: |
* |
* This routine supports the sem_init and sem_open routines. |
*/ |
|
int _POSIX_Semaphore_Create_support( |
const char *name, |
int pshared, |
unsigned int value, |
POSIX_Semaphore_Control **the_sem |
); |
|
/* |
* _POSIX_Semaphore_Delete |
* |
* DESCRIPTION: |
* |
* This routine supports the sem_close and sem_unlink routines. |
*/ |
|
void _POSIX_Semaphore_Delete( |
POSIX_Semaphore_Control *the_semaphore |
); |
|
/* |
* _POSIX_Semaphore_Wait_support |
* |
* DESCRIPTION: |
* |
* This routine supports the sem_wait, sem_trywait, and sem_timedwait |
* services. |
*/ |
|
int _POSIX_Semaphore_Wait_support( |
sem_t *sem, |
boolean blocking, |
Watchdog_Interval timeout |
); |
|
/* |
* _POSIX_Semaphore_Name_to_id |
* |
* DESCRIPTION: |
* |
* This routine performs name to id translation. |
*/ |
|
int _POSIX_Semaphore_Name_to_id( |
const char *name, |
sem_t *id |
); |
|
#include <rtems/posix/semaphore.inl> |
#if defined(RTEMS_MULTIPROCESSING) |
#include <rtems/posix/semaphoremp.h> |
#endif |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of include file */ |
|
/include/rtems/posix/pthreadmp.h
0,0 → 1,160
/* pthreadmp.h |
* |
* This include file contains all the constants and structures associated |
* with the Multiprocessing Support in the POSIX Threads Manager. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* pthreadmp.h,v 1.6 1999/11/17 17:50:22 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_THREADS_MP_h |
#define __RTEMS_POSIX_THREADS_MP_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/score/mppkt.h> |
#include <rtems/score/object.h> |
#include <rtems/score/thread.h> |
#include <rtems/score/watchdog.h> |
|
/* |
* The following enumerated type defines the list of |
* remote pthread operations. |
*/ |
|
typedef enum { |
POSIX_THREADS_MP_ANNOUNCE_CREATE = 0, |
POSIX_THREADS_MP_ANNOUNCE_DELETE = 1, |
POSIX_THREADS_MP_EXTRACT_PROXY = 2, |
POSIX_THREADS_MP_OBTAIN_REQUEST = 3, |
POSIX_THREADS_MP_OBTAIN_RESPONSE = 4, |
POSIX_THREADS_MP_RELEASE_REQUEST = 5, |
POSIX_THREADS_MP_RELEASE_RESPONSE = 6 |
} POSIX_Threads_MP_Remote_operations; |
|
/* |
* The following data structure defines the packet used to perform |
* remote pthread operations. |
*/ |
|
typedef struct { |
MP_packet_Prefix Prefix; |
POSIX_Threads_MP_Remote_operations operation; |
Objects_Name name; |
boolean wait; |
Objects_Id proxy_id; |
} POSIX_Threads_MP_Packet; |
|
/* |
* _POSIX_Threads_MP_Send_process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* process operation can be performed on another node. |
*/ |
|
void _POSIX_Threads_MP_Send_process_packet ( |
POSIX_Threads_MP_Remote_operations operation, |
Objects_Id pthread_id, |
Objects_Name name, |
Objects_Id proxy_id |
); |
|
/* |
* _POSIX_Threads_MP_Send_request_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive operation can be initiated on another node. |
*/ |
|
int _POSIX_Threads_MP_Send_request_packet ( |
POSIX_Threads_MP_Remote_operations operation, |
Objects_Id pthread_id, |
boolean wait, |
Watchdog_Interval timeout |
); |
|
/* |
* _POSIX_Threads_MP_Send_response_packet |
* |
* DESCRIPTION: |
* |
* This routine performs a remote procedure call so that a |
* directive can be performed on another node. |
*/ |
|
void _POSIX_Threads_MP_Send_response_packet ( |
POSIX_Threads_MP_Remote_operations operation, |
Objects_Id pthread_id, |
Thread_Control *the_thread |
); |
|
/* |
* |
* _POSIX_Threads_MP_Process_packet |
* |
* DESCRIPTION: |
* |
* This routine performs the actions specific to this package for |
* the request from another node. |
*/ |
|
void _POSIX_Threads_MP_Process_packet ( |
MP_packet_Prefix *the_packet_prefix |
); |
|
/* |
* _POSIX_Threads_MP_Send_object_was_deleted |
* |
* DESCRIPTION: |
* |
* This routine is invoked indirectly by the thread queue |
* when a proxy has been removed from the thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Threads_MP_Send_object_was_deleted ( |
Thread_Control *the_proxy |
); |
|
/* |
* _POSIX_Threads_MP_Send_extract_proxy |
* |
* DESCRIPTION: |
* |
* This routine is invoked when a task is deleted and it |
* has a proxy which must be removed from a thread queue and |
* the remote node must be informed of this. |
*/ |
|
void _POSIX_Threads_MP_Send_extract_proxy ( |
Thread_Control *the_thread |
); |
|
/* |
* _POSIX_Threads_MP_Get_packet |
* |
* DESCRIPTION: |
* |
* This function is used to obtain a pthread mp packet. |
*/ |
|
POSIX_Threads_MP_Packet *_POSIX_Threads_MP_Get_packet ( void ); |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of file */ |
/include/rtems/posix/cancel.h
0,0 → 1,29
/* rtems/posix/cancel.h |
* |
* cancel.h,v 1.6 2002/07/05 18:13:18 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_CANCEL_h |
#define __RTEMS_POSIX_CANCEL_h |
|
typedef struct { |
Chain_Node Node; |
void (*routine)( void * ); |
void *arg; |
} POSIX_Cancel_Handler_control; |
|
/* |
* _POSIX_Threads_cancel_run |
* |
* DESCRIPTION: |
* |
* This support routine runs through the chain of cancel handlers that |
* have been registered and executes them. |
*/ |
|
void _POSIX_Threads_cancel_run( |
Thread_Control *the_thread |
); |
|
#endif |
/* end of include file */ |
/include/rtems/posix/pthread.h
0,0 → 1,150
/* rtems/posix/pthread.h |
* |
* This include file contains all the private support information for |
* POSIX threads. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* pthread.h,v 1.15 1999/11/17 17:50:22 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_THREADS_h |
#define __RTEMS_POSIX_THREADS_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#include <rtems/posix/config.h> |
#include <rtems/posix/threadsup.h> |
|
#define PTHREAD_MINIMUM_STACK_SIZE (STACK_MINIMUM_SIZE * 2) |
|
/* |
* 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_Threads_User_initialization_threads; |
POSIX_EXTERN unsigned32 _POSIX_Threads_Number_of_initialization_threads; |
|
extern const pthread_attr_t _POSIX_Threads_Default_attributes; |
|
/* |
* _POSIX_Threads_Manager_initialization |
* |
* DESCRIPTION: |
* |
* This routine performs the initialization necessary for this manager. |
*/ |
|
void _POSIX_Threads_Manager_initialization( |
unsigned32 maximum_pthreads, |
unsigned32 number_of_initialization_threads, |
posix_initialization_threads_table *user_threads |
); |
|
/* |
* _POSIX_Threads_Allocate |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* This function maps pthread IDs to pthread control blocks. |
* If ID corresponds to a local pthread, then it returns |
* the_pthread control pointer which maps to ID and location |
* is set to OBJECTS_LOCAL. if the pthread ID is global and |
* resides on a remote node, then location is set to OBJECTS_REMOTE, |
* 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 |
* |
* DESCRIPTION: |
* |
* This function returns TRUE if the_pthread is NULL and FALSE otherwise. |
*/ |
|
RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null( |
Thread_Control *the_pthread |
); |
|
/* |
* _POSIX_Threads_Sporadic_budget_callout |
* |
* DESCRIPTION: |
* |
* This routine handles the sporadic scheduling algorithm. |
*/ |
|
void _POSIX_Threads_Sporadic_budget_callout( |
Thread_Control *the_thread |
); |
|
/* |
* _POSIX_Threads_Sporadic_budget_TSR |
* |
* DESCRIPTION: |
* |
* This routine supports the sporadic scheduling algorithm. |
*/ |
|
void _POSIX_Threads_Sporadic_budget_TSR( |
Objects_Id id, |
void *argument |
); |
|
#include <rtems/posix/pthread.inl> |
#if defined(RTEMS_MULTIPROCESSING) |
#include <rtems/posix/pthreadmp.h> |
#endif |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of include file */ |
|
/include/rtems/posix/key.h
0,0 → 1,135
/* rtems/posix/key.h |
* |
* This include file contains all the private support information for |
* POSIX key. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* key.h,v 1.9 2002/07/01 22:33:47 joel Exp |
*/ |
|
#ifndef __RTEMS_POSIX_KEY_h |
#define __RTEMS_POSIX_KEY_h |
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
/* |
* Data Structure used to manage a POSIX key |
* |
* 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; |
void (*destructor)( void * ); |
void **Values[ OBJECTS_APIS_LAST + 1 ]; |
} POSIX_Keys_Control; |
|
/* |
* 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 |
* |
* DESCRIPTION: |
* |
* This routine performs the initialization necessary for this manager. |
*/ |
|
void _POSIX_Key_Manager_initialization( |
unsigned32 maximum_keys |
); |
|
/* |
* _POSIX_Keys_Run_destructors |
* |
* DESCRIPTION: |
* |
* This function executes all the destructors associated with the thread's |
* keys. This function will execute until all values have been set to NULL. |
* |
* 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 |
); |
|
/* |
* _POSIX_Keys_Allocate |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
* |
* DESCRIPTION: |
* |
* This function maps key IDs to key control blocks. |
* If ID corresponds to a local keys, then it returns |
* the_key control pointer which maps to ID and location |
* is set to OBJECTS_LOCAL. if the keys ID is global and |
* resides on a remote node, then location is set to OBJECTS_REMOTE, |
* 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 |
* |
* DESCRIPTION: |
* |
* 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 |
); |
|
#include <rtems/posix/key.inl> |
|
#ifdef __cplusplus |
} |
#endif |
|
#endif |
/* end of include file */ |
|
include/rtems/posix
Property changes :
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile
+Makefile.in
Index: include/rtems
===================================================================
--- include/rtems (nonexistent)
+++ include/rtems (revision 1765)
include/rtems
Property changes :
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile
+Makefile.in
Index: include/Makefile.in
===================================================================
--- include/Makefile.in (nonexistent)
+++ include/Makefile.in (revision 1765)
@@ -0,0 +1,385 @@
+# Makefile.in generated by automake 1.6.2 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+AMTAR = @AMTAR@
+AWK = @AWK@
+BARE_CPU_CFLAGS = @BARE_CPU_CFLAGS@
+BARE_CPU_MODEL = @BARE_CPU_MODEL@
+CC = @CC@
+CPP = @CPP@
+DEPDIR = @DEPDIR@
+ENDIF = @ENDIF@
+GCCSED = @GCCSED@
+GCC_SPECS = @GCC_SPECS@
+HAS_POSIX_API = @HAS_POSIX_API@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+MAINT = @MAINT@
+MAKE = @MAKE@
+MULTIBUILDTOP = @MULTIBUILDTOP@
+MULTISUBDIR = @MULTISUBDIR@
+PACKAGE = @PACKAGE@
+PROJECT_INCLUDE = @PROJECT_INCLUDE@
+PROJECT_ROOT = @PROJECT_ROOT@
+PROJECT_TOPdir = @PROJECT_TOPdir@
+RANLIB = @RANLIB@
+RTEMS_BSP = @RTEMS_BSP@
+RTEMS_CPU = @RTEMS_CPU@
+RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@
+RTEMS_HOST = @RTEMS_HOST@
+RTEMS_ROOT = @RTEMS_ROOT@
+RTEMS_TOPdir = @RTEMS_TOPdir@
+RTEMS_USE_MACROS = @RTEMS_USE_MACROS@
+RTEMS_USE_NEWLIB = @RTEMS_USE_NEWLIB@
+STRIP = @STRIP@
+VERSION = @VERSION@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
+multilib_basedir = @multilib_basedir@
+project_libdir = @project_libdir@
+
+# include
+noinst_HEADERS = devctl.h intr.h rtems/posix/intr.h rtems/posix/threadsup.h
+
+include_HEADERS = sched.h aio.h mqueue.h semaphore.h
+
+PREINSTALL_FILES = $(PROJECT_INCLUDE) \
+ $(include_HEADERS:%=$(PROJECT_INCLUDE)/%)\
+$(PROJECT_INCLUDE)/rtems/posix \
+ $(include_rtems_posix_HEADERS:%=$(PROJECT_INCLUDE)/%)
+
+
+
+# rtems/posix
+include_rtems_posixdir = $(includedir)/rtems/posix
+
+MP_H_FILES = rtems/posix/condmp.h rtems/posix/mqueuemp.h rtems/posix/mutexmp.h \
+ rtems/posix/pthreadmp.h rtems/posix/semaphoremp.h
+
+
+STD_H_FILES = rtems/posix/cancel.h rtems/posix/cond.h rtems/posix/config.h \
+ rtems/posix/key.h rtems/posix/mqueue.h rtems/posix/mutex.h \
+ rtems/posix/posixapi.h rtems/posix/priority.h rtems/posix/psignal.h \
+ rtems/posix/pthread.h rtems/posix/ptimer.h rtems/posix/semaphore.h \
+ rtems/posix/threadsup.h rtems/posix/time.h rtems/posix/timer.h \
+ $(MP_H_FILES)
+
+
+@HAS_MP_TRUE@include_rtems_posix_HEADERS = $(STD_H_FILES) $(MP_H_FILES)
+@HAS_MP_FALSE@include_rtems_posix_HEADERS = $(STD_H_FILES)
+
+EXTRA_DIST = $(noinst_HEADERS)
+
+PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools
+subdir = include
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+HEADERS = $(include_HEADERS) $(include_rtems_posix_HEADERS) \
+ $(noinst_HEADERS)
+
+DIST_COMMON = $(include_HEADERS) $(include_rtems_posix_HEADERS) \
+ $(noinst_HEADERS) Makefile.am Makefile.in
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/../automake/local.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+uninstall-info-am:
+includeHEADERS_INSTALL = $(INSTALL_HEADER)
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(includedir)
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
+ $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \
+ done
+
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
+ rm -f $(DESTDIR)$(includedir)/$$f; \
+ done
+include_rtems_posixHEADERS_INSTALL = $(INSTALL_HEADER)
+install-include_rtems_posixHEADERS: $(include_rtems_posix_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(include_rtems_posixdir)
+ @list='$(include_rtems_posix_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(include_rtems_posixHEADERS_INSTALL) $$d$$p $(DESTDIR)$(include_rtems_posixdir)/$$f"; \
+ $(include_rtems_posixHEADERS_INSTALL) $$d$$p $(DESTDIR)$(include_rtems_posixdir)/$$f; \
+ done
+
+uninstall-include_rtems_posixHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_rtems_posix_HEADERS)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(include_rtems_posixdir)/$$f"; \
+ rm -f $(DESTDIR)$(include_rtems_posixdir)/$$f; \
+ done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ $(mkinstalldirs) $(distdir)/rtems/posix
+ @list='$(DISTFILES)'; for file in $$list; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS) all-local
+
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(includedir) $(DESTDIR)$(include_rtems_posixdir)
+
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-local mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-generic distclean-local distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-includeHEADERS \
+ install-include_rtems_posixHEADERS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+uninstall-am: uninstall-includeHEADERS \
+ uninstall-include_rtems_posixHEADERS uninstall-info-am
+
+.PHONY: GTAGS all all-am all-local check check-am clean clean-generic \
+ clean-local distclean distclean-generic distclean-local \
+ distclean-tags distdir dvi dvi-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-includeHEADERS \
+ install-include_rtems_posixHEADERS install-info install-info-am \
+ install-man install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic tags uninstall uninstall-am \
+ uninstall-includeHEADERS uninstall-include_rtems_posixHEADERS \
+ uninstall-info-am
+
+
+$(PROJECT_INCLUDE):
+ @$(mkinstalldirs) $@
+$(PROJECT_INCLUDE)/sys:
+ @$(mkinstalldirs) $@
+$(PROJECT_INCLUDE)/rtems/posix:
+ @$(mkinstalldirs) $@
+
+$(PROJECT_INCLUDE)/%.h: %.h
+ $(INSTALL_DATA) $< $@
+
+all-local: $(PREINSTALL_FILES)
+
+debug:
+ @echo
+ @echo "\"make debug\" is obsolete, instead use:"
+ @echo " make VARIANT=DEBUG"
+ @echo
+
+.PHONY: debug
+
+profile:
+ @echo
+ @echo "\"make profile\" is obsolete, instead use:"
+ @echo " make VARIANT=PROFILE"
+ @echo
+
+.PHONY: profile
+
+preinstall-am: $(PREINSTALL_FILES)
+preinstall: preinstall-am
+.PHONY: preinstall preinstall-am
+
+depend-am:
+depend: depend-am
+.PHONY: depend depend-am
+
+${ARCH}:
+ mkdir ${ARCH}
+
+clean-local:
+ $(RM) -r o-optimize o-debug o-profile $(CLEANDIRS)
+ $(RM) Depends-o-optimize.tmp Depends-o-debug.tmp Depends-o-profile.tmp
+
+distclean-local:
+ $(RM) Depends-o-optimize Depends-o-debug Depends-o-profile
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: include/intr.h
===================================================================
--- include/intr.h (nonexistent)
+++ include/intr.h (revision 1765)
@@ -0,0 +1,80 @@
+/* intr.h
+ *
+ * XXX: It is unclear if the type "intr_t" should be defined when
+ * _POSIX_INTERRUPT_CONTROL is not.
+ *
+ * intr.h,v 1.4 1999/04/26 18:22:08 joel Exp
+ */
+
+#ifndef __POSIX_INTERRUPTS_h
+#define __POSIX_INTERRUPTS_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+
+#if defined(_POSIX_INTERRUPT_CONTROL)
+
+/*
+ * 22.2 Concepts, P1003.4b/D8, p. 73
+ */
+
+typedef int intr_t;
+
+/*
+ * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74
+ */
+
+/*
+ * Return codes from an interrupt handler
+ */
+
+#define INTR_HANDLED_NOTIFY 0 /* ISR handled this interrupt, notify */
+ /* the thread that registered the */
+ /* ISR that the interrupt occurred. */
+#define INTR_HANDLED_DO_NOT_NOTIFY 1 /* ISR handled this interrupt, but */
+ /* do NOT perform notification. */
+#define INTR_NOT_HANDLED 2 /* ISR did not handle this interrupt, */
+ /* let the next handler try. */
+
+int intr_capture(
+ intr_t intr,
+ int (*intr_handler)( void *area ),
+ volatile void *area,
+ size_t areasize
+);
+
+int intr_release(
+ intr_t intr,
+ int (*intr_handler)( void *area )
+);
+
+int intr_lock(
+ intr_t intr
+);
+
+int intr_unlock(
+ intr_t intr
+);
+
+/*
+ * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76
+ */
+
+int intr_timed_wait(
+ int flags,
+ const struct timespec *timeout
+);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
Index: include/devctl.h
===================================================================
--- include/devctl.h (nonexistent)
+++ include/devctl.h (revision 1765)
@@ -0,0 +1,38 @@
+/* devctl.h
+ *
+ * devctl.h,v 1.4 1999/04/26 18:22:08 joel Exp
+ */
+
+#ifndef __POSIX_DEVICE_CONTROL_h
+#define __POSIX_DEVICE_CONTROL_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#if defined(_POSIX_DEVICE_CONTROL)
+
+#include
+#include
+
+/*
+ * 21.2.1 Control a Device, P1003.4b/D8, p. 65
+ */
+
+int devctl(
+ int filedes,
+ void *dev_data_ptr,
+ size_t nbyte,
+ int *dev_info_ptr
+);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
Index: include/mqueue.h
===================================================================
--- include/mqueue.h (nonexistent)
+++ include/mqueue.h (revision 1765)
@@ -0,0 +1,153 @@
+/* mqueue.h
+ *
+ * mqueue.h,v 1.4 1999/04/26 18:22:08 joel Exp
+ */
+
+#ifndef __POSIX_MESSAGE_QUEUE_h
+#define __POSIX_MESSAGE_QUEUE_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#if defined(_POSIX_MESSAGE_PASSING)
+
+#include
+
+#include
+#include
+
+/*
+ * 15.1.1 Data Structures, P1003.1b-1993, p. 271
+ */
+
+typedef Objects_Id mqd_t;
+
+struct mq_attr {
+ long mq_flags; /* Message queue flags */
+ long mq_maxmsg; /* Maximum number of messages */
+ long mq_msgsize; /* Maximum message size */
+ long mq_curmsgs; /* Number of messages currently queued */
+};
+
+/*
+ * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
+ */
+
+mqd_t mq_open(
+ const char *name,
+ int oflag,
+ ...
+);
+
+/*
+ * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
+ */
+
+int mq_close(
+ mqd_t mqdes
+);
+
+/*
+ * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
+ */
+
+int mq_unlink(
+ const char *name
+);
+
+/*
+ * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
+ *
+ * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
+ */
+
+int mq_send(
+ mqd_t mqdes,
+ const char *msg_ptr,
+ size_t msg_len,
+ unsigned int msg_prio
+);
+
+#if defined(_POSIX_TIMEOUTS)
+
+#include
+
+int mq_timedsend(
+ mqd_t mqdes,
+ const char *msg_ptr,
+ size_t msg_len,
+ unsigned int msg_prio,
+ const struct timespec *timeout
+);
+
+#endif /* _POSIX_TIMEOUTS */
+
+/*
+ * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
+ *
+ * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
+ */
+
+ssize_t mq_receive(
+ mqd_t mqdes,
+ char *msg_ptr,
+ size_t msg_len,
+ unsigned int *msg_prio
+);
+
+#if defined(_POSIX_TIMEOUTS)
+
+int mq_timedreceive( /* XXX: should this be ssize_t */
+ mqd_t mqdes,
+ char *msg_ptr,
+ size_t msg_len,
+ unsigned int *msg_prio,
+ const struct timespec *timeout
+);
+
+#endif /* _POSIX_TIMEOUTS */
+
+#if defined(_POSIX_REALTIME_SIGNALS)
+
+/*
+ * 15.2.6 Notify Process that a Message is Available on a Queue,
+ * P1003.1b-1993, p. 280
+ */
+
+int mq_notify(
+ mqd_t mqdes,
+ const struct sigevent *notification
+);
+
+#endif /* _POSIX_REALTIME_SIGNALS */
+
+/*
+ * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
+ */
+
+int mq_setattr(
+ mqd_t mqdes,
+ const struct mq_attr *mqstat,
+ struct mq_attr *omqstat
+);
+
+/*
+ * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
+ */
+
+int mq_getattr(
+ mqd_t mqdes,
+ struct mq_attr *mqstat
+);
+
+#endif /* _POSIX_MESSAGE_PASSING */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
Index: include/Makefile.am
===================================================================
--- include/Makefile.am (nonexistent)
+++ include/Makefile.am (revision 1765)
@@ -0,0 +1,55 @@
+##
+## Makefile.am,v 1.12 2002/06/17 09:07:32 ralf Exp
+##
+
+
+$(PROJECT_INCLUDE):
+ @$(mkinstalldirs) $@
+$(PROJECT_INCLUDE)/sys:
+ @$(mkinstalldirs) $@
+$(PROJECT_INCLUDE)/rtems/posix:
+ @$(mkinstalldirs) $@
+
+$(PROJECT_INCLUDE)/%.h: %.h
+ $(INSTALL_DATA) $< $@
+
+# include
+noinst_HEADERS = devctl.h intr.h
+
+include_HEADERS = sched.h aio.h mqueue.h semaphore.h
+
+PREINSTALL_FILES = $(PROJECT_INCLUDE) \
+ $(include_HEADERS:%=$(PROJECT_INCLUDE)/%)
+
+# rtems/posix
+
+include_rtems_posixdir = $(includedir)/rtems/posix
+
+MP_H_FILES = rtems/posix/condmp.h rtems/posix/mqueuemp.h rtems/posix/mutexmp.h \
+ rtems/posix/pthreadmp.h rtems/posix/semaphoremp.h
+
+STD_H_FILES = rtems/posix/cancel.h rtems/posix/cond.h rtems/posix/config.h \
+ rtems/posix/key.h rtems/posix/mqueue.h rtems/posix/mutex.h \
+ rtems/posix/posixapi.h rtems/posix/priority.h rtems/posix/psignal.h \
+ rtems/posix/pthread.h rtems/posix/ptimer.h rtems/posix/semaphore.h \
+ rtems/posix/threadsup.h rtems/posix/time.h rtems/posix/timer.h \
+ $(MP_H_FILES)
+
+noinst_HEADERS += rtems/posix/intr.h rtems/posix/threadsup.h
+
+if HAS_MP
+include_rtems_posix_HEADERS = $(STD_H_FILES) $(MP_H_FILES)
+else
+include_rtems_posix_HEADERS = $(STD_H_FILES)
+endif
+
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix \
+ $(include_rtems_posix_HEADERS:%=$(PROJECT_INCLUDE)/%)
+
+## General
+
+all-local: $(PREINSTALL_FILES)
+
+EXTRA_DIST = $(noinst_HEADERS)
+
+include $(top_srcdir)/../automake/local.am
Index: include/semaphore.h
===================================================================
--- include/semaphore.h (nonexistent)
+++ include/semaphore.h (revision 1765)
@@ -0,0 +1,116 @@
+/* semaphore.h
+ *
+ * semaphore.h,v 1.4 1999/04/26 18:22:08 joel Exp
+ */
+
+#ifndef __POSIX_SEMAPHORE_h
+#define __POSIX_SEMAPHORE_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#if defined(_POSIX_SEMAPHORES)
+
+#include
+
+/*
+ * 11.1 Semaphore Characteristics, P1003.1b-1993, p.219
+ */
+
+typedef int sem_t;
+
+/*
+ * 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
+ */
+
+int sem_init(
+ sem_t *sem,
+ int pshared,
+ unsigned int value
+);
+
+/*
+ * 11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
+ */
+
+int sem_destroy(
+ sem_t *sem
+);
+
+/*
+ * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
+ *
+ * NOTE: Follows open() calling conventions.
+ */
+
+sem_t *sem_open(
+ const char *name,
+ int oflag,
+ ...
+);
+
+/*
+ * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
+ */
+
+int sem_close(
+ sem_t *sem
+);
+
+/*
+ * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
+ */
+
+int sem_unlink(
+ const char *name
+);
+
+/*
+ * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
+ *
+ * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
+ */
+
+int sem_wait(
+ sem_t *sem
+);
+
+int sem_trywait(
+ sem_t *sem
+);
+
+#if defined(_POSIX_TIMEOUTS)
+int sem_timedwait(
+ sem_t *sem,
+ const struct timespec *timeout
+);
+#endif
+
+/*
+ * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
+ */
+
+int sem_post(
+ sem_t *sem
+);
+
+/*
+ * 11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
+ */
+
+int sem_getvalue(
+ sem_t *sem,
+ int *sval
+);
+
+#endif /* _POSIX_SEMAPHORES */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
Index: include/sched.h
===================================================================
--- include/sched.h (nonexistent)
+++ include/sched.h (revision 1765)
@@ -0,0 +1,96 @@
+/* sched.h
+ *
+ * sched.h,v 1.5 1999/04/26 18:22:08 joel Exp
+ */
+
+
+#ifndef __POSIX_SCHEDULING_h
+#define __POSIX_SCHEDULING_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#if defined(_POSIX_PRIORITY_SCHEDULING)
+
+#include
+#include
+#include
+#include
+
+/*
+ * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
+ *
+ */
+
+int sched_setparam(
+ pid_t pid,
+ const struct sched_param *param
+);
+
+/*
+ * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
+ */
+
+int sched_getparam(
+ pid_t pid,
+ const struct sched_param *param
+);
+
+/*
+ * 13.3.3 Set Scheduling Policy and Scheduling Parameters,
+ * P1003.1b-1993, p. 254
+ */
+
+int sched_setscheduler(
+ pid_t pid,
+ int policy,
+ const struct sched_param *param
+);
+
+/*
+ * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
+ */
+
+int sched_getscheduler(
+ pid_t pid
+);
+
+/*
+ * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
+ */
+
+int sched_get_priority_max(
+ int policy
+);
+
+int sched_get_priority_min(
+ int policy
+);
+
+int sched_rr_get_interval(
+ pid_t pid,
+ struct timespec *interval
+);
+
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+
+#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
+
+/*
+ * 13.3.5 Yield Processor, P1003.1b-1993, p. 257
+ */
+
+int sched_yield( void );
+
+#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
+
Index: include/aio.h
===================================================================
--- include/aio.h (nonexistent)
+++ include/aio.h (revision 1765)
@@ -0,0 +1,145 @@
+/* aio.h
+ *
+ * aio.h,v 1.5 1999/04/26 18:04:46 joel Exp
+ */
+
+#ifndef __POSIX_ASYNCHRONOUS_IO_h
+#define __POSIX_ASYNCHRONOUS_IO_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#if defined(_POSIX_ASYNCHRONOUS_IO)
+
+/*
+ * 6.7.1 Data Definitions for Asynchronous Input and Output,
+ * P1003.1b-1993, p. 151
+ */
+
+#include
+#include
+#include
+#include
+
+/*
+ * 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
+ */
+
+#define AIO_CANCELED 0 /* all requested operations have been canceled */
+#define AIO_NOTCANCELED 1 /* some of the operations could not be canceled */
+ /* since they are in progress */
+#define AIO_ALLDONE 2 /* none of the requested operations could be */
+ /* canceled since they are already complete */
+
+/* lio_listio() options */
+
+#define LIO_WAIT 0 /* calling process is to suspend until the */
+ /* operation is complete */
+#define LIO_NOWAIT 1 /* calling process is to continue execution while */
+ /* the operation is performed and no notification */
+ /* shall be given when the operation is completed */
+#define LIO_READ 2 /* request a read() */
+#define LIO_WRITE 3 /* request a write() */
+#define LIO_NOP 4 /* no transfer is requested */
+
+/*
+ * 6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151
+ */
+
+struct aiocb {
+ int aio_fildes; /* File descriptor */
+ off_t aio_offset; /* File offset */
+ volatile void *aio_buf; /* Location of buffer */
+ size_t aio_nbytes; /* Length of transfer */
+ int aio_reqprio; /* Request priority offset */
+ struct sigevent aio_sigevent; /* Signal number and value */
+ int aoi_lio_opcode; /* Operation to be performed */
+};
+
+/*
+ * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
+ */
+
+int aio_read(
+ struct aiocb *aiocbp
+);
+
+/*
+ * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
+ */
+
+int aio_write(
+ struct aiocb *aiocbp
+);
+
+/*
+ * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
+ */
+
+int lio_listio(
+ int mode,
+ struct aiocb * const list[],
+ int nent,
+ struct sigevent *sig
+);
+
+/*
+ * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
+ */
+
+int aio_error(
+ const struct aiocb *aiocbp
+);
+
+/*
+ * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
+ * P1003.1b-1993, p. 162
+ */
+
+int aio_return(
+ const struct aiocb *aiocbp
+);
+
+/*
+ * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
+ */
+
+int aio_cancel(
+ int filedes,
+ struct aiocb *aiocbp
+);
+
+/*
+ * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
+ */
+
+int aio_suspend(
+ struct aiocb * const list[],
+ int nent,
+ const struct timespec *timeout
+);
+
+#if defined(_POSIX_SYNCHRONIZED_IO)
+
+/*
+ * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
+ */
+
+int aio_fsync(
+ int op,
+ struct aiocb *aiocbp
+);
+
+#endif /* _POSIX_SYNCHRONIZED_IO */
+
+#endif /* _POSIX_ASYNCHRONOUS_IO */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
Index: include
===================================================================
--- include (nonexistent)
+++ include (revision 1765)
include
Property changes :
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile
+Makefile.in
Index: macros/rtems/posix/timer.inl
===================================================================
--- macros/rtems/posix/timer.inl (nonexistent)
+++ macros/rtems/posix/timer.inl (revision 1765)
@@ -0,0 +1,53 @@
+/* timer.inl
+ *
+ * This file contains the macro implementation of the inlined routines
+ * from the POSIX Timer Manager.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * timer.inl,v 1.1 2000/12/01 18:57:36 joel Exp
+ */
+
+#ifndef __POSIX_TIMER_inl
+#define __POSIX_TIMER_inl
+
+/*PAGE
+ *
+ * _POSIX_Timer_Allocate
+ */
+
+#define _POSIX_Timer_Allocate() \
+ (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information )
+
+/*PAGE
+ *
+ * _POSIX_Timer_Free
+ */
+
+#define _POSIX_Timer_Free( _the_timer ) \
+ _Objects_Free( &_POSIX_Timer_Information, &(_the_timer)->Object );
+
+/*PAGE
+ *
+ * _POSIX_Timer_Get
+ */
+
+#define _POSIX_Timer_Get( _the_timer ) \
+ (POSIX_Timer_Control *) \
+ _Objects_Get( &_POSIX_Timer_Information, (_id), (_location) )
+
+/*PAGE
+ *
+ * _POSIX_Timer_Is_null
+ */
+
+#define _POSIX_Timer_Is_null( _the_timer ) \
+ (!(_the_timer))
+
+#endif
+/* end of include file */
Index: macros/rtems/posix/mqueue.inl
===================================================================
--- macros/rtems/posix/mqueue.inl (nonexistent)
+++ macros/rtems/posix/mqueue.inl (revision 1765)
@@ -0,0 +1,101 @@
+/* rtems/posix/mqueue.inl
+ *
+ * This include file contains the macro implementation of the private
+ * inlined routines for POSIX Message Queue.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * mqueue.inl,v 1.3 2002/05/17 17:59:21 joel Exp
+ */
+
+#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_inl
+#define __RTEMS_POSIX_MESSAGE_QUEUE_inl
+
+/*
+ * _POSIX_Message_queue_Allocate
+ */
+
+#define _POSIX_Message_queue_Allocate() \
+ (POSIX_Message_queue_Control *) \
+ _Objects_Allocate( &_POSIX_Message_queue_Information )
+
+/*
+ * _POSIX_Message_queue_Allocate_fd
+ */
+
+#define _POSIX_Message_queue_Allocate_fd() \
+ (POSIX_Message_queue_Control_fd *) \
+ _Objects_Allocate( &_POSIX_Message_queue_Information_fds )
+
+/*
+ * _POSIX_Message_queue_Free
+ */
+
+#define _POSIX_Message_queue_Free( _the_mq ) \
+ _Objects_Free( &_POSIX_Message_queue_Information, &(_the_mq)->Object )
+
+/*
+ * _POSIX_Message_queue_Free_fd
+ */
+
+#define _POSIX_Message_queue_Free_fd( _the_mq_fd ) \
+ _Objects_Free( &_POSIX_Message_queue_Information_fds, &(_the_mq_fd)->Object )
+
+/*
+ * _POSIX_Message_queue_Namespace_remove
+ */
+
+#define _POSIX_Message_queue_Namespace_remove( _the_mq ) \
+ _Objects_Namespace_remove( \
+ &_POSIX_Message_queue_Information, &(_the_mq)->Object )
+
+/*
+ * _POSIX_Message_queue_Get
+ */
+
+#define _POSIX_Message_queue_Get( _id, _location ) \
+ (POSIX_Message_queue_Control *) \
+ _Objects_Get( &_POSIX_Message_queue_Information, (_id), (_location) )
+
+/*
+ * _POSIX_Message_queue_Get_fd
+ */
+
+#define _POSIX_Message_queue_Get_fd( _id, _location ) \
+ (POSIX_Message_queue_Control_fd *) \
+ _Objects_Get( &_POSIX_Message_queue_Information_fds, (_id), (_location) )
+
+/*
+ *
+ * _POSIX_Message_queue_Is_null
+ */
+
+#define _POSIX_Message_queue_Is_null( _the_mq ) \
+ (!(_the_mq))
+
+/*
+ *
+ * _POSIX_Message_queue_Priority_to_core
+ */
+
+#define _POSIX_Message_queue_Priority_to_core( _priority ) \
+ ((_priority) * -1)
+
+/*
+ * _POSIX_Message_queue_Priority_from_core
+ */
+
+/* absolute value without a library dependency */
+#define _POSIX_Message_queue_Priority_from_core( _priority ) \
+ ((((CORE_message_queue_Submit_types)(_priority)) >= 0) ? \
+ (_priority) : \
+ -((CORE_message_queue_Submit_types)(_priority)))
+
+#endif
+/* end of include file */
+
Index: macros/rtems/posix/priority.inl
===================================================================
--- macros/rtems/posix/priority.inl (nonexistent)
+++ macros/rtems/posix/priority.inl (revision 1765)
@@ -0,0 +1,25 @@
+/*
+ * priority.inl,v 1.1 2000/12/01 18:57:36 joel Exp
+ */
+
+#ifndef __RTEMS_POSIX_PRIORITY_inl
+#define __RTEMS_POSIX_PRIORITY_inl
+
+/*
+ * 1003.1b-1993,2.2.2.80 definition of priority, p. 19
+ *
+ * "Numericallly higher values represent higher priorities."
+ *
+ * Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
+ */
+
+#define _POSIX_Priority_Is_valid( _priority ) \
+ ((boolean) ((_priority) >= 1 && (_priority) <= 254))
+
+#define _POSIX_Priority_To_core( _priority ) \
+ ((Priority_Control) (255 - (_priority)))
+
+#define _POSIX_Priority_From_core( _priority ) \
+ (255 - (_priority))
+
+#endif
Index: macros/rtems/posix/mutex.inl
===================================================================
--- macros/rtems/posix/mutex.inl (nonexistent)
+++ macros/rtems/posix/mutex.inl (revision 1765)
@@ -0,0 +1,100 @@
+/* rtems/posix/mutex.inl
+ *
+ * This include file contains the macro implementation of the private
+ * inlined routines for POSIX mutex's.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * mutex.inl,v 1.1 2000/12/01 18:57:36 joel Exp
+ */
+
+#ifndef __RTEMS_POSIX_MUTEX_inl
+#define __RTEMS_POSIX_MUTEX_inl
+
+/*PAGE
+ *
+ * _POSIX_Mutex_Allocate
+ */
+
+#define _POSIX_Mutex_Allocate() \
+ (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information )
+
+/*PAGE
+ *
+ * _POSIX_Mutex_Free
+ */
+
+#define _POSIX_Mutex_Free( _the_mutex ) \
+ _Objects_Free( &_POSIX_Mutex_Information, &(_the_mutex)->Object )
+
+/*PAGE
+ *
+ * _POSIX_Mutex_Get
+ *
+ * NOTE: The support macro makes it possible for both to use exactly
+ * the same code to check for NULL id pointer and
+ * PTHREAD_MUTEX_INITIALIZER without adding overhead.
+ */
+
+#define ___POSIX_Mutex_Get_support( _id, _location ) \
+ do { \
+ int _status; \
+ \
+ if ( !_id ) { \
+ *_location = OBJECTS_ERROR; \
+ return (POSIX_Mutex_Control *) 0; \
+ } \
+ \
+ if ( *_id == PTHREAD_MUTEX_INITIALIZER ) { \
+ /* \
+ * Do an "auto-create" here. \
+ */ \
+ \
+ _status = pthread_mutex_init( _id, 0 ); \
+ if ( _status ) { \
+ *_location = OBJECTS_ERROR; \
+ return (POSIX_Mutex_Control *) 0; \
+ } \
+ } \
+ } while (0)
+
+static POSIX_Mutex_Control * _POSIX_Mutex_Get(
+ Objects_Id *id,
+ Objects_Locations *location
+)
+{
+ ___POSIX_Mutex_Get_support( id, location );
+
+ return (POSIX_Mutex_Control *)
+ _Objects_Get( &_POSIX_Mutex_Information, *id, location );
+}
+
+static POSIX_Mutex_Control *_POSIX_Mutex_Get_interrupt_disable(
+ Objects_Id *id,
+ Objects_Locations *location,
+ ISR_Level *level
+)
+{
+ ___POSIX_Mutex_Get_support( id, location );
+
+ return (POSIX_Mutex_Control *)
+ _Objects_Get_isr_disable( &_POSIX_Mutex_Information, *id, location, level );
+}
+
+
+/*PAGE
+ *
+ * _POSIX_Mutex_Is_null
+ */
+
+#define _POSIX_Mutex_Is_null( _the_mutex ) \
+ (!(_the_mutex))
+
+#endif
+/* end of include file */
+
Index: macros/rtems/posix/cond.inl
===================================================================
--- macros/rtems/posix/cond.inl (nonexistent)
+++ macros/rtems/posix/cond.inl (revision 1765)
@@ -0,0 +1,66 @@
+/* rtems/posix/cond.inl
+ *
+ * This include file contains the macro implementation of the private
+ * inlined routines for POSIX condition variables.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * cond.inl,v 1.1 2000/12/01 18:57:36 joel Exp
+ */
+
+#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_inl
+#define __RTEMS_POSIX_CONDITION_VARIABLES_inl
+
+/*PAGE
+ *
+ * _POSIX_Condition_variables_Allocate
+ */
+
+#define _POSIX_Condition_variables_Allocate() \
+ (POSIX_Condition_variables_Control *) \
+ _Objects_Allocate( &_POSIX_Condition_variables_Information )
+
+/*PAGE
+ *
+ * _POSIX_Condition_variables_Free
+ */
+
+#define _POSIX_Condition_variables_Free( _the_condition_variable ) \
+ _Objects_Free( &_POSIX_Condition_variables_Information, \
+ &(_the_condition_variable)->Object)
+
+/*PAGE
+ *
+ * _POSIX_Condition_variables_Get
+ */
+
+/* XXX how to write this as a macro */
+static POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
+ Objects_Id *id,
+ Objects_Locations *location
+)
+{
+/* XXX should support COND_INITIALIZER */
+ if ( id )
+ return (POSIX_Condition_variables_Control *)
+ _Objects_Get( &_POSIX_Condition_variables_Information, *id, location );
+
+ *location = OBJECTS_ERROR;
+ return NULL;
+}
+
+/*PAGE
+ *
+ * _POSIX_Condition_variables_Is_null
+ */
+
+#define _POSIX_Condition_variables_Is_null( _the_condition_variable ) \
+ (!(_the_condition_variable))
+
+#endif
+/* end of include file */
Index: macros/rtems/posix/semaphore.inl
===================================================================
--- macros/rtems/posix/semaphore.inl (nonexistent)
+++ macros/rtems/posix/semaphore.inl (revision 1765)
@@ -0,0 +1,64 @@
+/* rtems/posix/semaphore.inl
+ *
+ * This include file contains the macro implementation of the private
+ * inlined routines for POSIX Semaphores.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * semaphore.inl,v 1.1 2000/12/01 18:57:36 joel Exp
+ */
+
+#ifndef __RTEMS_POSIX_SEMAPHORE_inl
+#define __RTEMS_POSIX_SEMAPHORE_inl
+
+/*PAGE
+ *
+ * _POSIX_Semaphore_Allocate
+ */
+
+#define _POSIX_Semaphore_Allocate() \
+ (POSIX_Semaphore_Control *) \
+ _Objects_Allocate( &_POSIX_Semaphore_Information );
+
+/*PAGE
+ *
+ * _POSIX_Semaphore_Free
+ */
+
+#define _POSIX_Semaphore_Free( _the_semaphore ) \
+ _Objects_Free( &_POSIX_Semaphore_Information, &(_the_semaphore)->Object )
+
+/*PAGE
+ *
+ * _POSIX_Semaphore_Namespace_remove
+ */
+
+#define _POSIX_Semaphore_Namespace_remove( _the_semaphore ) \
+ _Objects_Namespace_remove( \
+ &_POSIX_Semaphore_Information, &(_the_semaphore)->Object )
+
+/*PAGE
+ *
+ * _POSIX_Semaphore_Get
+ */
+
+#define _POSIX_Semaphore_Get( _id, _location ) \
+ (POSIX_Semaphore_Control *) \
+ _Objects_Get( &_POSIX_Semaphore_Information, *(_id), (_location) )
+
+/*PAGE
+ *
+ * _POSIX_Semaphore_Is_null
+ */
+
+#define _POSIX_Semaphore_Is_null( _the_semaphore ) \
+ (!(_the_semaphore))
+
+#endif
+/* end of include file */
+
Index: macros/rtems/posix/pthread.inl
===================================================================
--- macros/rtems/posix/pthread.inl (nonexistent)
+++ macros/rtems/posix/pthread.inl (revision 1765)
@@ -0,0 +1,54 @@
+/* rtems/posix/pthread.inl
+ *
+ * This include file contains the macro implementation of the private
+ * inlined routines for POSIX threads.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * pthread.inl,v 1.1 2000/12/01 18:57:36 joel Exp
+ */
+
+#ifndef __RTEMS_POSIX_THREADS_inl
+#define __RTEMS_POSIX_THREADS_inl
+
+/*PAGE
+ *
+ * _POSIX_Threads_Allocate
+ */
+
+#define _POSIX_Threads_Allocate() \
+ (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information )
+
+/*PAGE
+ *
+ * _POSIX_Threads_Free
+ */
+
+#define _POSIX_Threads_Free( _the_pthread ) \
+ _Objects_Free( &_POSIX_Threads_Information, &(_the_pthread)->Object )
+
+/*PAGE
+ *
+ * _POSIX_Threads_Get
+ */
+
+#define _POSIX_Threads_Get( _id, _location ) \
+ (Thread_Control *) \
+ _Objects_Get( &_POSIX_Threads_Information, (Objects_Id)(_id), (_location) )
+
+/*PAGE
+ *
+ * _POSIX_Threads_Is_null
+ */
+
+#define _POSIX_Threads_Is_null( _the_pthread ) \
+ (!(_the_pthread))
+
+#endif
+/* end of include file */
+
Index: macros/rtems/posix/key.inl
===================================================================
--- macros/rtems/posix/key.inl (nonexistent)
+++ macros/rtems/posix/key.inl (revision 1765)
@@ -0,0 +1,54 @@
+/* rtems/posix/key.inl
+ *
+ * This include file contains the macro implementation of the private
+ * inlined routines for POSIX key's.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * key.inl,v 1.1 2000/12/01 18:57:36 joel Exp
+ */
+
+#ifndef __RTEMS_POSIX_KEY_inl
+#define __RTEMS_POSIX_KEY_inl
+
+/*PAGE
+ *
+ * _POSIX_Keys_Allocate
+ */
+
+#define _POSIX_Keys_Allocate() \
+ (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information )
+
+/*PAGE
+ *
+ * _POSIX_Keys_Free
+ */
+
+#define _POSIX_Keys_Free( _the_key ) \
+ _Objects_Free( &_POSIX_Keys_Information, &(_the_key)->Object );
+
+/*PAGE
+ *
+ * _POSIX_Keys_Get
+ */
+
+#define _POSIX_Keys_Get( _id, _location ) \
+ (POSIX_Keys_Control *) \
+ _Objects_Get( &_POSIX_Keys_Information, (_id), (_location) )
+
+/*PAGE
+ *
+ * _POSIX_Keys_Is_null
+ */
+
+#define _POSIX_Keys_Is_null( _the_key ) \
+ (!(_the_key))
+
+#endif
+/* end of include file */
+
Index: macros/rtems/posix/intr.inl
===================================================================
--- macros/rtems/posix/intr.inl (nonexistent)
+++ macros/rtems/posix/intr.inl (revision 1765)
@@ -0,0 +1,55 @@
+/* rtems/posix/intr.inl
+ *
+ * This include file contains the macro implementation of the private
+ * inlined routines for POSIX Interrupt Manager
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * intr.inl,v 1.1 2000/12/01 18:57:36 joel Exp
+ */
+
+#ifndef __RTEMS_POSIX_INTERRUPT_inl
+#define __RTEMS_POSIX_INTERRUPT_inl
+
+/*PAGE
+ *
+ * _POSIX_Interrupt_Allocate
+ */
+
+#define _POSIX_Interrupt_Allocate() \
+ (POSIX_Interrupt_Handler_control *) \
+ _Objects_Allocate( &_POSIX_Interrupt_Handlers_Information )
+
+/*PAGE
+ *
+ * _POSIX_Interrupt_Free
+ */
+
+#define _POSIX_Interrupt_Free( _the_intr ) \
+ _Objects_Free( &_POSIX_Interrupt_Handlers_Information, &(_the_intr)->Object )
+
+/*PAGE
+ *
+ * _POSIX_Interrupt_Get
+ */
+
+#define _POSIX_Interrupt_Get( _id, _location ) \
+ (POSIX_Interrupt_Control *) \
+ _Objects_Get( &_POSIX_Interrupt_Handlers_Information, (_id), (_location) )
+
+/*PAGE
+ *
+ * _POSIX_Interrupt_Is_null
+ */
+
+#define _POSIX_Interrupt_Is_null( _the_intr ) \
+ (!(_the_intr))
+
+#endif
+/* end of include file */
+
Index: macros/rtems/posix
===================================================================
--- macros/rtems/posix (nonexistent)
+++ macros/rtems/posix (revision 1765)
macros/rtems/posix
Property changes :
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile
+Makefile.in
Index: macros/rtems
===================================================================
--- macros/rtems (nonexistent)
+++ macros/rtems (revision 1765)
macros/rtems
Property changes :
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile
+Makefile.in
Index: macros/Makefile.in
===================================================================
--- macros/Makefile.in (nonexistent)
+++ macros/Makefile.in (revision 1765)
@@ -0,0 +1,339 @@
+# Makefile.in generated by automake 1.6.2 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+AMTAR = @AMTAR@
+AWK = @AWK@
+BARE_CPU_CFLAGS = @BARE_CPU_CFLAGS@
+BARE_CPU_MODEL = @BARE_CPU_MODEL@
+CC = @CC@
+CPP = @CPP@
+DEPDIR = @DEPDIR@
+ENDIF = @ENDIF@
+GCCSED = @GCCSED@
+GCC_SPECS = @GCC_SPECS@
+HAS_POSIX_API = @HAS_POSIX_API@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+MAINT = @MAINT@
+MAKE = @MAKE@
+MULTIBUILDTOP = @MULTIBUILDTOP@
+MULTISUBDIR = @MULTISUBDIR@
+PACKAGE = @PACKAGE@
+PROJECT_INCLUDE = @PROJECT_INCLUDE@
+PROJECT_ROOT = @PROJECT_ROOT@
+PROJECT_TOPdir = @PROJECT_TOPdir@
+RANLIB = @RANLIB@
+RTEMS_BSP = @RTEMS_BSP@
+RTEMS_CPU = @RTEMS_CPU@
+RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@
+RTEMS_HOST = @RTEMS_HOST@
+RTEMS_ROOT = @RTEMS_ROOT@
+RTEMS_TOPdir = @RTEMS_TOPdir@
+RTEMS_USE_MACROS = @RTEMS_USE_MACROS@
+RTEMS_USE_NEWLIB = @RTEMS_USE_NEWLIB@
+STRIP = @STRIP@
+VERSION = @VERSION@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
+multilib_basedir = @multilib_basedir@
+project_libdir = @project_libdir@
+
+include_rtems_posixdir = $(includedir)/rtems/posix
+
+@MACROS_TRUE@noinst_HEADERS = rtems/posix/intr.inl
+@MACROS_TRUE@include_rtems_posix_HEADERS = rtems/posix/cond.inl rtems/posix/key.inl \
+@MACROS_TRUE@ rtems/posix/mqueue.inl rtems/posix/mutex.inl \
+@MACROS_TRUE@ rtems/posix/pthread.inl rtems/posix/priority.inl \
+@MACROS_TRUE@ rtems/posix/semaphore.inl rtems/posix/timer.inl
+
+
+@MACROS_TRUE@PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems/posix \
+@MACROS_TRUE@ $(include_rtems_posix_HEADERS:%=$(PROJECT_INCLUDE)/%)
+
+
+PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools
+subdir = macros
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+HEADERS = $(include_rtems_posix_HEADERS) $(noinst_HEADERS)
+
+DIST_COMMON = $(include_rtems_posix_HEADERS) $(noinst_HEADERS) \
+ Makefile.am Makefile.in
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/../automake/local.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign macros/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+uninstall-info-am:
+include_rtems_posixHEADERS_INSTALL = $(INSTALL_HEADER)
+install-include_rtems_posixHEADERS: $(include_rtems_posix_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(include_rtems_posixdir)
+ @list='$(include_rtems_posix_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(include_rtems_posixHEADERS_INSTALL) $$d$$p $(DESTDIR)$(include_rtems_posixdir)/$$f"; \
+ $(include_rtems_posixHEADERS_INSTALL) $$d$$p $(DESTDIR)$(include_rtems_posixdir)/$$f; \
+ done
+
+uninstall-include_rtems_posixHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_rtems_posix_HEADERS)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(include_rtems_posixdir)/$$f"; \
+ rm -f $(DESTDIR)$(include_rtems_posixdir)/$$f; \
+ done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ $(mkinstalldirs) $(distdir)/rtems/posix
+ @list='$(DISTFILES)'; for file in $$list; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS) all-local
+
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(include_rtems_posixdir)
+
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-local mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-generic distclean-local distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-include_rtems_posixHEADERS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+uninstall-am: uninstall-include_rtems_posixHEADERS uninstall-info-am
+
+.PHONY: GTAGS all all-am all-local check check-am clean clean-generic \
+ clean-local distclean distclean-generic distclean-local \
+ distclean-tags distdir dvi dvi-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-include_rtems_posixHEADERS install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic tags \
+ uninstall uninstall-am uninstall-include_rtems_posixHEADERS \
+ uninstall-info-am
+
+
+$(PROJECT_INCLUDE)/rtems/posix:
+ @$(mkinstalldirs) $@
+$(PROJECT_INCLUDE)/%: %
+ $(INSTALL_DATA) $< $@
+
+all-local: $(PREINSTALL_FILES)
+
+debug:
+ @echo
+ @echo "\"make debug\" is obsolete, instead use:"
+ @echo " make VARIANT=DEBUG"
+ @echo
+
+.PHONY: debug
+
+profile:
+ @echo
+ @echo "\"make profile\" is obsolete, instead use:"
+ @echo " make VARIANT=PROFILE"
+ @echo
+
+.PHONY: profile
+
+preinstall-am: $(PREINSTALL_FILES)
+preinstall: preinstall-am
+.PHONY: preinstall preinstall-am
+
+depend-am:
+depend: depend-am
+.PHONY: depend depend-am
+
+${ARCH}:
+ mkdir ${ARCH}
+
+clean-local:
+ $(RM) -r o-optimize o-debug o-profile $(CLEANDIRS)
+ $(RM) Depends-o-optimize.tmp Depends-o-debug.tmp Depends-o-profile.tmp
+
+distclean-local:
+ $(RM) Depends-o-optimize Depends-o-debug Depends-o-profile
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: macros/Makefile.am
===================================================================
--- macros/Makefile.am (nonexistent)
+++ macros/Makefile.am (revision 1765)
@@ -0,0 +1,26 @@
+##
+## Makefile.am,v 1.5 2002/06/17 09:07:32 ralf Exp
+##
+
+
+include_rtems_posixdir = $(includedir)/rtems/posix
+
+$(PROJECT_INCLUDE)/rtems/posix:
+ @$(mkinstalldirs) $@
+$(PROJECT_INCLUDE)/%: %
+ $(INSTALL_DATA) $< $@
+
+if MACROS
+noinst_HEADERS = rtems/posix/intr.inl
+include_rtems_posix_HEADERS = rtems/posix/cond.inl rtems/posix/key.inl \
+ rtems/posix/mqueue.inl rtems/posix/mutex.inl \
+ rtems/posix/pthread.inl rtems/posix/priority.inl \
+ rtems/posix/semaphore.inl rtems/posix/timer.inl
+
+PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems/posix \
+ $(include_rtems_posix_HEADERS:%=$(PROJECT_INCLUDE)/%)
+endif
+
+all-local: $(PREINSTALL_FILES)
+
+include $(top_srcdir)/../automake/local.am
Index: macros
===================================================================
--- macros (nonexistent)
+++ macros (revision 1765)
macros
Property changes :
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile
+Makefile.in
Index: src/pthreadatfork.c
===================================================================
--- src/pthreadatfork.c (nonexistent)
+++ src/pthreadatfork.c (revision 1765)
@@ -0,0 +1,31 @@
+/*
+ * pthread_atfork() - POSIX 1003.1b 3.1.3
+ *
+ * 3.1.3 Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27
+ *
+ * RTEMS does not support processes, so we fall under this and do not
+ * provide this routine:
+ *
+ * "Either the implementation shall support the pthread_atfork() function
+ * as described above or the pthread_atfork() funciton shall not be
+ * provided."
+ *
+ * pthreadatfork.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+int pthread_atfork(
+ void (*prepare)(void),
+ void (*parent)(void),
+ void (*child)(void)
+)
+{
+ errno = ENOSYS;
+ return -1;
+}
Index: src/conddefaultattributes.c
===================================================================
--- src/conddefaultattributes.c (nonexistent)
+++ src/conddefaultattributes.c (revision 1765)
@@ -0,0 +1,28 @@
+/*
+ * conddefaultattributes.c,v 1.2 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * The default condition variable attributes structure.
+ */
+
+const pthread_condattr_t _POSIX_Condition_variables_Default_attributes = {
+ TRUE, /* is_initialized */
+ PTHREAD_PROCESS_PRIVATE /* process_shared */
+};
Index: src/getgid.c
===================================================================
--- src/getgid.c (nonexistent)
+++ src/getgid.c (revision 1765)
@@ -0,0 +1,47 @@
+/*
+ * getgid.c,v 1.6 2002/04/03 14:21:44 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+/*
+ * MACRO in userenv.h
+ *
+gid_t _POSIX_types_Gid = 0;
+*/
+
+/*PAGE
+ *
+ * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
+ * P1003.1b-1993, p. 84
+ */
+
+gid_t getgid( void )
+{
+ return _POSIX_types_Gid;
+}
+
+/*PAGE
+ *
+ * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
+ */
+
+int setgid(
+ gid_t gid
+)
+{
+ _POSIX_types_Gid = gid;
+ return 0;
+}
Index: src/posixtimespectointerval.c
===================================================================
--- src/posixtimespectointerval.c (nonexistent)
+++ src/posixtimespectointerval.c (revision 1765)
@@ -0,0 +1,42 @@
+/*
+ * posixtimespectointerval.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+/*PAGE
+ *
+ * _POSIX_Timespec_to_interval
+ */
+
+Watchdog_Interval _POSIX_Timespec_to_interval(
+ const struct timespec *time
+)
+{
+ Watchdog_Interval ticks;
+
+ ticks = (time->tv_sec * TOD_MICROSECONDS_PER_SECOND) /
+ _TOD_Microseconds_per_tick;
+
+ ticks += (time->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) /
+ _TOD_Microseconds_per_tick;
+
+ if (ticks)
+ return ticks;
+
+ return 1;
+}
Index: src/clockgetres.c
===================================================================
--- src/clockgetres.c (nonexistent)
+++ src/clockgetres.c (revision 1765)
@@ -0,0 +1,55 @@
+/*
+ * clockgetres.c,v 1.5 2002/01/04 18:28:24 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+/*PAGE
+ *
+ * 14.2.1 Clocks, P1003.1b-1993, p. 263
+ */
+
+int clock_getres(
+ clockid_t clock_id,
+ struct timespec *res
+)
+{
+ if ( !res )
+ rtems_set_errno_and_return_minus_one( EINVAL );
+
+ switch ( clock_id ) {
+
+ /*
+ * All time in rtems is based on the same clock tick.
+ */
+
+ case CLOCK_REALTIME:
+ case CLOCK_PROCESS_CPUTIME:
+ case CLOCK_THREAD_CPUTIME:
+ if ( res ) {
+ res->tv_sec = _TOD_Microseconds_per_tick / 1000000;
+ res->tv_nsec = _TOD_Microseconds_per_tick * 1000;
+ /* _POSIX_Interval_to_timespec( _TOD_Microseconds_per_tick, res ); */
+ }
+ break;
+
+ default:
+ rtems_set_errno_and_return_minus_one( EINVAL );
+
+ }
+ return 0;
+}
Index: src/semclose.c
===================================================================
--- src/semclose.c (nonexistent)
+++ src/semclose.c (revision 1765)
@@ -0,0 +1,55 @@
+/*
+ * semclose.c,v 1.5 2002/01/04 18:28:24 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+
+/*PAGE
+ *
+ * sem_close
+ *
+ * Routine to close a semaphore that has been opened or initialized.
+ *
+ * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
+ */
+
+int sem_close(
+ sem_t *sem
+)
+{
+ register POSIX_Semaphore_Control *the_semaphore;
+ Objects_Locations location;
+
+ the_semaphore = _POSIX_Semaphore_Get( sem, &location );
+ switch ( location ) {
+ case OBJECTS_ERROR:
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ case OBJECTS_REMOTE:
+ _Thread_Dispatch();
+ return POSIX_MP_NOT_IMPLEMENTED();
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ case OBJECTS_LOCAL:
+ the_semaphore->open_count -= 1;
+ _POSIX_Semaphore_Delete( the_semaphore );
+ _Thread_Enable_dispatch();
+ return 0;
+ }
+ return POSIX_BOTTOM_REACHED();
+}
Index: src/mqueuesend.c
===================================================================
--- src/mqueuesend.c (nonexistent)
+++ src/mqueuesend.c (revision 1765)
@@ -0,0 +1,57 @@
+/*
+ * NOTE: The structure of the routines is identical to that of POSIX
+ * Message_queues to leave the option of having unnamed message
+ * queues at a future date. They are currently not part of the
+ * POSIX standard but unnamed message_queues are. This is also
+ * the reason for the apparently unnecessary tracking of
+ * the process_shared attribute. [In addition to the fact that
+ * it would be trivial to add pshared to the mq_attr structure
+ * and have process private message queues.]
+ *
+ * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open
+ * time.
+ *
+ * mqueuesend.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
+ *
+ * NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
+ */
+
+int mq_send(
+ mqd_t mqdes,
+ const char *msg_ptr,
+ size_t msg_len,
+ unsigned int msg_prio
+)
+{
+ return _POSIX_Message_queue_Send_support(
+ mqdes,
+ msg_ptr,
+ msg_len,
+ msg_prio,
+ THREAD_QUEUE_WAIT_FOREVER
+ );
+}
+
Index: src/pthreadattrgetinheritsched.c
===================================================================
--- src/pthreadattrgetinheritsched.c (nonexistent)
+++ src/pthreadattrgetinheritsched.c (revision 1765)
@@ -0,0 +1,32 @@
+/*
+ * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * pthreadattrgetinheritsched.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+int pthread_attr_getinheritsched(
+ const pthread_attr_t *attr,
+ int *inheritsched
+)
+{
+ if ( !attr || !attr->is_initialized || !inheritsched )
+ return EINVAL;
+
+ *inheritsched = attr->inheritsched;
+ return 0;
+}
+
Index: src/mutexattrgetprotocol.c
===================================================================
--- src/mutexattrgetprotocol.c (nonexistent)
+++ src/mutexattrgetprotocol.c (revision 1765)
@@ -0,0 +1,38 @@
+/*
+ * mutexattrgetprotocol.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#if defined(RTEMS_MULTIPROCESSING)
+#include
+#endif
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
+ */
+
+int pthread_mutexattr_getprotocol(
+ const pthread_mutexattr_t *attr,
+ int *protocol
+)
+{
+ if ( !attr || !attr->is_initialized || !protocol )
+ return EINVAL;
+
+ *protocol = attr->protocol;
+ return 0;
+}
Index: src/getuid.c
===================================================================
--- src/getuid.c (nonexistent)
+++ src/getuid.c (revision 1765)
@@ -0,0 +1,47 @@
+/*
+ * getuid.c,v 1.6 2002/04/03 14:21:44 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+/*
+ * MACRO in userenv.h
+ *
+uid_t _POSIX_types_Uid = 0;
+*/
+
+/*PAGE
+ *
+ * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
+ * P1003.1b-1993, p. 84
+ */
+
+uid_t getuid( void )
+{
+ return _POSIX_types_Uid;
+}
+
+/*PAGE
+ *
+ * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
+ */
+
+int setuid(
+ uid_t uid
+)
+{
+ _POSIX_types_Uid = uid;
+ return 0;
+}
Index: src/pthreadexit.c
===================================================================
--- src/pthreadexit.c (nonexistent)
+++ src/pthreadexit.c (revision 1765)
@@ -0,0 +1,49 @@
+/*
+ * 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
+ *
+ * NOTE: Key destructors are executed in the POSIX api delete extension.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * pthreadexit.c,v 1.4 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+void pthread_exit(
+ void *value_ptr
+)
+{
+ Objects_Information *the_information;
+
+ the_information = _Objects_Get_information( _Thread_Executing->Object.id );
+
+ /* This should never happen if _Thread_Get() works right */
+ assert( the_information );
+
+ _Thread_Disable_dispatch();
+
+ _Thread_Executing->Wait.return_argument = (unsigned32 *)value_ptr;
+
+ _Thread_Close( the_information, _Thread_Executing );
+
+ _POSIX_Threads_Free( _Thread_Executing );
+
+ _Thread_Enable_dispatch();
+}
+
Index: src/sigdelset.c
===================================================================
--- src/sigdelset.c (nonexistent)
+++ src/sigdelset.c (revision 1765)
@@ -0,0 +1,47 @@
+/*
+ * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * sigdelset.c,v 1.5 2002/01/04 18:28:24 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+/*
+ * 3.3.3 Manipulate Signal Sets, P1003.1b-1993, p. 69
+ */
+
+int sigdelset(
+ sigset_t *set,
+ int signo
+)
+{
+ if ( !set )
+ rtems_set_errno_and_return_minus_one( EINVAL );
+
+ if ( !signo )
+ return 0;
+
+ if ( !is_valid_signo(signo) )
+ rtems_set_errno_and_return_minus_one( EINVAL );
+
+ *set &= ~signo_to_mask(signo);
+ return 0;
+}
+
Index: src/pthreadattrsetschedpolicy.c
===================================================================
--- src/pthreadattrsetschedpolicy.c (nonexistent)
+++ src/pthreadattrsetschedpolicy.c (revision 1765)
@@ -0,0 +1,43 @@
+/*
+ * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * pthreadattrsetschedpolicy.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+#include
+#include
+
+int pthread_attr_setschedpolicy(
+ pthread_attr_t *attr,
+ int policy
+)
+{
+ if ( !attr || !attr->is_initialized )
+ return EINVAL;
+
+ switch ( policy ) {
+ case SCHED_OTHER:
+ case SCHED_FIFO:
+ case SCHED_RR:
+ case SCHED_SPORADIC:
+ attr->schedpolicy = policy;
+ return 0;
+
+ default:
+ return ENOTSUP;
+ }
+}
Index: src/testcancel.c
===================================================================
--- src/testcancel.c (nonexistent)
+++ src/testcancel.c (revision 1765)
@@ -0,0 +1,46 @@
+/*
+ * testcancel.c,v 1.4 2002/07/05 18:13:18 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
+ */
+
+void pthread_testcancel( void )
+{
+ POSIX_API_Control *thread_support;
+
+ /*
+ * Don't even think about deleting a resource from an ISR.
+ * Besides this request is supposed to be for _Thread_Executing
+ * and the ISR context is not a thread.
+ */
+
+ if ( _ISR_Is_in_progress() )
+ return;
+
+ thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
+
+ _Thread_Disable_dispatch();
+ if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
+ thread_support->cancelation_requested )
+ _POSIX_Threads_cancel_run( _Thread_Executing );
+ _Thread_Enable_dispatch();
+}
Index: src/mqueuetimedreceive.c
===================================================================
--- src/mqueuetimedreceive.c (nonexistent)
+++ src/mqueuetimedreceive.c (revision 1765)
@@ -0,0 +1,58 @@
+/*
+ * NOTE: The structure of the routines is identical to that of POSIX
+ * Message_queues to leave the option of having unnamed message
+ * queues at a future date. They are currently not part of the
+ * POSIX standard but unnamed message_queues are. This is also
+ * the reason for the apparently unnecessary tracking of
+ * the process_shared attribute. [In addition to the fact that
+ * it would be trivial to add pshared to the mq_attr structure
+ * and have process private message queues.]
+ *
+ * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open
+ * time.
+ *
+ * mqueuetimedreceive.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
+ *
+ * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
+ */
+
+int mq_timedreceive( /* XXX: should this be ssize_t */
+ mqd_t mqdes,
+ char *msg_ptr,
+ size_t msg_len,
+ unsigned int *msg_prio,
+ const struct timespec *timeout
+)
+{
+ return _POSIX_Message_queue_Receive_support(
+ mqdes,
+ msg_ptr,
+ msg_len,
+ msg_prio,
+ _POSIX_Timespec_to_interval( timeout )
+ );
+}
+
Index: src/condattrdestroy.c
===================================================================
--- src/condattrdestroy.c (nonexistent)
+++ src/condattrdestroy.c (revision 1765)
@@ -0,0 +1,35 @@
+/*
+ * condattrdestroy.c,v 1.2 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 11.4.1 Condition Variable Initialization Attributes,
+ * P1003.1c/Draft 10, p. 96
+ */
+
+int pthread_condattr_destroy(
+ pthread_condattr_t *attr
+)
+{
+ if ( !attr || attr->is_initialized == FALSE )
+ return EINVAL;
+
+ attr->is_initialized = FALSE;
+ return 0;
+}
Index: src/pthreadattrsetinheritsched.c
===================================================================
--- src/pthreadattrsetinheritsched.c (nonexistent)
+++ src/pthreadattrsetinheritsched.c (revision 1765)
@@ -0,0 +1,41 @@
+/*
+ * 13.5.1 Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * pthreadattrsetinheritsched.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+#include
+#include
+
+int pthread_attr_setinheritsched(
+ pthread_attr_t *attr,
+ int inheritsched
+)
+{
+ if ( !attr || !attr->is_initialized )
+ return EINVAL;
+
+ switch ( inheritsched ) {
+ case PTHREAD_INHERIT_SCHED:
+ case PTHREAD_EXPLICIT_SCHED:
+ attr->inheritsched = inheritsched;
+ return 0;
+
+ default:
+ return ENOTSUP;
+ }
+}
Index: src/execvp.c
===================================================================
--- src/execvp.c (nonexistent)
+++ src/execvp.c (revision 1765)
@@ -0,0 +1,20 @@
+/*
+ * execvp() - POSIX 1003.1b 3.1.2
+ *
+ * execvp.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+
+int execvp(
+ const char *path,
+ char *const argv[]
+)
+{
+ errno = ENOSYS;
+ return -1;
+}
Index: src/sempost.c
===================================================================
--- src/sempost.c (nonexistent)
+++ src/sempost.c (revision 1765)
@@ -0,0 +1,57 @@
+/*
+ * sempost.c,v 1.5 2002/01/04 18:28:24 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
+ */
+
+int sem_post(
+ sem_t *sem
+)
+{
+ register POSIX_Semaphore_Control *the_semaphore;
+ Objects_Locations location;
+
+ the_semaphore = _POSIX_Semaphore_Get( sem, &location );
+ switch ( location ) {
+ case OBJECTS_ERROR:
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ case OBJECTS_REMOTE:
+ _Thread_Dispatch();
+ return POSIX_MP_NOT_IMPLEMENTED();
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ case OBJECTS_LOCAL:
+ _CORE_semaphore_Surrender(
+ &the_semaphore->Semaphore,
+ the_semaphore->Object.id,
+#if defined(RTEMS_MULTIPROCESSING)
+ NULL /* XXX need to define a routine to handle this case */
+#else
+ NULL
+#endif
+ );
+ _Thread_Enable_dispatch();
+ return 0;
+ }
+ return POSIX_BOTTOM_REACHED();
+}
Index: src/sigtimedwait.c
===================================================================
--- src/sigtimedwait.c (nonexistent)
+++ src/sigtimedwait.c (revision 1765)
@@ -0,0 +1,140 @@
+/*
+ * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * sigtimedwait.c,v 1.9 2002/01/04 18:28:24 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+int _POSIX_signals_Get_highest(
+ sigset_t set
+)
+{
+ int signo;
+
+ for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
+ if ( set & signo_to_mask( signo ) )
+ return signo;
+ }
+
+/* XXX - add __SIGFIRSTNOTRT or something like that to newlib signal .h */
+
+ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
+ if ( set & signo_to_mask( signo ) )
+ return signo;
+ }
+
+ return 0;
+}
+
+int sigtimedwait(
+ const sigset_t *set,
+ siginfo_t *info,
+ const struct timespec *timeout
+)
+{
+ Thread_Control *the_thread;
+ POSIX_API_Control *api;
+ Watchdog_Interval interval;
+ siginfo_t signal_information;
+ siginfo_t *the_info;
+ int signo;
+ ISR_Level level;
+
+ /*
+ * Error check parameters before disabling interrupts.
+ */
+
+ interval = 0;
+ if ( timeout ) {
+
+ if ( timeout->tv_nsec < 0 ||
+ timeout->tv_nsec >= TOD_NANOSECONDS_PER_SECOND) {
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ }
+
+ interval = _POSIX_Timespec_to_interval( timeout );
+ }
+
+ /*
+ * Initialize local variables.
+ */
+
+ the_info = ( info ) ? info : &signal_information;
+
+ the_thread = _Thread_Executing;
+
+ api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+
+ /*
+ * What if they are already pending?
+ */
+
+ /* API signals pending? */
+
+ _ISR_Disable( level );
+ if ( *set & api->signals_pending ) {
+ /* XXX real info later */
+ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending );
+ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, FALSE, FALSE );
+ _ISR_Enable( level );
+
+ the_info->si_code = SI_USER;
+ the_info->si_value.sival_int = 0;
+ return the_info->si_signo;
+ }
+
+ /* Process pending signals? */
+
+ if ( *set & _POSIX_signals_Pending ) {
+ signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending );
+ _POSIX_signals_Clear_signals( api, signo, the_info, TRUE, FALSE );
+ _ISR_Enable( level );
+
+ the_info->si_signo = signo;
+ the_info->si_code = SI_USER;
+ the_info->si_value.sival_int = 0;
+ return signo;
+ }
+
+ the_info->si_signo = -1;
+
+ _Thread_Disable_dispatch();
+ the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
+ the_thread->Wait.return_code = EINTR;
+ the_thread->Wait.option = *set;
+ the_thread->Wait.return_argument = (void *) the_info;
+ _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
+ _ISR_Enable( level );
+ _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
+ _Thread_Enable_dispatch();
+
+ /*
+ * When the thread is set free by a signal, it is need to eliminate
+ * the signal.
+ */
+
+ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, FALSE, FALSE );
+ errno = _Thread_Executing->Wait.return_code;
+ return the_info->si_signo;
+}
Index: src/mutexattrsetprotocol.c
===================================================================
--- src/mutexattrsetprotocol.c (nonexistent)
+++ src/mutexattrsetprotocol.c (revision 1765)
@@ -0,0 +1,46 @@
+/*
+ * mutexattrsetprotocol.c,v 1.2 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#if defined(RTEMS_MULTIPROCESSING)
+#include
+#endif
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
+ */
+
+int pthread_mutexattr_setprotocol(
+ pthread_mutexattr_t *attr,
+ int protocol
+)
+{
+ if ( !attr || !attr->is_initialized )
+ return EINVAL;
+
+ switch ( protocol ) {
+ case PTHREAD_PRIO_NONE:
+ case PTHREAD_PRIO_INHERIT:
+ case PTHREAD_PRIO_PROTECT:
+ attr->protocol = protocol;
+ return 0;
+
+ default:
+ return EINVAL;
+ }
+}
Index: src/alarm.c
===================================================================
--- src/alarm.c (nonexistent)
+++ src/alarm.c (revision 1765)
@@ -0,0 +1,56 @@
+/*
+ * 3.4.1 Schedule Alarm, P1003.1b-1993, p. 79
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * alarm.c,v 1.6 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+/* #include */
+
+#include
+#include
+#include
+
+unsigned int alarm(
+ unsigned int seconds
+)
+{
+ unsigned int remaining = 0;
+ Watchdog_Control *the_timer;
+
+ the_timer = &_POSIX_signals_Alarm_timer;
+
+ switch ( _Watchdog_Remove( the_timer ) ) {
+ case WATCHDOG_INACTIVE:
+ case WATCHDOG_BEING_INSERTED:
+ break;
+
+ case WATCHDOG_ACTIVE:
+ case WATCHDOG_REMOVE_IT:
+ /*
+ * The stop_time and start_time fields are snapshots of ticks since
+ * boot. Since alarm() is dealing in seconds, we must account for
+ * this.
+ */
+
+ remaining = the_timer->initial -
+ ((the_timer->stop_time - the_timer->start_time) / _TOD_Ticks_per_second);
+ break;
+ }
+
+ _Watchdog_Insert_seconds( the_timer, seconds );
+
+ return remaining;
+}
+
Index: src/conddestroy.c
===================================================================
--- src/conddestroy.c (nonexistent)
+++ src/conddestroy.c (revision 1765)
@@ -0,0 +1,80 @@
+/*
+ * conddestroy.c,v 1.2 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 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:
+#if defined(RTEMS_MULTIPROCESSING)
+ _Thread_Dispatch();
+ return POSIX_MP_NOT_IMPLEMENTED();
+ return EINVAL;
+#endif
+
+ case OBJECTS_ERROR:
+ return EINVAL;
+
+
+ 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,
+ 0, /* Not used */
+ 0 /* Not used */
+ );
+ }
+#endif
+ _Thread_Enable_dispatch();
+ return 0;
+ }
+ return POSIX_BOTTOM_REACHED();
+}
Index: src/clockgetenableattr.c
===================================================================
--- src/clockgetenableattr.c (nonexistent)
+++ src/clockgetenableattr.c (revision 1765)
@@ -0,0 +1,32 @@
+/*
+ * clockgetenableattr.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+/*PAGE
+ *
+ * 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58
+ */
+
+int clock_getenable_attr(
+ clockid_t clock_id,
+ int *attr
+)
+{
+ return POSIX_NOT_IMPLEMENTED();
+}
Index: src/signal_2.c
===================================================================
--- src/signal_2.c (nonexistent)
+++ src/signal_2.c (revision 1765)
@@ -0,0 +1,52 @@
+/*
+ * signal(2) - Install signal handler
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * signal_2.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+typedef void (*sighandler_t)(int);
+
+sighandler_t signal(
+ int signum,
+ sighandler_t handler
+)
+{
+ struct sigaction s;
+ struct sigaction old;
+
+ s.sa_handler = handler ;
+ sigemptyset(&s.sa_mask);
+
+ /*
+ * Depending on which system we want to behave like, one of
+ * the following versions should be chosen.
+ */
+
+/* #define signal_like_linux */
+
+#if defined(signal_like_linux)
+ s.sa_flags = SA_RESTART | SA_INTERRUPT | SA_NOMASK;
+ s.sa_restorer= NULL ;
+#elif defined(signal_like_SVR4)
+ s.sa_flags = SA_RESTART;
+#else
+ s.sa_flags = 0;
+#endif
+
+ sigaction( signum, &s, &old );
+ return (sighandler_t) old.sa_handler;
+}
Index: src/time.c
===================================================================
--- src/time.c (nonexistent)
+++ src/time.c (revision 1765)
@@ -0,0 +1,52 @@
+/*
+ * time.c,v 1.32 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+/*PAGE
+ *
+ * 4.5.1 Get System Time, P1003.1b-1993, p. 91
+ */
+
+/* Using the implementation in newlib */
+#if 0
+time_t time(
+ time_t *tloc
+)
+{
+ time_t seconds_since_epoch;
+
+ /*
+ * No error is the time of day is not set. For RTEMS the system time
+ * starts out at the rtems epoch.
+ */
+
+ /*
+ * Internally the RTEMS epoch is 1988. This must be taken into account.
+ */
+
+ seconds_since_epoch = _TOD_Seconds_since_epoch;
+
+ seconds_since_epoch += POSIX_TIME_SECONDS_1970_THROUGH_1988;
+
+ if ( tloc )
+ *tloc = seconds_since_epoch;
+
+ return seconds_since_epoch;
+}
+#endif
Index: src/condattrinit.c
===================================================================
--- src/condattrinit.c (nonexistent)
+++ src/condattrinit.c (revision 1765)
@@ -0,0 +1,35 @@
+/*
+ * condattrinit.c,v 1.2 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 11.4.1 Condition Variable Initialization Attributes,
+ * P1003.1c/Draft 10, p. 96
+ */
+
+int pthread_condattr_init(
+ pthread_condattr_t *attr
+)
+{
+ if ( !attr )
+ return EINVAL;
+
+ *attr = _POSIX_Condition_variables_Default_attributes;
+ return 0;
+}
Index: src/mutexfromcorestatus.c
===================================================================
--- src/mutexfromcorestatus.c (nonexistent)
+++ src/mutexfromcorestatus.c (revision 1765)
@@ -0,0 +1,52 @@
+/*
+ * mutexfromcorestatus.c,v 1.2 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#if defined(RTEMS_MULTIPROCESSING)
+#include
+#endif
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * _POSIX_Mutex_From_core_mutex_status
+ */
+
+int _POSIX_Mutex_From_core_mutex_status(
+ CORE_mutex_Status status
+)
+{
+ switch ( status ) {
+ case CORE_MUTEX_STATUS_SUCCESSFUL:
+ return 0;
+ case CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT:
+ return EBUSY;
+ case CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED:
+ return EDEADLK;
+ case CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE:
+ return EPERM;
+ case CORE_MUTEX_WAS_DELETED:
+ return EINVAL;
+ case CORE_MUTEX_TIMEOUT:
+ return EAGAIN;
+ case CORE_MUTEX_STATUS_CEILING_VIOLATED:
+ return EINVAL;
+ default:
+ break;
+ }
+ assert( 0 );
+ return 0;
+}
Index: src/mqueuereceive.c
===================================================================
--- src/mqueuereceive.c (nonexistent)
+++ src/mqueuereceive.c (revision 1765)
@@ -0,0 +1,57 @@
+/*
+ * NOTE: The structure of the routines is identical to that of POSIX
+ * Message_queues to leave the option of having unnamed message
+ * queues at a future date. They are currently not part of the
+ * POSIX standard but unnamed message_queues are. This is also
+ * the reason for the apparently unnecessary tracking of
+ * the process_shared attribute. [In addition to the fact that
+ * it would be trivial to add pshared to the mq_attr structure
+ * and have process private message queues.]
+ *
+ * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open
+ * time.
+ *
+ * mqueuereceive.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
+ *
+ * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
+ */
+
+ssize_t mq_receive(
+ mqd_t mqdes,
+ char *msg_ptr,
+ size_t msg_len,
+ unsigned int *msg_prio
+)
+{
+ return _POSIX_Message_queue_Receive_support(
+ mqdes,
+ msg_ptr,
+ msg_len,
+ msg_prio,
+ THREAD_QUEUE_WAIT_FOREVER
+ );
+}
+
Index: src/semopen.c
===================================================================
--- src/semopen.c (nonexistent)
+++ src/semopen.c (revision 1765)
@@ -0,0 +1,124 @@
+/*
+ * semopen.c,v 1.8 2002/01/04 18:28:24 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * sem_open
+ *
+ * Opens a named semaphore. Used in conjunction with the sem_close
+ * and sem_unlink commands.
+ *
+ * 11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
+ *
+ * NOTE: When oflag is O_CREAT, then optional third and fourth
+ * parameters must be present.
+ */
+
+sem_t *sem_open(
+ const char *name,
+ int oflag,
+ ...
+ /* mode_t mode, */
+ /* unsigned int value */
+)
+{
+ va_list arg;
+ mode_t mode;
+ unsigned int value = 0;
+ int status;
+ sem_t the_semaphore_id;
+ POSIX_Semaphore_Control *the_semaphore;
+ Objects_Locations location;
+
+ _Thread_Disable_dispatch();
+
+ if ( oflag & O_CREAT ) {
+ va_start(arg, oflag);
+ mode = (mode_t) va_arg( arg, unsigned int );
+ value = va_arg( arg, unsigned int );
+ va_end(arg);
+ }
+
+ status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id );
+
+ /*
+ * If the name to id translation worked, then the semaphore exists
+ * and we can just return a pointer to the id. Otherwise we may
+ * need to check to see if this is a "semaphore does not exist"
+ * or some other miscellaneous error on the name.
+ */
+
+ if ( status ) {
+
+ /*
+ * Unless provided a valid name that did not already exist
+ * and we are willing to create then it is an error.
+ */
+
+ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) {
+ _Thread_Enable_dispatch();
+ rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
+ }
+ } else {
+
+ /*
+ * Check for existence with creation.
+ */
+
+ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
+ _Thread_Enable_dispatch();
+ rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
+ }
+
+ the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location );
+ the_semaphore->open_count += 1;
+ _Thread_Enable_dispatch();
+ _Thread_Enable_dispatch();
+ return (sem_t *)&the_semaphore->Object.id;
+
+ }
+
+ /*
+ * At this point, the semaphore does not exist and everything has been
+ * checked. We should go ahead and create a semaphore.
+ */
+
+ status =_POSIX_Semaphore_Create_support(
+ name,
+ FALSE, /* not shared across processes */
+ value,
+ &the_semaphore
+ );
+
+ /*
+ * errno was set by Create_support, so don't set it again.
+ */
+
+ _Thread_Enable_dispatch();
+
+ if ( status == -1 )
+ return SEM_FAILED;
+
+ return (sem_t *) &the_semaphore->Object.id;
+}
+
+
Index: src/killinfo.c
===================================================================
--- src/killinfo.c (nonexistent)
+++ src/killinfo.c (revision 1765)
@@ -0,0 +1,336 @@
+/*
+ * kill() support routine
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * killinfo.c,v 1.8 2002/07/01 22:33:47 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+/*PAGE
+ *
+ * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68
+ *
+ * NOTE: Behavior of kill() depends on _POSIX_SAVED_IDS.
+ */
+
+#define _POSIX_signals_Is_interested( _api, _mask ) \
+ ( ~(_api)->signals_blocked & (_mask) )
+
+int killinfo(
+ pid_t pid,
+ int sig,
+ const union sigval *value
+)
+{
+ sigset_t mask;
+ POSIX_API_Control *api;
+ unsigned32 the_api;
+ unsigned32 index;
+ unsigned32 maximum;
+ Objects_Information *the_info;
+ Objects_Control **object_table;
+ Thread_Control *the_thread;
+ Thread_Control *interested_thread;
+ Priority_Control interested_priority;
+ Chain_Control *the_chain;
+ Chain_Node *the_node;
+ siginfo_t siginfo_struct;
+ siginfo_t *siginfo;
+ POSIX_signals_Siginfo_node *psiginfo;
+
+ /*
+ * Only supported for the "calling process" (i.e. this node).
+ */
+
+ if ( pid != getpid() )
+ rtems_set_errno_and_return_minus_one( ESRCH );
+
+ /*
+ * Validate the signal passed if not 0.
+ */
+
+ if ( sig && !is_valid_signo(sig) ) {
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ }
+
+ /*
+ * If the signal is being ignored, then we are out of here.
+ */
+
+ if ( !sig || _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
+ return 0;
+ }
+
+ /*
+ * P1003.1c/Draft 10, p. 33 says that certain signals should always
+ * be directed to the executing thread such as those caused by hardware
+ * faults.
+ */
+
+ switch ( sig ) {
+ case SIGFPE:
+ case SIGILL:
+ case SIGSEGV:
+ return pthread_kill( pthread_self(), sig );
+ default:
+ break;
+ }
+
+ mask = signo_to_mask( sig );
+
+ /*
+ * Build up a siginfo structure
+ */
+
+ siginfo = &siginfo_struct;
+ siginfo->si_signo = sig;
+ siginfo->si_code = SI_USER;
+ if ( !value ) {
+ siginfo->si_value.sival_int = 0;
+ } else {
+ siginfo->si_value = *value;
+ }
+
+ _Thread_Disable_dispatch();
+
+ /*
+ * Is the currently executing thread interested? If so then it will
+ * get it an execute it as soon as the dispatcher executes.
+ */
+
+ the_thread = _Thread_Executing;
+
+ api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+ if ( _POSIX_signals_Is_interested( api, mask ) ) {
+ goto process_it;
+ }
+
+ /*
+ * Is an interested thread waiting for this signal (sigwait())?
+ */
+
+ /* XXX violation of visibility -- need to define thread queue support */
+
+ for( index=0 ;
+ index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
+ index++ ) {
+
+ the_chain = &_POSIX_signals_Wait_queue.Queues.Priority[ index ];
+
+ for ( the_node = the_chain->first ;
+ !_Chain_Is_tail( the_chain, the_node ) ;
+ the_node = the_node->next ) {
+
+ the_thread = (Thread_Control *)the_node;
+ api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+
+ if ((the_thread->Wait.option & mask) || (~api->signals_blocked & mask)) {
+ goto process_it;
+ }
+
+ }
+ }
+
+ /*
+ * Is any other thread interested? The highest priority interested
+ * thread is selected. In the event of a tie, then the following
+ * additional criteria is used:
+ *
+ * + ready thread over blocked
+ * + blocked on call interruptible by signal (can return EINTR)
+ * + blocked on call not interruptible by signal
+ *
+ * This looks at every thread in the system regardless of the creating API.
+ *
+ * NOTES:
+ *
+ * + rtems internal threads do not receive signals.
+ */
+
+ interested_thread = NULL;
+ interested_priority = PRIORITY_MAXIMUM + 1;
+
+ for ( the_api = 2;
+ the_api <= OBJECTS_APIS_LAST;
+ the_api++ ) {
+
+ if ( the_api == OBJECTS_INTERNAL_THREADS )
+ continue;
+
+ if ( !_Objects_Information_table[ the_api ] ) /* API not installed */
+ continue;
+
+ the_info = _Objects_Information_table[ the_api ][ 1 ];
+
+ if ( !the_info ) /* manager not installed */
+ continue;
+
+ maximum = the_info->maximum;
+ object_table = the_info->local_table;
+
+ assert( object_table ); /* always at least 1 entry */
+
+ for ( index = 1 ; index <= maximum ; index++ ) {
+ the_thread = (Thread_Control *) object_table[ index ];
+
+ if ( !the_thread )
+ continue;
+
+ /*
+ * If this thread is of lower priority than the interested thread,
+ * go on to the next thread.
+ */
+
+ if ( the_thread->current_priority > interested_priority )
+ continue;
+
+ /*
+ * If this thread is not interested, then go on to the next thread.
+ */
+
+ api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+
+ if ( !api || !_POSIX_signals_Is_interested( api, mask ) )
+ continue;
+
+ /*
+ * Now we know the thread under connsideration is interested.
+ * If the thread under consideration is of higher priority, then
+ * it becomes the interested thread.
+ */
+
+ if ( the_thread->current_priority < interested_priority ) {
+ interested_thread = the_thread;
+ interested_priority = the_thread->current_priority;
+ continue;
+ }
+
+ /*
+ * Now the thread and the interested thread have the same priority.
+ * If the interested thread is ready, then we don't need to send it
+ * to a blocked thread.
+ */
+
+ if ( _States_Is_ready( interested_thread->current_state ) )
+ continue;
+
+ /*
+ * Now the interested thread is blocked.
+ * If the thread we are considering is not, the it becomes the
+ * interested thread.
+ */
+
+ if ( _States_Is_ready( the_thread->current_state ) ) {
+ interested_thread = the_thread;
+ interested_priority = the_thread->current_priority;
+ continue;
+ }
+
+ /*
+ * Now we know both threads are blocked.
+ * If the interested thread is interruptible, then just use it.
+ */
+
+ /* XXX need a new states macro */
+ if ( interested_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL )
+ continue;
+
+ /*
+ * Now both threads are blocked and the interested thread is not
+ * interruptible.
+ * If the thread under consideration is interruptible by a signal,
+ * then it becomes the interested thread.
+ */
+
+ /* XXX need a new states macro */
+ if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
+ interested_thread = the_thread;
+ interested_priority = the_thread->current_priority;
+ }
+ }
+ }
+
+ if ( interested_thread ) {
+ the_thread = interested_thread;
+ goto process_it;
+ }
+
+ /*
+ * OK so no threads were interested right now. It will be left on the
+ * global pending until a thread receives it. The global set of threads
+ * can change interest in this signal in one of the following ways:
+ *
+ * + a thread is created with the signal unblocked,
+ * + pthread_sigmask() unblocks the signal,
+ * + sigprocmask() unblocks the signal, OR
+ * + sigaction() which changes the handler to SIG_IGN.
+ */
+
+ the_thread = NULL;
+ goto post_process_signal;
+
+ /*
+ * We found a thread which was interested, so now we mark that this
+ * thread needs to do the post context switch extension so it can
+ * evaluate the signals pending.
+ */
+
+process_it:
+
+ the_thread->do_post_task_switch_extension = TRUE;
+
+ /*
+ * Returns TRUE if the signal was synchronously given to a thread
+ * blocked waiting for the signal.
+ */
+
+ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
+ _Thread_Enable_dispatch();
+ return 0;
+ }
+
+post_process_signal:
+
+ /*
+ * We may have woken up a thread but we definitely need to post the
+ * signal to the process wide information set.
+ */
+
+ _POSIX_signals_Set_process_signals( mask );
+
+ if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
+
+ psiginfo = (POSIX_signals_Siginfo_node *)
+ _Chain_Get( &_POSIX_signals_Inactive_siginfo );
+ if ( !psiginfo ) {
+ rtems_set_errno_and_return_minus_one( EAGAIN );
+ }
+
+ psiginfo->Info = *siginfo;
+
+ _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
+ }
+
+ _Thread_Enable_dispatch();
+ return 0;
+}
Index: src/pthreadjoin.c
===================================================================
--- src/pthreadjoin.c (nonexistent)
+++ src/pthreadjoin.c (revision 1765)
@@ -0,0 +1,72 @@
+/*
+ * 16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * pthreadjoin.c,v 1.3 2001/01/24 14:17:28 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+
+#include
+#include
+#include
+
+int pthread_join(
+ pthread_t thread,
+ void **value_ptr
+)
+{
+ register Thread_Control *the_thread;
+ POSIX_API_Control *api;
+ Objects_Locations location;
+ void *return_pointer;
+
+ the_thread = _POSIX_Threads_Get( thread, &location );
+ switch ( location ) {
+ case OBJECTS_ERROR:
+ case OBJECTS_REMOTE:
+ return ESRCH;
+ case OBJECTS_LOCAL:
+ api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+
+ if ( api->detachstate == PTHREAD_CREATE_DETACHED ) {
+ _Thread_Enable_dispatch();
+ return EINVAL;
+ }
+
+ if ( _Thread_Is_executing( the_thread ) ) {
+ _Thread_Enable_dispatch();
+ return EDEADLK;
+ }
+
+ /*
+ * Put ourself on the threads join list
+ */
+
+ _Thread_Executing->Wait.return_argument = (unsigned32 *) &return_pointer;
+
+ _Thread_queue_Enter_critical_section( &api->Join_List );
+
+ _Thread_queue_Enqueue( &api->Join_List, WATCHDOG_NO_TIMEOUT );
+
+ _Thread_Enable_dispatch();
+
+ if ( value_ptr )
+ *value_ptr = return_pointer;
+ return 0;
+ }
+
+ return POSIX_BOTTOM_REACHED();
+}
+
Index: src/aio.c
===================================================================
--- src/aio.c (nonexistent)
+++ src/aio.c (revision 1765)
@@ -0,0 +1,118 @@
+/*
+ * aio.c,v 1.9 2001/01/24 14:17:27 joel Exp
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+
+#include
+#include