1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ScoreSMPImpl |
---|
5 | * |
---|
6 | * @brief SuperCore SMP Implementation |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2011. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.com/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef _RTEMS_SCORE_SMPIMPL_H |
---|
19 | #define _RTEMS_SCORE_SMPIMPL_H |
---|
20 | |
---|
21 | #include <rtems/score/smp.h> |
---|
22 | |
---|
23 | #ifdef __cplusplus |
---|
24 | extern "C" { |
---|
25 | #endif |
---|
26 | |
---|
27 | /** |
---|
28 | * @defgroup ScoreSMP SMP Support |
---|
29 | * |
---|
30 | * @ingroup Score |
---|
31 | * |
---|
32 | * This defines the interface of the SuperCore SMP support. |
---|
33 | * |
---|
34 | * @{ |
---|
35 | */ |
---|
36 | |
---|
37 | /** |
---|
38 | * @brief SMP message to request a processor shutdown. |
---|
39 | * |
---|
40 | * @see _SMP_Send_message(). |
---|
41 | */ |
---|
42 | #define SMP_MESSAGE_SHUTDOWN UINT32_C(0x1) |
---|
43 | |
---|
44 | /** |
---|
45 | * @brief SMP fatal codes. |
---|
46 | */ |
---|
47 | typedef enum { |
---|
48 | SMP_FATAL_SHUTDOWN |
---|
49 | } SMP_Fatal_code; |
---|
50 | |
---|
51 | /** |
---|
52 | * @brief Initialize SMP Handler |
---|
53 | * |
---|
54 | * This method initialize the SMP Handler. |
---|
55 | */ |
---|
56 | #if defined( RTEMS_SMP ) |
---|
57 | void _SMP_Handler_initialize( void ); |
---|
58 | #else |
---|
59 | #define _SMP_Handler_initialize() \ |
---|
60 | do { } while ( 0 ) |
---|
61 | #endif |
---|
62 | |
---|
63 | #if defined( RTEMS_SMP ) |
---|
64 | |
---|
65 | /** |
---|
66 | * @brief Sends a SMP message to a processor. |
---|
67 | * |
---|
68 | * The target processor may be the sending processor. |
---|
69 | * |
---|
70 | * @param[in] cpu The target processor of the message. |
---|
71 | * @param[in] message The message. |
---|
72 | */ |
---|
73 | void _SMP_Send_message( uint32_t cpu, uint32_t message ); |
---|
74 | |
---|
75 | /** |
---|
76 | * @brief 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 | #endif /* defined( RTEMS_SMP ) */ |
---|
90 | |
---|
91 | /** |
---|
92 | * @brief Request other cores to perform first context switch. |
---|
93 | * |
---|
94 | * Send message to other cores requesting them to perform |
---|
95 | * their first context switch operation. |
---|
96 | */ |
---|
97 | #if defined( RTEMS_SMP ) |
---|
98 | void _SMP_Request_other_cores_to_perform_first_context_switch( void ); |
---|
99 | #else |
---|
100 | #define _SMP_Request_other_cores_to_perform_first_context_switch() \ |
---|
101 | do { } while ( 0 ) |
---|
102 | #endif |
---|
103 | |
---|
104 | /** |
---|
105 | * @brief Request other cores to shutdown. |
---|
106 | * |
---|
107 | * Send message to other cores requesting them to shutdown. |
---|
108 | */ |
---|
109 | #if defined( RTEMS_SMP ) |
---|
110 | void _SMP_Request_other_cores_to_shutdown( void ); |
---|
111 | #else |
---|
112 | #define _SMP_Request_other_cores_to_shutdown() \ |
---|
113 | do { } while ( 0 ) |
---|
114 | #endif |
---|
115 | |
---|
116 | /** @} */ |
---|
117 | |
---|
118 | #ifdef __cplusplus |
---|
119 | } |
---|
120 | #endif |
---|
121 | |
---|
122 | #endif |
---|
123 | /* end of include file */ |
---|