Re: Calling current() from interrupt context

From: Andi Kleen (
Date: Sun Oct 08 2000 - 20:28:51 EST

On Mon, Oct 09, 2000 at 02:09:49AM +0100, Kenn Humborg wrote:
> > 2.4 TCP code relies on current being valid in a softirq.
> >
> > The m68k port which has a interrupt stack solves the problem by
> > loading current into a global register variable on all kernel entries.
> > x86-64 will likely do the same.
> How do you tell GCC to stay away from that register when compiling
> the kernel without also making it unusable in userland?

info gcc ;)

Declare a global register variable.

register struct task_struct current asm("REGNAME");

This has to be declared in all kernel files, so you may want to use
gcc's -include option in CFLAGS.

Another option would be to clean up the current uses and use a special
variant of current "interrupt_current". This would save some cycles
in the interrupt path.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 21:00:11 EST