From owner-freebsd-arch Sat May 13 1:54:47 2000 Delivered-To: freebsd-arch@freebsd.org Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by hub.freebsd.org (Postfix) with ESMTP id 5E0E237B76F; Sat, 13 May 2000 01:54:43 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by anchor-post-31.mail.demon.net with esmtp (Exim 2.12 #1) id 12qXh3-0005nk-0V; Sat, 13 May 2000 09:54:42 +0100 Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id JAA20127; Sat, 13 May 2000 09:58:37 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Sat, 13 May 2000 09:59:09 +0100 (BST) From: Doug Rabson To: Mike Smith Cc: arch@freebsd.org Subject: Re: A new api for asynchronous task execution In-Reply-To: <200005130718.AAA01437@mass.cdrom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 13 May 2000, Mike Smith wrote: > > I'm planning to add a new system to the kernel which should make it much > > easier for drivers (especially loadable drivers) to use software > > interrupts to implement split-level interrupt handlers. The api was > > inspired by the Linux tqueue system but the implementation is quite > > different. > ... > > void (*func)(void *, int); /* task handler */ > > What's the second argument? Its explained later on in the text. Its a count of how many times the task was queued since the queue was last run. > > > void *arg; /* argument for handler */ > > }; > > > > struct taskqueue { > > STAILQ_HEAD(, task) queue; > > void (*enqueue)(struct taskqueue *queue); > > }; > > > > void > > taskqueue_init(struct taskqueue *queue, > > void (*enqueue)(struct taskqueue *queue)) > > Any sense in having statically-initialised task queues? > > TASK_QUEUE(name); I thought of this but couldn't quite decide if it was useful. I don't expect there to be many queues around. To start with, there will only be the SWI queue. > > I'm also wondering about naming the queue instances and linking them all > together for eg. debugging or "find queue by name" functionality. I'll think about it. I do want to keep this thing as lightweight as possible though. > > Apart from that, I'm delirious at the thought of this; I've been waiting > for something similar for a long time now. 8) I needed it when I started porting the Linux Matrox DRI driver. They use software interrupts to do the work of sceduling DMA between different 3D applications and there just wasn't anything usable in the FreeBSD kernel for this. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 20 8442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message