1 | /** |
---|
2 | * @file rtems/score/smp.h |
---|
3 | * |
---|
4 | * This include file defines the interface to the SuperCore |
---|
5 | * SMP support that is used internally to RTEMS. |
---|
6 | */ |
---|
7 | |
---|
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.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef _RTEMS_SCORE_SMP_H |
---|
20 | #define _RTEMS_SCORE_SMP_H |
---|
21 | |
---|
22 | #if defined (RTEMS_SMP) |
---|
23 | #include <rtems/score/percpu.h> |
---|
24 | |
---|
25 | /** |
---|
26 | * @defgroup SuperCore SMP Support |
---|
27 | * |
---|
28 | * This defines the interface of the SuperCore support |
---|
29 | * code for SMP support. |
---|
30 | */ |
---|
31 | |
---|
32 | /**@{*/ |
---|
33 | |
---|
34 | #ifdef __cplusplus |
---|
35 | extern "C" { |
---|
36 | #endif |
---|
37 | |
---|
38 | /** |
---|
39 | * This defines the bit which indicates the interprocessor interrupt |
---|
40 | * has been requested so that RTEMS will reschedule on this CPU |
---|
41 | * because the currently executing thread needs to be switched out. |
---|
42 | */ |
---|
43 | #define RTEMS_BSP_SMP_CONTEXT_SWITCH_NECESSARY 0x01 |
---|
44 | |
---|
45 | /** |
---|
46 | * This defines the bit which indicates the interprocessor interrupt |
---|
47 | * has been requested so that RTEMS will reschedule on this CPU |
---|
48 | * because the currently executing thread has been sent a signal. |
---|
49 | */ |
---|
50 | #define RTEMS_BSP_SMP_SIGNAL_TO_SELF 0x02 |
---|
51 | |
---|
52 | /** |
---|
53 | * This defines the bit which indicates the interprocessor interrupt |
---|
54 | * has been requested so that this CPU will be shutdown. This is done |
---|
55 | * as part of rtems_executive_shutdown(). |
---|
56 | */ |
---|
57 | #define RTEMS_BSP_SMP_SHUTDOWN 0x04 |
---|
58 | |
---|
59 | /** |
---|
60 | * This defines the bit which indicates the interprocessor interrupt |
---|
61 | * has been requested that the receiving CPU needs to perform a context |
---|
62 | * switch to the first task. |
---|
63 | */ |
---|
64 | #define RTEMS_BSP_SMP_FIRST_TASK 0x08 |
---|
65 | |
---|
66 | #ifndef ASM |
---|
67 | /** |
---|
68 | * @brief Number of CPUs in SMP System |
---|
69 | * |
---|
70 | * This variable is set during the SMP initialization sequence to |
---|
71 | * indicate the number of CPUs in this system. |
---|
72 | */ |
---|
73 | SCORE_EXTERN uint32_t _SMP_Processor_count; |
---|
74 | |
---|
75 | /** |
---|
76 | * @brief Make Request of Others CPUs |
---|
77 | * |
---|
78 | * This method is invoked by RTEMS when it needs to make a request |
---|
79 | * of the other CPUs. It should be implemented using some type of |
---|
80 | * interprocessor interrupt. CPUs not including the originating |
---|
81 | * CPU should receive the message. |
---|
82 | * |
---|
83 | * @param [in] message is message to send |
---|
84 | */ |
---|
85 | void _SMP_Broadcast_message( |
---|
86 | uint32_t message |
---|
87 | ); |
---|
88 | |
---|
89 | /** |
---|
90 | * @brief Request Other Cores to Perform First Context Switch |
---|
91 | * |
---|
92 | * Send message to other cores requesting them to perform |
---|
93 | * their first context switch operation. |
---|
94 | */ |
---|
95 | void _SMP_Request_other_cores_to_perform_first_context_switch(void); |
---|
96 | |
---|
97 | /** |
---|
98 | * @brief Request Dispatch on Other Cores |
---|
99 | * |
---|
100 | * Send message to other cores requesting them to perform |
---|
101 | * a thread dispatch operation. |
---|
102 | */ |
---|
103 | void _SMP_Request_other_cores_to_dispatch(void); |
---|
104 | |
---|
105 | /** |
---|
106 | * @Brief Request Other Cores to Shutdown |
---|
107 | * |
---|
108 | * Send message to other cores requesting them to shutdown. |
---|
109 | */ |
---|
110 | void _SMP_Request_other_cores_to_shutdown(void); |
---|
111 | |
---|
112 | #endif |
---|
113 | |
---|
114 | #ifdef __cplusplus |
---|
115 | } |
---|
116 | #endif |
---|
117 | |
---|
118 | #endif |
---|
119 | #endif |
---|
120 | /* end of include file */ |
---|