lkml.org 
[lkml]   [1999]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Strangest bug
Stanislav Krasilovskiy wrote:
>
> > yes, because occasionally the system is executing another process (or the
> > idle thread), in which context that user-space pointer makes no sense.
> >
> > the solution: copy the data into kernel-space, then use this kernel-space
> > data from interrupts.
> >
> > -- mingo
>
> Dear Mingo and others,
>
> Thanks for your help! That explains the bug.
>
> But what if I absolutely need to retrieve the latest values from the
> structure (now placed in kernel space) at the time of the interrupt, and
> somehow allow the user space process to access/modify it sometimes? How
> would I do that?
>
> I searched the 'net for this, and came across a posting mentioning
> something similar to setting up a DMA in sound drivers, i.e. setting up
> an area in kernel space, locking it and allowing the user proceess to mmap
> it into its own memory.
>
> Can something like that be used in my case? Do you know if there's sample
> code for doing something like this anywhere?

You've made a custom kernel call, right? Adapt it to set/get the
structure:

custom_call(DATA_GET,&structure_address); // Kernel fills in structure
with current data
custom_call(DATA_SET,&structure_address); // Kernel copies data from
supplied structure

D

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.058 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site