1 | /* |
---|
2 | * RTEMS SMP Support for Single Core |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-2013. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.rtems.com/license/LICENSE. |
---|
10 | */ |
---|
11 | |
---|
12 | #include <rtems.h> |
---|
13 | #include <rtems/bspIo.h> |
---|
14 | #include <rtems/bspsmp.h> |
---|
15 | #include <stdlib.h> |
---|
16 | |
---|
17 | uint32_t Schedsim_Current_cpu; |
---|
18 | extern uint32_t Schedsim_Maximum_CPUs_From_Command_Line; |
---|
19 | |
---|
20 | void bsp_smp_secondary_cpu_initialize(int cpu) |
---|
21 | { |
---|
22 | Schedsim_Current_cpu = 0; |
---|
23 | } |
---|
24 | |
---|
25 | int bsp_smp_processor_id(void) |
---|
26 | { |
---|
27 | return Schedsim_Current_cpu; |
---|
28 | } |
---|
29 | |
---|
30 | uint32_t bsp_smp_initialize( |
---|
31 | uint32_t configured_cpu_count |
---|
32 | ) |
---|
33 | { |
---|
34 | if ( configured_cpu_count < Schedsim_Maximum_CPUs_From_Command_Line ) { |
---|
35 | printf( |
---|
36 | "ERROR - Maximum cores per confdefs.h is %d\n", |
---|
37 | configured_cpu_count |
---|
38 | ); |
---|
39 | exit( 1 ); |
---|
40 | } |
---|
41 | |
---|
42 | /* return the number of CPUs */ |
---|
43 | return Schedsim_Maximum_CPUs_From_Command_Line; |
---|
44 | } |
---|
45 | |
---|
46 | void bsp_smp_broadcast_interrupt(void) |
---|
47 | { |
---|
48 | } |
---|
49 | |
---|
50 | void bsp_smp_broadcast_message( |
---|
51 | uint32_t message |
---|
52 | ) |
---|
53 | { |
---|
54 | } |
---|
55 | |
---|
56 | void bsp_smp_interrupt_cpu( |
---|
57 | int cpu |
---|
58 | ) |
---|
59 | { |
---|
60 | } |
---|
61 | |
---|
62 | void bsp_smp_delay( int max ) |
---|
63 | { |
---|
64 | } |
---|
65 | |
---|
66 | void bsp_smp_wait_for( |
---|
67 | volatile unsigned int *address, |
---|
68 | unsigned int desired, |
---|
69 | int maximum_usecs |
---|
70 | ) |
---|
71 | { |
---|
72 | int iterations; |
---|
73 | volatile int i; |
---|
74 | volatile unsigned int *p = address; |
---|
75 | |
---|
76 | for (iterations=0 ; iterations < maximum_usecs ; iterations++ ) { |
---|
77 | *p = desired; |
---|
78 | /* XXX hack to make simulator happy */ |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|