xpt_schedule() and start interface context question.
Joseph M Link
freebsd at joelink.net
Tue Jul 20 11:06:33 PDT 2004
Hello,
I have been looking at the targ driver written by Nate Lawson and Justin
Gibbs. I am seeing some access of user memory outside of what is
obviously user context (the call to copyin and cam_periph_mapmem() by
way of the targstart() interface). I am wondering how xpt_schedule()
works and if they are leveraging something there. Specifically, does a
call to a periph's start() function always get called in the same
context as the caller of xpt_schedule() (which happens to always be user
context in the targ driver)?
In looking at the code for xpt_schedule(), it definitely seems that that
is possible, but it also seems possible that if the device has no
resources available, the start() call is queued and delayed. If the
latter case is actually possible with the targ driver, then what context
is the targstart() called in? if it's not the user's context, that
would make the calls to copyin() and cam_periph_mapmem() behave
incorrectly, right?
Thanks,
Joe
More information about the freebsd-hackers
mailing list