5
Last change
on this file since 0d362ff3 was
0d362ff3,
checked in by Sebastian Huber <sebastian.huber@…>, on 07/23/18 at 12:54:51
|
score: _SMP_Inter_processor_interrupt_handler()
Pass current processor control via parameter since it may be already
available at the caller side.
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 2013, 2018 embedded brains GmbH. All rights reserved. |
---|
3 | * |
---|
4 | * embedded brains GmbH |
---|
5 | * Dornierstr. 4 |
---|
6 | * 82178 Puchheim |
---|
7 | * Germany |
---|
8 | * <info@embedded-brains.de> |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.org/license/LICENSE. |
---|
13 | */ |
---|
14 | |
---|
15 | #include <assert.h> |
---|
16 | |
---|
17 | #include <rtems/score/smpimpl.h> |
---|
18 | |
---|
19 | #include <libcpu/arm-cp15.h> |
---|
20 | |
---|
21 | #include <bsp/irq.h> |
---|
22 | |
---|
23 | static void bsp_inter_processor_interrupt(void *arg) |
---|
24 | { |
---|
25 | _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get()); |
---|
26 | } |
---|
27 | |
---|
28 | uint32_t _CPU_SMP_Initialize(void) |
---|
29 | { |
---|
30 | return arm_gic_irq_processor_count(); |
---|
31 | } |
---|
32 | |
---|
33 | void _CPU_SMP_Finalize_initialization(uint32_t cpu_count) |
---|
34 | { |
---|
35 | if (cpu_count > 0) { |
---|
36 | rtems_status_code sc; |
---|
37 | |
---|
38 | sc = rtems_interrupt_handler_install( |
---|
39 | ARM_GIC_IRQ_SGI_0, |
---|
40 | "IPI", |
---|
41 | RTEMS_INTERRUPT_UNIQUE, |
---|
42 | bsp_inter_processor_interrupt, |
---|
43 | NULL |
---|
44 | ); |
---|
45 | assert(sc == RTEMS_SUCCESSFUL); |
---|
46 | |
---|
47 | #if defined(BSP_DATA_CACHE_ENABLED) || defined(BSP_INSTRUCTION_CACHE_ENABLED) |
---|
48 | /* Enable unified L2 cache */ |
---|
49 | rtems_cache_enable_data(); |
---|
50 | #endif |
---|
51 | } |
---|
52 | } |
---|
53 | |
---|
54 | void _CPU_SMP_Prepare_start_multitasking( void ) |
---|
55 | { |
---|
56 | /* Do nothing */ |
---|
57 | } |
---|
58 | |
---|
59 | void _CPU_SMP_Send_interrupt( uint32_t target_processor_index ) |
---|
60 | { |
---|
61 | arm_gic_irq_generate_software_irq( |
---|
62 | ARM_GIC_IRQ_SGI_0, |
---|
63 | ARM_GIC_IRQ_SOFTWARE_IRQ_TO_ALL_IN_LIST, |
---|
64 | (uint8_t) (1U << target_processor_index) |
---|
65 | ); |
---|
66 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.