lkml.org 
[lkml]   [2005]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Question] arch-independent way to differentiate between user andkernel
Date
From

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 DeliveryErrors@analogic.com - 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 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/

\
 
 \ /
  Last update: 2005-08-03 13:00    [W:0.266 / U:0.016 seconds]
©2003-2014 Jasper Spaans. Advertise on this site