forked from Imagelibrary/rtems
@@ -34,15 +34,7 @@ extern "C" {
|
||||
* this class of objects.
|
||||
*/
|
||||
|
||||
POSIX_EXTERN Objects_Information _POSIX_Spinlock_Information;
|
||||
|
||||
/**
|
||||
* @brief POSIX spinlock manager initialization.
|
||||
*
|
||||
* This routine performs the initialization necessary for this manager.
|
||||
*/
|
||||
|
||||
void _POSIX_Spinlock_Manager_initialization(void);
|
||||
extern Objects_Information _POSIX_Spinlock_Information;
|
||||
|
||||
/**
|
||||
* @brief Translate core spinlock status code.
|
||||
|
||||
@@ -21,12 +21,15 @@
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/config.h>
|
||||
#include <rtems/sysinit.h>
|
||||
#include <rtems/posix/spinlockimpl.h>
|
||||
|
||||
Objects_Information _POSIX_Spinlock_Information;
|
||||
|
||||
/**
|
||||
* @brief _POSIX_Spinlock_Manager_initialization
|
||||
*/
|
||||
void _POSIX_Spinlock_Manager_initialization(void)
|
||||
static void _POSIX_Spinlock_Manager_initialization(void)
|
||||
{
|
||||
_Objects_Initialize_information(
|
||||
&_POSIX_Spinlock_Information, /* object information table */
|
||||
@@ -44,3 +47,9 @@ void _POSIX_Spinlock_Manager_initialization(void)
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
RTEMS_SYSINIT_ITEM(
|
||||
_POSIX_Spinlock_Manager_initialization,
|
||||
RTEMS_SYSINIT_POSIX_SPINLOCK,
|
||||
RTEMS_SYSINIT_ORDER_MIDDLE
|
||||
);
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <rtems/posix/config.h>
|
||||
#include <rtems/posix/priorityimpl.h>
|
||||
#include <rtems/posix/psignalimpl.h>
|
||||
#include <rtems/posix/spinlockimpl.h>
|
||||
#endif
|
||||
|
||||
void _POSIX_Fatal_error( POSIX_Fatal_domain domain, int eno )
|
||||
@@ -54,8 +53,4 @@ void _POSIX_API_Initialize(void)
|
||||
*/
|
||||
|
||||
_POSIX_Key_Manager_initialization();
|
||||
|
||||
#ifdef RTEMS_POSIX_API
|
||||
_POSIX_Spinlock_Manager_initialization();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ extern "C" {
|
||||
#define RTEMS_SYSINIT_POSIX_TIMER 000366
|
||||
#define RTEMS_SYSINIT_POSIX_BARRIER 000367
|
||||
#define RTEMS_SYSINIT_POSIX_RWLOCK 000368
|
||||
#define RTEMS_SYSINIT_POSIX_SPINLOCK 000369
|
||||
#define RTEMS_SYSINIT_POSIX_CLEANUP 00036a
|
||||
#define RTEMS_SYSINIT_IDLE_THREADS 000380
|
||||
#define RTEMS_SYSINIT_BSP_LIBC 000400
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <rtems/posix/pthreadimpl.h>
|
||||
#include <rtems/posix/rwlockimpl.h>
|
||||
#include <rtems/posix/semaphoreimpl.h>
|
||||
#include <rtems/posix/spinlockimpl.h>
|
||||
#include <rtems/posix/timerimpl.h>
|
||||
#endif /* RTEMS_POSIX_API */
|
||||
#include <rtems/rtems/barrierimpl.h>
|
||||
@@ -107,6 +108,8 @@ typedef enum {
|
||||
POSIX_BARRIER_POST,
|
||||
POSIX_RWLOCK_PRE,
|
||||
POSIX_RWLOCK_POST,
|
||||
POSIX_SPINLOCK_PRE,
|
||||
POSIX_SPINLOCK_POST,
|
||||
POSIX_CLEANUP_PRE,
|
||||
POSIX_CLEANUP_POST,
|
||||
#endif /* RTEMS_POSIX_API */
|
||||
@@ -467,6 +470,18 @@ LAST(RTEMS_SYSINIT_POSIX_RWLOCK)
|
||||
next_step(POSIX_RWLOCK_POST);
|
||||
}
|
||||
|
||||
FIRST(RTEMS_SYSINIT_POSIX_SPINLOCK)
|
||||
{
|
||||
assert(_POSIX_Spinlock_Information.maximum == 0);
|
||||
next_step(POSIX_SPINLOCK_PRE);
|
||||
}
|
||||
|
||||
LAST(RTEMS_SYSINIT_POSIX_SPINLOCK)
|
||||
{
|
||||
assert(_POSIX_Spinlock_Information.maximum != 0);
|
||||
next_step(POSIX_SPINLOCK_POST);
|
||||
}
|
||||
|
||||
static size_t user_extensions_pre_posix_cleanup;
|
||||
|
||||
FIRST(RTEMS_SYSINIT_POSIX_CLEANUP)
|
||||
@@ -608,6 +623,8 @@ static void Init(rtems_task_argument arg)
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 1
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 1
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_TIMERS 1
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
|
||||
|
||||
Reference in New Issue
Block a user