RTEMS
thread.c
Go to the documentation of this file.
1 
8 /*
9  * COPYRIGHT (c) 1989-2011.
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 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
21 #include <rtems/score/threadimpl.h>
23 #include <rtems/score/objectimpl.h>
24 #include <rtems/score/scheduler.h>
25 
26 #define THREAD_OFFSET_ASSERT( field ) \
27  RTEMS_STATIC_ASSERT( \
28  offsetof( Thread_Control, field ) == offsetof( Thread_Proxy_control, field ), \
29  field \
30  )
31 
32 THREAD_OFFSET_ASSERT( Object );
33 THREAD_OFFSET_ASSERT( Join_queue );
34 THREAD_OFFSET_ASSERT( current_state );
35 THREAD_OFFSET_ASSERT( Real_priority );
36 #if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
37 THREAD_OFFSET_ASSERT( resource_count );
38 #endif
39 THREAD_OFFSET_ASSERT( Scheduler );
40 THREAD_OFFSET_ASSERT( Wait );
41 THREAD_OFFSET_ASSERT( Timer );
42 #if defined(RTEMS_MULTIPROCESSING)
43 THREAD_OFFSET_ASSERT( receive_packet );
44 #endif
45 
47 {
49 
51  &information->Thread_queue_heads.Free,
52  information->Thread_queue_heads.initial,
53  _Objects_Get_maximum_index( &information->Objects ),
55  );
56 }
57 
59 {
60 #if defined(RTEMS_MULTIPROCESSING)
61  _Thread_MP_Handler_initialization( _MPCI_Configuration.maximum_proxies );
62 #endif
63 
64  /*
65  * Initialize the internal class of threads. We need an IDLE thread
66  * per CPU in an SMP system. In addition, if this is a loosely
67  * coupled multiprocessing system, account for the MPCI Server Thread.
68  */
70 }
static __inline__ Objects_Maximum _Objects_Get_maximum_index(const Objects_Information *information)
Returns the maximum index of the specified object class.
Definition: objectimpl.h:642
void _Objects_Initialize_information(Objects_Information *information)
Initializes the specified objects information.
static __inline__ void _Freechain_Initialize(Freechain_Control *freechain, void *initial_nodes, size_t number_nodes, size_t node_size)
Initializes a freechain.
Definition: freechainimpl.h:50
Freechain Handler API.
union Thread_Information::@27 Thread_queue_heads
Thread queue heads maintenance.
Objects_Information Objects
The object information.
Definition: thread.h:1004
Inlined Routines in the Object Handler.
The thread object information.
Definition: thread.h:1000
Freechain_Control Free
The free thread queue heads.
Definition: thread.h:1022
Thread_queue_Configured_heads * initial
Contains the initial set of thread queue heads.
Definition: thread.h:1015
const size_t _Thread_queue_Heads_size
Size of the thread queue heads of a particular application.
Inlined Routines from the Thread Handler.
void _Thread_Handler_initialization(void)
Initializes thread handler.
Definition: thread.c:58
Thread_Information _Thread_Information
The internal thread objects information.
Constants and Structures Associated with the Scheduler.
void _Thread_Initialize_information(Thread_Information *information)
Initializes the thread information.
Definition: thread.c:46