Rev 106 | Rev 146 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 106 | Rev 108 | ||
---|---|---|---|
Line 82... | Line 82... | ||
82 | * pop sequence otherwise. |
82 | * pop sequence otherwise. |
83 | */ |
83 | */ |
84 | static void main_bsp_separated_stack(void); |
84 | static void main_bsp_separated_stack(void); |
85 | static void main_ap_separated_stack(void); |
85 | static void main_ap_separated_stack(void); |
86 | 86 | ||
- | 87 | ||
- | 88 | /** Bootstrap CPU main kernel routine |
|
87 | /* |
89 | * |
- | 90 | * Initializes the kernel by bootstrap CPU. |
|
- | 91 | * |
|
88 | * Executed by the bootstrap processor. cpu_priority_high()'d |
92 | * Assuming cpu_priority_high(). |
- | 93 | * |
|
89 | */ |
94 | */ |
90 | void main_bsp(void) |
95 | void main_bsp(void) |
91 | { |
96 | { |
92 | config.cpu_count = 1; |
97 | config.cpu_count = 1; |
93 | config.cpu_active = 1; |
98 | config.cpu_active = 1; |
Line 100... | Line 105... | ||
100 | context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE, CONFIG_STACK_SIZE); |
105 | context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE, CONFIG_STACK_SIZE); |
101 | context_restore(&ctx); |
106 | context_restore(&ctx); |
102 | /* not reached */ |
107 | /* not reached */ |
103 | } |
108 | } |
104 | 109 | ||
- | 110 | ||
- | 111 | /** Bootstrap CPU main kernel routine stack wrapper |
|
- | 112 | * |
|
- | 113 | * Second part of main_bsp(). |
|
- | 114 | * |
|
- | 115 | */ |
|
105 | void main_bsp_separated_stack(void) { |
116 | void main_bsp_separated_stack(void) { |
106 | vm_t *m; |
117 | vm_t *m; |
107 | task_t *k; |
118 | task_t *k; |
108 | thread_t *t; |
119 | thread_t *t; |
109 | 120 | ||
Line 159... | Line 170... | ||
159 | */ |
170 | */ |
160 | scheduler(); |
171 | scheduler(); |
161 | /* not reached */ |
172 | /* not reached */ |
162 | } |
173 | } |
163 | 174 | ||
- | 175 | ||
164 | #ifdef __SMP__ |
176 | #ifdef __SMP__ |
- | 177 | /** Application CPUs main kernel routine |
|
165 | /* |
178 | * |
166 | * Executed by application processors. cpu_priority_high()'d |
179 | * Executed by application processors, temporary stack |
167 | * Temporary stack is at ctx.sp which was set during BP boot. |
180 | * is at ctx.sp which was set during BP boot. |
- | 181 | * |
|
- | 182 | * Assuming cpu_priority_high(). |
|
- | 183 | * |
|
168 | */ |
184 | */ |
169 | void main_ap(void) |
185 | void main_ap(void) |
170 | { |
186 | { |
171 | /* |
187 | /* |
172 | * Incrementing the active CPU counter will guarantee that the |
188 | * Incrementing the active CPU counter will guarantee that the |
Line 196... | Line 212... | ||
196 | context_set(&CPU->saved_context, FADDR(main_ap_separated_stack), CPU->stack, CPU_STACK_SIZE); |
212 | context_set(&CPU->saved_context, FADDR(main_ap_separated_stack), CPU->stack, CPU_STACK_SIZE); |
197 | context_restore(&CPU->saved_context); |
213 | context_restore(&CPU->saved_context); |
198 | /* not reached */ |
214 | /* not reached */ |
199 | } |
215 | } |
200 | 216 | ||
- | 217 | ||
- | 218 | /** Application CPUs main kernel routine stack wrapper |
|
- | 219 | * |
|
- | 220 | * Second part of main_ap(). |
|
- | 221 | * |
|
- | 222 | */ |
|
201 | void main_ap_separated_stack(void) |
223 | void main_ap_separated_stack(void) |
202 | { |
224 | { |
203 | /* |
225 | /* |
204 | * Configure timeouts for this cpu. |
226 | * Configure timeouts for this cpu. |
205 | */ |
227 | */ |