That code assumes that the process is calling the kernel, because these
functions are called during a system call, ( or fired by an external
interrupt, ... while a proccess is running, ... the acions are taken for
this process).
> Well what if the kernel wants to initiate communication with the user process? > How can they set up a meeting place?
First, you'd be better to evaluate the specific cost for the action you
want to take:
The fisrt option is to implement the mecanism throw message queues
(IPC) between the kernel and each proccess in your model.
Other option is to activate the scheduler, and select the process for
which the kernel-message is, an then, (throw a botton-half rutine) copy
up to the process (that will be the current) the information whith
put_user. This make the job asynchronously.
The thirth option (more efficient, than the second if you want
synchronism) is very ugly and i dont't like it at all. Consists in
hardcoding the second: Switch to the second process memory map (changing
its pgd and memory map) and doind the put_user. Then restore the
original context.
I think yo'd be better implementing the second, but perhaps the first
is the simpliest.
good luck.
-- Luis Irún Briz _______ lirun@iti.upv.es | | de | www.iti.upv.es/~lirun | | | U.P.V. - [ www.upv.es ] |nstituto |ecnológico |nformática- 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/