source: rtems/cpukit/score/src/threadq.c @ dfcc8bb

Last change on this file since dfcc8bb was dfcc8bb, checked in by Sebastian Huber <sebastian.huber@…>, on May 3, 2016 at 5:43:54 AM

score: Adjust thread queue layout

Adjust thread queue layout according to Newlib. This makes it possible
to use the same implementation for <sys/lock.h> and CORE mutexes in the
future.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Thread Queue Initialize
5 *  @ingroup ScoreThreadQ
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2014.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/threadqimpl.h>
22#include <rtems/score/rbtreeimpl.h>
23#include <rtems/score/threadimpl.h>
24
25#if HAVE_STRUCT__THREAD_QUEUE_QUEUE
26
27RTEMS_STATIC_ASSERT(
28#if defined(RTEMS_SMP)
29  offsetof( Thread_queue_Syslock_queue, Queue.Lock.next_ticket )
30#else
31  offsetof( Thread_queue_Syslock_queue, reserved[ 0 ] )
32#endif
33    == offsetof( struct _Thread_queue_Queue, _Lock._next_ticket ),
34  THREAD_QUEUE_SYSLOCK_QUEUE_NEXT_TICKET
35);
36
37RTEMS_STATIC_ASSERT(
38#if defined(RTEMS_SMP)
39  offsetof( Thread_queue_Syslock_queue, Queue.Lock.now_serving )
40#else
41  offsetof( Thread_queue_Syslock_queue, reserved[ 1 ] )
42#endif
43    == offsetof( struct _Thread_queue_Queue, _Lock._now_serving ),
44  THREAD_QUEUE_SYSLOCK_QUEUE_NOW_SERVING
45);
46
47RTEMS_STATIC_ASSERT(
48  offsetof( Thread_queue_Syslock_queue, Queue.heads )
49    == offsetof( struct _Thread_queue_Queue, _heads ),
50  THREAD_QUEUE_SYSLOCK_QUEUE_HEADS
51);
52
53RTEMS_STATIC_ASSERT(
54  offsetof( Thread_queue_Syslock_queue, Queue.owner )
55    == offsetof( struct _Thread_queue_Queue, _owner ),
56  THREAD_QUEUE_SYSLOCK_QUEUE_OWNER
57);
58
59RTEMS_STATIC_ASSERT(
60  sizeof( Thread_queue_Syslock_queue )
61    == sizeof( struct _Thread_queue_Queue ),
62  THREAD_QUEUE_SYSLOCK_QUEUE_SIZE
63);
64
65#endif /* HAVE_STRUCT__THREAD_QUEUE_QUEUE */
66
67void _Thread_queue_Initialize( Thread_queue_Control *the_thread_queue )
68{
69  _Thread_queue_Queue_initialize( &the_thread_queue->Queue );
70#if defined(RTEMS_SMP)
71  _SMP_lock_Stats_initialize( &the_thread_queue->Lock_stats, "Thread Queue" );
72#endif
73}
74
75#if defined(RTEMS_MULTIPROCESSING)
76void _Thread_queue_MP_callout_do_nothing(
77  Thread_Control *the_proxy,
78  Objects_Id      mp_id
79)
80{
81  /* Do nothing */
82}
83#endif
Note: See TracBrowser for help on using the repository browser.