source: rtems/cpukit/score/include/rtems/bspsmp.h @ 39e51758

4.115
Last change on this file since 39e51758 was 39e51758, checked in by Sebastian Huber <sebastian.huber@…>, on 06/14/13 at 12:00:38

smp: Add and use _CPU_SMP_Get_current_processor()

Add and use _SMP_Get_current_processor() and
rtems_smp_get_current_processor().

Delete bsp_smp_interrupt_cpu().

Change type of current processor index from int to uint32_t to match
_SMP_Processor_count type.

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/**
2 *  @file  rtems/bspsmp.h
3 *
4 *  @brief Interface Between RTEMS and an SMP Aware BSP
5 *
6 *  This include file defines the interface between RTEMS and an
7 *  SMP aware BSP.  These methods will only be used when RTEMS
8 *  is configured with SMP support enabled.
9 */
10
11/*
12 *  COPYRIGHT (c) 1989-2011.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.com/license/LICENSE.
18 */
19
20#ifndef _RTEMS_BSPSMP_H
21#define _RTEMS_BSPSMP_H
22
23#include <rtems/score/cpuopts.h>
24
25#if defined (RTEMS_SMP)
26#include <rtems/score/percpu.h>
27
28/**
29 *  @defgroup RTEMS BSP SMP Interface
30 *
31 *  @ingroup Score
32 *
33 *  This defines the interface between RTEMS and the BSP for
34 *  SMP support.  The interface uses the term primary
35 *  to refer to the "boot" processor and secondary to refer
36 *  to the "application" processors.  Different architectures
37 *  use different terminology.
38 *
39 *  It is assumed that when the processor is reset and thus
40 *  when RTEMS is initialized, that the primary processor is
41 *  the only one executing.  The others are assumed to be in
42 *  a quiescent or reset state awaiting a command to come online.
43 */
44
45/**@{*/
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51
52#ifndef ASM
53
54/**
55 * @brief Performs BSP specific SMP initialization in the context of the main
56 * processor.
57 *
58 * This function is invoked on the main processor by RTEMS during
59 * initialization.  All interrupt stacks are allocated at this point in case
60 * the CPU port allocates the interrupt stacks.
61 *
62 * The BSP may start secondary processors now.
63 *
64 * @param[in] configured_cpu_count The count of processors requested by the
65 * application configuration.
66 *
67 * @return The count of processors available for the application in the system.
68 * This value is less than or equal to the configured count of processors.
69 */
70uint32_t bsp_smp_initialize( uint32_t configured_cpu_count );
71
72/**
73 *  @brief Generate an interprocessor broadcast interrupt.
74 *
75 *  This method is invoked when RTEMS wants to let all of the other
76 *  CPUs know that it has sent them message.  CPUs not including
77 *  the originating CPU should receive the interrupt.
78
79 *
80 *  @note On CPUs without the capability to generate a broadcast
81 *        to all other CPUs interrupt, this can be implemented by
82 *        a loop of sending interrupts to specific CPUs.
83 */
84void bsp_smp_broadcast_interrupt(void);
85
86/**
87 *  @brief Generate a interprocessor interrupt.
88 *
89 *  This method is invoked by RTEMS to let @a cpu know that it
90 *  has sent it a message.
91 *
92 *  @param [in] cpu is the recipient CPU
93 */
94void bsp_smp_interrupt_cpu(
95  int cpu
96);
97
98/**
99 * @brief Performs high-level initialization of a secondary processor and runs
100 * the application threads.
101 *
102 * The low-level initialization code must call this function to hand over the
103 * control of this processor to RTEMS.  Interrupts must be disabled.  It must
104 * be possible to send inter-processor interrupts to this processor.  Since
105 * interrupts are disabled the inter-processor interrupt delivery is postponed
106 * until interrupts are enabled the first time.  This is usually a side-effect
107 * of the context switch to the first thread.
108 *
109 * The pre-requisites for the call to this function are
110 * - disabled interrupts,
111 * - delivery of inter-processor interrupts is possible,
112 * - a valid stack pointer and enough stack space,
113 * - a valid code memory, and
114 * - a valid BSS section.
115 *
116 * This function must not be called by the main processor.  This function does
117 * not return to the caller.
118 */
119void rtems_smp_secondary_cpu_initialize( void )
120  RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
121
122/**
123 *  @brief Process the incoming interprocessor request.
124 *
125 *  This is the method called by the BSP's interrupt handler
126 *  to process the incoming interprocessor request.
127 */
128void rtems_smp_process_interrupt(void);
129
130#endif
131
132#ifdef __cplusplus
133}
134#endif
135
136#endif
137
138/**@}*/
139#endif
140
141/* end of include file */
Note: See TracBrowser for help on using the repository browser.