[kernel][thread] Allow pinning threads to a specific cpu

The existing runqueues are scanned on resched until a thread that is
not pinned to another cpu is found.

Per-pu runqueues can be added later to avoid this scan.

Change-Id: Idd7dbddb4b79ef38a0ccd0c42b53f8867020e6cd

Conflicts:
	kernel/thread.c
This commit is contained in:
Arve Hjønnevåg
2015-01-23 19:38:43 -08:00
committed by Travis Geiselbrecht
parent 888ecb3e33
commit 794d304599
3 changed files with 35 additions and 12 deletions

View File

@@ -110,6 +110,7 @@ void lk_main(ulong arg0, ulong arg1, ulong arg2, ulong arg3)
// create a thread to complete system initialization
dprintf(SPEW, "creating bootstrap completion thread\n");
thread_t *t = thread_create("bootstrap2", &bootstrap2, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
t->pinned_cpu = 0;
thread_detach(t);
thread_resume(t);