On Mon, Oct 09, 2000 at 11:45:18PM +0100, Kenn Humborg wrote: > Simple. Each interrupt stack is, say, 8 pages. You have an array > of N interrupt stacks. Then you calculate > > cpu_id = (sp & ~(INT_STACK_SIZE-1)) >> (PAGE_SHIFT + 3); > > Actually, I'd put the interrupt stack and any other per-cpu data > structures together in this region. So your smp_processor_id() looks like: #define smp_processor_id() \ (in_interrupt() ? (sp & ~(INT_STACK_SIZE-1)) >> (PAGE_SHIFT + 3) : (struct task_struct *)(sp & -8192)->current_cpu) ? There is just an ugly problem: in_interrupt already requires the CPU id to look up the table of interrupt counters. Now you could change the code to use interrupt_processor_id() and usermode_processor_id(), but what would you do in code which can be executed in both ? -Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
- Re: Calling current() from interrupt cont... Andi Kleen
- Re: Calling current() from interrupt... Alan Cox
- Re: Calling current() from inter... Andi Kleen
- Re: Calling current() from inter... David S. Miller
- Re: Calling current() from inter... Jeff V. Merkey
- Re: Calling current() from inter... Jeff V. Merkey
- Re: Calling current() from inter... Jeff V. Merkey
- Re: Calling current() from inter... Jeff V. Merkey
- Re: Calling current() from inter... Alan Cox
- Re: Calling current() from interrupt... Kenn Humborg
- Re: Calling current() from inter... Andi Kleen
- Re: Calling current() from inter... Kenn Humborg
- Re: Calling current() from interrupt cont... Linus Torvalds
- Re: Calling current() from interrupt... Jamie Lokier
- Re: Calling current() from inter... Alan Cox
- Re: Calling current() from inter... David S. Miller
- Re: Calling current() from inter... kumon
- Re: Calling current() from inter... Linus Torvalds
- Re: Calling current() from interrupt cont... yodaiken
- Re: Calling current() from interrupt context Ralf Baechle