The text was copied from sched/sched/sched_getcpu.c.
This is a modified copy of armv6-m/armv7-m version.