score: Rename _POSIX_Absolute_timeout_to_ticks()

Rename _POSIX_Absolute_timeout_to_ticks() to
_TOD_Absolute_timeout_to_ticks() and move it to the score directory.
Delete empty <rtems/posix/time.h>.
This commit is contained in:
Sebastian Huber
2015-07-28 14:45:42 +02:00
parent f7d95581c8
commit 21789a2117
98 changed files with 101 additions and 238 deletions

View File

@@ -47,7 +47,6 @@ include_rtems_posix_HEADERS += include/rtems/posix/ptimer.h
include_rtems_posix_HEADERS += include/rtems/posix/semaphore.h
include_rtems_posix_HEADERS += include/rtems/posix/semaphoreimpl.h
include_rtems_posix_HEADERS += include/rtems/posix/threadsup.h
include_rtems_posix_HEADERS += include/rtems/posix/time.h
include_rtems_posix_HEADERS += include/rtems/posix/timer.h
include_rtems_posix_HEADERS += include/rtems/posix/timerimpl.h
include_rtems_posix_HEADERS += include/rtems/posix/barrier.h
@@ -195,7 +194,7 @@ libposix_a_SOURCES += src/pspin.c src/pspindestroy.c src/pspininit.c \
src/pspinunlock.c
## TIME_C_FILES
libposix_a_SOURCES += src/adjtime.c src/posixtimespecabsolutetimeout.c \
libposix_a_SOURCES += src/adjtime.c \
src/clockgetcpuclockid.c src/clockgetenableattr.c src/clocksetenableattr.c
## TIMER_C_FILES

View File

@@ -1,72 +0,0 @@
/**
* @file
*
* @brief POSIX Time Types
*
* This defines the interface to implementation helper routines related
* to POSIX time types.
*/
/*
* COPYRIGHT (c) 1989-2011.
* 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.rtems.org/license/LICENSE.
*/
#ifndef _RTEMS_POSIX_TIME_H
#define _RTEMS_POSIX_TIME_H
#include <rtems/score/timespec.h>
#include <rtems/score/watchdog.h>
/**
* @defgroup POSIX_TIMETYPES POSIX Time Types
*
* @ingroup POSIXAPI
*
*/
/**@{**/
/**
* @brief Absolute timeout conversion results.
*
* This enumeration defines the possible results of converting
* an absolute time used for timeouts to POSIX blocking calls to
* a number of ticks.
*/
typedef enum {
/** The timeout is invalid. */
POSIX_ABSOLUTE_TIMEOUT_INVALID,
/** The timeout represents a time that is in the past. */
POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST,
/** The timeout represents a time that is equal to the current time. */
POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
/** The timeout represents a time that is in the future. */
POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE,
} POSIX_Absolute_timeout_conversion_results_t;
/**
* @brief Convert absolute timeout to ticks.
*
* This method takes an absolute time being used as a timeout
* to a blocking directive, validates it and returns the number
* of corresponding clock ticks for use by the SuperCore.
*
* @param[in] abstime is a pointer to the timeout
* @param[out] ticks_out will contain the number of ticks
*
* @return This method returns the number of ticks in @a ticks_out
* and a status value indicating whether the absolute time
* is valid, in the past, equal to the current time or in
* the future as it should be.
*/
POSIX_Absolute_timeout_conversion_results_t _POSIX_Absolute_timeout_to_ticks(
const struct timespec *abstime,
Watchdog_Interval *ticks_out
);
/** @} */
#endif

View File

