Re: [PATCH RFC 6/6] Implement "current" with the PDA.

Andi Kleen
2006-08-27T16:02:34Z

On Sunday 27 August 2006 10:44, Jeremy Fitzhardinge wrote:
> Use the pcurrent field in the PDA to implement the "current" macro.
> This ends up compiling down to a single instruction to get the current
> task.
>
> The slightly tricky part about this patch is that cpu_init() uses
> current very early, before the PDA has been set up. In this instance,
> it uses current_thread_info()->task to get the current task.
>
> Also, the very early PDA set up for the boot cpu contains the initial
> task pointer so current works from a very early stage.

With that you could remove the code in do_IRQ now that setups up a fake thread_info
for interrupt stacks.

-Andi