Re: Process VM Addr to Kernel VM Addr at Interrupt Time.
Ramakrishna K (ramak@wipinfo.soft.net)
Wed, 28 Apr 1999 11:04:20 +0530 (IST)
> I have the following problem. An application talks directly to a
> peripheral card. The application give the peripheral device an address
> within the applications address space. Some time later, the peripheral
> device generates and interrupt and the interrupt service routine reads
> back the address given to the peripheral device earlier. The ISR
> now needs to access the data at the memory location read back, but
> it is in the memory space of the original application. The ISR
> knows the process ID of the applicaiton in question, but since it
> is not executing with the context of that application, how can it
> convert the address in the applications address space, to its
> own virtual address space?
>
> Any advice, pointers etc appreciated.
I have just started looking at Linux code. So i am not sure how this fits into
the Linux context in terms of the Linux code/calls. But the following idea might help.
If your sure of the address being read from the ISR.
a) Lock that user address into memory.
b) Map this user page(s) into the kernel address space.
As part of ISR, you can read the data now from this kernel address. In this case you
don't have to worry about if the process is currently running or not.
thanks,
Rama.
-
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/