OpenCores
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 + +int POSIX_NOT_IMPLEMENTED(); + +/*PAGE + * + * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154 + */ + +int aio_read( + struct aiocb *aiocbp +) +{ + return POSIX_NOT_IMPLEMENTED(); +} + +/*PAGE + * + * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155 + */ + +int aio_write( + struct aiocb *aiocbp +) +{ + return POSIX_NOT_IMPLEMENTED(); +} + +/*PAGE + * + * 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 +) +{ + return POSIX_NOT_IMPLEMENTED(); +} + +/*PAGE + * + * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161 + */ + +int aio_error( + const struct aiocb *aiocbp +) +{ + return POSIX_NOT_IMPLEMENTED(); +} + +/*PAGE + * + * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, + * P1003.1b-1993, p. 162 + */ + +int aio_return( + const struct aiocb *aiocbp +) +{ + return POSIX_NOT_IMPLEMENTED(); +} + +/*PAGE + * + * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163 + */ + +int aio_cancel( + int filedes, + struct aiocb *aiocbp +) +{ + return POSIX_NOT_IMPLEMENTED(); +} + +/*PAGE + * + * 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 +) +{ + return POSIX_NOT_IMPLEMENTED(); +} + +/*PAGE + * + * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166 + */ + +int aio_fsync( + int op, + struct aiocb *aiocbp +) +{ + return POSIX_NOT_IMPLEMENTED(); +} Index: src/pthreadattrsetdetachstate.c =================================================================== --- src/pthreadattrsetdetachstate.c (nonexistent) +++ src/pthreadattrsetdetachstate.c (revision 1765) @@ -0,0 +1,38 @@ +/* + * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 + * + * 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. + * + * pthreadattrsetdetachstate.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_setdetachstate( + pthread_attr_t *attr, + int detachstate +) +{ + if ( !attr || !attr->is_initialized ) + return EINVAL; + + switch ( detachstate ) { + case PTHREAD_CREATE_DETACHED: + case PTHREAD_CREATE_JOINABLE: + attr->detachstate = detachstate; + return 0; + + default: + return EINVAL; + } +} Index: src/clocksetenableattr.c =================================================================== --- src/clocksetenableattr.c (nonexistent) +++ src/clocksetenableattr.c (revision 1765) @@ -0,0 +1,32 @@ +/* + * clocksetenableattr.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_setenable_attr( + clockid_t clock_id, + int attr +) +{ + return POSIX_NOT_IMPLEMENTED(); +} Index: src/cancelrun.c =================================================================== --- src/cancelrun.c (nonexistent) +++ src/cancelrun.c (revision 1765) @@ -0,0 +1,67 @@ +/* + * cancelrun.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 + * + * _POSIX_Threads_cancel_run + * + */ + +#if !defined(PTHREAD_CANCELED) +#warning "PTHREAD_CANCELED NOT DEFINED -- patch newlib" +#define PTHREAD_CANCELED ((void *) -1) +#endif + +void _POSIX_Threads_cancel_run( + Thread_Control *the_thread +) +{ + POSIX_Cancel_Handler_control *handler; + Chain_Control *handler_stack; + POSIX_API_Control *thread_support; + ISR_Level level; + + thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; + + handler_stack = &thread_support->Cancellation_Handlers; + + thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; + + while ( !_Chain_Is_empty( handler_stack ) ) { + _ISR_Disable( level ); + handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack ); + _Chain_Extract_unprotected( &handler->Node ); + _ISR_Enable( level ); + + (*handler->routine)( handler->arg ); + + _Workspace_Free( handler ); + } + + /* Now we can delete the thread */ + + the_thread->Wait.return_argument = (unsigned32 *)PTHREAD_CANCELED; + _Thread_Close( + _Objects_Get_information( the_thread->Object.id ), + the_thread + ); + _POSIX_Threads_Free( the_thread ); + +} Index: src/pthreadgetschedparam.c =================================================================== --- src/pthreadgetschedparam.c (nonexistent) +++ src/pthreadgetschedparam.c (revision 1765) @@ -0,0 +1,59 @@ +/* + * 13.5.2 Dynamic Thread Scheduling Parameters Access, + * P1003.1c/Draft 10, p. 124 + * + * 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. + * + * pthreadgetschedparam.c,v 1.5 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include + +int pthread_getschedparam( + pthread_t thread, + int *policy, + struct sched_param *param +) +{ + Objects_Locations location; + POSIX_API_Control *api; + register Thread_Control *the_thread; + + if ( !policy || !param ) + return EINVAL; + + 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 ( policy ) + *policy = api->schedpolicy; + if ( param ) { + *param = api->schedparam; + param->sched_priority = + _POSIX_Priority_From_core( the_thread->current_priority ); + } + _Thread_Enable_dispatch(); + return 0; + } + + return POSIX_BOTTOM_REACHED(); + +} Index: src/pthreadequal.c =================================================================== --- src/pthreadequal.c (nonexistent) +++ src/pthreadequal.c (revision 1765) @@ -0,0 +1,83 @@ +/* + * 16.1.7 Compare Thread IDs, p1003.1c/Draft 10, p. 153 + * + * NOTE: POSIX does not define the behavior when either thread id is invalid. + * + * 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. + * + * pthreadequal.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 + +int pthread_equal( + pthread_t t1, + pthread_t t2 +) +{ + /* + * If the system is configured for debug, then we will do everything we + * can to insure that both ids are valid. Otherwise, we will do the + * cheapest possible thing to determine if they are equal. + */ + +#ifndef RTEMS_DEBUG + return _Objects_Are_ids_equal( t1, t2 ); +#else + int status; + Objects_Locations location; + + /* + * By default this is not a match. + */ + + status = 0; + + /* + * Validate the first id and return 0 if it is not valid + */ + + (void) _POSIX_Threads_Get( t1, &location ); + switch ( location ) { + case OBJECTS_ERROR: + case OBJECTS_REMOTE: + break; + + case OBJECTS_LOCAL: + + /* + * Validate the second id and return 0 if it is not valid + */ + + (void) _POSIX_Threads_Get( t2, &location ); + switch ( location ) { + case OBJECTS_ERROR: + case OBJECTS_REMOTE: + break; + case OBJECTS_LOCAL: + status = _Objects_Are_ids_equal( t1, t2 ); + break; + } + _Thread_Unnest_dispatch(); + break; + } + + _Thread_Enable_dispatch(); + return status; +#endif +} + Index: src/pthreadattrsetstacksize.c =================================================================== --- src/pthreadattrsetstacksize.c (nonexistent) +++ src/pthreadattrsetstacksize.c (revision 1765) @@ -0,0 +1,37 @@ +/* + * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 + * + * 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. + * + * pthreadattrsetstacksize.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_setstacksize( + pthread_attr_t *attr, + size_t stacksize +) +{ + if ( !attr || !attr->is_initialized ) + return EINVAL; + + if (stacksize < PTHREAD_MINIMUM_STACK_SIZE) + attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE; + else + attr->stacksize = stacksize; + return 0; +} Index: src/condwaitsupp.c =================================================================== --- src/condwaitsupp.c (nonexistent) +++ src/condwaitsupp.c (revision 1765) @@ -0,0 +1,108 @@ +/* + * condwaitsupp.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 + * + * _POSIX_Condition_variables_Wait_support + * + * 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 +) +{ + register POSIX_Condition_variables_Control *the_cond; + Objects_Locations location; + int status; + int mutex_status; + + if ( !_POSIX_Mutex_Get( mutex, &location ) ) { + return EINVAL; + } + + _Thread_Unnest_dispatch(); + + 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 ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { + _Thread_Enable_dispatch(); + return EINVAL; + } + + (void) pthread_mutex_unlock( mutex ); +/* XXX ignore this for now since behavior is undefined + if ( mutex_status ) { + _Thread_Enable_dispatch(); + return EINVAL; + } +*/ + + if ( !already_timedout ) { + the_cond->Mutex = *mutex; + + _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); + _Thread_Executing->Wait.return_code = 0; + _Thread_Executing->Wait.queue = &the_cond->Wait_queue; + _Thread_Executing->Wait.id = *cond; + + _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); + + _Thread_Enable_dispatch(); + + /* + * Switch ourself out because we blocked as a result of the + * _Thread_queue_Enqueue. + */ + + status = _Thread_Executing->Wait.return_code; + if ( status && status != ETIMEDOUT ) + return status; + + } else { + _Thread_Enable_dispatch(); + status = ETIMEDOUT; + } + + /* + * When we get here the dispatch disable level is 0. + */ + + mutex_status = pthread_mutex_lock( mutex ); + if ( mutex_status ) + return EINVAL; + + return status; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/sigaction.c =================================================================== --- src/sigaction.c (nonexistent) +++ src/sigaction.c (revision 1765) @@ -0,0 +1,94 @@ +/* + * 3.3.4 Examine and Change Signal Action, P1003.1b-1993, p. 70 + * + * 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. + * + * sigaction.c,v 1.7 2002/01/04 18:28:24 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * PARAMETERS_PASSING_S is defined in ptimer.c + */ + +extern void PARAMETERS_PASSING_S (int num_signal, const struct sigaction inf); + +int sigaction( + int sig, + const struct sigaction *act, + struct sigaction *oact +) +{ + ISR_Level level; + + if ( oact ) + *oact = _POSIX_signals_Vectors[ sig ]; + + if ( !sig ) + return 0; + + if ( !is_valid_signo(sig) ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + /* + * Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references. + * + * NOTE: Solaris documentation claims to "silently enforce" this which + * contradicts the POSIX specification. + */ + + if ( sig == SIGKILL ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + /* + * Evaluate the new action structure and set the global signal vector + * appropriately. + */ + + if ( act ) { + + /* + * Unless the user is installing the default signal actions, then + * we can just copy the provided sigaction structure into the vectors. + */ + + _ISR_Disable( level ); + if ( act->sa_handler == SIG_DFL ) { + _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; + } else { + _POSIX_signals_Clear_process_signals( signo_to_mask(sig) ); + _POSIX_signals_Vectors[ sig ] = *act; + } + _ISR_Enable( level ); + } + + /* + * No need to evaluate or dispatch because: + * + * + If we were ignoring the signal before, none could be pending + * now (signals not posted when SIG_IGN). + * + If we are now ignoring a signal that was previously pending, + * we clear the pending signal indicator. + */ + + return 0; +} + Index: src/condsignal.c =================================================================== --- src/condsignal.c (nonexistent) +++ src/condsignal.c (revision 1765) @@ -0,0 +1,30 @@ +/* + * condsignal.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.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 + */ + +int pthread_cond_signal( + pthread_cond_t *cond +) +{ + return _POSIX_Condition_variables_Signal_support( cond, FALSE ); +} Index: src/semgetvalue.c =================================================================== --- src/semgetvalue.c (nonexistent) +++ src/semgetvalue.c (revision 1765) @@ -0,0 +1,50 @@ +/* + * semgetvalue.c,v 1.4 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.8 Get the Value of a Semaphore, P1003.1b-1993, p.229 + */ + +int sem_getvalue( + sem_t *sem, + int *sval +) +{ + 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: + *sval = _CORE_semaphore_Get_count( &the_semaphore->Semaphore ); + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/mqueueopen.c =================================================================== --- src/mqueueopen.c (nonexistent) +++ src/mqueueopen.c (revision 1765) @@ -0,0 +1,158 @@ +/* + * 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. + * + * mqueueopen.c,v 1.9 2002/04/26 23:39:01 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/*PAGE + * + * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272 + */ + +mqd_t mq_open( + const char *name, + int oflag, + ... + /* mode_t mode, */ + /* struct mq_attr attr */ +) +{ + va_list arg; + mode_t mode; + struct mq_attr *attr = NULL; + int status; + Objects_Id the_mq_id; + POSIX_Message_queue_Control *the_mq; + POSIX_Message_queue_Control_fd *the_mq_fd; + Objects_Locations location; + + _Thread_Disable_dispatch(); + + if ( oflag & O_CREAT ) { + va_start(arg, oflag); + mode = (mode_t) va_arg( arg, unsigned int ); + attr = (struct mq_attr *) va_arg( arg, struct mq_attr * ); + va_end(arg); + } + + the_mq_fd = _POSIX_Message_queue_Allocate_fd(); + if ( !the_mq_fd ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( ENFILE ); + } + the_mq_fd->oflag = oflag; + + status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); + + /* + * If the name to id translation worked, then the message queue exists + * and we can just return a pointer to the id. Otherwise we may + * need to check to see if this is a "message queue 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) ) ) { + _POSIX_Message_queue_Free_fd( the_mq_fd ); + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one_cast( status, mqd_t ); + } + + } else { /* name -> ID translation succeeded */ + + /* + * Check for existence with creation. + */ + + if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { + _POSIX_Message_queue_Free_fd( the_mq_fd ); + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); + } + + /* + * In this case we need to do an ID->pointer conversion to + * check the mode. + */ + + the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); + the_mq->open_count += 1; + the_mq_fd->Queue = the_mq; + _Thread_Enable_dispatch(); + _Thread_Enable_dispatch(); + return (mqd_t)the_mq_fd->Object.id; + + } + + /* + * At this point, the message queue does not exist and everything has been + * checked. We should go ahead and create a message queue. + */ + + status = _POSIX_Message_queue_Create_support( + name, + TRUE, /* shared across processes */ + attr, + &the_mq + ); + + /* + * errno was set by Create_support, so don't set it again. + */ + + if ( status == -1 ) { + _Thread_Enable_dispatch(); + _POSIX_Message_queue_Free_fd( the_mq_fd ); + return (mqd_t) -1; + } + + the_mq_fd->Queue = the_mq; + _Objects_Open( + &_POSIX_Message_queue_Information_fds, + &the_mq_fd->Object, + NULL + ); + + _Thread_Enable_dispatch(); + + return (mqd_t) the_mq_fd->Object.id; +} + + + + + Index: src/mqueuesendsupp.c =================================================================== --- src/mqueuesendsupp.c (nonexistent) +++ src/mqueuesendsupp.c (revision 1765) @@ -0,0 +1,117 @@ +/* + * 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. + * + * mqueuesendsupp.c,v 1.10 2002/04/26 23:39:01 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +/*PAGE + * + * _POSIX_Message_queue_Send_support + */ + +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_Control *the_mq; + POSIX_Message_queue_Control_fd *the_mq_fd; + Objects_Locations location; + CORE_message_queue_Status msg_status; + + /* + * Validate the priority. + * XXX - Do not validate msg_prio is not less than 0. + */ + + if ( msg_prio > MQ_PRIO_MAX ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); + switch ( location ) { + case OBJECTS_ERROR: + rtems_set_errno_and_return_minus_one( EBADF ); + + case OBJECTS_REMOTE: + _Thread_Dispatch(); + return POSIX_MP_NOT_IMPLEMENTED(); + rtems_set_errno_and_return_minus_one( EINVAL ); + + case OBJECTS_LOCAL: + if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( EBADF ); + } + + the_mq = the_mq_fd->Queue; + + msg_status = _CORE_message_queue_Submit( + &the_mq->Message_queue, + (void *) msg_ptr, + msg_len, + mqdes, /* mqd_t is an object id */ +#if defined(RTEMS_MULTIPROCESSING) + NULL, /* XXX _POSIX_Message_queue_Core_message_queue_mp_support*/ +#else + NULL, +#endif + _POSIX_Message_queue_Priority_to_core( msg_prio ), + (the_mq_fd->oflag & O_NONBLOCK) ? FALSE : TRUE, + timeout /* no timeout */ + ); + + _Thread_Enable_dispatch(); + + /* + * If we had to block, then this is where the task returns + * after it wakes up. The returned status is correct for + * non-blocking operations but if we blocked, then we need + * to look at the status in our TCB. + */ + + if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT ) + msg_status = _Thread_Executing->Wait.return_code; + + if ( !msg_status ) + return msg_status; + + rtems_set_errno_and_return_minus_one( + _POSIX_Message_queue_Translate_core_message_queue_return_code( + msg_status + ) + ); + } + return POSIX_BOTTOM_REACHED(); +} Index: src/sigsuspend.c =================================================================== --- src/sigsuspend.c (nonexistent) +++ src/sigsuspend.c (revision 1765) @@ -0,0 +1,45 @@ +/* + * 3.3.7 Wait for a Signal, P1003.1b-1993, p. 75 + * + * 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. + * + * sigsuspend.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 sigsuspend( + const sigset_t *sigmask +) +{ + sigset_t saved_signals_blocked; + sigset_t all_signals; + int status; + POSIX_API_Control *api; + + api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + + status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); + + (void) sigfillset( &all_signals ); + + status = sigtimedwait( &all_signals, NULL, NULL ); + + (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); + + return status; +} Index: src/cancel.c =================================================================== --- src/cancel.c (nonexistent) +++ src/cancel.c (revision 1765) @@ -0,0 +1,62 @@ +/* + * cancel.c,v 1.9 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.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181 + */ + +int pthread_cancel( + pthread_t thread +) +{ + Thread_Control *the_thread; + POSIX_API_Control *thread_support; + Objects_Locations location; + + /* + * Don't even think about deleting a resource from an ISR. + */ + + if ( _ISR_Is_in_progress() ) + return EPROTO; + + the_thread = _POSIX_Threads_Get( thread, &location ); + switch ( location ) { + case OBJECTS_ERROR: + return EINVAL; + case OBJECTS_REMOTE: + return POSIX_MP_NOT_IMPLEMENTED(); + case OBJECTS_LOCAL: + thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; + + thread_support->cancelation_requested = 1; + + if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && + thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS ) { + _POSIX_Threads_cancel_run( the_thread ); + } + + _Thread_Enable_dispatch(); + return 0; + } + + return POSIX_BOTTOM_REACHED(); +} Index: src/psignalclearsignals.c =================================================================== --- src/psignalclearsignals.c (nonexistent) +++ src/psignalclearsignals.c (revision 1765) @@ -0,0 +1,89 @@ +/* + * psignalclearsignals.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 +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_signals_Clear_signals + */ + +boolean _POSIX_signals_Clear_signals( + POSIX_API_Control *api, + int signo, + siginfo_t *info, + boolean is_global, + boolean check_blocked +) +{ + sigset_t mask; + sigset_t signals_blocked; + ISR_Level level; + boolean do_callout; + POSIX_signals_Siginfo_node *psiginfo; + + mask = signo_to_mask( signo ); + + do_callout = FALSE; + + /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK + * insures that no signals are blocked and all are checked. + */ + + if ( check_blocked ) + signals_blocked = ~api->signals_blocked; + else + signals_blocked = SIGNAL_ALL_MASK; + + /* XXX this is not right for siginfo type signals yet */ + /* XXX since they can't be cleared the same way */ + + _ISR_Disable( level ); + if ( is_global ) { + if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { + if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { + psiginfo = (POSIX_signals_Siginfo_node *) + _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] ); + if ( _Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) + _POSIX_signals_Clear_process_signals( mask ); + if ( psiginfo ) { + *info = psiginfo->Info; + _Chain_Append_unprotected( + &_POSIX_signals_Inactive_siginfo, + &psiginfo->Node + ); + } else + do_callout = FALSE; + } else + _POSIX_signals_Clear_process_signals( mask ); + do_callout = TRUE; + } + } else { + if ( mask & (api->signals_pending & signals_blocked) ) { + api->signals_pending &= ~mask; + do_callout = TRUE; + } + } + _ISR_Enable( level ); + return do_callout; +} Index: src/key.c =================================================================== --- src/key.c (nonexistent) +++ src/key.c (revision 1765) @@ -0,0 +1,46 @@ +/* + * key.c,v 1.11 2002/07/01 22:33:47 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include + +/* + * _POSIX_Key_Manager_initialization + * + * DESCRIPTION: + * + * This routine performs the initialization necessary for this manager. + */ + +void _POSIX_Key_Manager_initialization( + unsigned32 maximum_keys +) +{ + _Objects_Initialize_information( + &_POSIX_Keys_Information, /* object information table */ + OBJECTS_POSIX_API, /* object API */ + OBJECTS_POSIX_KEYS, /* object class */ + maximum_keys, /* maximum objects of this class */ + sizeof( POSIX_Keys_Control ), + /* size of this object's control block */ + FALSE, /* TRUE if names for this object are strings */ + 0 /* maximum length of each object's name */ +#if defined(RTEMS_MULTIPROCESSING) + , + FALSE, /* TRUE if this is a global object class */ + NULL /* Proxy extraction support callout */ +#endif + ); +} Index: src/pthreadsetschedparam.c =================================================================== --- src/pthreadsetschedparam.c (nonexistent) +++ src/pthreadsetschedparam.c (revision 1765) @@ -0,0 +1,129 @@ +/* + * 13.5.2 Dynamic Thread Scheduling Parameters Access, + * P1003.1c/Draft 10, p. 124 + * + * 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. + * + * pthreadsetschedparam.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 + +int pthread_setschedparam( + pthread_t thread, + int policy, + struct sched_param *param +) +{ + register Thread_Control *the_thread; + POSIX_API_Control *api; + Thread_CPU_budget_algorithms budget_algorithm; + Thread_CPU_budget_algorithm_callout budget_callout; + Objects_Locations location; + + /* + * Check all the parameters + */ + + if ( !param ) + return EINVAL; + + if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) + return EINVAL; + + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; + budget_callout = NULL; + + switch ( policy ) { + case SCHED_OTHER: + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; + break; + + case SCHED_FIFO: + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; + break; + + case SCHED_RR: + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; + break; + + case SCHED_SPORADIC: + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; + budget_callout = _POSIX_Threads_Sporadic_budget_callout; + + if ( _POSIX_Timespec_to_interval( ¶m->ss_replenish_period ) < + _POSIX_Timespec_to_interval( ¶m->ss_initial_budget ) ) + return EINVAL; + + if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) ) + return EINVAL; + + break; + + default: + return EINVAL; + } + + /* + * Actually change the scheduling policy and parameters + */ + + 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->schedpolicy == SCHED_SPORADIC ) + (void) _Watchdog_Remove( &api->Sporadic_timer ); + + api->schedpolicy = policy; + api->schedparam = *param; + the_thread->budget_algorithm = budget_algorithm; + the_thread->budget_callout = budget_callout; + + switch ( api->schedpolicy ) { + case SCHED_OTHER: + case SCHED_FIFO: + case SCHED_RR: + the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; + + the_thread->real_priority = + _POSIX_Priority_To_core( api->schedparam.sched_priority ); + + _Thread_Change_priority( + the_thread, + the_thread->real_priority, + TRUE + ); + break; + + case SCHED_SPORADIC: + api->ss_high_priority = api->schedparam.sched_priority; + _Watchdog_Remove( &api->Sporadic_timer ); + _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); + break; + } + + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/pthreadonce.c =================================================================== --- src/pthreadonce.c (nonexistent) +++ src/pthreadonce.c (revision 1765) @@ -0,0 +1,45 @@ +/* + * 16.1.8 Dynamic Package Initialization, P1003.1c/Draft 10, p. 154 + * + * 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. + * + * pthreadonce.c,v 1.4 2002/03/01 17:49:57 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include + +int pthread_once( + pthread_once_t *once_control, + void (*init_routine)(void) +) +{ + if ( !once_control || !init_routine ) + return EINVAL; + + if ( !once_control->init_executed ) { + rtems_mode saveMode; + rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); + if ( !once_control->init_executed ) { + once_control->is_initialized = TRUE; + once_control->init_executed = TRUE; + (*init_routine)(); + } + rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); + } + return 0; +} + Index: src/keygetspecific.c =================================================================== --- src/keygetspecific.c (nonexistent) +++ src/keygetspecific.c (revision 1765) @@ -0,0 +1,47 @@ +/* + * keygetspecific.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 + +/*PAGE + * + * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 + */ + +void *pthread_getspecific( + pthread_key_t key +) +{ + register POSIX_Keys_Control *the_key; + unsigned32 index; + unsigned32 class; + Objects_Locations location; + void *key_data; + + the_key = _POSIX_Keys_Get( key, &location ); + switch ( location ) { + case OBJECTS_ERROR: + case OBJECTS_REMOTE: /* should never happen */ + return NULL; + case OBJECTS_LOCAL: + index = _Objects_Get_index( _Thread_Executing->Object.id ); + class = _Objects_Get_class( _Thread_Executing->Object.id ); + key_data = (void *) the_key->Values[ class ][ index ]; + _Thread_Enable_dispatch(); + return key_data; + } + return (void *) POSIX_BOTTOM_REACHED(); +} Index: src/setcancelstate.c =================================================================== --- src/setcancelstate.c (nonexistent) +++ src/setcancelstate.c (revision 1765) @@ -0,0 +1,61 @@ +/* + * setcancelstate.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 + */ + +int pthread_setcancelstate( + int state, + int *oldstate +) +{ + 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 EPROTO; + + if ( !oldstate ) + return EINVAL; + + if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE ) + return EINVAL; + + thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + + _Thread_Disable_dispatch(); + *oldstate = thread_support->cancelability_state; + thread_support->cancelability_state = state; + + if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && + thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && + thread_support->cancelation_requested ) + _POSIX_Threads_cancel_run( _Thread_Executing ); + _Thread_Enable_dispatch(); + + return 0; +} Index: src/mutex.c =================================================================== --- src/mutex.c (nonexistent) +++ src/mutex.c (revision 1765) @@ -0,0 +1,54 @@ +/* + * mutex.c,v 1.28 2002/07/01 22:33:47 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_Manager_initialization + * + * This routine initializes all mutex manager related data structures. + * + * Input parameters: + * maximum_mutexes - maximum configured mutexes + * + * Output parameters: NONE + */ + +void _POSIX_Mutex_Manager_initialization( + unsigned32 maximum_mutexes +) +{ + _Objects_Initialize_information( + &_POSIX_Mutex_Information, /* object information table */ + OBJECTS_POSIX_API, /* object API */ + OBJECTS_POSIX_MUTEXES, /* object class */ + maximum_mutexes, /* maximum objects of this class */ + sizeof( POSIX_Mutex_Control ), + /* size of this object's control block */ + FALSE, /* TRUE if names for this object are strings */ + 0 /* maximum length of each object's name */ +#if defined(RTEMS_MULTIPROCESSING) + , + FALSE, /* TRUE if this is a global object class */ + NULL /* Proxy extraction support callout */ +#endif + ); +} Index: src/psignalunblockthread.c =================================================================== --- src/psignalunblockthread.c (nonexistent) +++ src/psignalunblockthread.c (revision 1765) @@ -0,0 +1,93 @@ +/* + * psignalunblockthread.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 +#include +#include +#include +#include + + +/*PAGE + * + * _POSIX_signals_Unblock_thread + */ + +/* XXX this routine could probably be cleaned up */ +boolean _POSIX_signals_Unblock_thread( + Thread_Control *the_thread, + int signo, + siginfo_t *info +) +{ + POSIX_API_Control *api; + sigset_t mask; + siginfo_t *the_info = NULL; + + api = the_thread->API_Extensions[ THREAD_API_POSIX ]; + + mask = signo_to_mask( signo ); + + /* + * Is the thread is specifically waiting for a signal? + */ + + if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { + + if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { + the_thread->Wait.return_code = EINTR; + + the_info = (siginfo_t *) the_thread->Wait.return_argument; + + if ( !info ) { + the_info->si_signo = signo; + the_info->si_code = SI_USER; + the_info->si_value.sival_int = 0; + } else { + *the_info = *info; + } + + _Thread_queue_Extract_with_proxy( the_thread ); + return TRUE; + } + + /* + * This should only be reached via pthread_kill(). + */ + + return FALSE; + } + + if ( ~api->signals_blocked & mask ) { + the_thread->do_post_task_switch_extension = TRUE; + + if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { + the_thread->Wait.return_code = EINTR; + if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) + _Thread_queue_Extract_with_proxy( the_thread ); + else if ( _States_Is_delaying(the_thread->current_state)){ + if ( _Watchdog_Is_active( &the_thread->Timer ) ) + (void) _Watchdog_Remove( &the_thread->Timer ); + _Thread_Unblock( the_thread ); + } + } + } + return FALSE; + +} Index: src/mutexsetprioceiling.c =================================================================== --- src/mutexsetprioceiling.c (nonexistent) +++ src/mutexsetprioceiling.c (revision 1765) @@ -0,0 +1,82 @@ +/* + * mutexsetprioceiling.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 +#if defined(RTEMS_MULTIPROCESSING) +#include +#endif +#include +#include +#include + +/*PAGE + * + * 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131 + */ + +int pthread_mutex_setprioceiling( + pthread_mutex_t *mutex, + int prioceiling, + int *old_ceiling +) +{ + register POSIX_Mutex_Control *the_mutex; + Objects_Locations location; + Priority_Control the_priority; + int status; + + if ( !old_ceiling ) + return EINVAL; + + if ( !_POSIX_Priority_Is_valid( prioceiling ) ) + return EINVAL; + + the_priority = _POSIX_Priority_To_core( prioceiling ); + + /* + * Must acquire the mutex before we can change it's ceiling + */ + + status = pthread_mutex_lock( mutex ); + if ( status ) + return status; + + the_mutex = _POSIX_Mutex_Get( mutex, &location ); + switch ( location ) { + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) + /* XXX It feels questionable to set the ceiling on a remote mutex. */ + return EINVAL; +#endif + case OBJECTS_ERROR: + return EINVAL; /* impossible to get here */ + case OBJECTS_LOCAL: + *old_ceiling = _POSIX_Priority_From_core( + the_mutex->Mutex.Attributes.priority_ceiling + ); + the_mutex->Mutex.Attributes.priority_ceiling = the_priority; + _CORE_mutex_Surrender( + &the_mutex->Mutex, + the_mutex->Object.id, +#if defined(RTEMS_MULTIPROCESSING) + _POSIX_Threads_mutex_MP_support +#else + NULL +#endif + ); + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/mutexattrgetpshared.c =================================================================== --- src/mutexattrgetpshared.c (nonexistent) +++ src/mutexattrgetpshared.c (revision 1765) @@ -0,0 +1,38 @@ +/* + * mutexattrgetpshared.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 + * + * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 + */ + +int pthread_mutexattr_getpshared( + const pthread_mutexattr_t *attr, + int *pshared +) +{ + if ( !attr || !attr->is_initialized || !pshared ) + return EINVAL; + + *pshared = attr->process_shared; + return 0; +} Index: src/wait.c =================================================================== --- src/wait.c (nonexistent) +++ src/wait.c (revision 1765) @@ -0,0 +1,21 @@ +/* + * waitpid() - POSIX 1003.1b 3.2.1 + * + * wait.c,v 1.2 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +int wait( + int *stat_loc +) +{ + errno = ENOSYS; + return -1; +} Index: src/sigismember.c =================================================================== --- src/sigismember.c (nonexistent) +++ src/sigismember.c (revision 1765) @@ -0,0 +1,45 @@ +/* + * 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. + * + * sigismember.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 + +int sigismember( + const 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 ); + + if ( *set & signo_to_mask(signo) ) + return 1; + + return 0; +} + Index: src/condinit.c =================================================================== --- src/condinit.c (nonexistent) +++ src/condinit.c (revision 1765) @@ -0,0 +1,99 @@ +/* + * condinit.c,v 1.3 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 + * + * 11.4.2 Initializing and Destroying a Condition Variable, + * P1003.1c/Draft 10, p. 87 + */ + +int pthread_cond_init( + pthread_cond_t *cond, + const pthread_condattr_t *attr +) +{ + POSIX_Condition_variables_Control *the_cond; + const pthread_condattr_t *the_attr; + + if ( attr ) the_attr = attr; + else the_attr = &_POSIX_Condition_variables_Default_attributes; + + /* + * XXX: Be careful about attributes when global!!! + */ + + if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) + return POSIX_MP_NOT_IMPLEMENTED(); + + if ( !the_attr->is_initialized ) + return EINVAL; + + _Thread_Disable_dispatch(); + + the_cond = _POSIX_Condition_variables_Allocate(); + + if ( !the_cond ) { + _Thread_Enable_dispatch(); + return ENOMEM; + } + +#if defined(RTEMS_MULTIPROCESSING) + if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && + !( _Objects_MP_Allocate_and_open( &_POSIX_Condition_variables_Information, + 0, the_cond->Object.id, FALSE ) ) ) { + _POSIX_Condition_variables_Free( the_cond ); + _Thread_Enable_dispatch(); + return EAGAIN; + } +#endif + + the_cond->process_shared = the_attr->process_shared; + + the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; + +/* XXX some more initialization might need to go here */ + _Thread_queue_Initialize( + &the_cond->Wait_queue, + THREAD_QUEUE_DISCIPLINE_FIFO, + STATES_WAITING_FOR_CONDITION_VARIABLE, + ETIMEDOUT + ); + + _Objects_Open( + &_POSIX_Condition_variables_Information, + &the_cond->Object, + 0 + ); + + *cond = the_cond->Object.id; + +#if defined(RTEMS_MULTIPROCESSING) + if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) + _POSIX_Condition_variables_MP_Send_process_packet( + POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE, + the_cond->Object.id, + 0, /* Name not used */ + 0 /* Not used */ + ); +#endif + + _Thread_Enable_dispatch(); + + return 0; +} Index: src/keysetspecific.c =================================================================== --- src/keysetspecific.c (nonexistent) +++ src/keysetspecific.c (revision 1765) @@ -0,0 +1,47 @@ +/* + * keysetspecific.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 + +/*PAGE + * + * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 + */ + +int pthread_setspecific( + pthread_key_t key, + const void *value +) +{ + register POSIX_Keys_Control *the_key; + unsigned32 index; + unsigned32 class; + Objects_Locations location; + + the_key = _POSIX_Keys_Get( key, &location ); + switch ( location ) { + case OBJECTS_ERROR: + case OBJECTS_REMOTE: /* should never happen */ + return EINVAL; + case OBJECTS_LOCAL: + index = _Objects_Get_index( _Thread_Executing->Object.id ); + class = _Objects_Get_class( _Thread_Executing->Object.id ); + the_key->Values[ class ][ index ] = (void *) value; + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/execv.c =================================================================== --- src/execv.c (nonexistent) +++ src/execv.c (revision 1765) @@ -0,0 +1,20 @@ +/* + * execv() - POSIX 1003.1b 3.1.2 + * + * execv.c,v 1.4 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int execv( + const char *file, + char *const argv[] +) +{ + errno = ENOSYS; + return -1; +} Index: src/mutextrylock.c =================================================================== --- src/mutextrylock.c (nonexistent) +++ src/mutextrylock.c (revision 1765) @@ -0,0 +1,35 @@ +/* + * mutextrylock.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 + * + * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 + * + * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 + */ + +int pthread_mutex_trylock( + pthread_mutex_t *mutex +) +{ + return _POSIX_Mutex_Lock_support( mutex, FALSE, THREAD_QUEUE_WAIT_FOREVER ); +} Index: src/mutexlock.c =================================================================== --- src/mutexlock.c (nonexistent) +++ src/mutexlock.c (revision 1765) @@ -0,0 +1,35 @@ +/* + * mutexlock.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 + * + * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 + * + * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 + */ + +int pthread_mutex_lock( + pthread_mutex_t *mutex +) +{ + return _POSIX_Mutex_Lock_support( mutex, TRUE, THREAD_QUEUE_WAIT_FOREVER ); +} Index: src/README.mqueue =================================================================== --- src/README.mqueue (nonexistent) +++ src/README.mqueue (revision 1765) @@ -0,0 +1,38 @@ +# +# README.mqueue,v 1.2 2001/01/12 13:34:24 joel Exp +# + +This program should print out the default attribute settings for a +POSIX message queue. + +#include +#include + +main() +{ + mqd_t mqfd; + struct mq_attr mqstat; + int status; + + /* this should create it */ + mqfd = mq_open("myipc",O_WRONLY|O_CREAT,NULL); + if ( (int)mqfd == -1 ) { + perror( "Unable to open message queue" ); + exit( 1 ); + } + + status = mq_getattr(mqfd, &mqstat); + if ( !status ) { + printf( "mq_maxmsg: %d\n", mqstat.mq_maxmsg ); + printf( "mq_msgsize: %d\n", mqstat.mq_msgsize ); + printf( "mq_curmsgs: %d\n", mqstat.mq_curmsgs ); + } else { + perror( "Unable to get attributes on message queue" ); + exit( 1 ); + } + + /* this should delete it */ + (void) mq_close( mqfd ); + exit( 0 ); +} + Index: src/sigemptyset.c =================================================================== --- src/sigemptyset.c (nonexistent) +++ src/sigemptyset.c (revision 1765) @@ -0,0 +1,36 @@ +/* + * 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. + * + * sigemptyset.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 + +int sigemptyset( + sigset_t *set +) +{ + if ( !set ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + *set = 0; + return 0; +} + Index: src/pthreadgetcputime.c =================================================================== --- src/pthreadgetcputime.c (nonexistent) +++ src/pthreadgetcputime.c (revision 1765) @@ -0,0 +1,32 @@ +/* + * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59 + * + * 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. + * + * pthreadgetcputime.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_getcputime( + pthread_attr_t *attr, + int *clock_allowed +) +{ + if ( !attr || !attr->is_initialized || !clock_allowed ) + return EINVAL; + + *clock_allowed = attr->cputime_clock_allowed; + return 0; +} + Index: src/execve.c =================================================================== --- src/execve.c (nonexistent) +++ src/execve.c (revision 1765) @@ -0,0 +1,21 @@ +/* + * execve() - POSIX 1003.1b 3.1.2 + * + * execve.c,v 1.3 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int execve( + const char *path, + char *const argv[], + char *const envp[] +) +{ + errno = ENOSYS; + return -1; +} Index: src/pthreadattrsetstackaddr.c =================================================================== --- src/pthreadattrsetstackaddr.c (nonexistent) +++ src/pthreadattrsetstackaddr.c (revision 1765) @@ -0,0 +1,31 @@ +/* + * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 + * + * 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. + * + * pthreadattrsetstackaddr.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_setstackaddr( + pthread_attr_t *attr, + void *stackaddr +) +{ + if ( !attr || !attr->is_initialized ) + return EINVAL; + + attr->stackaddr = stackaddr; + return 0; +} Index: src/execlp.c =================================================================== --- src/execlp.c (nonexistent) +++ src/execlp.c (revision 1765) @@ -0,0 +1,21 @@ +/* + * execlp() - POSIX 1003.1b 3.1.2 + * + * execlp.c,v 1.3 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int execlp( + const char *file, + const char *arg, + ... +) +{ + errno = ENOSYS; + return -1; +} Index: src/condmp.c =================================================================== --- src/condmp.c (nonexistent) +++ src/condmp.c (revision 1765) @@ -0,0 +1,46 @@ +/* + * condmp.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 + +/* + * TEMPORARY + */ + +#if defined(RTEMS_MULTIPROCESSING) +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 +) +{ + (void) POSIX_MP_NOT_IMPLEMENTED(); +} + +void _POSIX_Condition_variables_MP_Send_extract_proxy( + Thread_Control *the_thread +) +{ + (void) POSIX_MP_NOT_IMPLEMENTED(); +} +#endif + +/* + * END OF TEMPORARY + */ + Index: src/mqueuenametoid.c =================================================================== --- src/mqueuenametoid.c (nonexistent) +++ src/mqueuenametoid.c (revision 1765) @@ -0,0 +1,66 @@ +/* + * 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. + * + * mqueuenametoid.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 +#include + +#include +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_Message_queue_Name_to_id + * + * Look up the specified name and attempt to locate the id + * for the associated message queue. + */ + +int _POSIX_Message_queue_Name_to_id( + const char *name, + Objects_Id *id +) +{ + Objects_Name_to_id_errors status; + + if ( !name ) + return EINVAL; + + if ( !name[0] ) + return EINVAL; + + if( strlen(name) > PATH_MAX ) + return ENAMETOOLONG; + + status = _Objects_Name_to_id( + &_POSIX_Message_queue_Information, (char *)name, 0, id ); + + if ( status == OBJECTS_SUCCESSFUL ) + return 0; + + return ENOENT; +} Index: src/condattrgetpshared.c =================================================================== --- src/condattrgetpshared.c (nonexistent) +++ src/condattrgetpshared.c (revision 1765) @@ -0,0 +1,36 @@ +/* + * condattrgetpshared.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_getpshared( + const pthread_condattr_t *attr, + int *pshared +) +{ + if ( !attr ) + return EINVAL; + + *pshared = attr->process_shared; + return 0; +} Index: src/sched.c =================================================================== --- src/sched.c (nonexistent) +++ src/sched.c (revision 1765) @@ -0,0 +1,157 @@ +/* + * sched.c,v 1.20 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 + * + * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252 + * + */ + +int sched_setparam( + pid_t pid, + const struct sched_param *param +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} + +/*PAGE + * + * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253 + */ + +int sched_getparam( + pid_t pid, + const struct sched_param *param +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} + +/*PAGE + * + * 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 +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} + +/*PAGE + * + * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256 + */ + +int sched_getscheduler( + pid_t pid +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} + +/*PAGE + * + * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 + */ + +int sched_get_priority_max( + int policy +) +{ + switch ( policy ) { + case SCHED_OTHER: + case SCHED_FIFO: + case SCHED_RR: + case SCHED_SPORADIC: + break; + + default: + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + return POSIX_SCHEDULER_MAXIMUM_PRIORITY; +} + +/*PAGE + * + * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 + */ + +int sched_get_priority_min( + int policy +) +{ + switch ( policy ) { + case SCHED_OTHER: + case SCHED_FIFO: + case SCHED_RR: + case SCHED_SPORADIC: + break; + + default: + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + return POSIX_SCHEDULER_MINIMUM_PRIORITY; +} + +/*PAGE + * + * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 + */ + +int sched_rr_get_interval( + pid_t pid, + struct timespec *interval +) +{ + /* XXX do we need to support different time quantums per thread */ + + /* + * Only supported for the "calling process" (i.e. this node). + */ + + if ( pid && pid != getpid() ) + rtems_set_errno_and_return_minus_one( ESRCH ); + + if ( !interval ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + _POSIX_Interval_to_timespec( _Thread_Ticks_per_timeslice, interval ); + return 0; +} + +/*PAGE + * + * 13.3.5 Yield Processor, P1003.1b-1993, p. 257 + */ + +int sched_yield( void ) +{ + _Thread_Disable_dispatch(); + _Thread_Yield_processor(); + _Thread_Enable_dispatch(); + return 0; +} Index: src/cleanuppush.c =================================================================== --- src/cleanuppush.c (nonexistent) +++ src/cleanuppush.c (revision 1765) @@ -0,0 +1,51 @@ +/* + * cleanuppush.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 +#include + +/*PAGE + * + * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184 + */ + +void pthread_cleanup_push( + void (*routine)( void * ), + void *arg +) +{ + POSIX_Cancel_Handler_control *handler; + Chain_Control *handler_stack; + POSIX_API_Control *thread_support; + + if ( !routine ) + return; /* XXX what to do really? */ + + handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); + + if ( !handler ) + return; /* XXX what to do really? */ + + thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + + handler_stack = &thread_support->Cancellation_Handlers; + + handler->routine = routine; + handler->arg = arg; + + _Chain_Append( handler_stack, &handler->Node ); +} Index: src/pthreadattrsetscope.c =================================================================== --- src/pthreadattrsetscope.c (nonexistent) +++ src/pthreadattrsetscope.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. + * + * pthreadattrsetscope.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_setscope( + pthread_attr_t *attr, + int contentionscope +) +{ + if ( !attr || !attr->is_initialized ) + return EINVAL; + + switch ( contentionscope ) { + case PTHREAD_SCOPE_PROCESS: + attr->contentionscope = contentionscope; + return 0; + + case PTHREAD_SCOPE_SYSTEM: + return ENOTSUP; + + default: + return EINVAL; + } +} Index: src/condsignalsupp.c =================================================================== --- src/condsignalsupp.c (nonexistent) +++ src/condsignalsupp.c (revision 1765) @@ -0,0 +1,61 @@ +/* + * condsignalsupp.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 + * + * _POSIX_Condition_variables_Signal_support + * + * 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 +) +{ + register POSIX_Condition_variables_Control *the_cond; + Objects_Locations location; + Thread_Control *the_thread; + + the_cond = _POSIX_Condition_variables_Get( cond, &location ); + switch ( location ) { + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) + _Thread_Dispatch(); + return POSIX_MP_NOT_IMPLEMENTED(); + return EINVAL; +#endif + + case OBJECTS_ERROR: + return EINVAL; + case OBJECTS_LOCAL: + + do { + the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue ); + if ( !the_thread ) + the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; + } while ( is_broadcast && the_thread ); + + _Thread_Enable_dispatch(); + + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/psignalchecksignal.c =================================================================== --- src/psignalchecksignal.c (nonexistent) +++ src/psignalchecksignal.c (revision 1765) @@ -0,0 +1,94 @@ +/* + * psignalchecksignal.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 +#include +#include +#include +#include + + +/*PAGE + * + * _POSIX_signals_Check_signal + */ + +boolean _POSIX_signals_Check_signal( + POSIX_API_Control *api, + int signo, + boolean is_global +) +{ + siginfo_t siginfo_struct; + sigset_t saved_signals_blocked; + + if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, + is_global, TRUE ) ) + return FALSE; + + /* + * Since we made a union of these, only one test is necessary but this is + * safer. + */ + + assert( _POSIX_signals_Vectors[ signo ].sa_handler || + _POSIX_signals_Vectors[ signo ].sa_sigaction ); + + /* + * Just to prevent sending a signal which is currently being ignored. + */ + + if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) + return FALSE; + + /* + * Block the signals requested in sa_mask + */ + + saved_signals_blocked = api->signals_blocked; + api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; + + /* Here, the signal handler function executes */ + + switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { + case SA_SIGINFO: +/* + * + * assert( is_global ); + */ + (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( + signo, + &siginfo_struct, + NULL /* context is undefined per 1003.1b-1993, p. 66 */ + ); + break; + default: + (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); + break; + } + + /* + * Restore the previous set of blocked signals + */ + + api->signals_blocked = saved_signals_blocked; + + return TRUE; +} + Index: src/mqueuedeletesupp.c =================================================================== --- src/mqueuedeletesupp.c (nonexistent) +++ src/mqueuedeletesupp.c (revision 1765) @@ -0,0 +1,74 @@ +/* + * 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. + * + * mqueuedeletesupp.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 +#include + +#include +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_Message_queue_Delete + */ + +void _POSIX_Message_queue_Delete( + POSIX_Message_queue_Control *the_mq +) +{ + if ( !the_mq->linked && !the_mq->open_count ) { + _Objects_Close( &_POSIX_Message_queue_Information, &the_mq->Object ); + + _CORE_message_queue_Close( + &the_mq->Message_queue, + NULL, /* no MP support */ + CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED + ); + + _POSIX_Message_queue_Free( the_mq ); + +#if 0 && defined(RTEMS_MULTIPROCESSING) + if ( the_mq->process_shared == PTHREAD_PROCESS_SHARED ) { + + _Objects_MP_Close( + &_POSIX_Message_queue_Information, + the_mq->Object.id + ); + + _POSIX_Message_queue_MP_Send_process_packet( + POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_DELETE, + the_mq->Object.id, + 0, /* Not used */ + 0 /* Not used */ + ); + } +#endif + + } +} + Index: src/semtimedwait.c =================================================================== --- src/semtimedwait.c (nonexistent) +++ src/semtimedwait.c (revision 1765) @@ -0,0 +1,40 @@ +/* + * semtimedwait.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 + * + * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 + * + * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 + */ + +int sem_timedwait( + sem_t *sem, + const struct timespec *timeout +) +{ + return _POSIX_Semaphore_Wait_support( + sem, + TRUE, + _POSIX_Timespec_to_interval( timeout ) + ); +} Index: src/mqueuecreatesupp.c =================================================================== --- src/mqueuecreatesupp.c (nonexistent) +++ src/mqueuecreatesupp.c (revision 1765) @@ -0,0 +1,152 @@ +/* + * 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. + * + * mqueuecreatesupp.c,v 1.12 2002/07/31 06:22:38 ralf Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_Message_queue_Create_support + * + * This routine does the actual creation and initialization of + * a poxix message queue. + */ + +int _POSIX_Message_queue_Create_support( + const char *_name, + int pshared, + struct mq_attr *attr_ptr, + POSIX_Message_queue_Control **message_queue +) +{ + POSIX_Message_queue_Control *the_mq; + CORE_message_queue_Attributes *the_mq_attr; + struct mq_attr attr; + char *name; + + _Thread_Disable_dispatch(); + + /* + * There is no real basis for the default values. They will work + * but were not compared against any existing implementation for + * compatibility. See README.mqueue for an example program we + * think will print out the defaults. Report anything you find with it. + */ + + if ( attr_ptr == NULL ) { + attr.mq_maxmsg = 10; + attr.mq_msgsize = 16; + } else { + if ( attr_ptr->mq_maxmsg < 0 ){ + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + if ( attr_ptr->mq_msgsize < 0 ){ + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + attr = *attr_ptr; + } + +#if 0 && defined(RTEMS_MULTIPROCESSING) + if ( pshared == PTHREAD_PROCESS_SHARED && + !( _Objects_MP_Allocate_and_open( &_POSIX_Message_queue_Information, 0, + the_mq->Object.id, FALSE ) ) ) { + _POSIX_Message_queue_Free( the_mq ); + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( ENFILE ); + } +#endif + + the_mq = _POSIX_Message_queue_Allocate(); + if ( !the_mq ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( ENFILE ); + } + + the_mq->process_shared = pshared; + the_mq->named = TRUE; + the_mq->open_count = 1; + the_mq->linked = TRUE; + + + /* XXX + * + * Note that thread blocking discipline should be based on the + * current scheduling policy. + */ + + the_mq_attr = &the_mq->Message_queue.Attributes; + the_mq_attr->discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; + + if ( ! _CORE_message_queue_Initialize( + &the_mq->Message_queue, + the_mq_attr, + attr.mq_maxmsg, + attr.mq_msgsize + ) ) { + +#if 0 && defined(RTEMS_MULTIPROCESSING) + if ( pshared == PTHREAD_PROCESS_SHARED ) + _Objects_MP_Close( &_POSIX_Message_queue_Information, the_mq->Object.id ); +#endif + + _POSIX_Message_queue_Free( the_mq ); + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( ENOSPC ); + } + + name = malloc(256); + strcpy( name, _name ); + _Objects_Open( + &_POSIX_Message_queue_Information, + &the_mq->Object, + (char *) name + ); + + *message_queue = the_mq; + +#if 0 && defined(RTEMS_MULTIPROCESSING) + if ( pshared == PTHREAD_PROCESS_SHARED ) + _POSIX_Message_queue_MP_Send_process_packet( + POSIX_MESSAGE_QUEUE_MP_ANNOUNCE_CREATE, + the_mq->Object.id, + (char *) name, + 0 /* Not used */ + ); +#endif + + _Thread_Enable_dispatch(); + return 0; +} Index: src/psignal.c =================================================================== --- src/psignal.c (nonexistent) +++ src/psignal.c (revision 1765) @@ -0,0 +1,250 @@ +/* + * psignal.c,v 1.48 2002/07/01 22:33:47 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include /* memcpy */ +#include /* exit */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* + * 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 ) + +/*** PROCESS WIDE STUFF ****/ + +sigset_t _POSIX_signals_Pending; + +void _POSIX_signals_Abnormal_termination_handler( int signo ) +{ + exit( 1 ); +} + +#define SIG_ARRAY_MAX (SIGRTMAX + 1) +struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ] = { + /* NO SIGNAL 0 */ SIGACTION_IGNORE, + /* SIGHUP 1 */ SIGACTION_TERMINATE, + /* SIGINT 2 */ SIGACTION_TERMINATE, + /* SIGQUIT 3 */ SIGACTION_TERMINATE, + /* SIGILL 4 */ SIGACTION_TERMINATE, + /* SIGTRAP 5 */ SIGACTION_TERMINATE, + /* SIGIOT 6 */ SIGACTION_TERMINATE, + /* SIGABRT 6 SIGACTION_TERMINATE, -- alias for SIGIOT */ + /* SIGEMT 7 */ SIGACTION_TERMINATE, + /* SIGFPE 8 */ SIGACTION_TERMINATE, + /* SIGKILL 9 */ SIGACTION_TERMINATE, + /* SIGBUS 10 */ SIGACTION_TERMINATE, + /* SIGSEGV 11 */ SIGACTION_TERMINATE, + /* SIGSYS 12 */ SIGACTION_TERMINATE, + /* SIGPIPE 13 */ SIGACTION_TERMINATE, + /* SIGALRM 14 */ SIGACTION_TERMINATE, + /* SIGTERM 15 */ SIGACTION_TERMINATE, + /* SIGUSR1 16 */ SIGACTION_TERMINATE, + /* SIGUSR2 17 */ SIGACTION_TERMINATE, + /* SIGRTMIN 18 */ SIGACTION_TERMINATE, + /* SIGRT 19 */ SIGACTION_TERMINATE, + /* SIGRT 20 */ SIGACTION_TERMINATE, + /* SIGRT 21 */ SIGACTION_TERMINATE, + /* SIGRT 22 */ SIGACTION_TERMINATE, + /* SIGRT 23 */ SIGACTION_TERMINATE, + /* SIGRT 24 */ SIGACTION_TERMINATE, + /* SIGRT 25 */ SIGACTION_TERMINATE, + /* SIGRT 26 */ SIGACTION_TERMINATE, + /* SIGRT 27 */ SIGACTION_TERMINATE, + /* SIGRT 28 */ SIGACTION_TERMINATE, + /* SIGRT 29 */ SIGACTION_TERMINATE, + /* SIGRT 30 */ SIGACTION_TERMINATE, + /* SIGRT 31 */ SIGACTION_TERMINATE, + /* SIGRTMAX 32 */ SIGACTION_TERMINATE +}; + +struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ]; + +Watchdog_Control _POSIX_signals_Alarm_timer; + +Thread_queue_Control _POSIX_signals_Wait_queue; + +Chain_Control _POSIX_signals_Inactive_siginfo; +Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ]; + +/*PAGE + * + * XXX - move these + */ + +#define _States_Is_interruptible_signal( _states ) \ + ( ((_states) & \ + (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) == \ + (STATES_WAITING_FOR_SIGNAL|STATES_INTERRUPTIBLE_BY_SIGNAL)) + +/* + * _POSIX_signals_Post_switch_extension + */ + +void _POSIX_signals_Post_switch_extension( + Thread_Control *the_thread +) +{ + POSIX_API_Control *api; + int signo; + ISR_Level level; + + api = the_thread->API_Extensions[ THREAD_API_POSIX ]; + + /* + * If we invoke any user code, there is the possibility that + * a new signal has been posted that we should process so we + * restart the loop if a signal handler was invoked. + * + * The first thing done is to check there are any signals to be + * processed at all. No point in doing this loop otherwise. + */ + +restart: + _ISR_Disable( level ); + if ( !(~api->signals_blocked & + (api->signals_pending | _POSIX_signals_Pending)) ) { + _ISR_Enable( level ); + return; + } + _ISR_Enable( level ); + + for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { + + if ( _POSIX_signals_Check_signal( api, signo, FALSE ) ) + goto restart; + + if ( _POSIX_signals_Check_signal( api, signo, TRUE ) ) + goto restart; + + } + +/* XXX - add __SIGFIRSTNOTRT or something like that to newlib signal .h */ + + for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { + + if ( _POSIX_signals_Check_signal( api, signo, FALSE ) ) + goto restart; + + if ( _POSIX_signals_Check_signal( api, signo, TRUE ) ) + goto restart; + + } + +} + +/*PAGE + * + * _POSIX_signals_Alarm_TSR + */ + +void _POSIX_signals_Alarm_TSR( + Objects_Id id, + void *argument +) +{ + int status; + + status = kill( getpid(), SIGALRM ); + /* XXX can't print from an ISR, should this be fatal? */ + assert( !status ); +} + +/*PAGE + * + * _POSIX_signals_Manager_Initialization + */ + +void _POSIX_signals_Manager_Initialization( + int maximum_queued_signals +) +{ + unsigned32 signo; + + /* + * Insure we have the same number of vectors and default vector entries + */ + + assert( + sizeof(_POSIX_signals_Vectors) == sizeof(_POSIX_signals_Default_vectors) + ); + + memcpy( + _POSIX_signals_Vectors, + _POSIX_signals_Default_vectors, + sizeof( _POSIX_signals_Vectors ) + ); + + /* + * Initialize the set of pending signals for the entire process + */ + + sigemptyset( &_POSIX_signals_Pending ); + + /* + * Initialize the timer used to implement alarm(). + */ + + _Watchdog_Initialize( + &_POSIX_signals_Alarm_timer, + _POSIX_signals_Alarm_TSR, + 0, + NULL + ); + + /* + * Initialize the queue we use to block for signals + */ + + _Thread_queue_Initialize( + &_POSIX_signals_Wait_queue, + THREAD_QUEUE_DISCIPLINE_PRIORITY, + STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL, + EAGAIN + ); + + /* XXX status codes */ + + /* + * Allocate the siginfo pools. + */ + + for ( signo=1 ; signo<= SIGRTMAX ; signo++ ) + _Chain_Initialize_empty( &_POSIX_signals_Siginfo[ signo ] ); + + _Chain_Initialize( + &_POSIX_signals_Inactive_siginfo, + _Workspace_Allocate_or_fatal_error( + maximum_queued_signals * sizeof( POSIX_signals_Siginfo_node ) + ), + maximum_queued_signals, + sizeof( POSIX_signals_Siginfo_node ) + ); +} Index: src/mutexattrsetprioceiling.c =================================================================== --- src/mutexattrsetprioceiling.c (nonexistent) +++ src/mutexattrsetprioceiling.c (revision 1765) @@ -0,0 +1,41 @@ +/* + * mutexattrsetprioceiling.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_setprioceiling( + pthread_mutexattr_t *attr, + int prioceiling +) +{ + if ( !attr || !attr->is_initialized ) + return EINVAL; + + if ( !_POSIX_Priority_Is_valid( prioceiling ) ) + return EINVAL; + + attr->prio_ceiling = prioceiling; + return 0; +} Index: src/ptimer.c =================================================================== --- src/ptimer.c (nonexistent) +++ src/ptimer.c (revision 1765) @@ -0,0 +1,102 @@ +/* + * ptimer.c,v 1.1 1996/06/03 16:29:58 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include +#include +#include + +#include + +/************************************/ +/* These includes are now necessary */ +/************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/*****************************/ +/* End of necessary includes */ +/*****************************/ + +#include + +/* *************************************************************************** + * TIMER_INITIALIZE_S + * + * Description: Initialize the data of a timer + * ***************************************************************************/ + +void TIMER_INITIALIZE_S ( int timer_pos ) +{ + + /* + * Indicates that the position in the table is free + */ + + timer_struct[timer_pos].state = STATE_FREE_C; + + /* + * The initial data of timing are set with null value + */ + + timer_struct[timer_pos].timer_data.it_value.tv_sec = 0; + timer_struct[timer_pos].timer_data.it_value.tv_nsec = 0; + timer_struct[timer_pos].timer_data.it_interval.tv_sec = 0; + timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0; + + /* + * The count of expirations is 0 + */ + + timer_struct[timer_pos].overrun = 0; + +} + +/* *************************************************************************** + * _POSIX_Timer_Manager_initialization + * + * Description: Initialize the internal structure in which the data of all + * the timers are stored + * ***************************************************************************/ + +int timer_max; +POSIX_Timer_Control *timer_struct; + + +void _POSIX_Timer_Manager_initialization ( int max_timers ) +{ + int index; + + timer_struct = _Workspace_Allocate_or_fatal_error( + max_timers * sizeof(POSIX_Timer_Control) ); + + /* + * Initialize all the timers + */ + + timer_max = max_timers; + + for (index=0; index +#include +#include + +#include +#include +#include +#include +#include + +int pthread_kill( + pthread_t thread, + int sig +) +{ + POSIX_API_Control *api; + Thread_Control *the_thread; + Objects_Locations location; + + if ( sig && !is_valid_signo(sig) ) + rtems_set_errno_and_return_minus_one( EINVAL ); + +/* commented out when posix timers added + if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) + rtems_set_errno_and_return_minus_one( ENOSYS ); +*/ + + the_thread = _POSIX_Threads_Get( thread, &location ); + switch ( location ) { + case OBJECTS_ERROR: + case OBJECTS_REMOTE: + rtems_set_errno_and_return_minus_one( ESRCH ); + case OBJECTS_LOCAL: + /* + * If sig == 0 then just validate arguments + */ + + api = the_thread->API_Extensions[ THREAD_API_POSIX ]; + + if ( sig ) { + + if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { + _Thread_Enable_dispatch(); + return 0; + } + + /* XXX critical section */ + + api->signals_pending |= signo_to_mask( sig ); + + (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); + + the_thread->do_post_task_switch_extension = TRUE; + + if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) + _ISR_Signals_to_thread_executing = TRUE; + } + _Thread_Enable_dispatch(); + return 0; + } + + return POSIX_BOTTOM_REACHED(); +} Index: src/semaphorenametoid.c =================================================================== --- src/semaphorenametoid.c (nonexistent) +++ src/semaphorenametoid.c (revision 1765) @@ -0,0 +1,52 @@ +/* + * semaphorenametoid.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 +#include + +#include +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_Semaphore_Name_to_id + * + * Look up the specified name and attempt to locate the id + * for the associated semaphore. + */ + +int _POSIX_Semaphore_Name_to_id( + const char *name, + sem_t *id +) +{ + Objects_Name_to_id_errors status; + + if ( !name ) + return EINVAL; + + if ( !name[0] ) + return EINVAL; + + status = _Objects_Name_to_id( + &_POSIX_Semaphore_Information, (char *)name, 0, (Objects_Id*)id ); + + if ( status == OBJECTS_SUCCESSFUL ) + return 0; + + return ENOENT; +} + Index: src/semunlink.c =================================================================== --- src/semunlink.c (nonexistent) +++ src/semunlink.c (revision 1765) @@ -0,0 +1,75 @@ +/* + * semunlink.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_unlink + * + * Unlinks a named semaphore, sem_close must also be called to remove + * the semaphore. + * + * 11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225 + */ + +int sem_unlink( + const char *name +) +{ + int status; + register POSIX_Semaphore_Control *the_semaphore; + sem_t the_semaphore_id; + + _Thread_Disable_dispatch(); + + status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); + if ( status != 0 ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( status ); + } + + /* + * Don't support unlinking a remote semaphore. + */ + + if ( !_Objects_Is_local_id(the_semaphore_id) ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( ENOSYS ); + } + + the_semaphore = (POSIX_Semaphore_Control *) _Objects_Get_local_object( + &_POSIX_Semaphore_Information, + _Objects_Get_index( the_semaphore_id ) + ); + +#if defined(RTEMS_MULTIPROCESSING) + if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) { + _Objects_MP_Close( &_POSIX_Semaphore_Information, the_semaphore_id ); + } +#endif + + the_semaphore->linked = FALSE; + _POSIX_Semaphore_Namespace_remove( the_semaphore ); + _POSIX_Semaphore_Delete( the_semaphore ); + + _Thread_Enable_dispatch(); + return 0; +} Index: src/pthreadattrinit.c =================================================================== --- src/pthreadattrinit.c (nonexistent) +++ src/pthreadattrinit.c (revision 1765) @@ -0,0 +1,33 @@ +/* + * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 + * + * 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. + * + * pthreadattrinit.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_init( + pthread_attr_t *attr +) +{ + if ( !attr ) + return EINVAL; + + *attr = _POSIX_Threads_Default_attributes; + return 0; +} Index: src/pthreadsigmask.c =================================================================== --- src/pthreadsigmask.c (nonexistent) +++ src/pthreadsigmask.c (revision 1765) @@ -0,0 +1,73 @@ +/* + * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 + * + * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask(). + * + * 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. + * + * pthreadsigmask.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 + +int pthread_sigmask( + int how, + const sigset_t *set, + sigset_t *oset +) +{ + POSIX_API_Control *api; + + if ( !set && !oset ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + + if ( oset ) + *oset = api->signals_blocked; + + if ( !set ) + return 0; + + switch ( how ) { + case SIG_BLOCK: + api->signals_blocked |= *set; + break; + case SIG_UNBLOCK: + api->signals_blocked &= ~*set; + break; + case SIG_SETMASK: + api->signals_blocked = *set; + break; + default: + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + /* XXX are there critical section problems here? */ + + /* XXX evaluate the new set */ + + if ( ~api->signals_blocked & + (api->signals_pending | _POSIX_signals_Pending) ) { + _Thread_Executing->do_post_task_switch_extension = TRUE; + _Thread_Dispatch(); + } + + return 0; +} Index: src/mutexattrdestroy.c =================================================================== --- src/mutexattrdestroy.c (nonexistent) +++ src/mutexattrdestroy.c (revision 1765) @@ -0,0 +1,38 @@ +/* + * mutexattrdestroy.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 + * + * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 + */ + +int pthread_mutexattr_destroy( + pthread_mutexattr_t *attr +) +{ + if ( !attr || !attr->is_initialized ) + return EINVAL; + + attr->is_initialized = FALSE; + return 0; +} + Index: src/seminit.c =================================================================== --- src/seminit.c (nonexistent) +++ src/seminit.c (revision 1765) @@ -0,0 +1,51 @@ +/* + * seminit.c,v 1.6 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.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219 + */ + +int sem_init( + sem_t *sem, + int pshared, + unsigned int value +) +{ + int status; + POSIX_Semaphore_Control *the_semaphore; + + if ( !sem ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + status = _POSIX_Semaphore_Create_support( + NULL, + pshared, + value, + &the_semaphore + ); + + if ( status != -1 ) + *sem = the_semaphore->Object.id; + + return status; +} Index: src/semtrywait.c =================================================================== --- src/semtrywait.c (nonexistent) +++ src/semtrywait.c (revision 1765) @@ -0,0 +1,35 @@ +/* + * semtrywait.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 + * + * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 + * + * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 + */ + +int sem_trywait( + sem_t *sem +) +{ + return _POSIX_Semaphore_Wait_support( sem, FALSE, THREAD_QUEUE_WAIT_FOREVER ); +} Index: src/clockgettime.c =================================================================== --- src/clockgettime.c (nonexistent) +++ src/clockgettime.c (revision 1765) @@ -0,0 +1,69 @@ +/* + * clockgettime.c,v 1.4 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_gettime( + clockid_t clock_id, + struct timespec *tp +) +{ + ISR_Level level; + time_t seconds; + long ticks; + + if ( !tp ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + switch ( clock_id ) { + + case CLOCK_REALTIME: + + _ISR_Disable( level ); + seconds = _TOD_Seconds_since_epoch; + ticks = _TOD_Current.ticks; + _ISR_Enable( level ); + + tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988; + tp->tv_nsec = ticks * _TOD_Microseconds_per_tick * + TOD_NANOSECONDS_PER_MICROSECOND; + break; + +#ifdef _POSIX_CPUTIME + case CLOCK_PROCESS_CPUTIME: + /* don't base this on _Watchdog_Ticks_since_boot--duration is too short*/ + return POSIX_NOT_IMPLEMENTED(); + break; +#endif + +#ifdef _POSIX_THREAD_CPUTIME + case CLOCK_THREAD_CPUTIME: + return POSIX_NOT_IMPLEMENTED(); + break; +#endif + default: + rtems_set_errno_and_return_minus_one( EINVAL ); + + } + return 0; +} Index: src/pthreadattrgetschedparam.c =================================================================== --- src/pthreadattrgetschedparam.c (nonexistent) +++ src/pthreadattrgetschedparam.c (revision 1765) @@ -0,0 +1,31 @@ +/* + * 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. + * + * pthreadattrgetschedparam.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_getschedparam( + const pthread_attr_t *attr, + struct sched_param *param +) +{ + if ( !attr || !attr->is_initialized || !param ) + return EINVAL; + + *param = attr->schedparam; + return 0; +} Index: src/mqueuetranslatereturncode.c =================================================================== --- src/mqueuetranslatereturncode.c (nonexistent) +++ src/mqueuetranslatereturncode.c (revision 1765) @@ -0,0 +1,101 @@ +/* + * POSIX Message Queue Error Translation + * + * + * 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. + * + * mqueuetranslatereturncode.c,v 1.5 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 + * + * _POSIX_Message_queue_Translate_core_message_queue_return_code + * + * Input parameters: + * the_message_queue_status - message_queue status code to translate + * + * Output parameters: + * rtems status code - translated POSIX status code + * + */ + +int _POSIX_Message_queue_Translate_core_message_queue_return_code( + unsigned32 the_message_queue_status +) +{ + switch ( the_message_queue_status ) { + case CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL: + return 0; + + /* + * Bad message size + */ + case CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE: + return EMSGSIZE; + + /* + * Queue is full of pending messages. + */ + case CORE_MESSAGE_QUEUE_STATUS_TOO_MANY: + return EAGAIN; + + /* + * Out of message buffers to queue pending message + */ + case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED: + return ENOMEM; + + /* + * No message available on receive poll + */ + case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT: + return EAGAIN; + + /* + * Queue was deleted while thread blocked on it. + */ + case CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED: + return EBADF; + + /* + * POSIX Real-Time Extensions add timeouts to send and receive. + */ + case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT: + return ETIMEDOUT; + + /* + * RTEMS POSIX API implementation does not support multiprocessing. + */ + case THREAD_STATUS_PROXY_BLOCKING: + return ENOSYS; + } + _Internal_error_Occurred( + INTERNAL_ERROR_POSIX_API, + TRUE, + the_message_queue_status + ); + return POSIX_BOTTOM_REACHED(); +} Index: src/keydelete.c =================================================================== --- src/keydelete.c (nonexistent) +++ src/keydelete.c (revision 1765) @@ -0,0 +1,58 @@ +/* + * keydelete.c,v 1.4 2002/07/01 22:33:47 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include + +/*PAGE + * + * 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 + */ + +int pthread_key_delete( + pthread_key_t key +) +{ + register POSIX_Keys_Control *the_key; + Objects_Locations location; + unsigned32 the_api; + + the_key = _POSIX_Keys_Get( key, &location ); + switch ( location ) { + case OBJECTS_ERROR: + case OBJECTS_REMOTE: /* should never happen */ + return EINVAL; + case OBJECTS_LOCAL: + _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); + + the_key->is_active = FALSE; + + for ( the_api = 1; + the_api <= OBJECTS_APIS_LAST; + the_api++ ) + if ( the_key->Values[ the_api ] ) + _Workspace_Free( the_key->Values[ the_api ] ); + + /* + * NOTE: The destructor is not called and it is the responsibility + * of the application to free the memory. + */ + + _POSIX_Keys_Free( the_key ); + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/semaphorewaitsupp.c =================================================================== --- src/semaphorewaitsupp.c (nonexistent) +++ src/semaphorewaitsupp.c (revision 1765) @@ -0,0 +1,71 @@ +/* + * semaphorewaitsupp.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 + * + * _POSIX_Semaphore_Wait_support + */ + +int _POSIX_Semaphore_Wait_support( + sem_t *sem, + boolean blocking, + Watchdog_Interval timeout +) +{ + 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(); + rtems_set_errno_and_return_minus_one( EINVAL ); + case OBJECTS_LOCAL: + _CORE_semaphore_Seize( + &the_semaphore->Semaphore, + the_semaphore->Object.id, + blocking, + timeout + ); + _Thread_Enable_dispatch(); + switch ( _Thread_Executing->Wait.return_code ) { + case CORE_SEMAPHORE_STATUS_SUCCESSFUL: + break; + case CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT: + rtems_set_errno_and_return_minus_one( EAGAIN ); + case CORE_SEMAPHORE_WAS_DELETED: + rtems_set_errno_and_return_minus_one( EAGAIN ); + case CORE_SEMAPHORE_TIMEOUT: + rtems_set_errno_and_return_minus_one( ETIMEDOUT ); + break; + case CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED: + /* + * This error can not occur since we set the maximum + * count to the largest value the count can hold. + */ + break; + } + } + return 0; +} Index: src/sigprocmask.c =================================================================== --- src/sigprocmask.c (nonexistent) +++ src/sigprocmask.c (revision 1765) @@ -0,0 +1,39 @@ +/* + * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 + * + * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask(). + * + * 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. + * + * sigprocmask.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 + +int sigprocmask( + int how, + const sigset_t *set, + sigset_t *oset +) +{ + /* + * P1003.1c/Draft 10, p. 38 maps sigprocmask to pthread_sigmask. + */ + + return pthread_sigmask( how, set, oset ); +} Index: src/mutexlocksupp.c =================================================================== --- src/mutexlocksupp.c (nonexistent) +++ src/mutexlocksupp.c (revision 1765) @@ -0,0 +1,67 @@ +/* + * mutexlocksupp.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 + * + * _POSIX_Mutex_Lock_support + * + * 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 +) +{ + register POSIX_Mutex_Control *the_mutex; + Objects_Locations location; + ISR_Level level; + + the_mutex = _POSIX_Mutex_Get_interrupt_disable( mutex, &location, &level ); + switch ( location ) { + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) + return _POSIX_Mutex_MP_Send_request_packet( + POSIX_MUTEX_MP_OBTAIN_REQUEST, + *mutex, + 0, /* must define the option set */ + WATCHDOG_NO_TIMEOUT + ); +#endif + case OBJECTS_ERROR: + return EINVAL; + case OBJECTS_LOCAL: + _CORE_mutex_Seize( + &the_mutex->Mutex, + the_mutex->Object.id, + blocking, + timeout, + level + ); + return _POSIX_Mutex_From_core_mutex_status( + (CORE_mutex_Status) _Thread_Executing->Wait.return_code + ); + } + return POSIX_BOTTOM_REACHED(); +} Index: src/clocksettime.c =================================================================== --- src/clocksettime.c (nonexistent) +++ src/clocksettime.c (revision 1765) @@ -0,0 +1,88 @@ +/* + * clocksettime.c,v 1.4 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_settime( + clockid_t clock_id, + const struct timespec *tp +) +{ + struct tm split_time; + TOD_Control tod; + Watchdog_Interval seconds; + + assert( tp ); + + switch ( clock_id ) { + + case CLOCK_REALTIME: + (void) gmtime_r( &tp->tv_sec, &split_time ); + + /* + * Convert the tm structure format to that used by the TOD Handler + * + * NOTE: TOD Handler does not honor leap seconds. + */ + + tod.year = split_time.tm_year + 1900; /* RHS is years since 1900 */ + tod.month = split_time.tm_mon + 1; /* RHS uses 0-11 */ + tod.day = split_time.tm_mday; + tod.hour = split_time.tm_hour; + tod.minute = split_time.tm_min; + tod.second = split_time.tm_sec; /* RHS allows 0-61 for leap seconds */ + + tod.ticks = (tp->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) / + _TOD_Microseconds_per_tick; + + if ( !_TOD_Validate( &tod ) ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + /* + * We can't use the tp->tv_sec field because it is based on + * a different EPOCH. + */ + + seconds = _TOD_To_seconds( &tod ); + _Thread_Disable_dispatch(); + _TOD_Set( &tod, seconds ); + _Thread_Enable_dispatch(); + break; + +#ifdef _POSIX_CPUTIME + case CLOCK_PROCESS_CPUTIME: + return POSIX_NOT_IMPLEMENTED(); + break; +#endif + +#ifdef _POSIX_THREAD_CPUTIME + case CLOCK_THREAD_CPUTIME: + return POSIX_NOT_IMPLEMENTED(); + break; +#endif + default: + rtems_set_errno_and_return_minus_one( EINVAL ); + + } + return 0; +} Index: src/pthreadattrsetschedparam.c =================================================================== --- src/pthreadattrsetschedparam.c (nonexistent) +++ src/pthreadattrsetschedparam.c (revision 1765) @@ -0,0 +1,31 @@ +/* + * 13.5.1 Thread Creation Scheduling Parameters, 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. + * + * pthreadattrsetschedparam.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_setschedparam( + pthread_attr_t *attr, + const struct sched_param *param +) +{ + if ( !attr || !attr->is_initialized || !param ) + return EINVAL; + + attr->schedparam = *param; + return 0; +} Index: src/mutexinit.c =================================================================== --- src/mutexinit.c (nonexistent) +++ src/mutexinit.c (revision 1765) @@ -0,0 +1,186 @@ +/* + * mutexinit.c,v 1.4 2002/07/01 22:33:47 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 + * + * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 + * + * NOTE: XXX Could be optimized so all the attribute error checking + * is not performed when attr is NULL. + */ + +int pthread_mutex_init( + pthread_mutex_t *mutex, + const pthread_mutexattr_t *attr +) +{ + POSIX_Mutex_Control *the_mutex; + CORE_mutex_Attributes *the_mutex_attr; + const pthread_mutexattr_t *the_attr; + CORE_mutex_Disciplines the_discipline; +#if 0 + register POSIX_Mutex_Control *mutex_in_use; + Objects_Locations location; +#endif + + if ( attr ) the_attr = attr; + else the_attr = &_POSIX_Mutex_Default_attributes; + + /* Check for NULL mutex */ + + if ( !mutex ) + return EINVAL; + + /* + * This code should eventually be removed. + * + * Although the POSIX specification says: + * + * "Attempting to initialize an already initialized mutex results + * in undefined behavior." + * + * Trying to keep the caller from doing the create when *mutex + * is actually a valid ID causes grief. All it takes is the wrong + * value in an uninitialized variable to make this fail. As best + * I can tell, RTEMS was the only pthread implementation to choose + * this option for "undefined behavior" and doing so has created + * portability problems. In particular, Rosimildo DaSilva + * saw seemingly random failures in the + * RTEMS port of omniORB2 when this code was enabled. + * + * Joel Sherrill 14 May 1999 + */ + + +#if 0 + /* avoid infinite recursion on call to this routine in _POSIX_Mutex_Get */ + + if ( *mutex != PTHREAD_MUTEX_INITIALIZER ) { + + /* EBUSY if *mutex is a valid id */ + + mutex_in_use = _POSIX_Mutex_Get( mutex, &location ); + switch ( location ) { + case OBJECTS_REMOTE: + case OBJECTS_ERROR: + break; + case OBJECTS_LOCAL: + _Thread_Enable_dispatch(); + return EBUSY; + } + } +#endif + + if ( !the_attr->is_initialized ) + return EINVAL; + + /* + * XXX: Be careful about attributes when global!!! + */ + + assert( the_attr->process_shared == PTHREAD_PROCESS_PRIVATE ); + +#if defined(RTEMS_MULTIPROCESSING) + if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) + return POSIX_MP_NOT_IMPLEMENTED(); +#endif + + /* + * Determine the discipline of the mutex + */ + + switch ( the_attr->protocol ) { + case PTHREAD_PRIO_NONE: + the_discipline = CORE_MUTEX_DISCIPLINES_FIFO; + break; + case PTHREAD_PRIO_INHERIT: + the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; + break; + case PTHREAD_PRIO_PROTECT: + the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; + break; + default: + return EINVAL; + } + + if ( !_POSIX_Priority_Is_valid( the_attr->prio_ceiling ) ) + return EINVAL; + + _Thread_Disable_dispatch(); + + the_mutex = _POSIX_Mutex_Allocate(); + + if ( !the_mutex ) { + _Thread_Enable_dispatch(); + return EAGAIN; + } + +#if defined(RTEMS_MULTIPROCESSING) + if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && + !( _Objects_MP_Allocate_and_open( &_POSIX_Mutex_Information, 0, + the_mutex->Object.id, FALSE ) ) ) { + _POSIX_Mutex_Free( the_mutex ); + _Thread_Enable_dispatch(); + return EAGAIN; + } +#endif + + the_mutex->process_shared = the_attr->process_shared; + + the_mutex_attr = &the_mutex->Mutex.Attributes; + + if ( the_attr->recursive ) + the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; + else + the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; + the_mutex_attr->only_owner_release = TRUE; + the_mutex_attr->priority_ceiling = + _POSIX_Priority_To_core( the_attr->prio_ceiling ); + the_mutex_attr->discipline = the_discipline; + + /* + * Must be initialized to unlocked. + */ + + _CORE_mutex_Initialize( + &the_mutex->Mutex, + the_mutex_attr, + CORE_MUTEX_UNLOCKED + ); + + _Objects_Open( &_POSIX_Mutex_Information, &the_mutex->Object, 0 ); + + *mutex = the_mutex->Object.id; + +#if defined(RTEMS_MULTIPROCESSING) + if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) + _POSIX_Mutex_MP_Send_process_packet( + POSIX_MUTEX_MP_ANNOUNCE_CREATE, + the_mutex->Object.id, + 0, /* Name not used */ + 0 /* Not used */ + ); +#endif + + _Thread_Enable_dispatch(); + return 0; +} Index: src/Makefile.am =================================================================== --- src/Makefile.am (nonexistent) +++ src/Makefile.am (revision 1765) @@ -0,0 +1,114 @@ +## +## Makefile.am,v 1.16 2002/07/22 13:39:01 ralf Exp +## + +LIB=$(ARCH)/libposix.a + +# following are semi-implemented and untested +UNUSED_C_FILES = devctl.c intr.c + +# These are really in the stand but not really functional +BUILD_FOR_NOW_C_FILES = aio.c + +ENOSYS_C_FILES = execl.c execle.c execlp.c execv.c execve.c execvp.c fork.c \ + pthreadatfork.c wait.c waitpid.c + +CANCEL_C_FILES = cancel.c cancelrun.c cleanuppop.c cleanuppush.c \ + setcancelstate.c setcanceltype.c testcancel.c + +CONDITION_VARIABLE_C_FILES = cond.c condattrdestroy.c condattrgetpshared.c \ + condattrinit.c condattrsetpshared.c condbroadcast.c \ + conddefaultattributes.c conddestroy.c condinit.c condmp.c condsignal.c \ + condsignalsupp.c condtimedwait.c condwait.c condwaitsupp.c + +ID_C_FILES = getegid.c geteuid.c getgid.c getgroups.c getlogin.c getpgrp.c \ + getpid.c getppid.c getuid.c setpgid.c setsid.c + +KEY_C_FILES = key.c keycreate.c keydelete.c keygetspecific.c \ + keyrundestructors.c keysetspecific.c + +MEMORY_C_FILES = getpagesize.c mprotect.c + +MESSAGE_QUEUE_C_FILES = mqueue.c mqueueclose.c mqueuecreatesupp.c \ + mqueuedeletesupp.c mqueuegetattr.c mqueuenametoid.c mqueuenotify.c \ + mqueueopen.c mqueuereceive.c mqueuerecvsupp.c mqueuesend.c \ + mqueuesendsupp.c mqueuesetattr.c mqueuetimedreceive.c mqueuetimedsend.c \ + mqueuetranslatereturncode.c mqueueunlink.c + +MUTEX_C_FILES = mutex.c mutexattrdestroy.c mutexattrgetprioceiling.c \ + mutexattrgetprotocol.c mutexattrgetpshared.c mutexattrinit.c \ + mutexattrsetprioceiling.c mutexattrsetprotocol.c mutexattrsetpshared.c \ + mutexdefaultattributes.c mutexdestroy.c mutexfromcorestatus.c \ + mutexgetprioceiling.c mutexinit.c mutexlock.c mutexlocksupp.c mutexmp.c \ + mutexsetprioceiling.c mutextimedlock.c mutextrylock.c mutexunlock.c + +PTHREAD_C_FILES = pthread.c pthreadsetcputime.c pthreadgetcputime.c \ + pthreadgetcpuclockid.c pthreadonce.c pthreadequal.c pthreadself.c \ + pthreadexit.c pthreaddetach.c pthreadjoin.c pthreadcreate.c \ + pthreadattrsetdetachstate.c pthreadattrgetdetachstate.c \ + pthreadattrgetstackaddr.c pthreadattrsetstackaddr.c \ + pthreadattrgetstacksize.c pthreadattrsetstacksize.c pthreadattrinit.c \ + pthreadattrdestroy.c pthreadsetschedparam.c pthreadgetschedparam.c \ + pthreadattrsetschedparam.c pthreadattrgetschedparam.c \ + pthreadattrgetschedpolicy.c pthreadattrsetschedpolicy.c \ + pthreadattrgetinheritsched.c pthreadattrsetinheritsched.c \ + pthreadattrgetscope.c pthreadattrsetscope.c + +PSIGNAL_C_FILES = psignal.c alarm.c kill.c killinfo.c pause.c \ + psignalclearprocesssignals.c psignalsetprocesssignals.c \ + psignalchecksignal.c psignalclearsignals.c psignalunblockthread.c \ + pthreadkill.c pthreadsigmask.c sigaction.c sigaddset.c sigdelset.c \ + sigemptyset.c sigfillset.c sigismember.c sigpending.c sigprocmask.c \ + sigqueue.c sigsuspend.c sigtimedwait.c sigwait.c sigwaitinfo.c \ + signal_2.c + +SEMAPHORE_C_FILES = semaphore.c semaphorecreatesupp.c semaphoredeletesupp.c \ + semaphoremp.c semaphorenametoid.c semaphorewaitsupp.c semclose.c \ + semdestroy.c semgetvalue.c seminit.c semopen.c sempost.c semtimedwait.c \ + semtrywait.c semunlink.c semwait.c + +TIME_C_FILES = time.c posixtimespecsubtract.c posixtimespectointerval.c \ + posixintervaltotimespec.c clockgetcpuclockid.c clockgetenableattr.c \ + clockgetres.c clockgettime.c clocksetenableattr.c clocksettime.c \ + nanosleep.c sleep.c + +# the timer manager needs to be split further but only after its +# dependence on the Classic API Timer Manager is removed. +TIMER_C_FILES = ptimer.c ptimer1.c + +C_FILES = adasupp.c $(CANCEL_C_FILES) $(CONDITION_VARIABLE_C_FILES) \ + $(ID_C_FILES) $(KEY_C_FILES) $(MEMORY_C_FILES) $(MESSAGE_QUEUE_C_FILES) \ + $(MUTEX_C_FILES) $(PTHREAD_C_FILES) $(PSIGNAL_C_FILES) sched.c \ + $(SEMAPHORE_C_FILES) sysconf.c $(TIME_C_FILES) $(TIMER_C_FILES) types.c \ + $(ENOSYS_C_FILES) $(BUILD_FOR_NOW_C_FILES) +C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) + +OBJS = $(C_O_FILES) + +include $(top_srcdir)/../automake/multilib.am +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/lib.am + +# +# Add local stuff here using += +# + +AM_CPPFLAGS += -I. -D__RTEMS_INSIDE__ + +all-local: ${ARCH} $(LIB) + +$(LIB): ${OBJS} + $(make-library) + +# temporary so we can see how many things are left to implement +not: + grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL + @echo + @echo + @echo + @echo `grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL | wc -l ` places marked not implemented + @echo `wc -l $(C_FILES) | grep total` lines of C code to test + +EXTRA_DIST = $(C_FILES) $(UNUSED_C_FILES) + +include $(top_srcdir)/../automake/local.am Index: src/mqueuegetattr.c =================================================================== --- src/mqueuegetattr.c (nonexistent) +++ src/mqueuegetattr.c (revision 1765) @@ -0,0 +1,80 @@ +/* + * 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. + * + * mqueuegetattr.c,v 1.6 2002/04/26 23:39:01 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/*PAGE + * + * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283 + */ + +int mq_getattr( + mqd_t mqdes, + struct mq_attr *mqstat +) +{ + POSIX_Message_queue_Control *the_mq; + POSIX_Message_queue_Control_fd *the_mq_fd; + Objects_Locations location; + CORE_message_queue_Attributes *the_mq_attr; + + if ( !mqstat ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); + switch ( location ) { + case OBJECTS_ERROR: + rtems_set_errno_and_return_minus_one( EBADF ); + case OBJECTS_REMOTE: + _Thread_Dispatch(); + return POSIX_MP_NOT_IMPLEMENTED(); + rtems_set_errno_and_return_minus_one( EINVAL ); + case OBJECTS_LOCAL: + the_mq = the_mq_fd->Queue; + + /* + * Return the old values. + */ + + the_mq_attr = &the_mq->Message_queue.Attributes; + + mqstat->mq_flags = the_mq_fd->oflag; + mqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size; + mqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages; + mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages; + + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} + Index: src/mprotect.c =================================================================== --- src/mprotect.c (nonexistent) +++ src/mprotect.c (revision 1765) @@ -0,0 +1,23 @@ +/* + * mprotect.c,v 1.1 2001/09/13 13:23:30 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +/*PAGE + * + * 12.2.3 Change Memory Protection, P1003.1b-1996, p. 277. + * + * This is not a functional version but the SPARC backend for at least + * gcc 2.8.1 plus gnat 3.13p and gcc 3.0.1 require it to be there and + * return 0. + */ + +int mprotect(const void *addr, size_t len, int prot) +{ + return 0; +} Index: src/setpgid.c =================================================================== --- src/setpgid.c (nonexistent) +++ src/setpgid.c (revision 1765) @@ -0,0 +1,29 @@ +/* + * setpgid.c,v 1.4 2002/01/04 18:28:24 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include +#include +#include + +/*PAGE + * + * 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89 + */ + +int setpgid( + pid_t pid, + pid_t pgid +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} Index: src/Makefile.in =================================================================== --- src/Makefile.in (nonexistent) +++ src/Makefile.in (revision 1765) @@ -0,0 +1,551 @@ +# 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@ $(GCCSPECS) +CPP = @CPP@ $(GCCSPECS) +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@ + +LIB = $(ARCH)/libposix.a + +# following are semi-implemented and untested +UNUSED_C_FILES = devctl.c intr.c + +# These are really in the stand but not really functional +BUILD_FOR_NOW_C_FILES = aio.c + +ENOSYS_C_FILES = execl.c execle.c execlp.c execv.c execve.c execvp.c fork.c \ + pthreadatfork.c wait.c waitpid.c + + +CANCEL_C_FILES = cancel.c cancelrun.c cleanuppop.c cleanuppush.c \ + setcancelstate.c setcanceltype.c testcancel.c + + +CONDITION_VARIABLE_C_FILES = cond.c condattrdestroy.c condattrgetpshared.c \ + condattrinit.c condattrsetpshared.c condbroadcast.c \ + conddefaultattributes.c conddestroy.c condinit.c condmp.c condsignal.c \ + condsignalsupp.c condtimedwait.c condwait.c condwaitsupp.c + + +ID_C_FILES = getegid.c geteuid.c getgid.c getgroups.c getlogin.c getpgrp.c \ + getpid.c getppid.c getuid.c setpgid.c setsid.c + + +KEY_C_FILES = key.c keycreate.c keydelete.c keygetspecific.c \ + keyrundestructors.c keysetspecific.c + + +MEMORY_C_FILES = getpagesize.c mprotect.c + +MESSAGE_QUEUE_C_FILES = mqueue.c mqueueclose.c mqueuecreatesupp.c \ + mqueuedeletesupp.c mqueuegetattr.c mqueuenametoid.c mqueuenotify.c \ + mqueueopen.c mqueuereceive.c mqueuerecvsupp.c mqueuesend.c \ + mqueuesendsupp.c mqueuesetattr.c mqueuetimedreceive.c mqueuetimedsend.c \ + mqueuetranslatereturncode.c mqueueunlink.c + + +MUTEX_C_FILES = mutex.c mutexattrdestroy.c mutexattrgetprioceiling.c \ + mutexattrgetprotocol.c mutexattrgetpshared.c mutexattrinit.c \ + mutexattrsetprioceiling.c mutexattrsetprotocol.c mutexattrsetpshared.c \ + mutexdefaultattributes.c mutexdestroy.c mutexfromcorestatus.c \ + mutexgetprioceiling.c mutexinit.c mutexlock.c mutexlocksupp.c mutexmp.c \ + mutexsetprioceiling.c mutextimedlock.c mutextrylock.c mutexunlock.c + + +PTHREAD_C_FILES = pthread.c pthreadsetcputime.c pthreadgetcputime.c \ + pthreadgetcpuclockid.c pthreadonce.c pthreadequal.c pthreadself.c \ + pthreadexit.c pthreaddetach.c pthreadjoin.c pthreadcreate.c \ + pthreadattrsetdetachstate.c pthreadattrgetdetachstate.c \ + pthreadattrgetstackaddr.c pthreadattrsetstackaddr.c \ + pthreadattrgetstacksize.c pthreadattrsetstacksize.c pthreadattrinit.c \ + pthreadattrdestroy.c pthreadsetschedparam.c pthreadgetschedparam.c \ + pthreadattrsetschedparam.c pthreadattrgetschedparam.c \ + pthreadattrgetschedpolicy.c pthreadattrsetschedpolicy.c \ + pthreadattrgetinheritsched.c pthreadattrsetinheritsched.c \ + pthreadattrgetscope.c pthreadattrsetscope.c + + +PSIGNAL_C_FILES = psignal.c alarm.c kill.c killinfo.c pause.c \ + psignalclearprocesssignals.c psignalsetprocesssignals.c \ + psignalchecksignal.c psignalclearsignals.c psignalunblockthread.c \ + pthreadkill.c pthreadsigmask.c sigaction.c sigaddset.c sigdelset.c \ + sigemptyset.c sigfillset.c sigismember.c sigpending.c sigprocmask.c \ + sigqueue.c sigsuspend.c sigtimedwait.c sigwait.c sigwaitinfo.c \ + signal_2.c + + +SEMAPHORE_C_FILES = semaphore.c semaphorecreatesupp.c semaphoredeletesupp.c \ + semaphoremp.c semaphorenametoid.c semaphorewaitsupp.c semclose.c \ + semdestroy.c semgetvalue.c seminit.c semopen.c sempost.c semtimedwait.c \ + semtrywait.c semunlink.c semwait.c + + +TIME_C_FILES = time.c posixtimespecsubtract.c posixtimespectointerval.c \ + posixintervaltotimespec.c clockgetcpuclockid.c clockgetenableattr.c \ + clockgetres.c clockgettime.c clocksetenableattr.c clocksettime.c \ + nanosleep.c sleep.c + + +# the timer manager needs to be split further but only after its +# dependence on the Classic API Timer Manager is removed. +TIMER_C_FILES = ptimer.c ptimer1.c + +C_FILES = adasupp.c $(CANCEL_C_FILES) $(CONDITION_VARIABLE_C_FILES) \ + $(ID_C_FILES) $(KEY_C_FILES) $(MEMORY_C_FILES) $(MESSAGE_QUEUE_C_FILES) \ + $(MUTEX_C_FILES) $(PTHREAD_C_FILES) $(PSIGNAL_C_FILES) sched.c \ + $(SEMAPHORE_C_FILES) sysconf.c $(TIME_C_FILES) $(TIMER_C_FILES) types.c \ + $(ENOSYS_C_FILES) $(BUILD_FOR_NOW_C_FILES) + +C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) + +OBJS = $(C_O_FILES) + +@MULTILIB_TRUE@MULTISRCTOP = +@MULTILIB_TRUE@MULTIDIRS = +@MULTILIB_TRUE@MULTIDO = true +@MULTILIB_TRUE@MULTICLEAN = true + +@RTEMS_USE_GCC_TRUE@CFLAGS_DEFAULT = -g -Wall +@RTEMS_USE_GCC_TRUE@GCCSPECS = $(GCC_SPECS) + +DEFS = @DEFS@ + +CPPFLAGS = @CPPFLAGS@ $(CPU_DEFINES) \ + $(DEFINES) $(XCPPFLAGS) $(CPPFLAGS_GCC) + +CFLAGS = $(CFLAGS_DEFAULT) $(CPU_CFLAGS) $(XCFLAGS) +ASFLAGS = $(CPU_ASFLAGS) $(CPU_CFLAGS) $(XASFLAGS) + +# when debugging, optimize flag: typically empty +# some compilers do allow optimization with their "-g" +CFLAGS_DEBUG_OPTIMIZE_V = -g + +# profile flag; use gprof(1) +CFLAGS_PROFILE_V = -pg + + +# +# How to compile stuff into ${ARCH} subdirectory +# +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +CCLD = $(CC) + +CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) + + +# Dependency files for use by gmake +# NOTE: we don't put them into $(ARCH) +# so that 'make clean' doesn't blow it away +DEPEND = Depends-${ARCH} + +CLEAN_DEPEND = $(DEPEND).tmp +CLOBBER_DEPEND = $(DEPEND) + +VARIANT = OPTIMIZE + +VARIANT_OPTIMIZE_V = OPTIMIZE +VARIANT_DEBUG_V = DEBUG +VARIANT_PROFILE_V = PROFILE +VARIANT_optimize_V = OPTIMIZE +VARIANT_debug_V = DEBUG +VARIANT_profile_V = PROFILE + +VARIANT_V = $(VARIANT_$(VARIANT)_V) + +ARCH_OPTIMIZE_V = o-optimize +ARCH_DEBUG_V = o-debug +ARCH_PROFILE_V = o-profile + +ARCH__V = $(ARCH_OPTIMIZE_V) +ARCH = $(ARCH_$(VARIANT_V)_V) + +LIBSUFFIX_OPTIMIZE_V = +LIBSUFFIX_DEBUG_V = _g +LIBSUFFIX_PROFILE_V = _p +LIBSUFFIX__V = $(LIBSUFFIX_OPTIMIZE_V) + +LIB_VARIANT = $(LIBSUFFIX_$(VARIANT_V)_V) +LIBSUFFIX_VA = $(LIB_VARIANT).a + +CFLAGS__V = $(CFLAGS_OPTIMIZE_V) + +@RTEMS_USE_GCC_TRUE@RTEMS_CFLAGS_OPTIMIZE_V = +@RTEMS_USE_GCC_TRUE@RTEMS_CFLAGS_DEBUG_V = -Wno-unused +@RTEMS_USE_GCC_TRUE@RTEMS_CFLAGS_PROFILE_V = + +RTEMS_CFLAGS__V = $(RTEMS_CFLAGS_OPTIMIZE_V) + + +# +# Add local stuff here using += +# +AM_CPPFLAGS = $(RTEMS_CPPFLAGS) -I. -D__RTEMS_INSIDE__ + +AM_CFLAGS = $(RTEMS_CFLAGS_$(VARIANT_V)_V) $(CFLAGS_$(VARIANT_V)_V) + +# AM_CFLAGS = $(RTEMS_BSP_CFLAGS) $(RTEMS_CFLAGS) +AM_CCASFLAGS = $(RTEMS_BSP_CFLAGS) $(RTEMS_CPPFLAGS) $(RTEMS_ASFLAGS) + +AR = @AR@ + +ARFLAGS = ruv + +TMPINSTALL_FILES = $(project_libdir)$(MULTISUBDIR) + +EXTRA_DIST = $(C_FILES) $(UNUSED_C_FILES) + +PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools +subdir = src +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = Makefile.am Makefile.in config.h.in +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/../automake/multilib.am $(top_srcdir)/../automake/compile.am $(top_srcdir)/../automake/lib.am $(top_srcdir)/../automake/local.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status src/config.h + +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOHEADER) + touch $(srcdir)/config.h.in + +distclean-hdr: + -rm -f config.h stamp-h1 +uninstall-info-am: +tags: TAGS +TAGS: + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @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 config.h all-local + +installdirs: + +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-hdr distclean-local + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +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-info-am + +.PHONY: all all-am all-local check check-am clean clean-generic \ + clean-local distclean distclean-generic distclean-hdr \ + distclean-local distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am + + +# Multilib support rules +.PHONY: all-multi install-multi mostlyclean-multi clean-multi distclean-multi \ + maintainer-clean-multi + +@MULTILIB_TRUE@all-recursive: all-multi +@MULTILIB_TRUE@install-recursive: install-multi + +@MULTILIB_TRUE@mostlyclean-recursive: mostlyclean-multi +@MULTILIB_TRUE@clean-recursive: clean-multi +@MULTILIB_TRUE@distclean-recursive: distclean-multi +@MULTILIB_TRUE@maintainer-clean-recursive: maintainer-clean-multi + +@MULTILIB_TRUE@all-multi: +@MULTILIB_TRUE@ $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do +@MULTILIB_TRUE@install-multi: +@MULTILIB_TRUE@ $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do + +@MULTILIB_TRUE@mostlyclean-multi: +@MULTILIB_TRUE@ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean +@MULTILIB_TRUE@clean-multi: +@MULTILIB_TRUE@ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean +@MULTILIB_TRUE@distclean-multi: +@MULTILIB_TRUE@ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean +@MULTILIB_TRUE@maintainer-clean-multi: +@MULTILIB_TRUE@ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean +@MULTILIB_FALSE@include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +@RTEMS_USE_GCC_FALSE@include $(CONFIG.CC) + +${ARCH}/%.$(OBJEXT): %.c + ${COMPILE} -o $@ -c $< + +${ARCH}/%.$(OBJEXT): %.S + ${CCASCOMPILE} -o $@ -c $< + +# Make foo.rel from foo.$(OBJEXT) +${ARCH}/%.rel: ${ARCH}/%.$(OBJEXT) + ${make-rel} + +# We deliberately don't have anything depend on the +# $(DEPEND) file; otherwise it will get rebuilt even +# on 'make clean' +# + +depend-am: $(C_FILES) $(CC_FILES) $(S_FILES) + $(COMPILE) -M $^ | \ + sed -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \ + -e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp + mv $(DEPEND).tmp $(DEPEND) +depend: depend-am + +# pull in dependencies if they exist +ifeq (${DEPEND},$(wildcard ${DEPEND})) +include ${DEPEND} +@ENDIF@ + +define make-library +$(RM) $@ +$(AR) $(ARFLAGS) $@ $^ +$(RANLIB) $@ +endef + +$(project_libdir)$(MULTISUBDIR): + @$(mkinstalldirs) $@ + +.PRECIOUS: $(LIB) + +all-local: ${ARCH} $(LIB) + +$(LIB): ${OBJS} + $(make-library) + +# temporary so we can see how many things are left to implement +not: + grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL + @echo + @echo + @echo + @echo `grep -i NOT_IMPL $(C_FILES) | grep -v MP_NOT_IMPL | wc -l ` places marked not implemented + @echo `wc -l $(C_FILES) | grep total` lines of C code to test + +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: src/execle.c =================================================================== --- src/execle.c (nonexistent) +++ src/execle.c (revision 1765) @@ -0,0 +1,21 @@ +/* + * execle() - POSIX 1003.1b 3.1.2 + * + * execle.c,v 1.2 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int execle( + const char *path, + char const *arg, + ... +) +{ + errno = ENOSYS; + return -1; +} Index: src/sigfillset.c =================================================================== --- src/sigfillset.c (nonexistent) +++ src/sigfillset.c (revision 1765) @@ -0,0 +1,36 @@ +/* + * 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. + * + * sigfillset.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 + +int sigfillset( + sigset_t *set +) +{ + if ( !set ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + *set = SIGNAL_ALL_MASK; + return 0; +} + Index: src/getpagesize.c =================================================================== --- src/getpagesize.c (nonexistent) +++ src/getpagesize.c (revision 1765) @@ -0,0 +1,23 @@ +/* + * getpagesize.c,v 1.1 2001/09/13 13:23:30 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +/*PAGE + * + * Get System Page Size (from SVR4 and 4.2+ BSD) + * + * This is not a functional version but the SPARC backend for at least + * gcc 2.8.1 plus gnat 3.13p and gcc 3.0.1 require it to be there and + * return a reasonable value. + */ + +size_t getpagesize(void) +{ + return 4096; +} Index: src/getegid.c =================================================================== --- src/getegid.c (nonexistent) +++ src/getegid.c (revision 1765) @@ -0,0 +1,33 @@ +/* + * getegid.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_Egid = 0; +*/ + +/*PAGE + * + * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, + * P1003.1b-1993, p. 84 + */ + +gid_t getegid( void ) +{ + return _POSIX_types_Egid; +} + Index: src/condwait.c =================================================================== --- src/condwait.c (nonexistent) +++ src/condwait.c (revision 1765) @@ -0,0 +1,36 @@ +/* + * condwait.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.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105 + */ + +int pthread_cond_wait( + pthread_cond_t *cond, + pthread_mutex_t *mutex +) +{ + return _POSIX_Condition_variables_Wait_support( + cond, + mutex, + THREAD_QUEUE_WAIT_FOREVER, + FALSE + ); +} Index: src/mqueuesetattr.c =================================================================== --- src/mqueuesetattr.c (nonexistent) +++ src/mqueuesetattr.c (revision 1765) @@ -0,0 +1,82 @@ +/* + * 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. + * + * mqueuesetattr.c,v 1.6 2002/04/26 23:39:01 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/*PAGE + * + * 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 +) +{ + POSIX_Message_queue_Control_fd *the_mq_fd; + CORE_message_queue_Control *the_core_mq; + Objects_Locations location; + + if ( !mqstat ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); + switch ( location ) { + case OBJECTS_ERROR: + rtems_set_errno_and_return_minus_one( EBADF ); + case OBJECTS_REMOTE: + _Thread_Dispatch(); + return POSIX_MP_NOT_IMPLEMENTED(); + rtems_set_errno_and_return_minus_one( EINVAL ); + case OBJECTS_LOCAL: + + the_core_mq = &the_mq_fd->Queue->Message_queue; + + /* + * Return the old values. + */ + + if ( omqstat ) { + omqstat->mq_flags = the_mq_fd->oflag; + omqstat->mq_msgsize = the_core_mq->maximum_message_size; + omqstat->mq_maxmsg = the_core_mq->maximum_pending_messages; + omqstat->mq_curmsgs = the_core_mq->number_of_pending_messages; + } + + the_mq_fd->oflag = mqstat->mq_flags; + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} + Index: src/sleep.c =================================================================== --- src/sleep.c (nonexistent) +++ src/sleep.c (revision 1765) @@ -0,0 +1,31 @@ +/* + * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 + * + * sleep.c,v 1.2 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include + + +unsigned int sleep( + unsigned int seconds +) +{ + /* XXX can we get away with this implementation? */ + struct timespec tp; + struct timespec tm; + + tp.tv_sec = seconds; + tp.tv_nsec = 0; + + nanosleep( &tp, &tm ); + + return tm.tv_sec; /* seconds remaining */ +} Index: src/pthreadattrgetschedpolicy.c =================================================================== --- src/pthreadattrgetschedpolicy.c (nonexistent) +++ src/pthreadattrgetschedpolicy.c (revision 1765) @@ -0,0 +1,32 @@ +/* + * 13.5.1 Thread Creation Scheduling Parameters, 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. + * + * pthreadattrgetschedpolicy.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_getschedpolicy( + const pthread_attr_t *attr, + int *policy +) +{ + if ( !attr || !attr->is_initialized || !policy ) + return EINVAL; + + *policy = attr->schedpolicy; + return 0; +} + Index: src/getpid.c =================================================================== --- src/getpid.c (nonexistent) +++ src/getpid.c (revision 1765) @@ -0,0 +1,45 @@ +/* + * getpid.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 +#include + +/*PAGE + * + * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83 + */ + +pid_t getpid( void ) +{ + return _Objects_Local_node; +} + +/* + * _getpid_r + * + * This is the Newlib dependent reentrant version of getpid(). + */ + +#if defined(RTEMS_NEWLIB) + +#include + +pid_t _getpid_r( + struct _reent *ptr +) +{ + return getpid(); +} +#endif + Index: src/mutexdefaultattributes.c =================================================================== --- src/mutexdefaultattributes.c (nonexistent) +++ src/mutexdefaultattributes.c (revision 1765) @@ -0,0 +1,34 @@ +/* + * mutexdefaultattributes.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 + * + * The default mutex attributes structure. + */ + +const pthread_mutexattr_t _POSIX_Mutex_Default_attributes = { + TRUE, /* is_initialized */ + PTHREAD_PROCESS_PRIVATE, /* process_shared */ + POSIX_SCHEDULER_MAXIMUM_PRIORITY, /* prio_ceiling */ + PTHREAD_PRIO_NONE, /* protocol */ + FALSE /* recursive */ +}; Index: src/keyrundestructors.c =================================================================== --- src/keyrundestructors.c (nonexistent) +++ src/keyrundestructors.c (revision 1765) @@ -0,0 +1,80 @@ +/* + * keyrundestructors.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 + +/*PAGE + * + * _POSIX_Keys_Run_destructors + * + * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 + * + * 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 +) +{ + unsigned32 index; + unsigned32 pthread_index; + unsigned32 pthread_class; + unsigned32 iterations; + boolean are_all_null; + POSIX_Keys_Control *the_key; + void *value; + + pthread_index = _Objects_Get_index( thread->Object.id ); + pthread_class = _Objects_Get_class( thread->Object.id ); + + iterations = 0; + + for ( ; ; ) { + + are_all_null = TRUE; + + for ( index=1 ; index <= _POSIX_Keys_Information.maximum ; index++ ) { + + the_key = (POSIX_Keys_Control *) + _POSIX_Keys_Information.local_table[ index ]; + + if ( the_key && the_key->is_active && the_key->destructor ) { + value = the_key->Values[ pthread_class ][ pthread_index ]; + if ( value ) { + (*the_key->destructor)( value ); + if ( the_key->Values[ pthread_class ][ pthread_index ] ) + are_all_null = FALSE; + } + } + } + + if ( are_all_null == TRUE ) + return; + + iterations++; + + /* + * The standard allows one to not do this and thus go into an infinite + * loop. It seems rude to unnecessarily lock up a system. + * + * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. + */ + + if ( iterations >= PTHREAD_DESTRUCTOR_ITERATIONS ) + return; + } +} Index: src/semaphoremp.c =================================================================== --- src/semaphoremp.c (nonexistent) +++ src/semaphoremp.c (revision 1765) @@ -0,0 +1,146 @@ +/* + * semaphoremp.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 + +#include +#include +#include +#include +#include + +#if defined(RTEMS_MULTIPROCESSING) +/* + * _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_MP_NOT_IMPLEMENTED(); +} + +/* + * _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_MP_NOT_IMPLEMENTED(); + return 0; +} + +/* + * _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_MP_NOT_IMPLEMENTED(); +} + +/* + * + * _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_MP_NOT_IMPLEMENTED(); +} + +/* + * _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_MP_NOT_IMPLEMENTED(); +} + +/* + * _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_MP_NOT_IMPLEMENTED(); +} + +/* + * _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 ) +{ + POSIX_MP_NOT_IMPLEMENTED(); + return NULL; +} + +#endif /* endif RTEMS_MULTIPROCESSING */ Index: src/cond.c =================================================================== --- src/cond.c (nonexistent) +++ src/cond.c (revision 1765) @@ -0,0 +1,52 @@ +/* + * cond.c,v 1.26 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 + * + * _POSIX_Condition_variables_Manager_initialization + * + * This routine initializes all condition variable manager related data + * structures. + * + * Input parameters: + * maximum_condition_variables - maximum configured condition_variables + * + * Output parameters: NONE + */ + +void _POSIX_Condition_variables_Manager_initialization( + unsigned32 maximum_condition_variables +) +{ + _Objects_Initialize_information( + &_POSIX_Condition_variables_Information, /* object information table */ + OBJECTS_POSIX_API, /* object API */ + OBJECTS_POSIX_CONDITION_VARIABLES, /* object class */ + maximum_condition_variables, /* maximum objects of this class */ + sizeof( POSIX_Condition_variables_Control ), + /* size of this object's control block */ + FALSE, /* TRUE if names for this object are strings */ + 0 /* maximum length of each object's name */ +#if defined(RTEMS_MULTIPROCESSING) + , + FALSE, /* TRUE if this is a global object class */ + NULL /* Proxy extraction support callout */ +#endif + ); +} Index: src/sysconf.c =================================================================== --- src/sysconf.c (nonexistent) +++ src/sysconf.c (revision 1765) @@ -0,0 +1,44 @@ +/* + * sysconf.c,v 1.6 2001/09/13 21:04:21 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include + +/*PAGE + * + * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95 + */ + +long sysconf( + int name +) +{ + + switch (name) { + case _SC_CLK_TCK: + return _TOD_Ticks_per_second; + + case _SC_OPEN_MAX: { + extern unsigned32 rtems_libio_number_iops; + return rtems_libio_number_iops; + } + +#if defined(__sparc__) + case 515: /* Solaris _SC_STACK_PROT */ + return 0; +#endif + + default: + break; + } + + return POSIX_NOT_IMPLEMENTED(); +} Index: src/geteuid.c =================================================================== --- src/geteuid.c (nonexistent) +++ src/geteuid.c (revision 1765) @@ -0,0 +1,33 @@ +/* + * geteuid.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_Euid = 0; +*/ + +/*PAGE + * + * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, + * P1003.1b-1993, p. 84 + */ + +uid_t geteuid( void ) +{ + return _POSIX_types_Euid; +} Index: src/sigpending.c =================================================================== --- src/sigpending.c (nonexistent) +++ src/sigpending.c (revision 1765) @@ -0,0 +1,40 @@ +/* + * 3.3.6 Examine Pending Signals, P1003.1b-1993, p. 75 + * + * 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. + * + * sigpending.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 + +int sigpending( + sigset_t *set +) +{ + POSIX_API_Control *api; + + if ( !set ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + + *set = api->signals_pending | _POSIX_signals_Pending; + + return 0; +} Index: src/condtimedwait.c =================================================================== --- src/condtimedwait.c (nonexistent) +++ src/condtimedwait.c (revision 1765) @@ -0,0 +1,61 @@ +/* + * condtimedwait.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.4 Waiting on a Condition, P1003.1c/Draft 10, p. 105 + */ + +int pthread_cond_timedwait( + pthread_cond_t *cond, + pthread_mutex_t *mutex, + const struct timespec *abstime +) +{ + Watchdog_Interval timeout; + struct timespec current_time; + struct timespec difference; + boolean already_timedout = FALSE; + + if ( !abstime ) + return EINVAL; + + /* + * The abstime is a walltime. We turn it into an interval. + */ + + (void) clock_gettime( CLOCK_REALTIME, ¤t_time ); + + /* XXX probably some error checking should go here */ + + _POSIX_Timespec_subtract( ¤t_time, abstime, &difference ); + + if ( ( difference.tv_sec < 0 ) || ( ( difference.tv_sec == 0 ) && + ( difference.tv_nsec < 0 ) ) ) + already_timedout = TRUE; + + timeout = _POSIX_Timespec_to_interval( &difference ); + + return _POSIX_Condition_variables_Wait_support( + cond, + mutex, + timeout, + already_timedout + ); +} Index: src/setsid.c =================================================================== --- src/setsid.c (nonexistent) +++ src/setsid.c (revision 1765) @@ -0,0 +1,28 @@ +/* + * setsid.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 + +/*PAGE + * + * 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88 + */ + +pid_t setsid( void ) +{ + rtems_set_errno_and_return_minus_one( EPERM ); +} + + Index: src/pthreadattrgetdetachstate.c =================================================================== --- src/pthreadattrgetdetachstate.c (nonexistent) +++ src/pthreadattrgetdetachstate.c (revision 1765) @@ -0,0 +1,32 @@ +/* + * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 + * + * 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. + * + * pthreadattrgetdetachstate.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_getdetachstate( + const pthread_attr_t *attr, + int *detachstate +) +{ + if ( !attr || !attr->is_initialized || !detachstate ) + return EINVAL; + + *detachstate = attr->detachstate; + return 0; +} + Index: src/semdestroy.c =================================================================== --- src/semdestroy.c (nonexistent) +++ src/semdestroy.c (revision 1765) @@ -0,0 +1,58 @@ +/* + * semdestroy.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.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220 + */ + +int sem_destroy( + 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: + /* + * Undefined operation on a named semaphore. + */ + + if ( the_semaphore->named == TRUE ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + _POSIX_Semaphore_Delete( the_semaphore ); + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/pthreaddetach.c =================================================================== --- src/pthreaddetach.c (nonexistent) +++ src/pthreaddetach.c (revision 1765) @@ -0,0 +1,48 @@ +/* + * 16.1.4 Detaching a Thread, P1003.1c/Draft 10, p. 149 + * + * 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. + * + * pthreaddetach.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_detach( + pthread_t thread +) +{ + register Thread_Control *the_thread; + POSIX_API_Control *api; + Objects_Locations location; + + 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 ]; + api->detachstate = PTHREAD_CREATE_DETACHED; + _Thread_Enable_dispatch(); + return 0; + } + + return POSIX_BOTTOM_REACHED(); +} + Index: src/pthreadattrgetstacksize.c =================================================================== --- src/pthreadattrgetstacksize.c (nonexistent) +++ src/pthreadattrgetstacksize.c (revision 1765) @@ -0,0 +1,31 @@ +/* + * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 + * + * 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. + * + * pthreadattrgetstacksize.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_getstacksize( + const pthread_attr_t *attr, + size_t *stacksize +) +{ + if ( !attr || !attr->is_initialized || !stacksize ) + return EINVAL; + + *stacksize = attr->stacksize; + return 0; +} Index: src/posixtimespecsubtract.c =================================================================== --- src/posixtimespecsubtract.c (nonexistent) +++ src/posixtimespecsubtract.c (revision 1765) @@ -0,0 +1,50 @@ +/* + * posixtimespecsubtract.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_subtract + */ + +void _POSIX_Timespec_subtract( + const struct timespec *the_start, + const struct timespec *end, + struct timespec *result +) +{ + struct timespec start_struct = *the_start; + struct timespec *start = &start_struct; + unsigned int nsecs_per_sec = TOD_NANOSECONDS_PER_SECOND; + + if (end->tv_nsec < start->tv_nsec) { + int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec + 1; + start->tv_nsec -= nsecs_per_sec * seconds; + start->tv_sec += seconds; + } + + if (end->tv_nsec - start->tv_nsec > nsecs_per_sec) { + int seconds = (start->tv_nsec - end->tv_nsec) / nsecs_per_sec; + start->tv_nsec += nsecs_per_sec * seconds; + start->tv_sec -= seconds; + } + + result->tv_sec = end->tv_sec - start->tv_sec; + result->tv_nsec = end->tv_nsec - start->tv_nsec; +} Index: src/sigaddset.c =================================================================== --- src/sigaddset.c (nonexistent) +++ src/sigaddset.c (revision 1765) @@ -0,0 +1,42 @@ +/* + * 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. + * + * sigaddset.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 + +int sigaddset( + 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/sigwait.c =================================================================== --- src/sigwait.c (nonexistent) +++ src/sigwait.c (revision 1765) @@ -0,0 +1,45 @@ +/* + * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 + * + * NOTE: P1003.1c/D10, p. 39 adds sigwait(). + * + * 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. + * + * sigwait.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 + +int sigwait( + const sigset_t *set, + int *sig +) +{ + int status; + + status = sigtimedwait( set, NULL, NULL ); + + if ( status != -1 ) { + if ( sig ) + *sig = status; + return 0; + } + + return errno; +} + Index: src/semwait.c =================================================================== --- src/semwait.c (nonexistent) +++ src/semwait.c (revision 1765) @@ -0,0 +1,35 @@ +/* + * semwait.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 + * + * 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 +) +{ + return _POSIX_Semaphore_Wait_support( sem, TRUE, THREAD_QUEUE_WAIT_FOREVER ); +} Index: src/intr.c =================================================================== --- src/intr.c (nonexistent) +++ src/intr.c (revision 1765) @@ -0,0 +1,349 @@ +/* + * NOTE: Each task has an interrupt semaphore associated with it. + * No matter which interrupt occurs that it has registered, + * the same semaphore is used. + * + * This whole interrupt scheme may have been eliminated in a later draft. + * + * intr.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 +#include +#include + +/* + * _POSIX_Interrupt_Manager_initialization + * + * DESCRIPTION: + * + * This routine performs the initialization necessary for this manager. + */ + +void _POSIX_Interrupt_Manager_initialization( + unsigned32 maximum_interrupt_handlers +) +{ + unsigned32 index; + POSIX_Interrupt_Control *the_vector; + + _Objects_Initialize_information( + &_POSIX_Interrupt_Handlers_Information, /* object information table */ + OBJECTS_POSIX_API, /* object API */ + OBJECTS_POSIX_INTERRUPTS, /* object class */ + maximum_interrupt_handlers, /* maximum objects of this class */ + sizeof( POSIX_Interrupt_Handler_control ), + /* size of this object's control block */ + FALSE, /* TRUE if names for this object are strings */ + 0 /* maximum length of each object's name */ +#if defined(RTEMS_MULTIPROCESSING) + , + FALSE, /* TRUE if this is a global object class */ + NULL /* Proxy extraction support callout */ +#endif + ); + + for ( index=0 ; index < CPU_INTERRUPT_NUMBER_OF_VECTORS ; index++ ) { + the_vector = &_POSIX_Interrupt_Information[ index ]; + + the_vector->number_installed = 0; + the_vector->lock_count = 0; + the_vector->deferred_count = 0; + _Chain_Initialize_empty( &the_vector->Handlers ); + } +} + +/*PAGE + * + * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 + */ + +int intr_capture( + intr_t intr, + int (*intr_handler)( void *area ), + volatile void *area, + size_t areasize +) +{ + POSIX_Interrupt_Handler_control *the_intr; + POSIX_Interrupt_Control *the_vector; + POSIX_API_Thread_Support_Control *thread_support; + proc_ptr old_handler; + + if ( !_ISR_Is_vector_number_valid( intr ) || + !_ISR_Is_valid_user_handler( intr_handler ) ) + return EINVAL; + + _Thread_Disable_dispatch(); + + the_intr = _POSIX_Interrupt_Allocate(); + + if ( !the_intr ) { + _Thread_Enable_dispatch(); + return ENOMEM; + } + + the_vector = &_POSIX_Interrupt_Information[ intr ]; + + the_intr->vector = intr; + the_intr->handler = intr_handler; + the_intr->user_data_area = area; + the_intr->server = _Thread_Executing; + the_intr->is_active = TRUE; + + thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + thread_support->interrupts_installed++; + +/* XXX should we malloc the semaphore on the fly??? if so we probably need to + release it when the thread has released all interrupts and keep + a count of how many it has installed. CURRENTLY NO.. ALLOCATED w/TCB +*/ + + /* + * This is sufficient to have the handlers invoked in the opposite + * order of installation. The loop invoking them can then go from + * the front of the list to the end. + */ + + _Chain_Prepend( &the_vector->Handlers, &the_intr->Object.Node ); + + if ( !the_vector->number_installed++ ) + _ISR_Install_vector( + intr, + (proc_ptr) _POSIX_Interrupt_Handler, + &old_handler + ); + + _Objects_Open( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object, 0 ); + + /* + * Normally, an Id would be returned here. + */ + + _Thread_Enable_dispatch(); + + return 0; +} + +/*PAGE + * + * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 + */ + +int intr_release( + intr_t intr, + int (*intr_handler)( void *area ) +) +{ + boolean found; + POSIX_Interrupt_Handler_control *the_intr; + POSIX_Interrupt_Control *the_vector; + POSIX_API_Thread_Support_Control *thread_support; + Chain_Node *the_node; + + if ( !_ISR_Is_valid_user_handler( intr_handler ) ) + return EINVAL; + + _Thread_Disable_dispatch(); + + /* + * Since interrupt handlers do not have a user visible id, there is + * no choice but to search the entire set of active interrupt handlers + * to find this one. + */ + + found = FALSE; + + the_vector = &_POSIX_Interrupt_Information[ intr ]; + + the_node = _Chain_Head( &the_vector->Handlers ); + + for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) { + the_intr = (POSIX_Interrupt_Handler_control *) the_node; + + if ( the_intr->handler == intr_handler ) { + found = TRUE; + break; + } + the_node = the_node->next; + } + + if ( !found ) { + _Thread_Enable_dispatch(); + return EINVAL; + } + + if ( !_Thread_Is_executing( the_intr->server ) ) { + _Thread_Enable_dispatch(); + return EINVAL; /* XXX should be ENOISR; */ + } + + /* + * OK now we have found the interrupt handler and can do some work. + */ + + _Chain_Extract( &the_intr->Object.Node ); + + the_intr->is_active = FALSE; + + the_vector->number_installed -= 1; + + thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + thread_support->interrupts_installed--; + + /* + * It is unnecessary to flush the semaphore since the handler can only + * be "removed" by the thread which installed it. Thus it cannot be + * blocked on the semaphore or it would not be executing this routine. + */ + + _Objects_Close( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object ); + + _POSIX_Interrupt_Free( the_intr ); + + _Thread_Enable_dispatch(); + + return 0; +} + +/*PAGE + * + * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 + */ + +int intr_lock( + intr_t intr +) +{ + POSIX_Interrupt_Control *the_vector; + + _Thread_Disable_dispatch(); + + the_vector = &_POSIX_Interrupt_Information[ intr ]; + + the_vector->lock_count++; + + _Thread_Enable_dispatch(); + + return 0; +} + +/*PAGE + * + * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 + */ + +int intr_unlock( + intr_t intr +) +{ + POSIX_Interrupt_Control *the_vector; + + _Thread_Disable_dispatch(); + + the_vector = &_POSIX_Interrupt_Information[ intr ]; + + if ( !--the_vector->lock_count ) { + while ( --the_vector->deferred_count ) { + _POSIX_Interrupt_Handler( intr ); + } + } + + _Thread_Enable_dispatch(); + + return 0; +} + +/* + * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76 + */ + +int intr_timed_wait( + int flags, + const struct timespec *timeout +) +{ + Watchdog_Interval ticks; + POSIX_API_Thread_Support_Control *thread_support; + + ticks = _POSIX_Timespec_to_interval( timeout ); + + thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + + _Thread_Disable_dispatch(); + + _CORE_semaphore_Seize( + &thread_support->Interrupt_Semaphore, + 0, /* XXX does id=0 hurt in this case? */ + TRUE, + ticks + ); + _Thread_Enable_dispatch(); + + return _Thread_Executing->Wait.return_code; /* XXX should be POSIX */ +} + +/*PAGE + * + * _POSIX_Interrupt_Handler + * + */ + +void _POSIX_Interrupt_Handler( + ISR_Vector_number vector +) +{ + POSIX_Interrupt_Handler_control *the_intr; + POSIX_Interrupt_Control *the_vector; + POSIX_API_Thread_Support_Control *thread_support; + Chain_Node *the_node; + int status; + + the_vector = &_POSIX_Interrupt_Information[ vector ]; + + the_node = _Chain_Head( &the_vector->Handlers ); + + for ( ; !_Chain_Is_tail( &the_vector->Handlers, the_node ) ; ) { + the_intr = (POSIX_Interrupt_Handler_control *) the_node; + + status = (*the_intr->handler)( (void *) the_intr->user_data_area ); + + switch ( status ) { + case INTR_HANDLED_NOTIFY: + thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + + _CORE_semaphore_Surrender( + &thread_support->Interrupt_Semaphore, + 0, /* XXX is id=0 a problem */ + 0 /* XXX is this a problem (mp support)*/ + ); + return; + + case INTR_HANDLED_DO_NOT_NOTIFY: + return; + + case INTR_NOT_HANDLED: + default: /* this should not happen */ + break; + } + the_node = the_node->next; + } + + /* XXX + * + * This is an unhandled interrupt!!! + */ +} Index: src/config.h.in =================================================================== --- src/config.h.in (nonexistent) +++ src/config.h.in (revision 1765) @@ -0,0 +1,10 @@ +/* src/config.h.in. Generated automatically from configure.ac by autoheader. */ + +/* if using newlib */ +#undef RTEMS_NEWLIB + +/* if using inlines */ +#undef USE_INLINES + +/* if using macros */ +#undef USE_MACROS Index: src/mqueueunlink.c =================================================================== --- src/mqueueunlink.c (nonexistent) +++ src/mqueueunlink.c (revision 1765) @@ -0,0 +1,84 @@ +/* + * 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. + * + * mqueueunlink.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 + * + * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276 + */ + +int mq_unlink( + const char *name +) +{ + int status; + register POSIX_Message_queue_Control *the_mq; + Objects_Id the_mq_id; + + _Thread_Disable_dispatch(); + + status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); + if ( status != 0 ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( status ); + } + + /* + * Don't support unlinking a remote message queue. + */ + + if ( !_Objects_Is_local_id(the_mq_id) ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( ENOSYS ); + } + + the_mq = (POSIX_Message_queue_Control *) _Objects_Get_local_object( + &_POSIX_Message_queue_Information, + _Objects_Get_index( the_mq_id ) + ); + +#if 0 && defined(RTEMS_MULTIPROCESSING) + if ( the_mq->process_shared == PTHREAD_PROCESS_SHARED ) { + _Objects_MP_Close( &_POSIX_Message_queue_Information, the_mq_id ); + } +#endif + + + the_mq->linked = FALSE; + _POSIX_Message_queue_Namespace_remove( the_mq ); + _POSIX_Message_queue_Delete( the_mq ); + + _Thread_Enable_dispatch(); + return 0; +} + Index: src/mqueueclose.c =================================================================== --- src/mqueueclose.c (nonexistent) +++ src/mqueueclose.c (revision 1765) @@ -0,0 +1,79 @@ +/* + * 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. + * + * mqueueclose.c,v 1.6 2002/04/26 23:39:01 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * + * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275 + */ + +int mq_close( + mqd_t mqdes +) +{ + POSIX_Message_queue_Control *the_mq; + POSIX_Message_queue_Control_fd *the_mq_fd; + Objects_Locations location; + + the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); + switch ( location ) { + case OBJECTS_ERROR: + rtems_set_errno_and_return_minus_one( EBADF ); + case OBJECTS_REMOTE: + _Thread_Dispatch(); + return POSIX_MP_NOT_IMPLEMENTED(); + rtems_set_errno_and_return_minus_one( EINVAL ); + case OBJECTS_LOCAL: + /* + * First update the actual message queue to reflect this descriptor + * being disassociated. This may result in the queue being really + * deleted. + */ + + the_mq = the_mq_fd->Queue; + the_mq->open_count -= 1; + _POSIX_Message_queue_Delete( the_mq ); + + /* + * Now close this file descriptor. + */ + + _Objects_Close( + &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); + _POSIX_Message_queue_Free_fd( the_mq_fd ); + + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/mutexgetprioceiling.c =================================================================== --- src/mutexgetprioceiling.c (nonexistent) +++ src/mutexgetprioceiling.c (revision 1765) @@ -0,0 +1,55 @@ +/* + * mutexgetprioceiling.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.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131 + */ + +int pthread_mutex_getprioceiling( + pthread_mutex_t *mutex, + int *prioceiling +) +{ + register POSIX_Mutex_Control *the_mutex; + Objects_Locations location; + + if ( !prioceiling ) + return EINVAL; + + the_mutex = _POSIX_Mutex_Get( mutex, &location ); + switch ( location ) { + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) + return POSIX_MP_NOT_IMPLEMENTED(); /* XXX feels questionable */ +#endif + case OBJECTS_ERROR: + return EINVAL; + case OBJECTS_LOCAL: + *prioceiling = _POSIX_Priority_From_core( + the_mutex->Mutex.Attributes.priority_ceiling + ); + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/sigqueue.c =================================================================== --- src/sigqueue.c (nonexistent) +++ src/sigqueue.c (revision 1765) @@ -0,0 +1,33 @@ +/* + * 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78 + * + * 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. + * + * sigqueue.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 sigqueue( + pid_t pid, + int signo, + const union sigval value +) +{ + return killinfo( pid, signo, &value ); +} + Index: src/psignalsetprocesssignals.c =================================================================== --- src/psignalsetprocesssignals.c (nonexistent) +++ src/psignalsetprocesssignals.c (revision 1765) @@ -0,0 +1,42 @@ +/* + * psignalsetprocesssignals.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 +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_signals_Set_process_signals + */ + +void _POSIX_signals_Set_process_signals( + sigset_t mask +) +{ + ISR_Level level; + + _ISR_Disable( level ); + if ( !_POSIX_signals_Pending ) + _Thread_Do_post_task_switch_extension++; + _POSIX_signals_Pending |= mask; + _ISR_Enable( level ); +} Index: src/mutextimedlock.c =================================================================== --- src/mutextimedlock.c (nonexistent) +++ src/mutextimedlock.c (revision 1765) @@ -0,0 +1,40 @@ +/* + * mutextimedlock.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 + * + * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 + * + * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 + */ + +int pthread_mutex_timedlock( + pthread_mutex_t *mutex, + const struct timespec *timeout +) +{ + return _POSIX_Mutex_Lock_support( + mutex, + TRUE, + _POSIX_Timespec_to_interval( timeout ) + ); +} Index: src/mutexmp.c =================================================================== --- src/mutexmp.c (nonexistent) +++ src/mutexmp.c (revision 1765) @@ -0,0 +1,66 @@ +/* + * mutexmp.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 + +/* + * TEMPORARY + */ + +#if defined(RTEMS_MULTIPROCESSING) +void _POSIX_Mutex_MP_Send_process_packet ( + POSIX_Mutex_MP_Remote_operations operation, + Objects_Id mutex_id, + Objects_Name name, + Objects_Id proxy_id +) +{ + (void) POSIX_MP_NOT_IMPLEMENTED(); +} + +void _POSIX_Mutex_MP_Send_object_was_deleted ( + Thread_Control *the_proxy +) +{ + (void) POSIX_MP_NOT_IMPLEMENTED(); +} + +int _POSIX_Mutex_MP_Send_request_packet ( + POSIX_Mutex_MP_Remote_operations operation, + Objects_Id mutex_id, + boolean wait, /* XXX options */ + Watchdog_Interval timeout +) +{ + return POSIX_MP_NOT_IMPLEMENTED(); +} + +void _POSIX_Threads_mutex_MP_support( + Thread_Control *the_thread, + Objects_Id id +) +{ + (void) POSIX_MP_NOT_IMPLEMENTED(); /* XXX: should never get here */ +} +#endif + +/* + * END OF TEMPORARY + */ Index: src/execl.c =================================================================== --- src/execl.c (nonexistent) +++ src/execl.c (revision 1765) @@ -0,0 +1,21 @@ +/* + * execl() - POSIX 1003.1b 3.1.2 + * + * execl.c,v 1.2 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int execl( + const char *path, + const char *arg, + ... +) +{ + errno = ENOSYS; + return -1; +} Index: src/mqueue.c =================================================================== --- src/mqueue.c (nonexistent) +++ src/mqueue.c (revision 1765) @@ -0,0 +1,81 @@ +/* + * 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. + * + * mqueue.c,v 1.15 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 +#include + +/*PAGE + * + * _POSIX_Message_queue_Manager_initialization + * + * This routine initializes all message_queue manager related data structures. + * + * Input parameters: + * maximum_message_queues - maximum configured message_queues + * + * Output parameters: NONE + */ + +void _POSIX_Message_queue_Manager_initialization( + unsigned32 maximum_message_queues +) +{ + _Objects_Initialize_information( + &_POSIX_Message_queue_Information, /* object information table */ + OBJECTS_POSIX_API, /* object API */ + OBJECTS_POSIX_MESSAGE_QUEUES, /* object class */ + maximum_message_queues, /* maximum objects of this class */ + sizeof( POSIX_Message_queue_Control ), + /* size of this object's control block */ + TRUE, /* TRUE if names for this object are strings */ + _POSIX_PATH_MAX /* maximum length of each object's name */ +#if defined(RTEMS_MULTIPROCESSING) + , + FALSE, /* TRUE if this is a global object class */ + NULL /* Proxy extraction support callout */ +#endif + ); + _Objects_Initialize_information( + &_POSIX_Message_queue_Information_fds, + OBJECTS_POSIX_API, + OBJECTS_POSIX_MESSAGE_QUEUE_FDS, + maximum_message_queues, + sizeof( POSIX_Message_queue_Control_fd ), + /* size of this object's control block */ + FALSE, /* TRUE if names for this object are strings */ + 0 /* maximum length of each object's name */ +#if defined(RTEMS_MULTIPROCESSING) + , + FALSE, /* TRUE if this is a global object class */ + NULL /* Proxy extraction support callout */ +#endif + ); +} Index: src/fork.c =================================================================== --- src/fork.c (nonexistent) +++ src/fork.c (revision 1765) @@ -0,0 +1,18 @@ +/* + * fork() - POSIX 1003.1b 3.1.1 + * + * fork.c,v 1.2 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +int fork( void ) +{ + errno = ENOSYS; + return -1; +} Index: src/waitpid.c =================================================================== --- src/waitpid.c (nonexistent) +++ src/waitpid.c (revision 1765) @@ -0,0 +1,23 @@ +/* + * waitpid() - POSIX 1003.1 3.2.1 + * + * waitpid.c,v 1.4 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +int waitpid( + pid_t pid, + int *stat_loc, + int options +) +{ + errno = ENOSYS; + return -1; +} Index: src/pthreadattrgetstackaddr.c =================================================================== --- src/pthreadattrgetstackaddr.c (nonexistent) +++ src/pthreadattrgetstackaddr.c (revision 1765) @@ -0,0 +1,31 @@ +/* + * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 + * + * 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. + * + * pthreadattrgetstackaddr.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_getstackaddr( + const pthread_attr_t *attr, + void **stackaddr +) +{ + if ( !attr || !attr->is_initialized || !stackaddr ) + return EINVAL; + + *stackaddr = attr->stackaddr; + return 0; +} Index: src/posixintervaltotimespec.c =================================================================== --- src/posixintervaltotimespec.c (nonexistent) +++ src/posixintervaltotimespec.c (revision 1765) @@ -0,0 +1,38 @@ +/* + * posixintervaltotimespec.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_Interval_to_timespec + */ + +void _POSIX_Interval_to_timespec( + Watchdog_Interval ticks, + struct timespec *time +) +{ + unsigned32 usecs; + + usecs = ticks * _TOD_Microseconds_per_tick; + + time->tv_sec = usecs / TOD_MICROSECONDS_PER_SECOND; + time->tv_nsec = (usecs % TOD_MICROSECONDS_PER_SECOND) * + TOD_NANOSECONDS_PER_MICROSECOND; +} Index: src/types.c =================================================================== --- src/types.c (nonexistent) +++ src/types.c (revision 1765) @@ -0,0 +1,47 @@ +/* + * This file is the shell of what it initially was and is now misnamed. + * + * types.c,v 1.15 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include +#include +#include + +/* + * TEMPORARY + */ + +#include + +int POSIX_MP_NOT_IMPLEMENTED() +{ + assert( 0 ); + return 0; +} + +int POSIX_BOTTOM_REACHED() +{ + assert( 0 ); + return 0; +} + +int POSIX_NOT_IMPLEMENTED() +{ + assert( 0 ); + return 0; +} + +/* + * END OF TEMPORARY + */ + Index: src/getlogin.c =================================================================== --- src/getlogin.c (nonexistent) +++ src/getlogin.c (revision 1765) @@ -0,0 +1,64 @@ +/* + * getlogin.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 +#include + +#include +#include + +/*PAGE + * + * 4.2.4 Get User Name, P1003.1b-1993, p. 87 + * + * NOTE: P1003.1c/D10, p. 49 adds getlogin_r(). + */ + +/* + * MACRO in userenv.h + * +static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ]; +*/ + +char *getlogin( void ) +{ + (void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX ); + return _POSIX_types_Getlogin_buffer; +} + +/*PAGE + * + * 4.2.4 Get User Name, P1003.1b-1993, p. 87 + * + * NOTE: P1003.1c/D10, p. 49 adds getlogin_r(). + */ + +int getlogin_r( + char *name, + size_t namesize +) +{ + struct passwd *pw; + if ( namesize < LOGIN_NAME_MAX ) + return ERANGE; + + pw=getpwuid(getuid()); + if (!pw) { + strcpy(name,""); + } else { + strncpy(name,pw->pw_name,LOGIN_NAME_MAX); + }; + return 0; +} Index: src/pthreadcreate.c =================================================================== --- src/pthreadcreate.c (nonexistent) +++ src/pthreadcreate.c (revision 1765) @@ -0,0 +1,257 @@ +/* + * 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144 + * + * 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. + * + * pthreadcreate.c,v 1.5 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include + +int pthread_create( + pthread_t *thread, + const pthread_attr_t *attr, + void *(*start_routine)( void * ), + void *arg +) +{ + const pthread_attr_t *the_attr; + Priority_Control core_priority; + Thread_CPU_budget_algorithms budget_algorithm; + Thread_CPU_budget_algorithm_callout budget_callout; + boolean is_fp; + boolean status; + Thread_Control *the_thread; + POSIX_API_Control *api; + int schedpolicy = SCHED_RR; + struct sched_param schedparam; + + the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; + + if ( !the_attr->is_initialized ) + return EINVAL; + + /* + * Core Thread Initialize insures we get the minimum amount of + * stack space if it is allowed to allocate it itself. + */ + + if ( the_attr->stackaddr && !_Stack_Is_enough( the_attr->stacksize ) ) + return EINVAL; + +#if 0 + int cputime_clock_allowed; /* see time.h */ + POSIX_NOT_IMPLEMENTED(); +#endif + + /* + * P1003.1c/Draft 10, p. 121. + * + * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread + * inherits scheduling attributes from the creating thread. If it is + * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the + * attributes structure. + */ + + switch ( the_attr->inheritsched ) { + case PTHREAD_INHERIT_SCHED: + api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + schedpolicy = api->schedpolicy; + schedparam = api->schedparam; + break; + + case PTHREAD_EXPLICIT_SCHED: + schedpolicy = the_attr->schedpolicy; + schedparam = the_attr->schedparam; + break; + + default: + return EINVAL; + } + + /* + * Check the contentionscope since rtems only supports PROCESS wide + * contention (i.e. no system wide contention). + */ + + if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) + return ENOTSUP; + + /* + * Interpret the scheduling parameters. + */ + + if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) + return EINVAL; + + core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); + + /* + * Set the core scheduling policy information. + */ + + budget_callout = NULL; + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; + + switch ( schedpolicy ) { + case SCHED_OTHER: + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; + break; + + case SCHED_FIFO: + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; + break; + + case SCHED_RR: + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; + break; + + case SCHED_SPORADIC: + budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; + budget_callout = _POSIX_Threads_Sporadic_budget_callout; + + if ( _POSIX_Timespec_to_interval( &schedparam.ss_replenish_period ) < + _POSIX_Timespec_to_interval( &schedparam.ss_initial_budget ) ) + return EINVAL; + + if ( !_POSIX_Priority_Is_valid( schedparam.ss_low_priority ) ) + return EINVAL; + + break; + + default: + return EINVAL; + } + + /* + * Currently all POSIX threads are floating point if the hardware + * supports it. + */ + + +#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) + is_fp = TRUE; +#else + is_fp = FALSE; +#endif + + /* + * Disable dispatch for protection + */ + + _Thread_Disable_dispatch(); + + /* + * Allocate the thread control block. + * + * NOTE: Global threads are not currently supported. + */ + + the_thread = _POSIX_Threads_Allocate(); + + if ( !the_thread ) { + _Thread_Enable_dispatch(); + return EAGAIN; + } + + /* + * Initialize the core thread for this task. + */ + + status = _Thread_Initialize( + &_POSIX_Threads_Information, + the_thread, + the_attr->stackaddr, + the_attr->stacksize, + is_fp, + core_priority, + TRUE, /* preemptible */ + budget_algorithm, + budget_callout, + 0, /* isr level */ + NULL /* posix threads don't have a name */ + ); + + if ( !status ) { + _POSIX_Threads_Free( the_thread ); + _Thread_Enable_dispatch(); + return EAGAIN; + } + + /* + * finish initializing the per API structure + */ + + + api = the_thread->API_Extensions[ THREAD_API_POSIX ]; + + api->Attributes = *the_attr; + api->detachstate = the_attr->detachstate; + api->schedpolicy = schedpolicy; + api->schedparam = schedparam; + + /* + * This insures we evaluate the process-wide signals pending when we + * first run. + * + * NOTE: Since the thread starts with all unblocked, this is necessary. + */ + + the_thread->do_post_task_switch_extension = TRUE; + + /* + * POSIX threads are allocated and started in one operation. + */ + + status = _Thread_Start( + the_thread, + THREAD_START_POINTER, + start_routine, + arg, + 0 /* unused */ + ); + + if ( schedpolicy == SCHED_SPORADIC ) { + _Watchdog_Insert_ticks( + &api->Sporadic_timer, + _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period ) + ); + } + + /* + * _Thread_Start only fails if the thread was in the incorrect state + */ + + if ( !status ) { + _POSIX_Threads_Free( the_thread ); + _Thread_Enable_dispatch(); + return EINVAL; + } + + /* + * Return the id and indicate we successfully created the thread + */ + + *thread = the_thread->Object.id; + + _Thread_Enable_dispatch(); + + return 0; +} + Index: src/pthreadattrgetscope.c =================================================================== --- src/pthreadattrgetscope.c (nonexistent) +++ src/pthreadattrgetscope.c (revision 1765) @@ -0,0 +1,31 @@ +/* + * 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. + * + * pthreadattrgetscope.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_getscope( + const pthread_attr_t *attr, + int *contentionscope +) +{ + if ( !attr || !attr->is_initialized || !contentionscope ) + return EINVAL; + + *contentionscope = attr->contentionscope; + return 0; +} Index: src/mutexunlock.c =================================================================== --- src/mutexunlock.c (nonexistent) +++ src/mutexunlock.c (revision 1765) @@ -0,0 +1,66 @@ +/* + * mutexunlock.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 + * + * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 + * + * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 + */ + +int pthread_mutex_unlock( + pthread_mutex_t *mutex +) +{ + register POSIX_Mutex_Control *the_mutex; + Objects_Locations location; + CORE_mutex_Status status; + + the_mutex = _POSIX_Mutex_Get( mutex, &location ); + switch ( location ) { + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) + return _POSIX_Mutex_MP_Send_request_packet( + POSIX_MUTEX_MP_RELEASE_REQUEST, + *mutex, + 0, /* Not used */ + MPCI_DEFAULT_TIMEOUT + ); +#endif + case OBJECTS_ERROR: + return EINVAL; + case OBJECTS_LOCAL: + status = _CORE_mutex_Surrender( + &the_mutex->Mutex, + the_mutex->Object.id, +#if defined(RTEMS_MULTIPROCESSING) + _POSIX_Threads_mutex_MP_support +#else + NULL +#endif + ); + _Thread_Enable_dispatch(); + return _POSIX_Mutex_From_core_mutex_status( status ); + break; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/getgroups.c =================================================================== --- src/getgroups.c (nonexistent) +++ src/getgroups.c (revision 1765) @@ -0,0 +1,30 @@ +/* + * getgroups.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 + +/*PAGE + * + * 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86 + */ + +int getgroups( + int gidsetsize, + gid_t grouplist[] +) +{ + return 0; /* no supplemental group ids */ +} + Index: src/mutexattrsetpshared.c =================================================================== --- src/mutexattrsetpshared.c (nonexistent) +++ src/mutexattrsetpshared.c (revision 1765) @@ -0,0 +1,46 @@ +/* + * mutexattrsetpshared.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 + * + * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 + */ + +int pthread_mutexattr_setpshared( + pthread_mutexattr_t *attr, + int pshared +) +{ + if ( !attr || !attr->is_initialized ) + return EINVAL; + + switch ( pshared ) { + case PTHREAD_PROCESS_SHARED: + case PTHREAD_PROCESS_PRIVATE: + attr->process_shared = pshared; + return 0; + + default: + return EINVAL; + } +} + Index: src/devctl.c =================================================================== --- src/devctl.c (nonexistent) +++ src/devctl.c (revision 1765) @@ -0,0 +1,26 @@ +/* + * devctl.c,v 1.7 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include + +/*PAGE + * + * 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 +) +{ + return POSIX_NOT_IMPLEMENTED(); +} Index: src/mutexattrinit.c =================================================================== --- src/mutexattrinit.c (nonexistent) +++ src/mutexattrinit.c (revision 1765) @@ -0,0 +1,37 @@ +/* + * mutexattrinit.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 + * + * 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 + */ + +int pthread_mutexattr_init( + pthread_mutexattr_t *attr +) +{ + if ( !attr ) + return EINVAL; + + *attr = _POSIX_Mutex_Default_attributes; + return 0; +} Index: src/mutexattrgetprioceiling.c =================================================================== --- src/mutexattrgetprioceiling.c (nonexistent) +++ src/mutexattrgetprioceiling.c (revision 1765) @@ -0,0 +1,38 @@ +/* + * mutexattrgetprioceiling.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_getprioceiling( + const pthread_mutexattr_t *attr, + int *prioceiling +) +{ + if ( !attr || !attr->is_initialized || !prioceiling ) + return EINVAL; + + *prioceiling = attr->prio_ceiling; + return 0; +} Index: src/semaphore.c =================================================================== --- src/semaphore.c (nonexistent) +++ src/semaphore.c (revision 1765) @@ -0,0 +1,54 @@ +/* + * semaphore.c,v 1.14 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 +#include + +/*PAGE + * + * _POSIX_Semaphore_Manager_initialization + * + * This routine initializes all semaphore manager related data structures. + * + * Input parameters: + * maximum_semaphores - maximum configured semaphores + * + * Output parameters: NONE + */ + +void _POSIX_Semaphore_Manager_initialization( + unsigned32 maximum_semaphores +) +{ + _Objects_Initialize_information( + &_POSIX_Semaphore_Information, /* object information table */ + OBJECTS_POSIX_API, /* object API */ + OBJECTS_POSIX_SEMAPHORES, /* object class */ + maximum_semaphores /* maximum objects of this class */, + sizeof( POSIX_Semaphore_Control ), + /* size of this object's control block */ + TRUE, /* TRUE if names for this object are strings */ + _POSIX_PATH_MAX /* maximum length of each object's name */ +#if defined(RTEMS_MULTIPROCESSING) + , + FALSE, /* TRUE if this is a global object class */ + NULL /* Proxy extraction support callout */ +#endif + ); +} Index: src/pthread.c =================================================================== --- src/pthread.c (nonexistent) +++ src/pthread.c (revision 1765) @@ -0,0 +1,387 @@ +/* + * pthread.c,v 1.57 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 +#include +#include +#include +#include +#include +#include +#include + +/*PAGE + * + * The default pthreads attributes structure. + * + * NOTE: Be careful .. if the default attribute set changes, + * _POSIX_Threads_Initialize_user_threads will need to be examined. + * + */ + +const pthread_attr_t _POSIX_Threads_Default_attributes = { + TRUE, /* is_initialized */ + NULL, /* stackaddr */ + PTHREAD_MINIMUM_STACK_SIZE, /* stacksize */ + PTHREAD_SCOPE_PROCESS, /* contentionscope */ + PTHREAD_INHERIT_SCHED, /* inheritsched */ + SCHED_FIFO, /* schedpolicy */ + { /* schedparam */ + 2, /* sched_priority */ + 0, /* ss_low_priority */ + { 0L, 0 }, /* ss_replenish_period */ + { 0L, 0 } /* ss_initial_budget */ + }, + PTHREAD_CREATE_JOINABLE, /* detachstate */ + 1 /* cputime_clock_allowed */ +}; + +/*PAGE + * + * _POSIX_Threads_Sporadic_budget_TSR + */ + +void _POSIX_Threads_Sporadic_budget_TSR( + Objects_Id id, + void *argument +) +{ + unsigned32 ticks; + unsigned32 new_priority; + Thread_Control *the_thread; + POSIX_API_Control *api; + + the_thread = argument; + + api = the_thread->API_Extensions[ THREAD_API_POSIX ]; + + ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_initial_budget ); + + if ( !ticks ) + ticks = 1; + + the_thread->cpu_time_budget = ticks; + + new_priority = _POSIX_Priority_To_core( api->ss_high_priority ); + the_thread->real_priority = new_priority; + + if ( the_thread->resource_count == 0 || + the_thread->current_priority > new_priority ) + _Thread_Change_priority( the_thread, new_priority, TRUE ); + + ticks = _POSIX_Timespec_to_interval( &api->schedparam.ss_replenish_period ); + + if ( !ticks ) + ticks = 1; + + _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); +} + +/*PAGE + * + * _POSIX_Threads_Sporadic_budget_callout + */ + +void _POSIX_Threads_Sporadic_budget_callout( + Thread_Control *the_thread +) +{ + POSIX_API_Control *api; + unsigned32 new_priority; + + api = the_thread->API_Extensions[ THREAD_API_POSIX ]; + + /* + * This will prevent the thread from consuming its entire "budget" + * while at low priority. + */ + + + the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ + + new_priority = _POSIX_Priority_To_core( api->schedparam.ss_low_priority ); + the_thread->real_priority = new_priority; + + if ( the_thread->resource_count == 0 || + the_thread->current_priority > new_priority ) + _Thread_Change_priority( the_thread, new_priority, TRUE ); +} + +/*PAGE + * + * _POSIX_Threads_Create_extension + * + * XXX + */ + +boolean _POSIX_Threads_Create_extension( + Thread_Control *executing, + Thread_Control *created +) +{ + POSIX_API_Control *api; + POSIX_API_Control *executing_api; + + api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); + + if ( !api ) + return FALSE; + + created->API_Extensions[ THREAD_API_POSIX ] = api; + + /* XXX check all fields are touched */ + api->Attributes = _POSIX_Threads_Default_attributes; + api->detachstate = _POSIX_Threads_Default_attributes.detachstate; + api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy; + api->schedparam = _POSIX_Threads_Default_attributes.schedparam; + api->schedparam.sched_priority = + _POSIX_Priority_From_core( created->current_priority ); + + /* + * POSIX 1003.1 1996, 18.2.2.2 + */ + api->cancelation_requested = 0; + api->cancelability_state = PTHREAD_CANCEL_ENABLE; + api->cancelability_type = PTHREAD_CANCEL_DEFERRED; + _Chain_Initialize_empty (&api->Cancellation_Handlers); + + /* + * If the thread is not a posix thread, then all posix signals are blocked + * by default. + */ + + /* XXX use signal constants */ + api->signals_pending = 0; + if ( _Objects_Get_API( created->Object.id ) == OBJECTS_POSIX_API && + _Objects_Get_class( created->Object.id ) == 1 ) { + executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + api->signals_blocked = api->signals_blocked; + } else + api->signals_blocked = 0xffffffff; + + _Thread_queue_Initialize( + &api->Join_List, + THREAD_QUEUE_DISCIPLINE_FIFO, + STATES_WAITING_FOR_JOIN_AT_EXIT, + 0 + ); + + _Watchdog_Initialize( + &api->Sporadic_timer, + _POSIX_Threads_Sporadic_budget_TSR, + created->Object.id, + created + ); + + return TRUE; +} + +/*PAGE + * + * _POSIX_Threads_Delete_extension + */ + +User_extensions_routine _POSIX_Threads_Delete_extension( + Thread_Control *executing, + Thread_Control *deleted +) +{ + Thread_Control *the_thread; + POSIX_API_Control *api; + void **value_ptr; + + api = deleted->API_Extensions[ THREAD_API_POSIX ]; + + /* + * Run the POSIX cancellation handlers + */ + + _POSIX_Keys_Run_destructors( deleted ); + + /* + * Wakeup all the tasks which joined with this one + */ + + value_ptr = (void **) deleted->Wait.return_argument; + + while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) + *(void **)the_thread->Wait.return_argument = value_ptr; + + if ( api->schedpolicy == SCHED_SPORADIC ) + (void) _Watchdog_Remove( &api->Sporadic_timer ); + + deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; + + (void) _Workspace_Free( api ); +} + +/* + * + * _POSIX_Threads_Exitted_extension + */ + +User_extensions_routine _POSIX_Threads_Exitted_extension( + Thread_Control *executing +) +{ + pthread_exit( executing->Wait.return_argument ); +} + +/*PAGE + * + * _POSIX_Threads_Initialize_user_threads + * + * This routine creates and starts all configured user + * initialzation threads. + * + * Input parameters: NONE + * + * Output parameters: NONE + */ + +void _POSIX_Threads_Initialize_user_threads( void ) +{ + int status; + unsigned32 index; + unsigned32 maximum; + posix_initialization_threads_table *user_threads; + pthread_t thread_id; + pthread_attr_t attr; + + user_threads = _POSIX_Threads_User_initialization_threads; + maximum = _POSIX_Threads_Number_of_initialization_threads; + + if ( !user_threads || maximum == 0 ) + return; + + /* + * Be careful .. if the default attribute set changes, this may need to. + * + * Setting the attributes explicitly is critical, since we don't want + * to inherit the idle tasks attributes. + */ + + for ( index=0 ; index < maximum ; index++ ) { + status = pthread_attr_init( &attr ); + assert( !status ); + + status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); + assert( !status ); + + status = pthread_attr_setstacksize( &attr, user_threads[ index ].stack_size); + assert( !status ); + + status = pthread_create( + &thread_id, + &attr, + user_threads[ index ].thread_entry, + NULL + ); + assert( !status ); + } +} + +/*PAGE + * + * API Extension control structures + */ + +API_extensions_Control _POSIX_Threads_API_extensions = { + { NULL, NULL }, + NULL, /* predriver */ + _POSIX_Threads_Initialize_user_threads, /* postdriver */ + _POSIX_signals_Post_switch_extension, /* post switch */ +}; + +User_extensions_Control _POSIX_Threads_User_extensions = { + { NULL, NULL }, + { { NULL, NULL }, NULL }, + { _POSIX_Threads_Create_extension, /* create */ + NULL, /* start */ + NULL, /* restart */ + _POSIX_Threads_Delete_extension, /* delete */ + NULL, /* switch */ + NULL, /* begin */ + _POSIX_Threads_Exitted_extension, /* exitted */ + NULL /* fatal */ + } +}; + +/*PAGE + * + * _POSIX_Threads_Manager_initialization + * + * This routine initializes all threads manager related data structures. + * + * Input parameters: + * maximum_pthreads - maximum configured pthreads + * + * Output parameters: NONE + */ + +void _POSIX_Threads_Manager_initialization( + unsigned32 maximum_pthreads, + unsigned32 number_of_initialization_threads, + posix_initialization_threads_table *user_threads + +) +{ + _POSIX_Threads_Number_of_initialization_threads = + number_of_initialization_threads; + _POSIX_Threads_User_initialization_threads = user_threads; + + /* + * There may not be any POSIX initialization threads configured. + */ + +#if 0 + if ( user_threads == NULL || number_of_initialization_threads == 0 ) + _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, TRUE, EINVAL ); +#endif + + _Objects_Initialize_information( + &_POSIX_Threads_Information, /* object information table */ + OBJECTS_POSIX_API, /* object API */ + OBJECTS_POSIX_THREADS, /* object class */ + maximum_pthreads, /* maximum objects of this class */ + sizeof( Thread_Control ), + /* size of this object's control block */ + FALSE, /* TRUE if names for this object are strings */ + 0 /* maximum length of each object's name */ +#if defined(RTEMS_MULTIPROCESSING) + , + FALSE, /* TRUE if this is a global object class */ + NULL /* Proxy extraction support callout */ +#endif + ); + + /* + * Add all the extensions for this API + */ + + _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions ); + + _API_extensions_Add( &_POSIX_Threads_API_extensions ); + + + /* + * If we supported MP, then here we would ... + * Register the MP Process Packet routine. + */ + +} Index: src/pthreadgetcpuclockid.c =================================================================== --- src/pthreadgetcpuclockid.c (nonexistent) +++ src/pthreadgetcpuclockid.c (revision 1765) @@ -0,0 +1,30 @@ +/* + * 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/Draft 8, p. 58 + * + * 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. + * + * pthreadgetcpuclockid.c,v 1.4 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include + +int pthread_getcpuclockid( + pthread_t pid, + clockid_t *clock_id +) +{ + return POSIX_NOT_IMPLEMENTED(); +} + Index: src/pthreadsetcputime.c =================================================================== --- src/pthreadsetcputime.c (nonexistent) +++ src/pthreadsetcputime.c (revision 1765) @@ -0,0 +1,39 @@ +/* + * 20.1.7 CPU-time Clock Thread Creation Attribute, P1003.4b/Draft 8, p. 59 + * + * 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. + * + * pthreadsetcputime.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_setcputime( + pthread_attr_t *attr, + int clock_allowed +) +{ + if ( !attr || !attr->is_initialized ) + return EINVAL; + + switch ( clock_allowed ) { + case CLOCK_ENABLED: + case CLOCK_DISABLED: + attr->cputime_clock_allowed = clock_allowed; + return 0; + + default: + return EINVAL; + } +} + Index: src/mqueuenotify.c =================================================================== --- src/mqueuenotify.c (nonexistent) +++ src/mqueuenotify.c (revision 1765) @@ -0,0 +1,108 @@ +/* + * 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. + * + * mqueuenotify.c,v 1.7 2002/04/26 23:39:01 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_Message_queue_Notify_handler + * + */ + +void _POSIX_Message_queue_Notify_handler( + void *user_data +) +{ + POSIX_Message_queue_Control *the_mq; + + the_mq = user_data; + + kill( getpid(), the_mq->notification.sigev_signo ); + + _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); +} + +/*PAGE + * + * 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 +) +{ + POSIX_Message_queue_Control *the_mq; + POSIX_Message_queue_Control_fd *the_mq_fd; + Objects_Locations location; + + the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); + switch ( location ) { + case OBJECTS_ERROR: + rtems_set_errno_and_return_minus_one( EBADF ); + case OBJECTS_REMOTE: + _Thread_Dispatch(); + return POSIX_MP_NOT_IMPLEMENTED(); + rtems_set_errno_and_return_minus_one( EINVAL ); + case OBJECTS_LOCAL: + the_mq = the_mq_fd->Queue; + + if ( notification ) { + if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( EBUSY ); + } + + _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); + + the_mq->notification = *notification; + + _CORE_message_queue_Set_notify( + &the_mq->Message_queue, + _POSIX_Message_queue_Notify_handler, + the_mq + ); + } else { + + _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); + + } + + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} + Index: src/kill.c =================================================================== --- src/kill.c (nonexistent) +++ src/kill.c (revision 1765) @@ -0,0 +1,52 @@ +/* + * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68 + * + * 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. + * + * kill.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 kill( + pid_t pid, + int sig +) +{ + return killinfo( pid, sig, NULL ); +} + +/* + * _kill_r + * + * This is the Newlib dependent reentrant version of kill(). + */ + +#if defined(RTEMS_NEWLIB) + +#include + +int _kill_r( + struct _reent *ptr, + pid_t pid, + int sig +) +{ + return kill( pid, sig ); +} +#endif + Index: src/pthreadattrdestroy.c =================================================================== --- src/pthreadattrdestroy.c (nonexistent) +++ src/pthreadattrdestroy.c (revision 1765) @@ -0,0 +1,32 @@ +/* + * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 + * + * 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. + * + * pthreadattrdestroy.c,v 1.3 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include + +int pthread_attr_destroy( + pthread_attr_t *attr +) +{ + if ( !attr || !attr->is_initialized ) + return EINVAL; + + attr->is_initialized = FALSE; + return 0; +} Index: src/adasupp.c =================================================================== --- src/adasupp.c (nonexistent) +++ src/adasupp.c (revision 1765) @@ -0,0 +1,32 @@ +/* + * adasupp.c,v 1.3 2001/01/24 14:17:27 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include + +/*PAGE + * + * _ada_pthread_minimum_stack_size + * + * This routine returns the minimum stack size so the GNAT RTS can + * allocate enough stack for Ada tasks. + */ + +size_t _ada_pthread_minimum_stack_size( void ) +{ + /* + * Eventually this may need to include a per cpu family calculation + * but for now, this will do. + */ + + return PTHREAD_MINIMUM_STACK_SIZE * 2; +} Index: src/mqueuetimedsend.c =================================================================== --- src/mqueuetimedsend.c (nonexistent) +++ src/mqueuetimedsend.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. + * + * mqueuetimedsend.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_timedsend( + mqd_t mqdes, + const char *msg_ptr, + size_t msg_len, + unsigned int msg_prio, + const struct timespec *timeout +) +{ + return _POSIX_Message_queue_Send_support( + mqdes, + msg_ptr, + msg_len, + msg_prio, + _POSIX_Timespec_to_interval( timeout ) + ); +} + Index: src/condattrsetpshared.c =================================================================== --- src/condattrsetpshared.c (nonexistent) +++ src/condattrsetpshared.c (revision 1765) @@ -0,0 +1,43 @@ +/* + * condattrsetpshared.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_setpshared( + pthread_condattr_t *attr, + int pshared +) +{ + if ( !attr ) + return EINVAL; + + switch ( pshared ) { + case PTHREAD_PROCESS_SHARED: + case PTHREAD_PROCESS_PRIVATE: + attr->process_shared = pshared; + return 0; + + default: + return EINVAL; + } +} Index: src/pthreadself.c =================================================================== --- src/pthreadself.c (nonexistent) +++ src/pthreadself.c (revision 1765) @@ -0,0 +1,27 @@ +/* + * 16.1.6 Get Calling Thread's ID, p1003.1c/Draft 10, p. 152 + * + * 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. + * + * pthreadself.c,v 1.3 2001/01/24 14:17:28 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include + +pthread_t pthread_self( void ) +{ + return _Thread_Executing->Object.id; +} Index: src/setcanceltype.c =================================================================== --- src/setcanceltype.c (nonexistent) +++ src/setcanceltype.c (revision 1765) @@ -0,0 +1,61 @@ +/* + * setcanceltype.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 + */ + +int pthread_setcanceltype( + int type, + int *oldtype +) +{ + 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 EPROTO; + + if ( !oldtype ) + return EINVAL; + + if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS ) + return EINVAL; + + thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + + _Thread_Disable_dispatch(); + *oldtype = thread_support->cancelability_type; + thread_support->cancelability_type = type; + + if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && + thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && + thread_support->cancelation_requested ) + _POSIX_Threads_cancel_run( _Thread_Executing ); + _Thread_Enable_dispatch(); + + return 0; +} Index: src/condbroadcast.c =================================================================== --- src/condbroadcast.c (nonexistent) +++ src/condbroadcast.c (revision 1765) @@ -0,0 +1,30 @@ +/* + * condbroadcast.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.3 Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 + */ + +int pthread_cond_broadcast( + pthread_cond_t *cond +) +{ + return _POSIX_Condition_variables_Signal_support( cond, TRUE ); +} Index: src/cleanuppop.c =================================================================== --- src/cleanuppop.c (nonexistent) +++ src/cleanuppop.c (revision 1765) @@ -0,0 +1,51 @@ +/* + * cleanuppop.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 +#include + +/*PAGE + * + * 18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184 + */ + +void pthread_cleanup_pop( + int execute +) +{ + POSIX_Cancel_Handler_control *handler; + Chain_Control *handler_stack; + POSIX_API_Control *thread_support; + ISR_Level level; + + thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; + + handler_stack = &thread_support->Cancellation_Handlers; + + if ( _Chain_Is_empty( handler_stack ) ) + return; + + _ISR_Disable( level ); + handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack ); + _Chain_Extract_unprotected( &handler->Node ); + _ISR_Enable( level ); + + if ( execute ) + (*handler->routine)( handler->arg ); + + _Workspace_Free( handler ); +} Index: src/getpgrp.c =================================================================== --- src/getpgrp.c (nonexistent) +++ src/getpgrp.c (revision 1765) @@ -0,0 +1,31 @@ +/* + * getpgrp.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 + +/*PAGE + * + * 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89 + */ + +pid_t getpgrp( void ) +{ + /* + * This always succeeds and returns the process group id. For rtems, + * this will always be the local node; + */ + + return _Objects_Local_node; +} Index: src/keycreate.c =================================================================== --- src/keycreate.c (nonexistent) +++ src/keycreate.c (revision 1765) @@ -0,0 +1,90 @@ +/* + * keycreate.c,v 1.4 2002/07/01 22:33:47 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include + +/*PAGE + * + * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 + */ + +int pthread_key_create( + pthread_key_t *key, + void (*destructor)( void * ) +) +{ + POSIX_Keys_Control *the_key; + void *table; + unsigned32 the_api; + unsigned32 bytes_to_allocate; + + + _Thread_Disable_dispatch(); + + the_key = _POSIX_Keys_Allocate(); + + if ( !the_key ) { + _Thread_Enable_dispatch(); + return EAGAIN; + } + + the_key->destructor = destructor; + + /* + * This is a bit more complex than one might initially expect because + * APIs are optional. Thus there may be no ITRON tasks to have keys + * for. [NOTE: Currently RTEMS Classic API tasks are not always enabled.] + */ + + for ( the_api = 1; + the_api <= OBJECTS_APIS_LAST; + the_api++ ) { + + if ( _Objects_Information_table[ the_api ] && + _Objects_Information_table[ the_api ][ 1 ] ) { + bytes_to_allocate = sizeof( void * ) * + (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); + table = _Workspace_Allocate( bytes_to_allocate ); + if ( !table ) { + for ( --the_api; + the_api >= 1; + the_api-- ) + _Workspace_Free( the_key->Values[ the_api ] ); + + _POSIX_Keys_Free( the_key ); + _Thread_Enable_dispatch(); + return ENOMEM; + } + + the_key->Values[ the_api ] = table; + memset( table, '\0', bytes_to_allocate ); + } else { + the_key->Values[ the_api ] = NULL; + } + + + } + + the_key->is_active = TRUE; + + _Objects_Open( &_POSIX_Keys_Information, &the_key->Object, 0 ); + + *key = the_key->Object.id; + + _Thread_Enable_dispatch(); + + return 0; +} Index: src/mutexdestroy.c =================================================================== --- src/mutexdestroy.c (nonexistent) +++ src/mutexdestroy.c (revision 1765) @@ -0,0 +1,87 @@ +/* + * mutexdestroy.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 + * + * 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 + */ + +int pthread_mutex_destroy( + pthread_mutex_t *mutex +) +{ + register POSIX_Mutex_Control *the_mutex; + Objects_Locations location; + + the_mutex = _POSIX_Mutex_Get( mutex, &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: + /* + * XXX: There is an error for the mutex being locked + * or being in use by a condition variable. + */ + + if ( _CORE_mutex_Is_locked( &the_mutex->Mutex ) ) { + _Thread_Enable_dispatch(); + return EBUSY; + } + + _Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object ); + + _CORE_mutex_Flush( + &the_mutex->Mutex, +#if defined(RTEMS_MULTIPROCESSING) + _POSIX_Mutex_MP_Send_object_was_deleted, +#else + NULL, +#endif + EINVAL + ); + + _POSIX_Mutex_Free( the_mutex ); + +#if defined(RTEMS_MULTIPROCESSING) + if ( the_mutex->process_shared == PTHREAD_PROCESS_SHARED ) { + + _Objects_MP_Close( &_POSIX_Mutex_Information, the_mutex->Object.id ); + + _POSIX_Mutex_MP_Send_process_packet( + POSIX_MUTEX_MP_ANNOUNCE_DELETE, + the_mutex->Object.id, + 0, /* Not used */ + 0 /* Not used */ + ); + } +#endif + _Thread_Enable_dispatch(); + return 0; + } + return POSIX_BOTTOM_REACHED(); +} Index: src/pause.c =================================================================== --- src/pause.c (nonexistent) +++ src/pause.c (revision 1765) @@ -0,0 +1,41 @@ +/* + * 3.4.2 Suspend Process Execution, P1003.1b-1993, p. 81 + * + * 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. + * + * pause.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 + +/* + * 3.4.2 Suspend Process Execution, P1003.1b-1993, p. 81 + */ + +int pause( void ) +{ + sigset_t all_signals; + int status; + + (void) sigfillset( &all_signals ); + + status = sigtimedwait( &all_signals, NULL, NULL ); + + return status; +} + Index: src/semaphoredeletesupp.c =================================================================== --- src/semaphoredeletesupp.c (nonexistent) +++ src/semaphoredeletesupp.c (revision 1765) @@ -0,0 +1,65 @@ +/* + * semaphoredeletesupp.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 + +#include +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_Semaphore_Delete + */ + +void _POSIX_Semaphore_Delete( + POSIX_Semaphore_Control *the_semaphore +) +{ + if ( !the_semaphore->linked && !the_semaphore->open_count ) { + _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object ); + + _CORE_semaphore_Flush( + &the_semaphore->Semaphore, +#if defined(RTEMS_MULTIPROCESSING) + _POSIX_Semaphore_MP_Send_object_was_deleted, +#else + NULL, +#endif + -1 /* XXX should also seterrno -> EINVAL */ + ); + + _POSIX_Semaphore_Free( the_semaphore ); + +#if defined(RTEMS_MULTIPROCESSING) + if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) { + + _Objects_MP_Close( + &_POSIX_Semaphore_Information, + the_semaphore->Object.id + ); + + _POSIX_Semaphore_MP_Send_process_packet( + POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE, + the_semaphore->Object.id, + 0, /* Not used */ + 0 /* Not used */ + ); + } +#endif + + } +} Index: src/semaphorecreatesupp.c =================================================================== --- src/semaphorecreatesupp.c (nonexistent) +++ src/semaphorecreatesupp.c (revision 1765) @@ -0,0 +1,129 @@ +/* + * semaphorecreatesupp.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 /* strlen */ + +#include +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_Semaphore_Create_support + * + * This routine does the actual creation and initialization of + * a poxix semaphore. It is a support routine for sem_init and + * sem_open. + */ + +int _POSIX_Semaphore_Create_support( + const char *name, + int pshared, + unsigned int value, + POSIX_Semaphore_Control **the_sem +) +{ + POSIX_Semaphore_Control *the_semaphore; + CORE_semaphore_Attributes *the_sem_attr; + + _Thread_Disable_dispatch(); + + /* Sharing semaphores among processes is not currently supported */ + if (pshared != 0) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( ENOSYS ); + } + + if ( name ) { + if( strlen(name) > PATH_MAX ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); + } + } + + the_semaphore = _POSIX_Semaphore_Allocate(); + + if ( !the_semaphore ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( ENOSPC ); + } + +#if defined(RTEMS_MULTIPROCESSING) + if ( pshared == PTHREAD_PROCESS_SHARED && + !( _Objects_MP_Allocate_and_open( &_POSIX_Semaphore_Information, 0, + the_semaphore->Object.id, FALSE ) ) ) { + _POSIX_Semaphore_Free( the_semaphore ); + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( EAGAIN ); + } +#endif + + the_semaphore->process_shared = pshared; + + if ( name ) { + the_semaphore->named = TRUE; + the_semaphore->open_count = 1; + the_semaphore->linked = TRUE; + } + else + the_semaphore->named = FALSE; + + the_sem_attr = &the_semaphore->Semaphore.Attributes; + + /* + * POSIX does not appear to specify what the discipline for + * blocking tasks on this semaphore should be. It could somehow + * be derived from the current scheduling policy. One + * thing is certain, no matter what we decide, it won't be + * the same as all other POSIX implementations. :) + */ + + the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; + + /* + * This effectively disables limit checking. + */ + + the_sem_attr->maximum_count = 0xFFFFFFFF; + + _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); + + /* + * Make the semaphore available for use. + */ + + _Objects_Open( + &_POSIX_Semaphore_Information, + &the_semaphore->Object, + (char *) name + ); + + *the_sem = the_semaphore; + +#if defined(RTEMS_MULTIPROCESSING) + if ( pshared == PTHREAD_PROCESS_SHARED ) + _POSIX_Semaphore_MP_Send_process_packet( + POSIX_SEMAPHORE_MP_ANNOUNCE_CREATE, + the_semaphore->Object.id, + (char *) name, + 0 /* proxy id - Not used */ + ); +#endif + + _Thread_Enable_dispatch(); + return 0; +} Index: src/ptimer1.c =================================================================== --- src/ptimer1.c (nonexistent) +++ src/ptimer1.c (revision 1765) @@ -0,0 +1,790 @@ +/* + * ptimer.c,v 1.1 1996/06/03 16:29:58 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include +#include +#include + +#include + +/************************************/ +/* These includes are now necessary */ +/************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/*****************************/ +/* End of necessary includes */ +/*****************************/ + +/* ************ + * Constants + * ************/ + +/* +#define DEBUG_MESSAGES + */ + +/* + * Data for the signals + */ + +/*********************************** + * Definition of Internal Functions + ***********************************/ + +/* *************************************************************************** + * TIMER_INITIALIZE_S + * + * Description: Initialize the data of a timer + * ***************************************************************************/ + +extern void TIMER_INITIALIZE_S ( int timer_pos ); + +/* *************************************************************************** + * _POSIX_Timer_Manager_initialization + * + * Description: Initialize the internal structure in which the data of all + * the timers are stored + * ***************************************************************************/ + +/* split to reduce minimum size */ + +/* *************************************************************************** + * FIRST_FREE_POSITION_F + * + * Description: Returns the first free position in the table of timers. + * If there is not a free position, it returns NO_MORE_TIMERS_C + * ***************************************************************************/ + +int FIRST_FREE_POSITION_F () +{ + int index; + + for (index=0; indexit_value.tv_sec = source->it_value.tv_sec; + target->it_value.tv_nsec = source->it_value.tv_nsec; + target->it_interval.tv_sec = source->it_interval.tv_sec; + target->it_interval.tv_nsec = source->it_interval.tv_nsec; + +} + +/* *************************************************************************** + * ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S + * + * Description: This function converts the data of a structure itimerspec + * into structure rtems_time_of_day + * ***************************************************************************/ + +void ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S + ( const struct itimerspec *itimer, rtems_time_of_day *rtems_time ) +{ + unsigned long int seconds; + + /* The leap years and the months with 28, 29 or 31 days have not been + * considerated. It will be made in the future */ + + seconds = itimer->it_value.tv_sec; + + rtems_time->year = seconds / SECONDS_PER_YEAR_C; + seconds = seconds % SECONDS_PER_YEAR_C; + + rtems_time->month = seconds / SECONDS_PER_MONTH_C; + seconds = seconds % SECONDS_PER_MONTH_C; + + rtems_time->day = seconds / SECONDS_PER_DAY_C; + seconds = seconds % SECONDS_PER_DAY_C; + + rtems_time->hour = seconds / SECONDS_PER_HOUR_C; + seconds = seconds % SECONDS_PER_HOUR_C; + + rtems_time->minute = seconds / SECONDS_PER_MINUTE_C; + seconds = seconds % SECONDS_PER_MINUTE_C; + + rtems_time->second = seconds; + + rtems_time->ticks = ( itimer->it_value.tv_nsec * SEC_TO_TICKS_C ) / + NSEC_PER_SEC_C; + +} + + +/* *************************************************************************** + * FIRE_TIMER_S + * + * Description: This is the operation that is ran when a timer expires + * ***************************************************************************/ + + +rtems_timer_service_routine FIRE_TIMER_S (rtems_id timer, void *data) +{ + int timer_pos; /* Position in the table of the timer that + * has expirated */ + rtems_status_code return_v; /* Return value of rtems_timer_fire_after */ + int sig_number; /* Number of the signal to send */ + + + /* The position of the table of timers that contains the data of the + * expired timer will be stored in "timer_pos". In theory a timer can not + * expire if it has not been created or has been deleted */ + + timer_pos = TIMER_POSITION_F(timer); + + /* Increases the number of expiration of the timer in one unit. */ + timer_struct[timer_pos].overrun = timer_struct[timer_pos].overrun + 1; + + + if ( ( timer_struct[timer_pos].timer_data.it_interval.tv_sec != 0 ) || + ( timer_struct[timer_pos].timer_data.it_interval.tv_nsec != 0 ) ) { + + /* The timer must be reprogrammed */ + + return_v = rtems_timer_fire_after ( timer, + timer_struct[timer_pos].ticks, + FIRE_TIMER_S, + NULL ); + + /* Stores the time when the timer was started again */ + + timer_struct[timer_pos].time = _TOD_Current; + + /* The state has not to be actualized, because nothing modifies it */ + + timer_struct[timer_pos].state = STATE_CREATE_RUN_C; + + } else { + /* Indicates that the timer is stopped */ + + timer_struct[timer_pos].state = STATE_CREATE_STOP_C; + + } + + /* + * The sending of the signal to the process running the handling function + * specified for that signal is simulated + */ + + sig_number = timer_struct[timer_pos].inf.sigev_signo; + + if( pthread_kill ( timer_struct[timer_pos].thread_id , + timer_struct[timer_pos].inf.sigev_signo ) ) { + /* XXX error handling */ + } + + /* + * After the signal handler returns, the count of expirations of the + * timer must be set to 0. + */ + + timer_struct[timer_pos].overrun = 0; + +} + +/* ********************************************************************* + * 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 +) +{ + + rtems_status_code return_v; /* return value of the operation */ + rtems_id timer_id; /* created timer identifier */ + int timer_pos; /* Position in the table of timers */ + + /* + * The data of the structure evp are checked in order to verify if they + * are coherent. + */ + + if (evp != NULL) { + /* The structure has data */ + if ( ( evp->sigev_notify != SIGEV_NONE ) && + ( evp->sigev_notify != SIGEV_SIGNAL ) ) { + /* The value of the field sigev_notify is not valid */ + rtems_set_errno_and_return_minus_one( EINVAL ); + } + } + + /* + * A timer is created using the primitive rtems_timer_create + */ + + return_v = rtems_timer_create ( clock_id, &timer_id ); + + switch (return_v) { + case RTEMS_SUCCESSFUL : + + /* + * The timer has been created properly + */ + + /* Obtains the first free position in the table of timers */ + + timer_pos = FIRST_FREE_POSITION_F(); + + if ( timer_pos == NO_MORE_TIMERS_C ) { + /* There is not position for another timers in spite of RTEMS + * supports it. It will necessaty to increase the structure used */ + + rtems_set_errno_and_return_minus_one( EAGAIN ); + } + + /* Exit parameter */ + + *timerid = timer_id; + + /* The data of the created timer are stored to use them later */ + + timer_struct[timer_pos].state = STATE_CREATE_NEW_C; + + /* NEW VERSION*/ + timer_struct[timer_pos].thread_id = pthread_self (); + + if ( evp != NULL ) { + timer_struct[timer_pos].inf.sigev_notify = evp->sigev_notify; + timer_struct[timer_pos].inf.sigev_signo = evp->sigev_signo; + timer_struct[timer_pos].inf.sigev_value = evp->sigev_value; + } + + timer_struct[timer_pos].timer_id = timer_id; + timer_struct[timer_pos].overrun = 0; + + timer_struct[timer_pos].timer_data.it_value.tv_sec = 0; + timer_struct[timer_pos].timer_data.it_value.tv_nsec = 0; + timer_struct[timer_pos].timer_data.it_interval.tv_sec = 0; + timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0; + + return 0; + + case RTEMS_INVALID_NAME : /* The assigned name is not valid */ + + rtems_set_errno_and_return_minus_one( EINVAL ); + + case RTEMS_TOO_MANY : + + /* There has been created too much timers for the same process */ + rtems_set_errno_and_return_minus_one( EAGAIN ); + + default : + + /* + * Does nothing. It only returns the error without assigning a value + * to errno. In theory, it can not happen because the call to + * rtems_timer_create can not return other different value. + */ + + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + /* + * The next sentence is used to avoid singular situations + */ + + rtems_set_errno_and_return_minus_one( EINVAL ); +} + +/* + * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266 + */ + +int timer_delete( + timer_t timerid +) +{ + + /* + * IDEA: This function must probably stop the timer first and then delete it + * + * It will have to do a call to rtems_timer_cancel and then another + * call to rtems_timer_delete. + * The call to rtems_timer_delete will be probably unnecessary, + * because rtems_timer_delete stops the timer before deleting it. + */ + + int timer_pos; + rtems_status_code status; + + + /* First the position in the table of timers is obtained */ + + timer_pos = TIMER_POSITION_F ( timerid ); + + if ( timer_pos == BAD_TIMER_C ) { + /* The timer identifier is erroneus */ + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + /* The timer is deleted */ + + status = rtems_timer_delete ( timerid ); + + if ( status == RTEMS_INVALID_ID ) { + /* The timer identifier is erroneus */ + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + /* Initializes the data of the timer */ + + TIMER_INITIALIZE_S ( timer_pos ); + return 0; +} + +/* + * 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 +) +{ + + rtems_status_code return_v; /* Return of the calls to RTEMS */ + int timer_pos; /* Position of the timer in the table */ + rtems_time_of_day rtems_time; /* Time in RTEMS */ + + + /* First the position in the table of timers is obtained */ + + timer_pos = TIMER_POSITION_F ( timerid ); + + if ( timer_pos == BAD_TIMER_C ) { + /* The timer identifier is erroneus */ + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + if ( value == NULL ) { + /* The stucture of times of the timer is free, and then returns an + error but the variable errno is not actualized */ + + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + /* If the function reaches this point, then it will be necessary to do + * something with the structure of times of the timer: to stop, start + * or start it again */ + + /* First, it verifies if the timer must be stopped */ + + if ( value->it_value.tv_sec == 0 && value->it_value.tv_nsec == 0 ) { + /* The timer is stopped */ + + return_v = rtems_timer_cancel ( timerid ); + + /* The old data of the timer are returned */ + + if ( ovalue ) + *ovalue = timer_struct[timer_pos].timer_data; + + /* The new data are set */ + + timer_struct[timer_pos].timer_data = *value; + + /* Indicates that the timer is created and stopped */ + + timer_struct[timer_pos].state = STATE_CREATE_STOP_C; + + /* Returns with success */ + + return 0; + } + + /* + * If the function reaches this point, then the timer will have to be + * initialized with new values: to start it or start it again + */ + + /* First, it verifies if the structure "value" is correct */ + + if ( ( value->it_value.tv_nsec > MAX_NSEC_C ) || + ( value->it_value.tv_nsec < MIN_NSEC_C ) ) { + /* The number of nanoseconds is not correct */ + + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + /* Then, "value" must be converted from seconds and nanoseconds to clock + * ticks, to use it in the calls to RTEMS */ + + /* It is also necessary to take in account if the time is absolute + * or relative */ + + switch (flags) { + case TIMER_ABSTIME: + + /* The fire time is absolute: + * It has to use "rtems_time_fire_when" */ + + /* First, it converts from struct itimerspec to rtems_time_of_day */ + + ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S ( value, &rtems_time ); + + return_v = rtems_timer_fire_when ( timerid, &rtems_time, FIRE_TIMER_S, NULL); + + switch ( return_v ) { + case RTEMS_SUCCESSFUL: + + /* The timer has been started and is running */ + + /* Actualizes the data of the structure and + * returns the old ones in "ovalue" */ + + if ( ovalue ) + *ovalue = timer_struct[timer_pos].timer_data; + + timer_struct[timer_pos].timer_data = *value; + + /* It indicates that the time is running */ + + timer_struct[timer_pos].state = STATE_CREATE_RUN_C; + + /* Stores the time in which the timer was started again */ + + timer_struct[timer_pos].time = _TOD_Current; + return 0; + + break; + + case RTEMS_INVALID_ID: + + /* XXX error handling */ + break; + + case RTEMS_NOT_DEFINED: + + /* XXX error handling */ + break; + + case RTEMS_INVALID_CLOCK: + + /* XXX error handling */ + break; + + default: break; + + + } + + break; + + case TIMER_RELATIVE_C: + + /* The fire time is relative: + * It has to use "rtems_time_fire_after" */ + + /* First, it converts from seconds and nanoseconds to ticks */ + + /* The form in which this operation is done can produce a lost + * of precision of 1 second */ + +/* This is the process to convert from nanoseconds to ticks + * + * There is a tick every 10 miliseconds, then the nanoseconds are + * divided between 10**7. The result of this operation will be the + * number of ticks + */ + + timer_struct[timer_pos].ticks = + ( SEC_TO_TICKS_C * value->it_value.tv_sec ) + + ( value->it_value.tv_nsec / ( 1000 * 1000 * 10 ) ); + + return_v = rtems_timer_fire_after ( timerid, + timer_struct[timer_pos].ticks, + FIRE_TIMER_S, + NULL ); + + switch (return_v) { + case RTEMS_SUCCESSFUL: + + /* The timer has been started and is running */ + + /* Actualizes the data of the structure and + * returns the old ones in "ovalue" */ + + if ( ovalue ) + *ovalue = timer_struct[timer_pos].timer_data; + + timer_struct[timer_pos].timer_data = *value; + + /* It indicates that the time is running */ + + timer_struct[timer_pos].state = STATE_CREATE_RUN_C; + + /* Stores the time in which the timer was started again */ + + timer_struct[timer_pos].time = _TOD_Current; + + return 0; + + break; + + case RTEMS_INVALID_ID: + + /* The timer identifier is not correct. In theory, this + * situation can not occur, but the solution is easy */ + + rtems_set_errno_and_return_minus_one( EINVAL ); + + break; + + case RTEMS_INVALID_NUMBER: + + /* In this case, RTEMS fails because the values of timing + * are incorrect */ + + /* + * I do not know if errno must be actualized + * + * errno = EINVAL; + */ + + rtems_set_errno_and_return_minus_one( EINVAL ); + break; + + default: break; + } + + break; + + default: break; + + /* It does nothing, although it will be probably necessary to + * return an error */ + } + + /* To avoid problems */ + return 0; +} + + +/* + * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 + */ + +/* ************** + * timer_gettime + * **************/ + +int timer_gettime( + timer_t timerid, + struct itimerspec *value +) +{ + + /* + * IDEA: This function does not use functions of RTEMS to the handle + * of timers. It uses some functions for managing the time. + * + * A possible form to do this is the following: + * + * - When a timer is initialized, the value of the time in + * that moment is stored. + * - When this function is called, it returns the difference + * between the current time and the initialization time. + */ + + rtems_time_of_day current_time; + int timer_pos; + unsigned32 hours; + unsigned32 minutes; + unsigned32 seconds; + unsigned32 ticks; + unsigned32 nanosec; + + + /* Reads the current time */ + + current_time = _TOD_Current; + + timer_pos = TIMER_POSITION_F ( timerid ); + + if ( timer_pos == BAD_TIMER_C ) { + /* The timer identifier is erroneus */ + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + /* Calculates the difference between the start time of the timer and + * the current one */ + + hours = current_time.hour - timer_struct[timer_pos].time.hour; + + if ( current_time.minute < timer_struct[timer_pos].time.minute ) { + minutes = 60 - timer_struct[timer_pos].time.minute + current_time.minute; + hours--; + } else { + minutes = current_time.minute - timer_struct[timer_pos].time.minute; + } + + if ( current_time.second < timer_struct[timer_pos].time.second ) { + seconds = 60 - timer_struct[timer_pos].time.second + current_time.second; + minutes--; + } else { + seconds = current_time.second - timer_struct[timer_pos].time.second; + } + + if ( current_time.ticks < timer_struct[timer_pos].time.ticks ) { + ticks = 100 - timer_struct[timer_pos].time.ticks + current_time.ticks; + seconds--; + } else { + ticks = current_time.ticks - timer_struct[timer_pos].time.ticks; + } + + /* The time that the timer is running is calculated */ + seconds = hours * 60 * 60 + + minutes * 60 + + seconds; + + nanosec = ticks * 10 * /* msec */ + 1000 * /* microsec */ + 1000; /* nanosec */ + + + /* Calculates the time left before the timer finishes */ + + value->it_value.tv_sec = + timer_struct[timer_pos].timer_data.it_value.tv_sec - seconds; + + value->it_value.tv_nsec = + timer_struct[timer_pos].timer_data.it_value.tv_nsec - nanosec; + + + value->it_interval.tv_sec = + timer_struct[timer_pos].timer_data.it_interval.tv_sec; + value->it_interval.tv_nsec = + timer_struct[timer_pos].timer_data.it_interval.tv_nsec; + + + return 0; + +} + +/* + * 14.2.4 Per-Process Timers, P1003.1b-1993, p. 267 + */ + +/* ***************** + * timer_getoverrun + * *****************/ + +int timer_getoverrun( + timer_t timerid +) +{ + + /* + * IDEA: This function must count the times the timer expires. + * + * The expiration of a timer must increase by one a counter. + * After the signal handler associated to the timer finishs + * its execution, FIRE_TIMER_S will have to set this counter to 0. + */ + + int timer_pos; /* Position of the timer in the structure */ + int overrun; /* Overflow count */ + + + timer_pos = TIMER_POSITION_F ( timerid ); + + if ( timer_pos == BAD_TIMER_C ) { + /* The timer identifier is erroneus */ + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + /* The overflow count of the timer is stored in "overrun" */ + + overrun = timer_struct[timer_pos].overrun; + + /* It is set to 0 */ + + timer_struct[timer_pos].overrun = 0; + + return overrun; + +} Index: src/sigwaitinfo.c =================================================================== --- src/sigwaitinfo.c (nonexistent) +++ src/sigwaitinfo.c (revision 1765) @@ -0,0 +1,34 @@ +/* + * 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 + * + * NOTE: P1003.1c/D10, p. 39 adds sigwait(). + * + * 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. + * + * sigwaitinfo.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 sigwaitinfo( + const sigset_t *set, + siginfo_t *info +) +{ + return sigtimedwait( set, info, NULL ); +} + Index: src/psignalclearprocesssignals.c =================================================================== --- src/psignalclearprocesssignals.c (nonexistent) +++ src/psignalclearprocesssignals.c (revision 1765) @@ -0,0 +1,42 @@ +/* + * psignalclearprocesssignals.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 +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_signals_Clear_process_signals + */ + +void _POSIX_signals_Clear_process_signals( + sigset_t mask +) +{ + ISR_Level level; + + _ISR_Disable( level ); + _POSIX_signals_Pending &= ~mask; + if ( !_POSIX_signals_Pending ) + _Thread_Do_post_task_switch_extension--; + _ISR_Enable( level ); +} Index: src/nanosleep.c =================================================================== --- src/nanosleep.c (nonexistent) +++ src/nanosleep.c (revision 1765) @@ -0,0 +1,104 @@ +/* + * nanosleep.c,v 1.4 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.5 High Resolution Sleep, P1003.1b-1993, p. 269 + */ + +int nanosleep( + const struct timespec *rqtp, + struct timespec *rmtp +) +{ + Watchdog_Interval ticks; + struct timespec *the_rqtp; + + if ( !rqtp ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + the_rqtp = (struct timespec *)rqtp; + + /* + * Return EAGAIN if the delay interval is negative. + * + * NOTE: This behavior is beyond the POSIX specification. + * FSU pthreads shares this behavior. + */ + + if ( the_rqtp->tv_sec < 0 ) + the_rqtp->tv_sec = 0; + + if ( /* the_rqtp->tv_sec < 0 || */ the_rqtp->tv_nsec < 0 ) + rtems_set_errno_and_return_minus_one( EAGAIN ); + + if ( the_rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + ticks = _POSIX_Timespec_to_interval( the_rqtp ); + + /* + * This behavior is also beyond the POSIX specification but is + * consistent with the RTEMS api and yields desirable behavior. + */ + + if ( !ticks ) { + _Thread_Disable_dispatch(); + _Thread_Yield_processor(); + _Thread_Enable_dispatch(); + if ( rmtp ) { + rmtp->tv_sec = 0; + rmtp->tv_nsec = 0; + } + return 0; + } + + _Thread_Disable_dispatch(); + _Thread_Set_state( + _Thread_Executing, + STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL + ); + _Watchdog_Initialize( + &_Thread_Executing->Timer, + _Thread_Delay_ended, + _Thread_Executing->Object.id, + NULL + ); + _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); + _Thread_Enable_dispatch(); + + /* calculate time remaining */ + + if ( rmtp ) { + ticks -= + _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; + + _POSIX_Interval_to_timespec( ticks, rmtp ); + + /* + * If there is time remaining, then we were interrupted by a signal. + */ + + if ( ticks ) + rtems_set_errno_and_return_minus_one( EINTR ); + } + + return 0; +} Index: src/mqueuerecvsupp.c =================================================================== --- src/mqueuerecvsupp.c (nonexistent) +++ src/mqueuerecvsupp.c (revision 1765) @@ -0,0 +1,108 @@ +/* + * 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. + * + * mqueuerecvsupp.c,v 1.7 2002/04/26 23:39:01 joel Exp + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/*PAGE + * + * _POSIX_Message_queue_Receive_support + * + * NOTE: XXX Document how size, priority, length, and the buffer go + * through the layers. + */ + +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_Control *the_mq; + POSIX_Message_queue_Control_fd *the_mq_fd; + Objects_Locations location; + unsigned32 length_out; + + the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); + switch ( location ) { + case OBJECTS_ERROR: + rtems_set_errno_and_return_minus_one( EBADF ); + case OBJECTS_REMOTE: + _Thread_Dispatch(); + return POSIX_MP_NOT_IMPLEMENTED(); + rtems_set_errno_and_return_minus_one( EINVAL ); + case OBJECTS_LOCAL: + if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( EBADF ); + } + + the_mq = the_mq_fd->Queue; + + if ( msg_len < the_mq->Message_queue.maximum_message_size ) { + _Thread_Enable_dispatch(); + rtems_set_errno_and_return_minus_one( EMSGSIZE ); + } + + /* + * Now if something goes wrong, we return a "length" of -1 + * to indicate an error. + */ + + length_out = -1; + + _CORE_message_queue_Seize( + &the_mq->Message_queue, + mqdes, + msg_ptr, + &length_out, + (the_mq_fd->oflag & O_NONBLOCK) ? FALSE : TRUE, + timeout + ); + + _Thread_Enable_dispatch(); + *msg_prio = + _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); + + if ( !_Thread_Executing->Wait.return_code ) + return length_out; + + rtems_set_errno_and_return_minus_one( + _POSIX_Message_queue_Translate_core_message_queue_return_code( + _Thread_Executing->Wait.return_code + ) + ); + } + return POSIX_BOTTOM_REACHED(); +} + Index: src/getppid.c =================================================================== --- src/getppid.c (nonexistent) +++ src/getppid.c (revision 1765) @@ -0,0 +1,29 @@ +/* + * getppid.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 + +pid_t _POSIX_types_Ppid = 0; + +/*PAGE + * + * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83 + */ + +pid_t getppid( void ) +{ + return _POSIX_types_Ppid; +} + Index: src/clockgetcpuclockid.c =================================================================== --- src/clockgetcpuclockid.c (nonexistent) +++ src/clockgetcpuclockid.c (revision 1765) @@ -0,0 +1,32 @@ +/* + * clockgetcpuclockid.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.3 Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 + */ + +int clock_getcpuclockid( + pid_t pid, + clockid_t *clock_id +) +{ + return POSIX_NOT_IMPLEMENTED(); +} Index: src =================================================================== --- src (nonexistent) +++ src (revision 1765)
src Property changes : Added: svn:ignore ## -0,0 +1,6 ## +Makefile +Makefile.in +stamp-h +stamp-h.in +config.h +config.h.in Index: inline/rtems/posix/timer.inl =================================================================== --- inline/rtems/posix/timer.inl (nonexistent) +++ inline/rtems/posix/timer.inl (revision 1765) @@ -0,0 +1,90 @@ +/* timer.inl + * + * This file contains the static inline 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/08/25 17:15:44 joel Exp + */ + +#ifndef __POSIX_TIMER_inl +#define __POSIX_TIMER_inl + +/*PAGE + * + * _POSIX_Timer_Allocate + * + * DESCRIPTION: + * + * This function allocates a timer control block from + * the inactive chain of free timer control blocks. + */ + +RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) +{ + return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); +} + +/*PAGE + * + * _POSIX_Timer_Free + * + * DESCRIPTION: + * + * This routine frees a timer control block to the + * inactive chain of free timer control blocks. + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free ( + POSIX_Timer_Control *the_timer +) +{ + _Objects_Free( &_POSIX_Timer_Information, &the_timer->Object ); +} + +/*PAGE + * + * _POSIX_Timer_Get + * + * DESCRIPTION: + * + * This function maps timer IDs to timer control blocks. + * If ID corresponds to a local timer, then it returns + * the timer control pointer which maps to ID and location + * is set to OBJECTS_LOCAL. Otherwise, location is set + * to OBJECTS_ERROR and the returned value is undefined. + */ + +RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (POSIX_Timer_Control *) + _Objects_Get( &_POSIX_Timer_Information, id, location ); +} + +/*PAGE + * + * _POSIX_Timer_Is_null + * + * DESCRIPTION: + * + * This function returns TRUE if the_timer is NULL and FALSE otherwise. + */ + +RTEMS_INLINE_ROUTINE boolean _POSIX_Timer_Is_null ( + Timer_Control *the_timer +) +{ + return (the_timer == NULL); +} + +#endif +/* end of include file */ Index: inline/rtems/posix/mqueue.inl =================================================================== --- inline/rtems/posix/mqueue.inl (nonexistent) +++ inline/rtems/posix/mqueue.inl (revision 1765) @@ -0,0 +1,150 @@ +/* rtems/posix/mqueue.inl + * + * This include file contains the static inline 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.11 2002/04/26 23:39:01 joel Exp + */ + +#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_inl +#define __RTEMS_POSIX_MESSAGE_QUEUE_inl + +/*PAGE + * + * _POSIX_Message_queue_Allocate + */ + +RTEMS_INLINE_ROUTINE + POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void ) +{ + return (POSIX_Message_queue_Control *) + _Objects_Allocate( &_POSIX_Message_queue_Information ); +} + +/*PAGE + * + * _POSIX_Message_queue_Allocate_fd + */ + +RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * + _POSIX_Message_queue_Allocate_fd( void ) +{ + return (POSIX_Message_queue_Control_fd *) + _Objects_Allocate( &_POSIX_Message_queue_Information_fds ); +} + +/*PAGE + * + * _POSIX_Message_queue_Free + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free ( + POSIX_Message_queue_Control *the_mq +) +{ + _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object ); +} + +/*PAGE + * + * _POSIX_Message_queue_Free_fd + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( + POSIX_Message_queue_Control_fd *the_mq_fd +) +{ + _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); +} + +/*PAGE + * + * _POSIX_Message_queue_Namespace_remove + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Namespace_remove ( + POSIX_Message_queue_Control *the_mq +) +{ + _Objects_Namespace_remove( + &_POSIX_Message_queue_Information, &the_mq->Object ); +} + +/*PAGE + * + * _POSIX_Message_queue_Get + */ + +RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (POSIX_Message_queue_Control *) + _Objects_Get( &_POSIX_Message_queue_Information, id, location ); +} + +/*PAGE + * + * _POSIX_Message_queue_Get_fd + */ + +RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( + Objects_Id id, + Objects_Locations *location +) +{ + return (POSIX_Message_queue_Control_fd *) + _Objects_Get( &_POSIX_Message_queue_Information_fds, id, location ); +} + +/*PAGE + * + * _POSIX_Message_queue_Is_null + */ + +RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null ( + POSIX_Message_queue_Control *the_mq +) +{ + return !the_mq; +} + +/*PAGE + * + * _POSIX_Message_queue_Priority_to_core + */ + +RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core( + unsigned int priority +) +{ + return priority * -1; +} + +/* + * _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 +) +{ + /* absolute value without a library dependency */ + return ((priority >= 0) ? priority : -priority); +} + +#endif +/* end of include file */ + Index: inline/rtems/posix/priority.inl =================================================================== --- inline/rtems/posix/priority.inl (nonexistent) +++ inline/rtems/posix/priority.inl (revision 1765) @@ -0,0 +1,37 @@ +/* + * priority.inl,v 1.7 1997/04/15 18:02:18 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. + */ + +RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid( + int priority +) +{ + return (boolean) (priority >= 1 && priority <= 254); +} + +RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( + int priority +) +{ + return (Priority_Control) (255 - priority); +} + +RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core( + Priority_Control priority +) +{ + return 255 - priority; +} + +#endif Index: inline/rtems/posix/mutex.inl =================================================================== --- inline/rtems/posix/mutex.inl (nonexistent) +++ inline/rtems/posix/mutex.inl (revision 1765) @@ -0,0 +1,110 @@ +/* rtems/posix/mutex.inl + * + * This include file contains the static inline 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.10 2002/01/16 22:01:19 joel Exp + */ + +#ifndef __RTEMS_POSIX_MUTEX_inl +#define __RTEMS_POSIX_MUTEX_inl + +/*PAGE + * + * _POSIX_Mutex_Allocate + */ + +RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void ) +{ + return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information ); +} + +/*PAGE + * + * _POSIX_Mutex_Free + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free ( + POSIX_Mutex_Control *the_mutex +) +{ + _Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object ); +} + +/*PAGE + * + * _POSIX_Mutex_Get_support + * + * 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) + +RTEMS_INLINE_ROUTINE 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 ); +} + +RTEMS_INLINE_ROUTINE 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 + */ + +RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null ( + POSIX_Mutex_Control *the_mutex +) +{ + return !the_mutex; +} + +#endif +/* end of include file */ + Index: inline/rtems/posix/cond.inl =================================================================== --- inline/rtems/posix/cond.inl (nonexistent) +++ inline/rtems/posix/cond.inl (revision 1765) @@ -0,0 +1,79 @@ +/* rtems/posix/cond.inl + * + * This include file contains the static inline 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.9 2000/06/12 14:59:26 joel Exp + */ + +#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_inl +#define __RTEMS_POSIX_CONDITION_VARIABLES_inl + +/*PAGE + * + * _POSIX_Condition_variables_Allocate + */ + +RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control + *_POSIX_Condition_variables_Allocate( void ) +{ + return (POSIX_Condition_variables_Control *) + _Objects_Allocate( &_POSIX_Condition_variables_Information ); +} + +/*PAGE + * + * _POSIX_Condition_variables_Free + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free ( + POSIX_Condition_variables_Control *the_condition_variable +) +{ + _Objects_Free( + &_POSIX_Condition_variables_Information, + &the_condition_variable->Object + ); +} + +/*PAGE + * + * _POSIX_Condition_variables_Get + */ + +RTEMS_INLINE_ROUTINE 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 + */ + +RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null ( + POSIX_Condition_variables_Control *the_condition_variable +) +{ + return !the_condition_variable; +} + +#endif +/* end of include file */ + Index: inline/rtems/posix/semaphore.inl =================================================================== --- inline/rtems/posix/semaphore.inl (nonexistent) +++ inline/rtems/posix/semaphore.inl (revision 1765) @@ -0,0 +1,85 @@ +/* rtems/posix/semaphore.inl + * + * This include file contains the static inline 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.9 2001/01/22 13:46:28 joel Exp + */ + +#ifndef __RTEMS_POSIX_SEMAPHORE_inl +#define __RTEMS_POSIX_SEMAPHORE_inl + +/*PAGE + * + * _POSIX_Semaphore_Allocate + */ + +RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) +{ + return (POSIX_Semaphore_Control *) + _Objects_Allocate( &_POSIX_Semaphore_Information ); +} + +/*PAGE + * + * _POSIX_Semaphore_Free + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( + POSIX_Semaphore_Control *the_semaphore +) +{ + _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); +} + +/*PAGE + * + * _POSIX_Semaphore_Namespace_remove + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Namespace_remove ( + POSIX_Semaphore_Control *the_semaphore +) +{ + _Objects_Namespace_remove( + &_POSIX_Semaphore_Information, &the_semaphore->Object ); +} + + + +/*PAGE + * + * _POSIX_Semaphore_Get + */ + +RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( + sem_t *id, + Objects_Locations *location +) +{ + return (POSIX_Semaphore_Control *) + _Objects_Get( &_POSIX_Semaphore_Information, *id, location ); +} + +/*PAGE + * + * _POSIX_Semaphore_Is_null + */ + +RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null ( + POSIX_Semaphore_Control *the_semaphore +) +{ + return !the_semaphore; +} + +#endif +/* end of include file */ + Index: inline/rtems/posix/pthread.inl =================================================================== --- inline/rtems/posix/pthread.inl (nonexistent) +++ inline/rtems/posix/pthread.inl (revision 1765) @@ -0,0 +1,69 @@ +/* rtems/posix/pthread.inl + * + * This include file contains the static inline 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.8 1999/11/17 17:50:22 joel Exp + */ + +#ifndef __RTEMS_POSIX_THREADS_inl +#define __RTEMS_POSIX_THREADS_inl + +/*PAGE + * + * _POSIX_Threads_Allocate + */ + +RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) +{ + return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); +} + +/*PAGE + * + * _POSIX_Threads_Free + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( + Thread_Control *the_pthread +) +{ + _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); +} + +/*PAGE + * + * _POSIX_Threads_Get + */ + +RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get ( + pthread_t id, + Objects_Locations *location +) +{ + return (Thread_Control *) + _Objects_Get( &_POSIX_Threads_Information, (Objects_Id)id, location ); +} + +/*PAGE + * + * _POSIX_Threads_Is_null + */ + +RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null ( + Thread_Control *the_pthread +) +{ + return !the_pthread; +} + +#endif +/* end of include file */ + Index: inline/rtems/posix/key.inl =================================================================== --- inline/rtems/posix/key.inl (nonexistent) +++ inline/rtems/posix/key.inl (revision 1765) @@ -0,0 +1,69 @@ +/* rtems/posix/key.inl + * + * This include file contains the static inline 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.7 1999/11/17 17:50:22 joel Exp + */ + +#ifndef __RTEMS_POSIX_KEY_inl +#define __RTEMS_POSIX_KEY_inl + +/*PAGE + * + * _POSIX_Keys_Allocate + */ + +RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void ) +{ + return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information ); +} + +/*PAGE + * + * _POSIX_Keys_Free + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( + POSIX_Keys_Control *the_key +) +{ + _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); +} + +/*PAGE + * + * _POSIX_Keys_Get + */ + +RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (POSIX_Keys_Control *) + _Objects_Get( &_POSIX_Keys_Information, id, location ); +} + +/*PAGE + * + * _POSIX_Keys_Is_null + */ + +RTEMS_INLINE_ROUTINE boolean _POSIX_Keys_Is_null ( + POSIX_Keys_Control *the_key +) +{ + return !the_key; +} + +#endif +/* end of include file */ + Index: inline/rtems/posix/intr.inl =================================================================== --- inline/rtems/posix/intr.inl (nonexistent) +++ inline/rtems/posix/intr.inl (revision 1765) @@ -0,0 +1,71 @@ +/* rtems/posix/intr.inl + * + * This include file contains the static inline 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.7 1999/11/17 17:50:22 joel Exp + */ + +#ifndef __RTEMS_POSIX_INTERRUPT_inl +#define __RTEMS_POSIX_INTERRUPT_inl + +/*PAGE + * + * _POSIX_Interrupt_Allocate + */ + +RTEMS_INLINE_ROUTINE POSIX_Interrupt_Handler_control * + _POSIX_Interrupt_Allocate( void ) +{ + return (POSIX_Interrupt_Handler_control *) + _Objects_Allocate( &_POSIX_Interrupt_Handlers_Information ); +} + +/*PAGE + * + * _POSIX_Interrupt_Free + */ + +RTEMS_INLINE_ROUTINE void _POSIX_Interrupt_Free ( + POSIX_Interrupt_Handler_control *the_intr +) +{ + _Objects_Free( &_POSIX_Interrupt_Handlers_Information, &the_intr->Object ); +} + +/*PAGE + * + * _POSIX_Interrupt_Get + */ + +RTEMS_INLINE_ROUTINE POSIX_Interrupt_Control *_POSIX_Interrupt_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (POSIX_Interrupt_Control *) + _Objects_Get( &_POSIX_Interrupt_Handlers_Information, id, location ); +} + +/*PAGE + * + * _POSIX_Interrupt_Is_null + */ + +RTEMS_INLINE_ROUTINE boolean _POSIX_Interrupt_Is_null ( + POSIX_Interrupt_Handler_control *the_intr +) +{ + return !the_intr; +} + +#endif +/* end of include file */ + Index: inline/rtems/posix =================================================================== --- inline/rtems/posix (nonexistent) +++ inline/rtems/posix (revision 1765)
inline/rtems/posix Property changes : Added: svn:ignore ## -0,0 +1,2 ## +Makefile +Makefile.in Index: inline/rtems =================================================================== --- inline/rtems (nonexistent) +++ inline/rtems (revision 1765)
inline/rtems Property changes : Added: svn:ignore ## -0,0 +1,2 ## +Makefile +Makefile.in Index: inline/Makefile.in =================================================================== --- inline/Makefile.in (nonexistent) +++ inline/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 + +@INLINE_TRUE@noinst_HEADERS = rtems/posix/intr.inl +@INLINE_TRUE@include_rtems_posix_HEADERS = rtems/posix/cond.inl rtems/posix/key.inl \ +@INLINE_TRUE@ rtems/posix/mqueue.inl rtems/posix/mutex.inl \ +@INLINE_TRUE@ rtems/posix/pthread.inl rtems/posix/priority.inl \ +@INLINE_TRUE@ rtems/posix/semaphore.inl rtems/posix/timer.inl + + +@INLINE_TRUE@PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems/posix \ +@INLINE_TRUE@ $(include_rtems_posix_HEADERS:%=$(PROJECT_INCLUDE)/%) + + +PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools +subdir = inline +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 inline/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: inline/Makefile.am =================================================================== --- inline/Makefile.am (nonexistent) +++ inline/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 INLINE +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: inline =================================================================== --- inline (nonexistent) +++ inline (revision 1765)
inline Property changes : Added: svn:ignore ## -0,0 +1,2 ## +Makefile +Makefile.in Index: configure =================================================================== --- configure (nonexistent) +++ configure (revision 1765) @@ -0,0 +1,4226 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52 for rtems-c-src-exec-posix ss-20020528. +# +# Report bugs to . +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +ac_unique_file="src/pthread.c" +ac_default_prefix=/opt/rtems + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Identity of this package. +PACKAGE_NAME='rtems-c-src-exec-posix' +PACKAGE_TARNAME='rtems-c-src-exec-posix' +PACKAGE_VERSION='ss-20020528' +PACKAGE_STRING='rtems-c-src-exec-posix ss-20020528' +PACKAGE_BUGREPORT='rtems-bugs@OARcorp.com' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_RTEMS_BSP_set=${RTEMS_BSP+set} +ac_env_RTEMS_BSP_value=$RTEMS_BSP +ac_cv_env_RTEMS_BSP_set=${RTEMS_BSP+set} +ac_cv_env_RTEMS_BSP_value=$RTEMS_BSP +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF +rtems-c-src-exec-posix configure ss-20020528 +generated by GNU Autoconf 2.52 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:859: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + cat "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:870: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:878: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:894: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:898: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:904: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:906: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:908: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:927: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:929: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:949: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:952: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + +for ac_prog in gmake make +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:965: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MAKE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$MAKE"; then + ac_cv_prog_MAKE="$MAKE" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAKE="$ac_prog" +echo "$as_me:980: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +MAKE=$ac_cv_prog_MAKE +if test -n "$MAKE"; then + echo "$as_me:988: result: $MAKE" >&5 +echo "${ECHO_T}$MAKE" >&6 +else + echo "$as_me:991: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$MAKE" && break +done + +ENDIF=endif + +RTEMS_TOPdir="../.."; + +test -n "$with_target_subdir" || with_target_subdir="." + +if test "$with_target_subdir" = "." ; then +# Native +PROJECT_TOPdir="${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +else +# Cross +dots=`echo $with_target_subdir|\ +sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` +PROJECT_TOPdir="${dots}${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +fi + +PROJECT_ROOT="${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" + +echo "$as_me:1016: checking for RTEMS Version" >&5 +echo $ECHO_N "checking for RTEMS Version... $ECHO_C" >&6 +if test -r "${srcdir}/${RTEMS_TOPdir}/cpukit/aclocal/version.m4"; then + : +else + { { echo "$as_me:1021: error: Unable to find ${RTEMS_TOPdir}/cpukit/aclocal/version.m4" >&5 +echo "$as_me: error: Unable to find ${RTEMS_TOPdir}/cpukit/aclocal/version.m4" >&2;} + { (exit 1); exit 1; }; } +fi + +echo "$as_me:1026: result: ss-20020528" >&5 +echo "${ECHO_T}ss-20020528" >&6 + +ac_aux_dir= +for ac_dir in ../.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:1046: error: cannot find install-sh or install.sh in ../.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in ../.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:1056: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:1060: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:1069: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:1073: error: $ac_config_sub $ac_cv_build_alias failed." >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1078: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:1085: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:1094: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1099: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:1106: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:1115: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1120: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +echo "$as_me:1133: checking rtems target cpu" >&5 +echo $ECHO_N "checking rtems target cpu... $ECHO_C" >&6 +case "${target}" in + # hpux unix port should go here + i[34567]86-*linux*) # unix "simulator" port + RTEMS_CPU=unix + ;; + i[34567]86-*freebsd*) # unix "simulator" port + RTEMS_CPU=unix + ;; + i[34567]86-pc-cygwin*) # Cygwin is just enough unix like :) + RTEMS_CPU=unix + ;; + no_cpu-*rtems*) + RTEMS_CPU=no_cpu + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_CPU=unix + ;; + *) + RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` + ;; +esac + +echo "$as_me:1157: result: $RTEMS_CPU" >&5 +echo "${ECHO_T}$RTEMS_CPU" >&6 + +am__api_version="1.6" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:1173: checking for a BSD compatible install" >&5 +echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_IFS=$IFS; IFS=$ac_path_separator + for ac_dir in $PATH; do + IFS=$ac_save_IFS + # Account for people who put trailing slashes in PATH elements. + case $ac_dir/ in + / | ./ | .// | /cC/* \ + | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ + | /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if $as_executable_p "$ac_dir/$ac_prog"; then + if test $ac_prog = install && + grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:1222: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:1233: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:1257: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:1270: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:1276: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:1300: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +for ac_prog in mawk gawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1308: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AWK="$ac_prog" +echo "$as_me:1323: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:1331: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:1334: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:1341: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:1361: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:1365: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + # test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:1373: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# Define the identity of the package. + PACKAGE=rtems-c-src-exec-posix + VERSION=ss-20020528 + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:1406: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_STRIP="${ac_tool_prefix}strip" +echo "$as_me:1421: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:1429: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:1432: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:1441: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_STRIP="strip" +echo "$as_me:1456: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:1465: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:1468: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + +echo "$as_me:1483: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:1492: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + +# Check whether --enable-posix or --disable-posix was given. +if test "${enable_posix+set}" = set; then + enableval="$enable_posix" + case "${enableval}" in + yes) RTEMS_HAS_POSIX_API=yes ;; + no) RTEMS_HAS_POSIX_API=no ;; + *) { { echo "$as_me:1511: error: bad value ${enableval} for enable-posix option" >&5 +echo "$as_me: error: bad value ${enableval} for enable-posix option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + RTEMS_HAS_POSIX_API=yes +fi; + +case "${host}" in + # hpux unix port should go here + i[34567]86-pc-linux*) # unix "simulator" port + RTEMS_HAS_POSIX_API=no + ;; + i[34567]86-*freebsd*) # unix "simulator" port + RTEMS_HAS_POSIX_API=no + ;; + no_cpu-*rtems*) + RTEMS_HAS_POSIX_API=no + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_HAS_POSIX_API=no + ;; + *) + ;; +esac + +# Check whether --enable-rtems-inlines or --disable-rtems-inlines was given. +if test "${enable_rtems_inlines+set}" = set; then + enableval="$enable_rtems_inlines" + case "${enableval}" in + yes) RTEMS_USE_MACROS=no ;; + no) RTEMS_USE_MACROS=yes ;; + *) { { echo "$as_me:1543: error: bad value ${enableval} for disable-rtems-inlines option" >&5 +echo "$as_me: error: bad value ${enableval} for disable-rtems-inlines option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + RTEMS_USE_MACROS=no +fi; + +if test x"${RTEMS_USE_MACROS}" = x"yes"; +then + +cat >>confdefs.h <>confdefs.h <&5 +echo "$as_me: error: bad value ${enableval} for multilib option" >&2;} + { (exit 1); exit 1; }; } ;; + esac +else + multilib=no +fi; + +if test x"${multilib}" = x"yes"; then + MULTILIB_TRUE= + MULTILIB_FALSE='#' +else + MULTILIB_TRUE='#' + MULTILIB_FALSE= +fi + +if test x"$multilib" = x"yes"; then + if test -n "$with_multisubdir"; then + MULTIBUILDTOP=`echo "/$with_multisubdir" | sed 's,/[^\\/]*,../,g'` +fi + + if test -n "$with_multisubdir"; then + MULTISUBDIR="/$with_multisubdir" +fi + + GCC_SPECS="-isystem \$(PROJECT_INCLUDE)" + + PROJECT_INCLUDE="\$(PROJECT_ROOT)/lib/include" + + project_libdir="\$(PROJECT_ROOT)/lib" + + RTEMS_ROOT="${PROJECT_ROOT}" + + includedir="\${exec_prefix}/lib/include" + libdir="${libdir}\$(MULTISUBDIR)" +else + +echo "$as_me:1609: checking for RTEMS_BSP" >&5 +echo $ECHO_N "checking for RTEMS_BSP... $ECHO_C" >&6 +if test "${rtems_cv_RTEMS_BSP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP"; + +fi +if test -z "$rtems_cv_RTEMS_BSP"; then + { { echo "$as_me:1618: error: Missing RTEMS_BSP" >&5 +echo "$as_me: error: Missing RTEMS_BSP" >&2;} + { (exit 1); exit 1; }; } +fi +RTEMS_BSP="$rtems_cv_RTEMS_BSP" +echo "$as_me:1623: result: ${RTEMS_BSP}" >&5 +echo "${ECHO_T}${RTEMS_BSP}" >&6 + +PROJECT_INCLUDE="\$(PROJECT_ROOT)/$RTEMS_BSP/lib/include" + +project_libdir="${PROJECT_ROOT}/$RTEMS_BSP/lib" + +RTEMS_ROOT="$PROJECT_ROOT/c/$RTEMS_BSP" + +GCC_SPECS="-isystem \$(PROJECT_INCLUDE)" + +# Check whether --enable-bare-cpu-cflags or --disable-bare-cpu-cflags was given. +if test "${enable_bare_cpu_cflags+set}" = set; then + enableval="$enable_bare_cpu_cflags" + case "${enableval}" in + no) BARE_CPU_CFLAGS="" ;; + *) BARE_CPU_CFLAGS="${enableval}" ;; +esac +else + BARE_CPU_CFLAGS="" +fi; + +# Check whether --enable-bare-cpu-model or --disable-bare-cpu-model was given. +if test "${enable_bare_cpu_model+set}" = set; then + enableval="$enable_bare_cpu_model" + case "${enableval}" in + no) BARE_CPU_MODEL="" ;; + *) BARE_CPU_MODEL="${enableval}" ;; +esac +else + BARE_CPU_MODEL="" +fi; + +if false; then + MULTILIB_TRUE= + MULTILIB_FALSE='#' +else + MULTILIB_TRUE='#' + MULTILIB_FALSE= +fi + +includedir="\${exec_prefix}/${RTEMS_BSP}/lib/include" +libdir="\${exec_prefix}/${RTEMS_BSP}/lib" + +echo "$as_me:1667: checking for make/custom/$RTEMS_BSP.cfg" >&5 +echo $ECHO_N "checking for make/custom/$RTEMS_BSP.cfg... $ECHO_C" >&6 +if test -r "$srcdir/$RTEMS_TOPdir/make/custom/$RTEMS_BSP.cfg"; then + echo "$as_me:1670: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + { { echo "$as_me:1673: error: no" >&5 +echo "$as_me: error: no" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +# Is this a supported CPU? +echo "$as_me:1681: checking if cpu $RTEMS_CPU is supported" >&5 +echo $ECHO_N "checking if cpu $RTEMS_CPU is supported... $ECHO_C" >&6 +if test -d "$srcdir/$RTEMS_TOPdir/cpukit/score/cpu/$RTEMS_CPU"; then + echo "$as_me:1684: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + { { echo "$as_me:1687: error: no" >&5 +echo "$as_me: error: no" >&2;} + { (exit 1); exit 1; }; } +fi + +RTEMS_HOST=$host_os +case "${target}" in + # hpux unix port should go here + i[34567]86-*linux*) # unix "simulator" port + RTEMS_HOST=Linux + ;; + i[34567]86-*freebsd*) # unix "simulator" port + RTEMS_HOST=FreeBSD + ;; + i[34567]86-pc-cygwin*) # Cygwin is just enough unix like :) + RTEMS_HOST=Cygwin + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_HOST=Solaris + ;; + *) + ;; +esac + +rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null + +ac_config_commands="$ac_config_commands depfiles" + +am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:1729: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + +echo "$as_me:1756: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + if test "x$build_alias" != "x$host_alias"; then + rtems_tool_prefix=${ac_tool_prefix} +fi + + # Extract the first word of "${rtems_tool_prefix}gcc", so it can be a program name with args. +set dummy ${rtems_tool_prefix}gcc; ac_word=$2 +echo "$as_me:1784: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${rtems_tool_prefix}gcc" +echo "$as_me:1799: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1807: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1810: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +test -z "$CC" && \ + { { echo "$as_me:1815: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:1826: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}gcc" +echo "$as_me:1841: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1849: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1852: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:1861: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1876: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1884: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1887: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:1900: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}cc" +echo "$as_me:1915: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1923: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1926: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1935: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1950: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1958: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1961: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1974: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1994: found $ac_dir/$ac_word" >&5 +break +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:2016: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:2019: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:2030: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +echo "$as_me:2045: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:2053: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:2056: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:2069: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="$ac_prog" +echo "$as_me:2084: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:2092: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:2095: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:2107: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:2112:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:2115: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:2118: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2120: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:2123: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2125: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:2128: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 2132 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:2148: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:2151: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:2154: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:2177: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:2183: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:2188: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:2194: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2197: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:2204: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:2212: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:2219: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:2221: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:2224: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:2226: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2229: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:2245: error: cannot compute EXEEXT: cannot compile and link" >&5 +echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:2251: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:2257: checking for object suffix" >&5 +echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2263 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:2275: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2278: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:2290: error: cannot compute OBJEXT: cannot compile" >&5 +echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:2297: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:2301: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2307 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2322: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2325: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2328: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2331: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:2343: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:2349: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2355 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2367: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2370: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2373: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2376: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2386: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2413: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2416: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2419: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2422: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 2434 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2447: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2450: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2453: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2456: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 2466 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2478: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2481: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2484: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2487: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +echo "$as_me:2516: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:2578: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:2587: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 2608 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:2613: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2619: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 2642 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2646: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2652: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:2689: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 2699 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:2704: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2710: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 2733 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2737: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2743: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:2771: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test x"$GCC" = x"yes"; then + RTEMS_USE_GCC_TRUE= + RTEMS_USE_GCC_FALSE='#' +else + RTEMS_USE_GCC_TRUE='#' + RTEMS_USE_GCC_FALSE= +fi + +echo "$as_me:2790: checking whether $CC accepts -specs" >&5 +echo $ECHO_N "checking whether $CC accepts -specs... $ECHO_C" >&6 +if test "${rtems_cv_gcc_specs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +rtems_cv_gcc_specs=no +if test x"$GCC" = x"yes"; then + touch confspec + echo 'void f(){}' >conftest.c + if test -z "`${CC} -specs confspec -c conftest.c 2>&1`";then + rtems_cv_gcc_specs=yes + fi +fi +rm -f confspec conftest* + +fi +echo "$as_me:2807: result: $rtems_cv_gcc_specs" >&5 +echo "${ECHO_T}$rtems_cv_gcc_specs" >&6 + +echo "$as_me:2810: checking whether $CC accepts --pipe" >&5 +echo $ECHO_N "checking whether $CC accepts --pipe... $ECHO_C" >&6 +if test "${rtems_cv_gcc_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +rtems_cv_gcc_pipe=no +if test x"$GCC" = x"yes"; then + echo 'void f(){}' >conftest.c + if test -z "`${CC} --pipe -c conftest.c 2>&1`";then + rtems_cv_gcc_pipe=yes + fi + rm -f conftest* +fi + +fi +echo "$as_me:2826: result: $rtems_cv_gcc_pipe" >&5 +echo "${ECHO_T}$rtems_cv_gcc_pipe" >&6 + +test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe" + +if test "$GCC" = yes; then + +CPPFLAGS="$CPPFLAGS -ansi -fasm" + +CFLAGS="-g -Wall" +fi + +#case $build_os in +#*cygwin*) GCCSED="| sed 's%\\\\%/%g'" ;; +#*) ;; +#esac + + if test "x$build_alias" != "x$host_alias"; then + rtems_tool_prefix=${ac_tool_prefix} +fi + + # Extract the first word of "${rtems_tool_prefix}ar", so it can be a program name with args. +set dummy ${rtems_tool_prefix}ar; ac_word=$2 +echo "$as_me:2849: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AR="${rtems_tool_prefix}ar" +echo "$as_me:2864: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="no" +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:2873: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:2876: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test "x$build_alias" != "x$host_alias"; then + rtems_tool_prefix=${ac_tool_prefix} +fi + + # Extract the first word of "${rtems_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${rtems_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:2886: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_RANLIB="${rtems_tool_prefix}ranlib" +echo "$as_me:2901: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:2910: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:2913: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:2920: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" +echo "$as_me:2935: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:2943: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:2946: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:2955: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_RANLIB="ranlib" +echo "$as_me:2970: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:2979: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:2982: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +# Check whether --enable-multiprocessing or --disable-multiprocessing was given. +if test "${enable_multiprocessing+set}" = set; then + enableval="$enable_multiprocessing" + case "${enable_multiprocessing}" in + yes) ;; + no) ;; + *) { { echo "$as_me:2997: error: bad value ${enableval} for enable-multiprocessing option" >&5 +echo "$as_me: error: bad value ${enableval} for enable-multiprocessing option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + enable_multiprocessing=no +fi; + +if test "$enable_multiprocessing" = "yes"; then + HAS_MP="yes" +else + HAS_MP="no" +fi + +echo "$as_me:3011: checking whether CPU supports libposix" >&5 +echo $ECHO_N "checking whether CPU supports libposix... $ECHO_C" >&6 +if test "${rtems_cv_HAS_POSIX_API+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$RTEMS_CPU" in + unix*) + rtems_cv_HAS_POSIX_API="no" + ;; + *) + if test "${RTEMS_HAS_POSIX_API}" = "yes"; then + rtems_cv_HAS_POSIX_API="yes"; + else + rtems_cv_HAS_POSIX_API="disabled"; + fi + ;; + esac +fi +echo "$as_me:3029: result: $rtems_cv_HAS_POSIX_API" >&5 +echo "${ECHO_T}$rtems_cv_HAS_POSIX_API" >&6 +if test "$rtems_cv_HAS_POSIX_API" = "yes"; then + HAS_POSIX_API="yes"; +else + HAS_POSIX_API="no"; +fi + +# If RTEMS macros are enabled, then use them. Otherwise, use inlines. +if test "$RTEMS_USE_MACROS" = "yes"; then + INLINEdir="macros" +else + INLINEdir="inline" +fi + +if test "$INLINEdir" = "inline" ; then + INLINE_TRUE= + INLINE_FALSE='#' +else + INLINE_TRUE='#' + INLINE_FALSE= +fi + +if test "$INLINEdir" = "macros" ; then + MACROS_TRUE= + MACROS_FALSE='#' +else + MACROS_TRUE='#' + MACROS_FALSE= +fi + +if test "$HAS_MP" = "yes" ; then + HAS_MP_TRUE= + HAS_MP_FALSE='#' +else + HAS_MP_TRUE='#' + HAS_MP_FALSE= +fi + +## Needed when using automake for libs/rels + +echo "$as_me:3070: checking for RTEMS newlib" >&5 +echo $ECHO_N "checking for RTEMS newlib... $ECHO_C" >&6 +if test "${rtems_cv_use_newlib+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line 3077 "configure" +#include "confdefs.h" +extern void not_required_by_rtems() ; +int +main () +{ +not_required_by_rtems() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3089: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3092: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3095: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3098: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + rtems_cv_use_newlib="yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + if test -z "$rtems_cv_use_newlib"; then + cat >conftest.$ac_ext <<_ACEOF +#line 3109 "configure" +#include "confdefs.h" +extern void rtems_provides_crt0() ; +int +main () +{ +rtems_provides_crt0() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3121: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3124: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3127: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3130: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + rtems_cv_use_newlib="yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +rtems_cv_use_newlib="no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi + +fi +echo "$as_me:3143: result: $rtems_cv_use_newlib" >&5 +echo "${ECHO_T}$rtems_cv_use_newlib" >&6 + RTEMS_USE_NEWLIB="$rtems_cv_use_newlib" + + if test x"${RTEMS_USE_NEWLIB}" = x"yes"; then + +cat >>confdefs.h <&5 +echo "$as_me: error: libposix is not supported by this configuration" >&2;} + { (exit 1); exit 1; }; } +fi + +# Add the stamp file to the list of files AC keeps track of, +# along with our hook. +ac_config_headers="$ac_config_headers src/config.h" + +# Explicitly list all Makefiles here +ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile inline/Makefile macros/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:3246: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${MULTILIB_TRUE}" && test -z "${MULTILIB_FALSE}"; then + { { echo "$as_me:3253: error: conditional \"MULTILIB\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MULTILIB\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${MULTILIB_TRUE}" && test -z "${MULTILIB_FALSE}"; then + { { echo "$as_me:3260: error: conditional \"MULTILIB\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MULTILIB\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:3267: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${RTEMS_USE_GCC_TRUE}" && test -z "${RTEMS_USE_GCC_FALSE}"; then + { { echo "$as_me:3274: error: conditional \"RTEMS_USE_GCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"RTEMS_USE_GCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${INLINE_TRUE}" && test -z "${INLINE_FALSE}"; then + { { echo "$as_me:3281: error: conditional \"INLINE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"INLINE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${MACROS_TRUE}" && test -z "${MACROS_FALSE}"; then + { { echo "$as_me:3288: error: conditional \"MACROS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MACROS\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAS_MP_TRUE}" && test -z "${HAS_MP_FALSE}"; then + { { echo "$as_me:3295: error: conditional \"HAS_MP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAS_MP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:3305: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:3481: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:3500: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me (rtems-c-src-exec-posix ss-20020528) 2.52, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "inline/Makefile" ) CONFIG_FILES="$CONFIG_FILES inline/Makefile" ;; + "macros/Makefile" ) CONFIG_FILES="$CONFIG_FILES macros/Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; + *) { { echo "$as_me:3551: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@MAKE@,$MAKE,;t t +s,@ENDIF@,$ENDIF,;t t +s,@RTEMS_TOPdir@,$RTEMS_TOPdir,;t t +s,@PROJECT_TOPdir@,$PROJECT_TOPdir,;t t +s,@PROJECT_ROOT@,$PROJECT_ROOT,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@RTEMS_CPU@,$RTEMS_CPU,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@RTEMS_HAS_POSIX_API@,$RTEMS_HAS_POSIX_API,;t t +s,@RTEMS_USE_MACROS@,$RTEMS_USE_MACROS,;t t +s,@MULTILIB_TRUE@,$MULTILIB_TRUE,;t t +s,@MULTILIB_FALSE@,$MULTILIB_FALSE,;t t +s,@MULTIBUILDTOP@,$MULTIBUILDTOP,;t t +s,@MULTISUBDIR@,$MULTISUBDIR,;t t +s,@GCC_SPECS@,$GCC_SPECS,;t t +s,@PROJECT_INCLUDE@,$PROJECT_INCLUDE,;t t +s,@project_libdir@,$project_libdir,;t t +s,@RTEMS_ROOT@,$RTEMS_ROOT,;t t +s,@RTEMS_BSP@,$RTEMS_BSP,;t t +s,@BARE_CPU_MODEL@,$BARE_CPU_MODEL,;t t +s,@BARE_CPU_CFLAGS@,$BARE_CPU_CFLAGS,;t t +s,@RTEMS_HOST@,$RTEMS_HOST,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@CPP@,$CPP,;t t +s,@RTEMS_USE_GCC_TRUE@,$RTEMS_USE_GCC_TRUE,;t t +s,@RTEMS_USE_GCC_FALSE@,$RTEMS_USE_GCC_FALSE,;t t +s,@GCCSED@,$GCCSED,;t t +s,@AR@,$AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@HAS_POSIX_API@,$HAS_POSIX_API,;t t +s,@INLINE_TRUE@,$INLINE_TRUE,;t t +s,@INLINE_FALSE@,$INLINE_FALSE,;t t +s,@MACROS_TRUE@,$MACROS_TRUE,;t t +s,@MACROS_FALSE@,$MACROS_FALSE,;t t +s,@HAS_MP_TRUE@,$HAS_MP_TRUE,;t t +s,@HAS_MP_FALSE@,$HAS_MP_FALSE,;t t +s,@RTEMS_USE_NEWLIB@,$RTEMS_USE_NEWLIB,;t t +CEOF + +EOF + + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` + else + ac_dir_suffix= ac_dots= + fi + + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_dots$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:3828: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:3846: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:3859: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:3920: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:3931: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:3944: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +EOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\EOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +EOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\EOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +EOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # egrep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\EOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated automatically by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:4061: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + fi + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi + # Run the commands associated with the file. + case $ac_file in + src/config.h ) # update the timestamp +echo 'timestamp for src/config.h' >"src/stamp-h1" + ;; + esac +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case $dirpart/$fdir in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy=$dirpart/$fdir +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +EOF + +cat >>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi +
configure Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: Makefile.in =================================================================== --- Makefile.in (nonexistent) +++ Makefile.in (revision 1765) @@ -0,0 +1,491 @@ +# 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@ + +ACLOCAL_AMFLAGS = -I ../aclocal + +SUBDIRS = include inline macros src + +PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_HEADER = $(top_builddir)/src/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = ../../COPYING ../../ChangeLog ../../INSTALL ../../README \ + ../../acinclude.m4 ../../config.guess ../../config.sub \ + ../../configure ../../configure.ac ../../depcomp \ + ../../install-sh ../../missing ../../mkinstalldirs ChangeLog \ + Makefile.am Makefile.in aclocal.m4 configure configure.ac +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: + +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/../automake/subdirs.am $(top_srcdir)/../automake/local.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.ac ../aclocal/bsp-alias.m4 ../aclocal/canonical-host.m4 ../aclocal/canonical-target-name.m4 ../aclocal/canonicalize-tools.m4 ../aclocal/check-bsp-cache.m4 ../aclocal/check-bsps.m4 ../aclocal/check-cpu.m4 ../aclocal/check-itron.m4 ../aclocal/check-multiprocessing.m4 ../aclocal/check-networking.m4 ../aclocal/check-newlib.m4 ../aclocal/check-posix.m4 ../aclocal/check-tool.m4 ../aclocal/enable-bare.m4 ../aclocal/enable-inlines.m4 ../aclocal/enable-itron.m4 ../aclocal/enable-multiprocessing.m4 ../aclocal/enable-networking.m4 ../aclocal/enable-posix.m4 ../aclocal/enable-rtemsbsp.m4 ../aclocal/env-rtemsbsp.m4 ../aclocal/env-rtemscpu.m4 ../aclocal/gcc-pipe.m4 ../aclocal/gcc-specs.m4 ../aclocal/multi.m4 ../aclocal/multilib.m4 ../aclocal/prog-cc.m4 ../aclocal/prog-ccas.m4 ../aclocal/rtems-cpu-subdirs.m4 ../aclocal/rtems-debug.m4 ../aclocal/rtems-top.m4 ../aclocal/sysv-ipc.m4 ../aclocal/tool-paths.m4 ../aclocal/version.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + 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: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + 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 = $(PACKAGE)-$(VERSION) + +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + +GZIP_ENV = --best +distcleancheck_listfiles = find . -type f -print + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/../.. + @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 + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + find $$dc_install_base -type f -print ; \ + exit 1; } >&2 ) \ + && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ + && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +distcleancheck: distclean + if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +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-recursive + +clean-am: clean-generic clean-local mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +distclean-am: clean-am distclean-generic distclean-local distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf autom4te.cache +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-local clean-recursive dist dist-all \ + dist-gzip distcheck distclean distclean-generic distclean-local \ + distclean-recursive distclean-tags distcleancheck distdir dvi \ + dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive tags tags-recursive uninstall \ + uninstall-am uninstall-info-am uninstall-info-recursive \ + uninstall-recursive + + +depend-recursive \ +preinstall-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +preinstall: preinstall-recursive +.PHONY: preinstall-recursive + +depend: depend-recursive +.PHONY: depend-recursive + +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: configure.ac =================================================================== --- configure.ac (nonexistent) +++ configure.ac (revision 1765) @@ -0,0 +1,58 @@ +## Process this file with autoconf to produce a configure script. +## +## configure.ac,v 1.9 2002/07/05 15:53:56 ralf Exp + +AC_PREREQ(2.52) +AC_INIT([rtems-c-src-exec-posix],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) +AC_CONFIG_SRCDIR([src/pthread.c]) +RTEMS_TOP(../..) +AC_CONFIG_AUX_DIR(../..) + +RTEMS_CANONICAL_TARGET_CPU + +AM_INIT_AUTOMAKE([no-define foreign 1.6]) +AM_MAINTAINER_MODE + +RTEMS_ENABLE_POSIX +RTEMS_ENABLE_INLINES + +RTEMS_ENV_RTEMSCPU + +RTEMS_CHECK_CPU +RTEMS_CANONICAL_HOST + +RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) +RTEMS_CANONICALIZE_TOOLS +AC_PROG_RANLIB + +RTEMS_CHECK_MULTIPROCESSING +RTEMS_CHECK_POSIX_API + +# If RTEMS macros are enabled, then use them. Otherwise, use inlines. +if test "$RTEMS_USE_MACROS" = "yes"; then + INLINEdir="macros" +else + INLINEdir="inline" +fi +AM_CONDITIONAL(INLINE,test "$INLINEdir" = "inline" ) +AM_CONDITIONAL(MACROS,test "$INLINEdir" = "macros" ) +AM_CONDITIONAL(HAS_MP,test "$HAS_MP" = "yes" ) + +## Needed when using automake for libs/rels +RTEMS_CHECK_NEWLIB + +## Refuse to build if bsp does not support libposix +if test "$HAS_POSIX_API" != "yes"; then +AC_MSG_ERROR([libposix is not supported by this configuration]) +fi + +AM_CONFIG_HEADER(src/config.h) + +# Explicitly list all Makefiles here +AC_CONFIG_FILES([Makefile +src/Makefile +include/Makefile +inline/Makefile +macros/Makefile +]) +AC_OUTPUT Index: ChangeLog =================================================================== --- ChangeLog (nonexistent) +++ ChangeLog (revision 1765) @@ -0,0 +1,391 @@ +2002-07-31 Ralf Corsepius + + * src/mqueuecreatesupp.c: #include (malloc). + +2002-07-22 Ralf Corsepius + + * src/Makefile.am: Use .$(OBJEXT) instead of .o. + +2002-07-22 Ralf Corsepius + + * src/Makefile.am: Use AM_CPPFLAGS instead of INCLUDES. + +2002-07-05 Joel Sherrill + + * include/rtems/posix/cancel.h, src/cancel.c, src/cancelrun.c, + src/mqueue.c, src/pthread.c, src/semaphore.c, src/setcancelstate.c, + src/setcanceltype.c, src/testcancel.c: Per PR164, corrected the + behavior of thread cancellation and did some cleanup as a side-effect. + +2002-07-05 Ralf Corsepius + + * configure.ac: RTEMS_TOP(../..). + +2002-07-01 Joel Sherrill + + * Mega patch merge to change the format of the object IDs to + loosen the dependency between the SCORE and the various APIs. + There was considerable work to simplify the object name management + and it appears that the name_table field is no longer needed. + This patch also includes the addition of the internal mutex + which is currently only used to protect some types of allocation + and deallocation. This significantly can reduce context + switch latency under certain circumstances. In particular, + some heap/region operations were O(n) and had dispatching + disabled. This should help enormously. With this merge, + the patch is not as clean as it should be. In particular, + the documentation has not been modified to reflect the new object + ID layout, the IDs in the test screens are not updated, and + _Objects_Get_information needs to be a real routine not inlined. + As part of this patch a lot of MP code for thread/proxy blocking + was made conditional and cleaned up. + * include/rtems/posix/key.h, src/cond.c, src/condinit.c, src/intr.c, + src/key.c, src/keycreate.c, src/keydelete.c, src/killinfo.c, + src/mqueue.c, src/mqueuecreatesupp.c, src/mutex.c, src/mutexinit.c, + src/psignal.c, src/pthread.c, src/semaphore.c, + src/semaphorecreatesupp.c: Modified as part of above. + +2002-07-01 Ralf Corsepius + + * configure.ac: Remove RTEMS_PROJECT_ROOT. + +2002-06-27 Ralf Corsepius + + * configure.ac: Use AC_CONFIG_AUX_DIR(../..). + Add AC_PROG_RANLIB. + +2002-06-26 Ralf Corsepius + + * configure.ac: Remove references to RTEMS_BSP. + * src/Makefile.am: Add libposix.a. + +2002-06-17 Ralf Corsepius + + * include/Makefile.am: Include $(top_srcdir)/../automake/*.am. + * Makefile.am: Include $(top_srcdir)/../automake/*.am. + Use ../aclocal. + * inline/Makefile.am: Include $(top_srcdir)/../automake/*.am. + * macros/Makefile.am: Include $(top_srcdir)/../automake/*.am. + * src/Makefile.am: Include $(top_srcdir)/../automake/*.am. + +2001-05-17 Joel Sherrill + + * macros/rtems/posix/mqueue.inl: Implemented missing routines + to support message queue FDs. + +2002-05-03 Ralf Corsepius + + * include/sys/utsname.h: Remove. + * include/Makefile.am: Reflect changes above. + * src/utsname.c: Remove. + * src/Makefile.am: Reflect changes above. + +2001-04-26 Joel Sherrill + + * include/rtems/posix/mqueue.h, inline/rtems/posix/mqueue.inl, + src/mqueue.c, src/mqueueclose.c, src/mqueuecreatesupp.c, + src/mqueuegetattr.c, src/mqueuenotify.c, src/mqueueopen.c, + src/mqueuerecvsupp.c, src/mqueuesendsupp.c, src/mqueuesetattr.c: + Per PR81 reworked to add a message queue descriptor separate from + the underlying message queue. This allows non-blocking to follow + the "open" not the underlying queue. + +2002-04-06 Ralf Corsepius + + * src/psignal.c: Include . + +2002-04-08 Chris Johns + + * Per PR142, make task switch extension its own list. + * src/pthread.c (_POSIX_Threads_User_extensions): Reflect above. + +2002-04-02 Ralf Corsepius + + * src/getegid.c: Remove . + * src/geteuid.c: Ditto. + * src/getgid.c: Ditto. + * src/getuid.c: Ditto. + * src/getlogin.c: Move . + +2002-03-27 Ralf Corsepius + + * configure.ac: + AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). + AM_INIT_AUTOMAKE([no-define foreign 1.6]). + * src/Makefile.am: Remove AUTOMAKE_OPTIONS. + * Makefile.am: Remove AUTOMAKE_OPTIONS. + * include/Makefile.am: Remove AUTOMAKE_OPTIONS. + * inline/Makefile.am: Remove AUTOMAKE_OPTIONS. + * macros/Makefile.am: Remove AUTOMAKE_OPTIONS. + +2002-03-01 Eric Norum + + * src/pthreadonce.c: Task is not preemptable while running a + pthread_once init function. This is slightly less heavy handed + than disabling dispatching and seems better than consuming a mutex. + +2002-02-09 Ralf Corsepius + + * src/getegid.c: Add #include . + Remove #include . + * src/geteuid.c: Ditto. + * src/getgid.c: Ditto. + * src/getlogin.c: Ditto. + * src/getuid.c: Ditto. + + +2001-01-16 Joel Sherrill + + * inline/rtems/posix/mutex.inl (_POSIX_Mutex_Get_support): Corrected + name of routine in header. + +2002-01-07 Joel Sherrill + + * optman/, optman/.cvsignore, optman/Makefile.am: Removed entire + contents of optman/ directory since it has been moved. + +2002-02-05 Ralf Corsepius + + * configure.ac: AC_CONFIG_SRCDIR([src/pthreads.c]) + * src/psignal.c: #include . + +2001-12-22 Ralf Corsepius + + * configure.ac: Remove optman/Makefile from CONFIG_FILES. + * Makefile.am: Remove optman from SUBDIRS. + +2001-12-19 Ralf Corsepius + + * optman/Makefile.am: Add multilib support. Remove ASM4FLAGS. + * src/Makefile.am: Add multilib support. + +2001-10-16 Ralf Corsepius + + * include/sys/Makefile.am: Remove. + * include/rtems/Makefile.am: Remove. + * include/rtems/posix/Makefile.am: Remove. + * include/Makefile.am: Handle subdirs. + * inline/rtems/Makefile.am: Remove. + * inline/rtems/posix/Makefile.am: Remove. + * inline/Makefile.am: Handle subdirs. + * macros/rtems/Makefile.am: Remove. + * macros/rtems/posix/Makefile.am: Remove. + * macros/Makefile.am: Handle subdirs. + * configure.ac: Reflect changes above. + +2001-10-11 Ralf Corsepius + + * .cvsignore: Add autom4te.cache for autoconf > 2.52. + * configure.in: Remove. + * configure.ac: New file, generated from configure.in by autoupdate. + +2001-09-28 Joel Sherrill + + * src/mqueueopen.c, src/semopen.c: Clarify type on va_arg. + +2001-09-23 Ralf Corsepius + + * include/sys/Makefile.am: Use 'PREINSTALL_FILES ='. + * include/rtems/posix/Makefile.am: Use 'PREINSTALL_FILES ='. + * include/Makefile.am: Use 'PREINSTALL_FILES ='. + * inline/rtems/posix/Makefile.am: Use 'PREINSTALL_FILES ='. + * macros/rtems/posix/Makefile.am: Use 'PREINSTALL_FILES ='. + +2001-09-22 Ralf Corsepius + + * optman/Makefile.am: Adapt ASM4FLAGS to automake-1.5 happy. + * src/Makefile.am: Adapt INCLUDES to make automake-1.5 happy. + +2001-09-13 Joel Sherrill + + * src/sysconf.c: Fix typo syntax error accidentally committed. + +2001-09-13 Joel Sherrill + + * src/mprotect.c: New file. Stub required by some gcc's to pass tests. + In particular, about 350 ACATS tests fail if this is not present. + * src/getpagesize.c: Ditto. + * src/sysconf.c: Addition of Solaris value for _SC_STACK_PROT required + to pass about 350 ACATS test cases. + * src/Makefile.am: Added new files. + +2001-08-30 Joel Sherrill + + * macros/rtems/posix/mqueue.inl: Add cast so negation works. + +2001-08-16 Joel Sherrill + + * src/mqueuesendsupp.c: Account for possibly blocking during the + core send operation. + +2001-08-09 Joel Sherrill + + * src/mqueuesendsupp.c: Unblocking message queue operations should + NOT use _Thread_Executing for return status since it is permissible + to invoke message send operations from an ISR. This was reported + by Suvrat Gupta . + +2000-05-24 Fernando Ruiz Casas + + * src/getegid.c, src/geteuid.c, src/getgid.c, src/getlogin.c, + src/getuid.c: Now save their values in private user environment. + +2001-04-27 Ralf Corsepius + + * configure.in: Add [-ansi -fasm] to RTEMS_PROG_CC_FOR_TARGET. + +2001-03-19 Joel Sherrill + + * sys/utsname.h: Added C++ wrapper. + +2001-02-03 Ralf Corsepius + + * include/Makefile.am, include/rtems/posix/Makefile.am, + include/sys/Makefile.am, inline/rtems/posix/Makefile.am, + macros/rtems/posix/Makefile.am: + Apply include_*HEADERS instead of H_FILES. + +2001-01-24 Ralf Corsepius + + * configure.in: Add src/config.h + * src/Makefile.am: Add INCLUDES += -I. to pickup config.h + * src/.cvsignore: Add config.h and stamp-h + * src/*.c: Add config.h support. + +2001-01-23 Joel Sherrill + + * src/alarm.c: Eliminated use of C++ style comments. + +2001-01-12 Joel Sherrill + + * src/clockgetres.c: Fixed match problem. We are not converting + an interval to a timespec -- it is actually a real number of + microseconds. + +2001-01-22 Michael Hamel + + * include/rtems/posix/semaphore.h, inline/rtems/posix/semaphore.inl, + src/ptimer1.c, include/rtems/posix/semaphore.h, + inline/rtems/posix/semaphore.inl, src/alarm.c, src/ptimer1.c, + src/semaphorenametoid.c, src/semopen.c, src/semunlink.c: + Modifications to make CodeWarrior happy. + +2001-01-12 Joel Sherrill + + * src/README.mqueue: Enhanced example. + +2000-12-19 Joel Sherrill + + * src/pthreadgetschedparam.c: Do not set output parameters if + the pointers are NULL. + +2000-12-06 Joel Sherrill + + * src/pthreadgetcpuclockid.c: Add include of to + eliminate warning. + +2000-12-01 Joel Sherrill + + * include/rtems/posix/cond.h: #if 0'ed out prototype of + _POSIX_Condition_variables_Get to avoid conflict with macro + implementation. + +2000-12-01 Joel Sherrill + + * Added macro support to POSIX API. This is known to compile. + * macros/rtems/posix/cond.inl, macros/rtems/posix/intr.inl, + macros/rtems/posix/key.inl, macros/rtems/posix/mqueue.inl, + macros/rtems/posix/mutex.inl, macros/rtems/posix/priority.inl, + macros/rtems/posix/pthread.inl, macros/rtems/posix/semaphore.inl, + macros/rtems/posix/timer.inl: New files. + * configure.in: Removed error check for enabling macros. + * rtems/posix/mutex.h: #if 0'ed out prototypes for inlined routines + since you cannot have prototypes for macros. + * macros/rtems/posix/Makefile.am: Added files. + +2000-11-30 Joel Sherrill + + * inline/rtems/posix/mqueue.inl: Removed explicit dependency on abs(). + +2000-11-27 Joel Sherrill + + * src/sysconf.c: Add support for _SC_CLK_TCK and _SC_OPEN_MAX. + +2000-11-09 Ralf Corsepius + + * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. + +2000-11-02 Ralf Corsepius + + * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. + +2000-10-30 Ralf Corsepius + + * configure.in: Cleanup comments. + +2000-10-30 Joel Sherrill + + * include/Makefile.am: Updated to reflect files merged into newlib. + This resulted in some definitions moving to other files and thus + some secondary effects in RTEMS source code. + * include/unistd.h: Removed. Now use newlib's. + * include/rtems/posix/mqueue.h: Add include of . + * include/rtems/posix/threadsup.h: Add include of + * src/execv.c: Corrected prototype to agree with newlib. + * src/execve.c: Corrected prototype to agree with newlib. + * src/execvp.c: Corrected prototype to agree with newlib. + * src/psignal.c: Rewrote reference to in comment since + that file no longer exists. + * src/pthreadkill.c: Added include of . + * src/sigaction.c: Added include of . + * src/sigtimedwait.c: Rewrote reference to in comment since + that file no longer exists. + +2000-10-25 Ralf Corsepius + + * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. + Switch to GNU canonicalization. + +2000-09-04 Ralf Corsepius + + * src/Makefile.am, optman/Makefile.am: Include compile.am. + +2000-08-30 Joel Sherrill + + * Many files: Moved posix/include/rtems/posix/seterr.h to + score/include/rtems/seterr.h so it would be available within + all APIs. + +2000-08-25 Joel Sherrill + + * inline/rtems/posix/timer.inl, include/rtems/posix/timer.h, + inline/rtems/posix/Makefile.am, src/ptimer1.c: Redid the + style of src/ptimer1.c. Continued effort to make the + POSIX Timer implementation match that of other managers. + Added data structures required to use SuperCore Object Handler. + +2000-08-15 Joel Sherrill + + * src/ptimer1.c: Minor formatting fixes. + +2000-08-15 Joel Sherrill + + * src/ptimer1.c: Removed unused routine PRINT_ERRNO_S. + * src/ptimer1.c: Removed unnecessary routine COPY_ITIMERSPEC_S + and used structure copy instead. + * src/ptimer1.c: Renamed timer_alive_t to POSIX_Timer_Control. + * include/rtems/posix/timer.h: Ditto. + +2000-08-15 Joel Sherrill + + * src/ptimer1.c: Switched to using set_errno_and_return_minus_one() + to ensure that errno was always set. + +2000-08-15 Joel Sherrill + + * src/ptimer1.c (timer_settime): Converted use of rtems_clock_get + to use SuperCore _TOD_Current variable. + +2000-08-10 Joel Sherrill + + * ChangeLog: New file. Index: Makefile.am =================================================================== --- Makefile.am (nonexistent) +++ Makefile.am (revision 1765) @@ -0,0 +1,10 @@ +## +## Makefile.am,v 1.10 2002/06/17 09:07:31 ralf Exp +## + +ACLOCAL_AMFLAGS = -I ../aclocal + +SUBDIRS = include inline macros src + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am Index: aclocal.m4 =================================================================== --- aclocal.m4 (nonexistent) +++ aclocal.m4 (revision 1765) @@ -0,0 +1,1469 @@ +# aclocal.m4 generated automatically by aclocal 1.6.2 -*- Autoconf -*- + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file 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. + +dnl rtems-top.m4,v 1.5 2002/07/31 14:40:48 ralf Exp + +dnl +dnl RTEMS_TOP($1) +dnl +dnl $1 .. relative path from this configure.in to the toplevel configure.in +dnl +AC_DEFUN(RTEMS_TOP, +[dnl +AC_REQUIRE([RTEMS_VERSIONING]) +AC_CHECK_PROGS(MAKE, gmake make) +AC_BEFORE([$0], [AC_CONFIG_AUX_DIR])dnl +AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl + +AC_PREFIX_DEFAULT([/opt/rtems]) + +ENDIF=endif +AC_SUBST(ENDIF) + +RTEMS_TOPdir="$1"; +AC_SUBST(RTEMS_TOPdir) + +test -n "$with_target_subdir" || with_target_subdir="." + +if test "$with_target_subdir" = "." ; then +# Native +PROJECT_TOPdir="${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +else +# Cross +dots=`echo $with_target_subdir|\ +sed -e 's%^\./%%' -e 's%[[^/]]$%&/%' -e 's%[[^/]]*/%../%g'` +PROJECT_TOPdir="${dots}${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +fi +AC_SUBST(PROJECT_TOPdir) + +PROJECT_ROOT="${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +AC_SUBST(PROJECT_ROOT) + +AC_MSG_CHECKING([for RTEMS Version]) +AS_IF([test -r "${srcdir}/${RTEMS_TOPdir}/cpukit/aclocal/version.m4"], +[], +[AC_MSG_ERROR([Unable to find ${RTEMS_TOPdir}/cpukit/aclocal/version.m4])]) +AC_MSG_RESULT([_RTEMS_VERSION]) +])dnl + +AC_DEFUN([RTEMS_VERSIONING], +m4_define([_RTEMS_VERSION],[ss-20020528])) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +AC_PREREQ([2.52]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl + AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_][CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_][CC], + defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_][CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_][CXX], + defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.6.2])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# -*- Autoconf -*- + + +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +# Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# serial 4 -*- Autoconf -*- + +# Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null +AC_SUBST([DEPDIR]) +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST(am__include) +AC_SUBST(am__quote) +AC_MSG_RESULT($_am_result) +rm -f confinc confmf +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 5 + +AC_PREREQ(2.52) + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional \"$1\" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +dnl +dnl canonical-target-name.m4,v 1.1 2002/06/17 08:52:47 ralf Exp +dnl + +dnl canonicalize target cpu +dnl NOTE: Most rtems targets do not fullfil autoconf's +dnl target naming conventions "processor-vendor-os" +dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them +dnl and we have to fix it for rtems ourselves + +AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, +[ +AC_CANONICAL_TARGET +AC_MSG_CHECKING(rtems target cpu) +case "${target}" in + # hpux unix port should go here + i[[34567]]86-*linux*) # unix "simulator" port + RTEMS_CPU=unix + ;; + i[[34567]]86-*freebsd*) # unix "simulator" port + RTEMS_CPU=unix + ;; + i[[34567]]86-pc-cygwin*) # Cygwin is just enough unix like :) + RTEMS_CPU=unix + ;; + no_cpu-*rtems*) + RTEMS_CPU=no_cpu + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_CPU=unix + ;; + *) + RTEMS_CPU=`echo $target | sed 's%^\([[^-]]*\)-\(.*\)$%\1%'` + ;; +esac +AC_SUBST(RTEMS_CPU) +AC_MSG_RESULT($RTEMS_CPU) +]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright 1996, 1998, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +dnl enable-posix.m4,v 1.1 2002/06/17 08:52:47 ralf Exp + +AC_DEFUN(RTEMS_ENABLE_POSIX, +[ + +AC_ARG_ENABLE(posix, +AC_HELP_STRING([--enable-posix],[enable posix interface]), +[case "${enableval}" in + yes) RTEMS_HAS_POSIX_API=yes ;; + no) RTEMS_HAS_POSIX_API=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;; +esac],[RTEMS_HAS_POSIX_API=yes]) + +case "${host}" in + # hpux unix port should go here + i[[34567]]86-pc-linux*) # unix "simulator" port + RTEMS_HAS_POSIX_API=no + ;; + i[[34567]]86-*freebsd*) # unix "simulator" port + RTEMS_HAS_POSIX_API=no + ;; + no_cpu-*rtems*) + RTEMS_HAS_POSIX_API=no + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_HAS_POSIX_API=no + ;; + *) + ;; +esac +AC_SUBST(RTEMS_HAS_POSIX_API) +]) + +dnl enable-inlines.m4,v 1.1 2002/06/17 08:52:47 ralf Exp + +AC_DEFUN(RTEMS_ENABLE_INLINES, +[AC_ARG_ENABLE(rtems-inlines, +AC_HELP_STRING([--enable-rtems-inlines],[enable RTEMS inline functions (default:enabled, disable to use macros)]), +[case "${enableval}" in + yes) RTEMS_USE_MACROS=no ;; + no) RTEMS_USE_MACROS=yes ;; + *) AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;; +esac],[RTEMS_USE_MACROS=no]) +AC_SUBST(RTEMS_USE_MACROS)dnl + +if test x"${RTEMS_USE_MACROS}" = x"yes"; +then + AC_DEFINE_UNQUOTED(USE_MACROS,1,[if using macros]) +else + AC_DEFINE_UNQUOTED(USE_INLINES,1,[if using inlines]) +fi + + +]) + +dnl env-rtemscpu.m4,v 1.4 2002/08/06 07:31:26 ralf Exp + +AC_DEFUN(RTEMS_ENV_RTEMSCPU, +[AC_REQUIRE([RTEMS_ENABLE_MULTILIB]) + +if test x"$multilib" = x"yes"; then + AS_IF([test -n "$with_multisubdir"], + [MULTIBUILDTOP=`echo "/$with_multisubdir" | sed 's,/[[^\\/]]*,../,g'`]) + AC_SUBST(MULTIBUILDTOP) + + AS_IF([test -n "$with_multisubdir"], + [MULTISUBDIR="/$with_multisubdir"]) + AC_SUBST(MULTISUBDIR) + + GCC_SPECS="-isystem \$(PROJECT_INCLUDE)" + AC_SUBST(GCC_SPECS) + + PROJECT_INCLUDE="\$(PROJECT_ROOT)/lib/include" + AC_SUBST(PROJECT_INCLUDE) + + project_libdir="\$(PROJECT_ROOT)/lib" + AC_SUBST(project_libdir) + + RTEMS_ROOT="${PROJECT_ROOT}" + AC_SUBST(RTEMS_ROOT) + + includedir="\${exec_prefix}/lib/include" + libdir="${libdir}\$(MULTISUBDIR)" +else + RTEMS_ENV_RTEMSBSP + RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) +fi +]) + +dnl This provides configure definitions used for multilib support + +dnl parts of these macros are derived from newlib-1.8.2's multilib support + +AC_DEFUN(RTEMS_ENABLE_MULTILIB, +[ +AC_ARG_ENABLE(multilib, +AC_HELP_STRING([--enable-multilib], +[build many library versions (default=no)]), +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=no])dnl + +AM_CONDITIONAL(MULTILIB,test x"${multilib}" = x"yes") +]) + +AC_DEFUN([RTEMS_ENABLE_MULTILIB_MASTER], +[ +AC_REQUIRE([RTEMS_ENABLE_MULTILIB]) + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + multilib_basedir="[$]{srcdir}/[$]{with_multisrctop}../ifelse([$2],,,[$2])" + else + multilib_basedir="[$]{srcdir}/[$]{with_multisrctop}ifelse([$2],,,[$2])" + fi +else + multilib_basedir="[$]{srcdir}/ifelse([$2],,,[$2])" +fi +AC_SUBST(multilib_basedir) + +if test "${multilib}" = "yes"; then + multilib_arg="--enable-multilib" +else + multilib_arg= +fi + +AC_OUTPUT_COMMANDS( +[case " $CONFIG_FILES " in + *" ]m4_if([$1],,Makefile,[$1])[ "*) + ac_file=]m4_if([$1],,Makefile,[$1])[ . ${multilib_basedir}/config-ml.in +esac], +[ + srcdir=${srcdir} + host=${host} + target=${target} + with_multisrctop="${with_multisrctop}" + with_target_subdir="${with_target_subdir}" + with_multisubdir="${with_multisubdir}" + ac_configure_args="${multilib_arg} ${ac_configure_args}" + CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + multilib_basedir=${multilib_basedir} + CC="${CC}"]) +]) + +dnl env-rtemsbsp.m4,v 1.3 2002/08/06 10:09:33 ralf Exp + +dnl Pass a single BSP via an environment variable +dnl used by per BSP configure scripts +AC_DEFUN(RTEMS_ENV_RTEMSBSP, +[dnl +AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl +AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl +AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl + +AC_ARG_VAR([RTEMS_BSP],[RTEMS_BSP to build]) +AC_MSG_CHECKING([for RTEMS_BSP]) +AC_CACHE_VAL(rtems_cv_RTEMS_BSP, +[dnl + test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP"; +])dnl +if test -z "$rtems_cv_RTEMS_BSP"; then + AC_MSG_ERROR([Missing RTEMS_BSP]) +fi +RTEMS_BSP="$rtems_cv_RTEMS_BSP" +AC_MSG_RESULT(${RTEMS_BSP}) +AC_SUBST(RTEMS_BSP) + +PROJECT_INCLUDE="\$(PROJECT_ROOT)/$RTEMS_BSP/lib/include" +AC_SUBST(PROJECT_INCLUDE) + +project_libdir="${PROJECT_ROOT}/$RTEMS_BSP/lib" +AC_SUBST(project_libdir) + +RTEMS_ROOT="$PROJECT_ROOT/c/$RTEMS_BSP" +AC_SUBST(RTEMS_ROOT) + +GCC_SPECS="-isystem \$(PROJECT_INCLUDE)" +AC_SUBST(GCC_SPECS) + +RTEMS_ENABLE_BARE +AC_SUBST(BARE_CPU_MODEL) +AC_SUBST(BARE_CPU_CFLAGS) + +AM_CONDITIONAL([MULTILIB],[false]) + +includedir="\${exec_prefix}/${RTEMS_BSP}/lib/include" +libdir="\${exec_prefix}/${RTEMS_BSP}/lib" +]) + +dnl enable-rtemsbsp.m4,v 1.1 2002/06/17 08:52:47 ralf Exp + +dnl Override the set of BSPs to be built. +dnl used by the toplevel configure script +dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list) +AC_DEFUN(RTEMS_ENABLE_RTEMSBSP, +[ +AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])dnl +AC_ARG_ENABLE(rtemsbsp, +AC_HELP_STRING([--enable-rtemsbsp="bsp1 bsp2 .."], +[BSPs to include in build]), +[case "${enableval}" in + yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);; + *) $1=$enableval;; +esac],[$1=""]) +]) + +dnl check-bsps.m4,v 1.3 2002/07/17 22:28:20 ralf Exp + +AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP, +[dnl +AC_REQUIRE([RTEMS_TOP]) + +AC_MSG_CHECKING([for make/custom/[$]$1.cfg]) +if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then + AC_MSG_RESULT([yes]) +else + AC_MSG_ERROR([no]) +fi +])dnl + +AC_DEFUN(RTEMS_ENABLE_BARE, +[ +AC_ARG_ENABLE(bare-cpu-cflags, +AC_HELP_STRING([--enable-bare-cpu-cflags],[specify a particular cpu cflag (bare bsp specific)]), +[case "${enableval}" in + no) BARE_CPU_CFLAGS="" ;; + *) BARE_CPU_CFLAGS="${enableval}" ;; +esac], +[BARE_CPU_CFLAGS=""]) + +AC_ARG_ENABLE(bare-cpu-model, +AC_HELP_STRING([--enable-bare-cpu-model],[specify a particular cpu model (bare bsp specific)]), +[case "${enableval}" in + no) BARE_CPU_MODEL="" ;; + *) BARE_CPU_MODEL="${enableval}" ;; +esac], +[BARE_CPU_MODEL=""]) +]) + + +dnl check-cpu.m4,v 1.3 2002/07/17 22:28:20 ralf Exp + +dnl check if RTEMS support a cpu +AC_DEFUN(RTEMS_CHECK_CPU, +[dnl +AC_REQUIRE([RTEMS_TOP]) +AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU]) + +# Is this a supported CPU? +AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported]) +if test -d "$srcdir/$RTEMS_TOPdir/cpukit/score/cpu/$RTEMS_CPU"; then + AC_MSG_RESULT(yes) +else + AC_MSG_ERROR(no) +fi +])dnl + + +dnl canonical-host.m4,v 1.1 2002/06/17 08:52:47 ralf Exp + +AC_DEFUN(RTEMS_CANONICAL_HOST, +[dnl +AC_REQUIRE([AC_CANONICAL_HOST]) +RTEMS_HOST=$host_os +case "${target}" in + # hpux unix port should go here + i[[34567]]86-*linux*) # unix "simulator" port + RTEMS_HOST=Linux + ;; + i[[34567]]86-*freebsd*) # unix "simulator" port + RTEMS_HOST=FreeBSD + ;; + i[[34567]]86-pc-cygwin*) # Cygwin is just enough unix like :) + RTEMS_HOST=Cygwin + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_HOST=Solaris + ;; + *) + ;; +esac +AC_SUBST(RTEMS_HOST) +])dnl + +dnl +dnl prog-cc.m4,v 1.2 2002/07/01 09:20:43 ralf Exp +dnl +dnl Check for target gcc +dnl + +AC_DEFUN(RTEMS_PROG_CC, +[ +AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_BEFORE([$0], [AC_PROG_CC])dnl +AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl + +RTEMS_CHECK_TOOL(CC,gcc) +test -z "$CC" && \ + AC_MSG_ERROR([no acceptable cc found in \$PATH]) +AC_PROG_CC +AC_PROG_CPP + +AM_CONDITIONAL(RTEMS_USE_GCC,test x"$GCC" = x"yes") +]) + +AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET, +[ +dnl check target cc +RTEMS_PROG_CC +dnl check if the compiler supports --specs +RTEMS_GCC_SPECS +dnl check if the target compiler may use --pipe +RTEMS_GCC_PIPE +test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe" + +if test "$GCC" = yes; then +] +m4_if([$1],,[],[CPPFLAGS="$CPPFLAGS $1"]) +[ +CFLAGS="-g -Wall" +fi + +dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-* +#case $build_os in +#*cygwin*) GCCSED="| sed 's%\\\\%/%g'" ;; +#*) ;; +#esac +AC_SUBST(GCCSED) +]) + +dnl +dnl canonicalize-tools.m4,v 1.3 2002/07/31 14:57:47 ralf Exp +dnl +dnl Set target tools +dnl + +AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, +[AC_REQUIRE([RTEMS_PROG_CC])dnl + +dnl FIXME: What shall be done if these tools are not available? + RTEMS_CHECK_TOOL(AR,ar,no) + +dnl special treatment of ranlib + RTEMS_CHECK_TOOL(RANLIB,ranlib,:) +]) + +dnl check-tool.m4,v 1.1 2002/06/17 08:52:47 ralf Exp + +dnl RTEMS_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN(RTEMS_CHECK_TOOL, +[ + AS_IF([test "x$build_alias" != "x$host_alias"], + [rtems_tool_prefix=${ac_tool_prefix}]) + AC_CHECK_PROG($1, ${rtems_tool_prefix}$2, ${rtems_tool_prefix}$2, $3, $4) +]) + +dnl +dnl gcc-specs.m4,v 1.1 2002/06/17 08:52:47 ralf Exp +dnl +dnl Check whether the target compiler accepts -specs +dnl + +AC_DEFUN(RTEMS_GCC_SPECS, +[AC_REQUIRE([RTEMS_PROG_CC]) +AC_CACHE_CHECK(whether $CC accepts -specs,rtems_cv_gcc_specs, +[ +rtems_cv_gcc_specs=no +if test x"$GCC" = x"yes"; then + touch confspec + echo 'void f(){}' >conftest.c + if test -z "`${CC} -specs confspec -c conftest.c 2>&1`";then + rtems_cv_gcc_specs=yes + fi +fi +rm -f confspec conftest* +])]) + +dnl +dnl gcc-pipe.m4,v 1.1 2002/06/17 08:52:47 ralf Exp +dnl +dnl Check whether the target compiler accepts -pipe +dnl + +AC_DEFUN(RTEMS_GCC_PIPE, +[AC_REQUIRE([RTEMS_PROG_CC]) +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_CACHE_CHECK(whether $CC accepts --pipe,rtems_cv_gcc_pipe, +[ +rtems_cv_gcc_pipe=no +if test x"$GCC" = x"yes"; then + echo 'void f(){}' >conftest.c + if test -z "`${CC} --pipe -c conftest.c 2>&1`";then + rtems_cv_gcc_pipe=yes + fi + rm -f conftest* +fi +]) +]) + +dnl +dnl check-multiprocessing.m4,v 1.2 2002/06/26 10:56:11 ralf Exp +dnl + +AC_DEFUN(RTEMS_CHECK_MULTIPROCESSING, +[dnl +AC_REQUIRE([RTEMS_ENV_RTEMSCPU])dnl +AC_REQUIRE([RTEMS_CHECK_CPU])dnl +AC_REQUIRE([RTEMS_ENABLE_MULTIPROCESSING])dnl + +AS_IF([test "$enable_multiprocessing" = "yes"], + [HAS_MP="yes"], + [HAS_MP="no"]) +]) + +AC_DEFUN(RTEMS_DEFINE_MULTIPROCESSING, +[AC_REQUIRE([RTEMS_CHECK_MULTIPROCESSING])dnl +if test x"${HAS_MP}" = x"yes"; +then + AC_DEFINE_UNQUOTED(RTEMS_MULTIPROCESSING,1,[if multiprocessing is enabled]) +fi +]) + +dnl enable-multiprocessing.m4,v 1.3 2002/07/01 09:20:43 ralf Exp + +AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING, +[ +AC_ARG_ENABLE(multiprocessing, +AC_HELP_STRING([--enable-multiprocessing],[enable multiprocessing interface]), +[case "${enable_multiprocessing}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;; +esac],[enable_multiprocessing=no]) +]) + +dnl check-posix.m4,v 1.1 2002/06/17 08:52:47 ralf Exp +dnl +AC_DEFUN(RTEMS_CHECK_POSIX_API, +[dnl +AC_REQUIRE([RTEMS_CHECK_CPU])dnl +AC_REQUIRE([RTEMS_ENABLE_POSIX])dnl + +AC_CACHE_CHECK([whether CPU supports libposix], + rtems_cv_HAS_POSIX_API, + [dnl + case "$RTEMS_CPU" in + unix*) + rtems_cv_HAS_POSIX_API="no" + ;; + *) + if test "${RTEMS_HAS_POSIX_API}" = "yes"; then + rtems_cv_HAS_POSIX_API="yes"; + else + rtems_cv_HAS_POSIX_API="disabled"; + fi + ;; + esac]) +if test "$rtems_cv_HAS_POSIX_API" = "yes"; then + HAS_POSIX_API="yes"; +else + HAS_POSIX_API="no"; +fi +AC_SUBST(HAS_POSIX_API)dnl +]) + +AC_DEFUN(RTEMS_DEFINE_POSIX_API, +[AC_REQUIRE([RTEMS_CHECK_POSIX_API])dnl +AS_IF( + [test x"${HAS_POSIX_API}" = x"yes"], + [AC_DEFINE_UNQUOTED(RTEMS_POSIX_API,1,[if posix api is supported])]) +]) + +dnl check-newlib.m4,v 1.1 2002/06/17 08:52:47 ralf Exp + +AC_DEFUN(RTEMS_CHECK_NEWLIB, +[dnl +AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnl +AC_REQUIRE([RTEMS_CANONICALIZE_TOOLS])dnl +AC_CACHE_CHECK([for RTEMS newlib], + rtems_cv_use_newlib, + [ +dnl some versions of newlib provide not_required_by_rtems + AC_TRY_LINK( + [extern void not_required_by_rtems() ;], + [not_required_by_rtems()], + rtems_cv_use_newlib="yes") + +dnl some versions of newlib provide rtems_provides_crt0() + AS_IF([test -z "$rtems_cv_use_newlib"], + [AC_TRY_LINK( + [extern void rtems_provides_crt0() ;], + [rtems_provides_crt0()], + rtems_cv_use_newlib="yes", + rtems_cv_use_newlib="no")] + ) + ]) + RTEMS_USE_NEWLIB="$rtems_cv_use_newlib" + AC_SUBST(RTEMS_USE_NEWLIB) + + AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"], + [ AC_DEFINE_UNQUOTED(RTEMS_NEWLIB,1,[if using newlib])] + ) +]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_PREREQ([2.52]) + +# serial 6 + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. We must strip everything past the first ":", +# and everything past the last "/". + +# _AM_DIRNAME(PATH) +# ----------------- +# Like AS_DIRNAME, only do it during macro expansion +AC_DEFUN([_AM_DIRNAME], + [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, + m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, + m4_if(regexp([$1], [^/.*]), -1, + [.], + patsubst([$1], [^\(/\).*], [\1])), + patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), + patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl +])# _AM_DIRNAME + + +# The stamp files are numbered to have different names. +# We could number them on a directory basis, but that's additional +# complications, let's have a unique counter. +m4_define([_AM_STAMP_Count], [0]) + + +# _AM_STAMP(HEADER) +# ----------------- +# The name of the stamp file for HEADER. +AC_DEFUN([_AM_STAMP], +[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl +AS_ESCAPE(_AM_DIRNAME(patsubst([$1], + [:.*])))/stamp-h[]_AM_STAMP_Count]) + + +# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) +# ------------------------------------------------------------ +# We used to try to get a real timestamp in stamp-h. But the fear is that +# that will cause unnecessary cvs conflicts. +AC_DEFUN([_AM_CONFIG_HEADER], +[# Add the stamp file to the list of files AC keeps track of, +# along with our hook. +AC_CONFIG_HEADERS([$1], + [# update the timestamp +echo 'timestamp for $1' >"_AM_STAMP([$1])" +$2], + [$3]) +])# _AM_CONFIG_HEADER + + +# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) +# -------------------------------------------------------------- +AC_DEFUN([AM_CONFIG_HEADER], +[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) +])# AM_CONFIG_HEADER + Index: . =================================================================== --- . (nonexistent) +++ . (revision 1765)
. Property changes : Added: svn:ignore ## -0,0 +1,14 ## +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +config.cache +config.guess +config.log +config.status +config.sub +configure +depcomp +install-sh +missing +mkinstalldirs

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.