@@ -125,10 +125,6 @@ $(PROJECT_INCLUDE)/rtems/posix/threadsup.h: include/rtems/posix/threadsup.h $(PR
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/threadsup.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/threadsup.h
$(PROJECT_INCLUDE)/rtems/posix/time.h: include/rtems/posix/time.h $(PROJECT_INCLUDE)/rtems/posix/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/time.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/time.h
$(PROJECT_INCLUDE)/rtems/posix/timer.h: include/rtems/posix/timer.h $(PROJECT_INCLUDE)/rtems/posix/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/timer.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/timer.h

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*

View File

@@ -26,7 +26,6 @@
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/time.h>
/*
* 20.1.3 Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55

View File

@@ -26,7 +26,6 @@
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/time.h>
/*
* 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58

View File

@@ -26,7 +26,6 @@
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/time.h>
/*
* 20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 58

View File

@@ -26,7 +26,6 @@
#include <rtems/config.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/**

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/**

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/**

View File

@@ -17,7 +17,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/**

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/**

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*

View File

@@ -22,9 +22,8 @@
#include <errno.h>
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/score/todimpl.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*
@@ -39,7 +38,7 @@ int pthread_cond_timedwait(
{
Watchdog_Interval ticks;
bool already_timedout;
POSIX_Absolute_timeout_conversion_results_t status;
TOD_Absolute_timeout_conversion_results status;
/*
* POSIX requires that blocking calls with timeouts that take
@@ -51,12 +50,12 @@ int pthread_cond_timedwait(
* status into the appropriate error.
*/
already_timedout = false;
status = _POSIX_Absolute_timeout_to_ticks(abstime, &ticks);
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
status = _TOD_Absolute_timeout_to_ticks(abstime, &ticks);
if ( status == TOD_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
if ( status == TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == TOD_ABSOLUTE_TIMEOUT_IS_NOW )
already_timedout = true;
return _POSIX_Condition_variables_Wait_support(

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*

View File

@@ -25,7 +25,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/score/statesimpl.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
int _POSIX_Condition_variables_Wait_support(

View File

@@ -31,7 +31,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*
* _POSIX_Message_queue_Manager_initialization

View File

@@ -42,7 +42,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*
*

View File

@@ -38,7 +38,6 @@
#include <rtems/score/wkspace.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*
* _POSIX_Message_queue_Create_support

View File

@@ -31,7 +31,6 @@
#include <rtems/score/wkspace.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
#if defined(RTEMS_DEBUG)
#include <rtems/bspIo.h>
#endif

View File

@@ -42,7 +42,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*
* 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283

View File

@@ -32,7 +32,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*
* _POSIX_Message_queue_Notify_handler

View File

@@ -41,7 +41,6 @@
#include <rtems/score/todimpl.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
#define MQ_OPEN_FAILED ((mqd_t) -1)

View File

@@ -30,7 +30,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
ssize_t mq_receive(
mqd_t mqdes,

View File

@@ -30,7 +30,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*
* _POSIX_Message_queue_Receive_support

View File

@@ -42,7 +42,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*
* 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277

View File

@@ -42,7 +42,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*

View File

@@ -30,7 +30,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
int mq_setattr(
mqd_t mqdes,

View File

@@ -41,10 +41,9 @@
#include <mqueue.h>
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/score/todimpl.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*
* 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
@@ -62,7 +61,7 @@ ssize_t mq_timedreceive(
{
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
TOD_Absolute_timeout_conversion_results status;
/*
* POSIX requires that blocking calls with timeouts that take
@@ -73,12 +72,12 @@ ssize_t mq_timedreceive(
* then we do a polling operation and convert the UNSATISFIED
* status into the appropriate error.
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* If the status is TOD_ABSOLUTE_TIMEOUT_INVALID,
* TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST, or TOD_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
status = _TOD_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
return _POSIX_Message_queue_Receive_support(

View File

@@ -27,10 +27,9 @@
#include <mqueue.h>
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/score/todimpl.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
int mq_timedsend(
mqd_t mqdes,
@@ -42,7 +41,7 @@ int mq_timedsend(
{
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
TOD_Absolute_timeout_conversion_results status;
/*
* POSIX requires that blocking calls with timeouts that take
@@ -53,12 +52,12 @@ int mq_timedsend(
* then we do a polling operation and convert the UNSATISFIED
* status into the appropriate error.
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* If the status is TOD_ABSOLUTE_TIMEOUT_INVALID,
* TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST, or TOD_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
status = _TOD_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
return _POSIX_Message_queue_Send_support(

View File

@@ -31,7 +31,6 @@
#include <rtems/score/wkspace.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/time.h>
/*
* 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276

View File

@@ -28,7 +28,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* _POSIX_Mutex_Manager_initialization

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/**
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_gettype(

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/**
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_settype(

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/**
* 11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* _POSIX_Mutex_Lock_support

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131

View File

@@ -23,10 +23,9 @@
#include <rtems/system.h>
#include <rtems/score/coremuteximpl.h>
#include <rtems/score/watchdog.h>
#include <rtems/score/todimpl.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/**
* 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
@@ -40,7 +39,7 @@ int pthread_mutex_timedlock(
{
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
TOD_Absolute_timeout_conversion_results status;
int lock_status;
/*
@@ -52,12 +51,12 @@ int pthread_mutex_timedlock(
* then we do a polling operation and convert the UNSATISFIED
* status into the appropriate error.
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* If the status is TOD_ABSOLUTE_TIMEOUT_INVALID,
* TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST, or TOD_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
status = _TOD_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
@@ -68,10 +67,10 @@ int pthread_mutex_timedlock(
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
if ( status == TOD_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
if ( status == TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == TOD_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/**
* 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93

View File

@@ -26,7 +26,6 @@
#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
/*
* 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93

View File

@@ -22,8 +22,8 @@
#include <errno.h>
#include <rtems/posix/rwlockimpl.h>
#include <rtems/posix/time.h>
#include <rtems/score/thread.h>
#include <rtems/score/todimpl.h>
/*
* pthread_rwlock_timedrdlock
@@ -47,7 +47,7 @@ int pthread_rwlock_timedrdlock(
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
TOD_Absolute_timeout_conversion_results status;
Thread_Control *executing;
/*
@@ -59,12 +59,12 @@ int pthread_rwlock_timedrdlock(
* then we do a polling operation and convert the UNSATISFIED
* status into the appropriate error.
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* If the status is TOD_ABSOLUTE_TIMEOUT_INVALID,
* TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST, or TOD_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
status = _TOD_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
@@ -85,10 +85,10 @@ int pthread_rwlock_timedrdlock(
_Objects_Put( &the_rwlock->Object );
if ( !do_wait ) {
if ( executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
if ( status == TOD_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
if ( status == TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == TOD_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}

View File

@@ -24,8 +24,8 @@
#include <errno.h>
#include <rtems/posix/rwlockimpl.h>
#include <rtems/posix/time.h>
#include <rtems/score/thread.h>
#include <rtems/score/todimpl.h>
/*
* pthread_rwlock_timedwrlock
@@ -49,7 +49,7 @@ int pthread_rwlock_timedwrlock(
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
TOD_Absolute_timeout_conversion_results status;
Thread_Control *executing;
/*
@@ -61,12 +61,12 @@ int pthread_rwlock_timedwrlock(
* then we do a polling operation and convert the UNSATISFIED
* status into the appropriate error.
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* If the status is TOD_ABSOLUTE_TIMEOUT_INVALID,
* TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST, or TOD_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
status = _TOD_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
@@ -87,10 +87,10 @@ int pthread_rwlock_timedwrlock(
_Objects_Put( &the_rwlock->Object );
if ( !do_wait &&
(executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
if ( status == TOD_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
if ( status == TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == TOD_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}

View File

@@ -31,7 +31,6 @@
#include <rtems/posix/threadsup.h>
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/time.h>
#include <rtems/config.h>
#include <rtems/seterr.h>

View File

@@ -34,7 +34,6 @@
#include <rtems/posix/threadsup.h>
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/time.h>
#include <stdio.h>
bool _POSIX_signals_Check_signal(

View File

@@ -30,7 +30,6 @@
#include <rtems/posix/threadsup.h>
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/time.h>
#include <stdio.h>
/*

View File

@@ -30,7 +30,6 @@
#include <rtems/posix/threadsup.h>
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/time.h>
#include <stdio.h>
void _POSIX_signals_Set_process_signals(

View File

@@ -32,7 +32,6 @@
#include <rtems/posix/threadsup.h>
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/time.h>
#include <stdio.h>
static bool _POSIX_signals_Unblock_thread_done(

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
int _POSIX_Thread_Translate_sched_param(
int policy,

View File

@@ -39,7 +39,6 @@
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/config.h>
#include <rtems/posix/keyimpl.h>
#include <rtems/posix/time.h>
#include <rtems/score/timespec.h>
#include <rtems/score/cpusetimpl.h>
#include <rtems/score/assert.h>

View File

@@ -27,7 +27,6 @@
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/time.h>
#include <rtems/score/cpusetimpl.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/apimutex.h>

View File

@@ -33,7 +33,6 @@
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/config.h>
#include <rtems/posix/time.h>
#include <rtems/rtems/config.h>
void _POSIX_Threads_Initialize_user_threads_body(void)

View File

@@ -27,7 +27,6 @@
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/watchdogimpl.h>
#include <rtems/config.h>

View File

@@ -27,7 +27,6 @@
#include <rtems/score/isr.h>
#include <rtems/score/thread.h>
#include <rtems/posix/time.h>
/************************************/
/* These includes are now necessary */

View File

@@ -24,7 +24,6 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
/*

View File

@@ -27,7 +27,6 @@
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
int sched_getscheduler(
pid_t pid __attribute__((unused))

View File

@@ -27,7 +27,6 @@
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
int sched_setparam(
pid_t pid __attribute__((unused)),

View File

@@ -25,7 +25,6 @@
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/time.h>
int sched_setscheduler(
pid_t pid __attribute__((unused)),

View File

@@ -29,7 +29,6 @@
#include <rtems/system.h>
#include <rtems/config.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
/*

View File

@@ -30,7 +30,6 @@
#include <rtems/system.h>
#include <rtems/score/wkspace.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
/*

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
void _POSIX_Semaphore_Delete(

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
int _POSIX_Semaphore_Wait_support(

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
int sem_close(

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
int sem_destroy(

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
int sem_getvalue(

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
/*

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
/*

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
int sem_post(

View File

@@ -27,8 +27,8 @@
#include <limits.h>
#include <rtems/system.h>
#include <rtems/score/todimpl.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
/*
@@ -44,7 +44,7 @@ int sem_timedwait(
{
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
TOD_Absolute_timeout_conversion_results status;
int lock_status;
/*
@@ -56,12 +56,12 @@ int sem_timedwait(
* then we do a polling operation and convert the UNSATISFIED
* status into the appropriate error.
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* If the status is TOD_ABSOLUTE_TIMEOUT_INVALID,
* TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST, or TOD_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
status = _TOD_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
@@ -73,10 +73,10 @@ int sem_timedwait(
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
if ( lock_status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
if ( lock_status == TOD_ABSOLUTE_TIMEOUT_INVALID )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
if ( lock_status == TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
lock_status == TOD_ABSOLUTE_TIMEOUT_IS_NOW )
rtems_set_errno_and_return_minus_one( ETIMEDOUT );
}

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
int sem_trywait(

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
int sem_unlink(

View File

@@ -28,7 +28,6 @@
#include <rtems/system.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/seterr.h>
int sem_wait(

View File

@@ -26,7 +26,6 @@
#include <rtems/posix/psignalimpl.h>
#include <rtems/score/threadqimpl.h>
#include <rtems/seterr.h>
#include <rtems/posix/time.h>
#include <rtems/score/isr.h>
static int _POSIX_signals_Get_lowest(

View File

@@ -28,7 +28,6 @@
#include <rtems/seterr.h>
#include <rtems/score/thread.h>
#include <rtems/posix/sigset.h>
#include <rtems/posix/time.h>
#include <rtems/posix/timerimpl.h>
#include <rtems/score/watchdogimpl.h>

View File

@@ -28,7 +28,6 @@
#include <rtems/seterr.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdogimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/timerimpl.h>

View File

@@ -23,7 +23,6 @@
#include <time.h>
#include <errno.h>
#include <rtems/posix/time.h>
#include <rtems/posix/ptimer.h>
#include <rtems/posix/timerimpl.h>
#include <rtems/score/todimpl.h>

View File

@@ -24,7 +24,6 @@
#include <pthread.h>
#include <signal.h>
#include <rtems/posix/time.h>
#include <rtems/posix/ptimer.h>
#include <rtems/posix/timerimpl.h>
#include <rtems/score/todimpl.h>

View File

@@ -23,7 +23,6 @@
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/time.h>
#include <rtems/score/threaddispatch.h>
#include <rtems/score/todimpl.h>
#include <rtems/score/watchdogimpl.h>

View File

@@ -43,7 +43,6 @@
#include <rtems/posix/timerimpl.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/spinlockimpl.h>
#include <rtems/posix/time.h>
#endif
void _POSIX_Fatal_error( POSIX_Fatal_domain domain, int eno )

View File

@@ -324,6 +324,7 @@ libscore_a_SOURCES += src/coretod.c src/coretodset.c \
src/coretodtickle.c \
src/coretodtickspersec.c \
src/coretodadjust.c
libscore_a_SOURCES += src/coretodabsolutetimeout.c
## WATCHDOG_C_FILES
libscore_a_SOURCES += src/watchdog.c src/watchdogadjust.c \

View File

@@ -21,6 +21,7 @@
#include <rtems/score/tod.h>
#include <rtems/score/timestamp.h>
#include <rtems/score/timecounterimpl.h>
#include <rtems/score/watchdog.h>
#include <sys/time.h>
#include <time.h>
@@ -339,6 +340,44 @@ RTEMS_INLINE_ROUTINE bool _TOD_Is_set( void )
return _TOD.is_set;
}
/**
* @brief Absolute timeout conversion results.
*
* This enumeration defines the possible results of converting
* an absolute time used for timeouts to POSIX blocking calls to
* a number of ticks for example.
*/
typedef enum {
/** The timeout is invalid. */
TOD_ABSOLUTE_TIMEOUT_INVALID,
/** The timeout represents a time that is in the past. */
TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST,
/** The timeout represents a time that is equal to the current time. */
TOD_ABSOLUTE_TIMEOUT_IS_NOW,
/** The timeout represents a time that is in the future. */
TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE,
} TOD_Absolute_timeout_conversion_results;
/**
* @brief Convert absolute timeout to ticks.
*
* This method takes an absolute time being used as a timeout
* to a blocking directive, validates it and returns the number
* of corresponding clock ticks for use by the SuperCore.
*
* @param[in] abstime is a pointer to the timeout
* @param[out] ticks_out will contain the number of ticks
*
* @return This method returns the number of ticks in @a ticks_out
* and a status value indicating whether the absolute time
* is valid, in the past, equal to the current time or in
* the future as it should be.
*/
TOD_Absolute_timeout_conversion_results _TOD_Absolute_timeout_to_ticks(
const struct timespec *abstime,
Watchdog_Interval *ticks_out
);
/**@}*/
#ifdef __cplusplus

View File

@@ -2,7 +2,7 @@
* @file
*
* @brief Convert Absolute Timeout to Ticks
* @ingroup POSIX_TIMETYPES Time Types
* @ingroup ScoreTOD
*/
/*
@@ -18,23 +18,12 @@
#include "config.h"
#endif
#include <stdarg.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <semaphore.h>
#include <limits.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/posix/time.h>
#include <rtems/score/todimpl.h>
#include <rtems/seterr.h>
/*
* The abstime is a walltime. We turn it into an interval.
*/
POSIX_Absolute_timeout_conversion_results_t _POSIX_Absolute_timeout_to_ticks(
TOD_Absolute_timeout_conversion_results _TOD_Absolute_timeout_to_ticks(
const struct timespec *abstime,
Watchdog_Interval *ticks_out
)
@@ -52,7 +41,7 @@ POSIX_Absolute_timeout_conversion_results_t _POSIX_Absolute_timeout_to_ticks(
* Is the absolute time even valid?
*/
if ( !_Timespec_Is_valid(abstime) )
return POSIX_ABSOLUTE_TIMEOUT_INVALID;
return TOD_ABSOLUTE_TIMEOUT_INVALID;
/*
* Is the absolute time in the past?
@@ -60,7 +49,7 @@ POSIX_Absolute_timeout_conversion_results_t _POSIX_Absolute_timeout_to_ticks(
_TOD_Get_as_timespec( &current_time );
if ( _Timespec_Less_than( abstime, &current_time ) )
return POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST;
return TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST;
/*
* How long until the requested absolute time?
@@ -77,12 +66,12 @@ POSIX_Absolute_timeout_conversion_results_t _POSIX_Absolute_timeout_to_ticks(
* we better wear shades.
*/
if ( !*ticks_out )
return POSIX_ABSOLUTE_TIMEOUT_IS_NOW;
return TOD_ABSOLUTE_TIMEOUT_IS_NOW;
/*
* This is the case we were expecting and it took this long to
* get here.
*/
return POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE;
return TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE;
}