diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-16 14:50:09 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-23 12:52:06 +0100 |
commit | c42be504c92d76d2e06d0fc8ebd05fc913376d2d (patch) | |
tree | 259f8a712a6139f427888647955bc3c95480877e /testsuites/psxtests/psxspin02/main.c | |
parent | score: Add RTEMS_ALIAS() (diff) | |
download | rtems-c42be504c92d76d2e06d0fc8ebd05fc913376d2d.tar.bz2 |
posix: Add self-contained pthread spinlock
Turn pthread_spinlock_t into a self-contained object. On uni-processor
configurations, interrupts are disabled in the lock/trylock operations
and the previous interrupt status is restored in the corresponding
unlock operations. On SMP configurations, a ticket lock is a acquired
and released in addition.
The self-contained pthread_spinlock_t object is defined by Newlib in
<sys/_pthreadtypes.h>.
typedef struct {
struct _Ticket_lock_Control _lock;
__uint32_t _interrupt_state;
} pthread_spinlock_t;
This implementation is simple and efficient. However, this test case of
the Linux Test Project would fail due to call of printf() and sleep()
during spin lock ownership:
https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c
There is only limited support for profiling on SMP configurations.
Delete CORE spinlock implementation.
Update #2674.
Diffstat (limited to 'testsuites/psxtests/psxspin02/main.c')
-rw-r--r-- | testsuites/psxtests/psxspin02/main.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/testsuites/psxtests/psxspin02/main.c b/testsuites/psxtests/psxspin02/main.c deleted file mode 100644 index 15eb51ea6c..0000000000 --- a/testsuites/psxtests/psxspin02/main.c +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * - * Simple test program wrapper for Spinlocks - */ - -/* - * COPYRIGHT (c) 1989-2012. - * 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. - */ - -#define CONFIGURE_INIT - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <bsp.h> -#include <pmacros.h> - -/* forward declarations to avoid warnings */ -rtems_task Init(rtems_task_argument ignored); -void test_main(void); - -rtems_task Init( - rtems_task_argument ignored -) -{ - test_main(); - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 1 - -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) -#define CONFIGURE_INIT_TASK_PRIORITY 2 -#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_PREEMPT - -#define CONFIGURE_EXTRA_TASK_STACKS RTEMS_MINIMUM_STACK_SIZE - -#define CONFIGURE_INIT - -#include <rtems/confdefs.h> - -/* end of file */ |