Files
rtems/cpukit/libcsupport/src
Sebastian Huber c42be504c9 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.
2016-11-23 12:52:06 +01:00
..
2015-10-26 09:13:19 +01:00
2015-10-26 09:13:19 +01:00
2014-11-28 11:23:53 +01:00
2015-01-22 07:52:40 +01:00
2015-10-26 09:13:19 +01:00
2015-10-26 09:13:19 +01:00
2015-10-26 09:13:19 +01:00
2016-05-25 15:47:34 +10:00
2015-10-26 09:13:19 +01:00
2014-11-20 10:30:22 +01:00
2015-10-26 09:13:19 +01:00
2015-10-26 09:13:19 +01:00
2015-10-26 09:13:19 +01:00
2015-10-26 09:13:19 +01:00
2016-02-25 11:35:54 +01:00
2016-07-22 09:13:07 +02:00
2015-11-25 08:33:31 +01:00
2015-10-26 09:13:19 +01:00
2016-05-20 07:49:37 +02:00
2015-10-26 09:13:19 +01:00
2015-12-24 16:52:34 -06:00
2014-10-24 16:05:59 -07:00
2015-01-22 07:52:40 +01:00
2015-10-26 09:13:19 +01:00
2015-10-26 09:13:19 +01:00
2016-11-02 08:46:47 +01:00
2015-10-26 09:13:19 +01:00
2016-09-19 07:52:34 +02:00
2015-05-19 12:00:44 +02:00
2015-10-26 09:13:19 +01:00
2015-10-26 09:13:19 +01:00

--

Overview of newlib support (newlib is from CYGNUS)
    Each task can have its own libc state including:
        open stdio files
        strtok
        multi precision arithmetic state
        etc.

    This is implemented by a reentrancy data structure for each task.

    When a task is "started" (in RTEMS sense) the reentrancy structure
    is allocated.

    When task is switched to, the value of global variable _impure_ptr
    is changed to the value of the new tasks reentrancy structure.

    When a task is deleted
        atexit() processing (for that task) happens
        task's stdio buffers are flushed

    When exit(3) is called
        calling task's atexit processing done
        global libc state atexit processing done
            (this will include any atexit routines installed by drivers)
        executive is shutdown
            causes a context switch back to bsp land


NOTE:
    libc extension are installed by bsp_libc_init()
        iff we are using clock interrupts.
        This hack is necessary to allow the tmtests to avoid
        timing the extensions.