From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 20 18:06:33 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E93716A4CE for ; Tue, 20 Jul 2004 18:06:33 +0000 (GMT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC45843D39 for ; Tue, 20 Jul 2004 18:06:32 +0000 (GMT) (envelope-from freebsd@joelink.net) Received: from [192.168.0.3] (c-24-14-79-34.client.comcast.net[24.14.79.34]) by comcast.net (sccrmhc11) with ESMTP id <2004072018063101100drm2he>; Tue, 20 Jul 2004 18:06:32 +0000 Message-ID: <40FD5F20.3090502@joelink.net> Date: Tue, 20 Jul 2004 13:06:24 -0500 From: Joseph M Link User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: xpt_schedule() and start interface context question. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2004 18:06:33 -0000 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