MCPcopy Create free account
hub / github.com/coreboot/coreboot / threads_initialize

Function threads_initialize

src/lib/thread.c:241–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static void threads_initialize(void)
242{
243 int i;
244 struct thread *t;
245 u8 *stack_top;
246
247 if (initialized)
248 return;
249
250 t = &all_threads[0];
251
252 set_current_thread(t);
253
254 t->stack_orig = 0; /* We never free the main thread */
255 t->id = 0;
256 t->can_yield = 1;
257
258 for (i = 0; i < sizeof(thread_stacks) / sizeof(u32); i++)
259 ((u32 *)thread_stacks)[i] = 0xDEADBEEF;
260
261 stack_top = &thread_stacks[CONFIG_THREAD_STACK_SIZE];
262 for (i = 1; i < TOTAL_NUM_THREADS; i++) {
263 t = &all_threads[i];
264 t->stack_orig = (uintptr_t)stack_top;
265 t->id = i;
266 stack_top += CONFIG_THREAD_STACK_SIZE;
267 free_thread(t);
268 }
269
270 idle_thread_init();
271
272 initialized = 1;
273}
274
275int thread_run(struct thread_handle *handle, enum cb_err (*func)(void *), void *arg)
276{

Callers 2

thread_runFunction · 0.85
thread_run_untilFunction · 0.85

Calls 3

set_current_threadFunction · 0.85
free_threadFunction · 0.85
idle_thread_initFunction · 0.85

Tested by

no test coverage detected