1 | /* |
---|
2 | * SuperCore Barrier Handler |
---|
3 | * |
---|
4 | * DESCRIPTION: |
---|
5 | * |
---|
6 | * This package is part of the implementation of the SuperCore Barrier Handler. |
---|
7 | * |
---|
8 | * COPYRIGHT (c) 1989-2006. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.com/license/LICENSE. |
---|
14 | * |
---|
15 | * $Id$ |
---|
16 | */ |
---|
17 | |
---|
18 | #if HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <rtems/system.h> |
---|
23 | #include <rtems/score/corebarrier.h> |
---|
24 | #include <rtems/score/states.h> |
---|
25 | #include <rtems/score/thread.h> |
---|
26 | #include <rtems/score/threadq.h> |
---|
27 | #if defined(RTEMS_MULTIPROCESSING) |
---|
28 | #include <rtems/score/mpci.h> |
---|
29 | #endif |
---|
30 | |
---|
31 | /*PAGE |
---|
32 | * |
---|
33 | * _CORE_barrier_Initialize |
---|
34 | * |
---|
35 | * This function initialize a barrier and sets the initial value based |
---|
36 | * on the given count. |
---|
37 | * |
---|
38 | * Input parameters: |
---|
39 | * the_barrier - the barrier control block to initialize |
---|
40 | * the_barrier_attributes - the attributes specified at create time |
---|
41 | * |
---|
42 | * Output parameters: NONE |
---|
43 | */ |
---|
44 | |
---|
45 | void _CORE_barrier_Initialize( |
---|
46 | CORE_barrier_Control *the_barrier, |
---|
47 | CORE_barrier_Attributes *the_barrier_attributes |
---|
48 | ) |
---|
49 | { |
---|
50 | |
---|
51 | the_barrier->Attributes = *the_barrier_attributes; |
---|
52 | the_barrier->number_of_waiting_threads = 0; |
---|
53 | |
---|
54 | _Thread_queue_Initialize( |
---|
55 | &the_barrier->Wait_queue, |
---|
56 | THREAD_QUEUE_DISCIPLINE_FIFO, |
---|
57 | STATES_WAITING_FOR_BARRIER, |
---|
58 | CORE_BARRIER_TIMEOUT |
---|
59 | ); |
---|
60 | } |
---|