Re: [Question] arch-independent way to differentiate between user andkernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 3 Aug 2005, Steven Rostedt wrote:

> Hi all,
>
> I'm dealing with a problem where I want to know from __do_IRQ in
> kernel/irq/handle.c if the interrupt occurred while the process was in
> user space or kernel space.  But the trick here is that it must work on
> all architectures.
>
> Does anyone know of some way that that function can tell if it had
> interrupted the kernel or user space?  I know of serveral arch-dependent
> ways, but that's not acceptable right now.
>
> Thanks,
>
> -- Steve
>

The interrupt handler gets a pointer to a structure called "struct pt_regs".
That contains, amongst other things, the registers pushed onto the stack
during the interrupt. If the segments were kernel segments, the interrupt
occurred while in kernel mode. But..... If you have any code that
needs to know, it's horribly and irreparably broken beyond all
repair. Interrupts need to be handled NOW, without regard to what
got interrupted.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Warning : 98.36% of all statistics are fiction.
.
I apologize for the following. I tried to kill it with the above dot :

****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux