From 4eee8781458f271be78e6f92cf344f9dbd2b4c8e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 14 Dec 2015 16:40:28 +0100 Subject: Optional POSIX Spinlock initialization Update #2408. --- testsuites/sptests/spsysinit01/init.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'testsuites/sptests/spsysinit01') diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c index e5d6dc9fc4..042c60002c 100644 --- a/testsuites/sptests/spsysinit01/init.c +++ b/testsuites/sptests/spsysinit01/init.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #endif /* RTEMS_POSIX_API */ #include @@ -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 -- cgit v1.2.3