The task register is only pure, not const. It's true that it's only
initialized during cpu_init(), but different cpus in the system have
different task register values.
get_TR();
schedule();
get_TR();
must reload the task register.
But the value of "current" can be considered as const: It never changes
for a running thread. The exception are fork() and clone(), but both
functions directly call asm code and run on a fresh stack after forking.
> Using pure would mean if you do get_TR, then store
> something into global memory and do get_TR again, it will be done twice.
> Also, I wonder why you don't inline it.
>
ben?
I think get_current should be inline, const. get_TR() and
smp_processor_id would be inline, pure.
-- Manfred - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/