Re: No user space access during irq?

Richard B. Johnson (root@chaos.analogic.com)
Mon, 8 Feb 1999 08:52:20 -0500 (EST)


On Mon, 8 Feb 1999, Till Harbaum wrote:

> Hi all!
>
> I just encountered a problem while trying to use
> put_user and memcpy_tofs while handling an interrrupt
> in 2.0.x .
>
> The idea behind this is fast IO. The user creates some
> buffer space and the kernel routine fills it
> directly from hardware to user space. Unfortunately
> the machine just crashes. Am i not allowed to use the
> above functions in an interrupt?
>
> Ciao,
> Till
>

Put_user uses `current`, i.e., the current processs to access the
current processes data. An interrupt will occur at any time, not
just during your task's time-slice, therefore `current` will not
mean anything usefull. When your user buffer is allocated, you
need to convert its address to a physical page, make sure the
page can't be paged out, and access that physical page from your
ISR.

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.2.1 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
Wisdom : It's not a Y2K problem. It's a Y2Day problem.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/