Changeset 12f93fbb in rtems


Ignore:
Timestamp:
Jul 27, 2015, 11:19:17 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
214d8ed
Parents:
0e3c59d6
git-author:
Sebastian Huber <sebastian.huber@…> (07/27/15 11:19:17)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/30/15 07:11:17)
Message:

score: Add thread queue for self-contained objects

Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/configure.ac

    r0e3c59d6 r12f93fbb  
    7272AC_CHECK_DECLS([__env_lock],,,[#include <envlock.h>])
    7373AC_CHECK_DECLS([__env_unlock],,,[#include <envlock.h>])
     74AC_CHECK_TYPES([struct _Thread_queue_Queue],[],[],[#include <sys/lock.h>])
    7475
    7576# Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME
  • cpukit/score/include/rtems/score/threadqimpl.h

    r0e3c59d6 r12f93fbb  
    3333 */
    3434/**@{*/
     35
     36/**
     37 * @brief Thread queue with a layout compatible to struct _Thread_queue_Queue
     38 * defined in Newlib <sys/lock.h>.
     39 */
     40typedef struct {
     41  Thread_queue_Queue Queue;
     42
     43#if !defined(RTEMS_SMP)
     44  /*
     45   * The struct _Thread_queue_Queue definition is independent of the RTEMS
     46   * build configuration.  Thus, the storage space for the SMP lock is always
     47   * present.  In SMP configurations, the SMP lock is contained in the
     48   * Thread_queue_Queue.
     49   */
     50  unsigned int reserved[2];
     51#endif
     52} Thread_queue_Syslock_queue;
    3553
    3654RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_initialize(
  • cpukit/score/src/threadq.c

    r0e3c59d6 r12f93fbb  
    2222#include <rtems/score/rbtreeimpl.h>
    2323#include <rtems/score/threadimpl.h>
     24
     25#if HAVE_STRUCT__THREAD_QUEUE_QUEUE
     26
     27RTEMS_STATIC_ASSERT(
     28  offsetof( Thread_queue_Syslock_queue, Queue.heads )
     29    == offsetof( struct _Thread_queue_Queue, _heads ),
     30  THREAD_QUEUE_SYSLOCK_QUEUE_HEADS
     31);
     32
     33RTEMS_STATIC_ASSERT(
     34#if defined(RTEMS_SMP)
     35  offsetof( Thread_queue_Syslock_queue, Queue.Lock.next_ticket )
     36#else
     37  offsetof( Thread_queue_Syslock_queue, reserved[ 0 ] )
     38#endif
     39    == offsetof( struct _Thread_queue_Queue, _Lock._next_ticket ),
     40  THREAD_QUEUE_SYSLOCK_QUEUE_NEXT_TICKET
     41);
     42
     43RTEMS_STATIC_ASSERT(
     44#if defined(RTEMS_SMP)
     45  offsetof( Thread_queue_Syslock_queue, Queue.Lock.now_serving )
     46#else
     47  offsetof( Thread_queue_Syslock_queue, reserved[ 1 ] )
     48#endif
     49    == offsetof( struct _Thread_queue_Queue, _Lock._now_serving ),
     50  THREAD_QUEUE_SYSLOCK_QUEUE_NOW_SERVING
     51);
     52
     53RTEMS_STATIC_ASSERT(
     54  sizeof( Thread_queue_Syslock_queue )
     55    == sizeof( struct _Thread_queue_Queue ),
     56  THREAD_QUEUE_SYSLOCK_QUEUE_SIZE
     57);
     58
     59#endif /* HAVE_STRUCT__THREAD_QUEUE_QUEUE */
    2460
    2561RBTree_Compare_result _Thread_queue_Compare_priority(
Note: See TracChangeset for help on using the changeset viewer.