Skip to content
Snippets Groups Projects
Commit 165e1c39 authored by Avi Kivity's avatar Avi Kivity
Browse files

sched: make the current cpu pointer a member of the thread struct

With the current implementation, where the current cpu is a thread-local
variable, we cannot change the cpu pointer atomically during a context switch,
as we cannot obtain a pointer to a thread-local variable before the thread
has been run.

By moving the cpu pointer to the thread structure, we can change it atomically
by switching the thread-local base register (%fs on x64).
parent 384f787a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment