mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 17:36:15 +08:00
@@ -35,13 +35,6 @@ extern "C" {
|
||||
|
||||
#include <rtems/posix/config.h>
|
||||
|
||||
/**
|
||||
* @brief POSIX Timer Manager Initialization
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
void _POSIX_Timer_Manager_initialization(void);
|
||||
|
||||
/**
|
||||
* @brief Create a Per-Process Timer
|
||||
*/
|
||||
|
||||
@@ -50,13 +50,6 @@ extern "C" {
|
||||
#error "POSIX_TIMER_RELATIVE == TIMER_ABSTIME"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief POSIX Timer Manager Initialization
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
void _POSIX_Timer_Manager_initialization(void);
|
||||
|
||||
/**
|
||||
* @brief POSIX Timer Manager Timer Service Routine Helper
|
||||
*
|
||||
@@ -79,7 +72,7 @@ bool _POSIX_Timer_Insert_helper(
|
||||
* The following defines the information control block used to manage
|
||||
* this class of objects.
|
||||
*/
|
||||
POSIX_EXTERN Objects_Information _POSIX_Timer_Information;
|
||||
extern Objects_Information _POSIX_Timer_Information;
|
||||
|
||||
/**
|
||||
* @brief POSIX Timer Allocate
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
/************************************/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <rtems/sysinit.h>
|
||||
#include <rtems/rtems/status.h>
|
||||
#include <rtems/rtems/types.h>
|
||||
#include <rtems/rtems/timer.h>
|
||||
@@ -44,6 +45,8 @@
|
||||
|
||||
#include <rtems/posix/timerimpl.h>
|
||||
|
||||
Objects_Information _POSIX_Timer_Information;
|
||||
|
||||
/*
|
||||
* _POSIX_Timer_Manager_initialization
|
||||
*
|
||||
@@ -53,7 +56,7 @@
|
||||
* the timers are stored
|
||||
*/
|
||||
|
||||
void _POSIX_Timer_Manager_initialization(void)
|
||||
static void _POSIX_Timer_Manager_initialization(void)
|
||||
{
|
||||
_Objects_Initialize_information(
|
||||
&_POSIX_Timer_Information, /* object information table */
|
||||
@@ -72,3 +75,9 @@ void _POSIX_Timer_Manager_initialization(void)
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
RTEMS_SYSINIT_ITEM(
|
||||
_POSIX_Timer_Manager_initialization,
|
||||
RTEMS_SYSINIT_POSIX_TIMER,
|
||||
RTEMS_SYSINIT_ORDER_MIDDLE
|
||||
);
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <rtems/posix/priorityimpl.h>
|
||||
#include <rtems/posix/psignalimpl.h>
|
||||
#include <rtems/posix/rwlockimpl.h>
|
||||
#include <rtems/posix/timerimpl.h>
|
||||
#include <rtems/posix/spinlockimpl.h>
|
||||
#endif
|
||||
|
||||
@@ -59,7 +58,6 @@ void _POSIX_API_Initialize(void)
|
||||
_POSIX_Key_Manager_initialization();
|
||||
|
||||
#ifdef RTEMS_POSIX_API
|
||||
_POSIX_Timer_Manager_initialization();
|
||||
_POSIX_Barrier_Manager_initialization();
|
||||
_POSIX_RWLock_Manager_initialization();
|
||||
_POSIX_Spinlock_Manager_initialization();
|
||||
|
||||
@@ -48,6 +48,7 @@ extern "C" {
|
||||
#define RTEMS_SYSINIT_POSIX_MUTEX 000363
|
||||
#define RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE 000364
|
||||
#define RTEMS_SYSINIT_POSIX_SEMAPHORE 000365
|
||||
#define RTEMS_SYSINIT_POSIX_TIMER 000366
|
||||
#define RTEMS_SYSINIT_POSIX_CLEANUP 00036a
|
||||
#define RTEMS_SYSINIT_IDLE_THREADS 000380
|
||||
#define RTEMS_SYSINIT_BSP_LIBC 000400
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <rtems/posix/psignalimpl.h>
|
||||
#include <rtems/posix/pthreadimpl.h>
|
||||
#include <rtems/posix/semaphoreimpl.h>
|
||||
#include <rtems/posix/timerimpl.h>
|
||||
#endif /* RTEMS_POSIX_API */
|
||||
#include <rtems/rtems/barrierimpl.h>
|
||||
#include <rtems/rtems/dpmemimpl.h>
|
||||
@@ -98,6 +99,8 @@ typedef enum {
|
||||
POSIX_MESSAGE_QUEUE_POST,
|
||||
POSIX_SEMAPHORE_PRE,
|
||||
POSIX_SEMAPHORE_POST,
|
||||
POSIX_TIMER_PRE,
|
||||
POSIX_TIMER_POST,
|
||||
POSIX_CLEANUP_PRE,
|
||||
POSIX_CLEANUP_POST,
|
||||
#endif /* RTEMS_POSIX_API */
|
||||
@@ -422,6 +425,18 @@ LAST(RTEMS_SYSINIT_POSIX_SEMAPHORE)
|
||||
next_step(POSIX_SEMAPHORE_POST);
|
||||
}
|
||||
|
||||
FIRST(RTEMS_SYSINIT_POSIX_TIMER)
|
||||
{
|
||||
assert(_POSIX_Timer_Information.maximum == 0);
|
||||
next_step(POSIX_TIMER_PRE);
|
||||
}
|
||||
|
||||
LAST(RTEMS_SYSINIT_POSIX_TIMER)
|
||||
{
|
||||
assert(_POSIX_Timer_Information.maximum != 0);
|
||||
next_step(POSIX_TIMER_POST);
|
||||
}
|
||||
|
||||
static size_t user_extensions_pre_posix_cleanup;
|
||||
|
||||
FIRST(RTEMS_SYSINIT_POSIX_CLEANUP)
|
||||
@@ -559,6 +574,8 @@ static void Init(rtems_task_argument arg)
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 1
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_TIMERS 1
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
|
||||
|
||||
#endif /* RTEMS_POSIX_API */
|
||||
|
||||
Reference in New Issue
Block a user