From owner-freebsd-hackers@FreeBSD.ORG Tue May 23 02:07:32 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 4533516A426; Tue, 23 May 2006 02:07:32 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id B20E343D48; Tue, 23 May 2006 02:07:31 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (yuojqcq06jdeuipr@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.4/8.13.3) with ESMTP id k4N27RRp027040; Mon, 22 May 2006 19:07:27 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.4/8.13.3/Submit) id k4N27QqC027039; Mon, 22 May 2006 19:07:26 -0700 (PDT) (envelope-from jmg) Date: Mon, 22 May 2006 19:07:26 -0700 From: John-Mark Gurney To: william wallace Message-ID: <20060523020726.GP770@funkthat.com> Mail-Followup-To: william wallace , Warner Losh , "freebsd-hackers@freebsd.org" , freebsd-arch@freebsd.org References: <87ab37ab0605210108w127a235bue281428f52bbc784@mail.gmail.com> <20060521.114807.74702188.imp@bsdimp.com> <87ab37ab0605212328ue7c70fcu49c5fec8921ae229@mail.gmail.com> <20060522.005010.104089663.imp@bsdimp.com> <87ab37ab0605221816y6cca5387sc43fa1e1116f55cc@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ab37ab0605221816y6cca5387sc43fa1e1116f55cc@mail.gmail.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: "freebsd-hackers@freebsd.org" , freebsd-arch@freebsd.org Subject: Re: misc questions about the device&driver arch X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 May 2006 02:07:32 -0000 william wallace wrote this message on Tue, May 23, 2006 at 09:16 +0800: > In order to keep the API as consistent as possible between classic > interrupt sources and MSI sources, I'd like to add a new bus method: > > int > bus_reserve_resource(device_t, int *start, int *end, int *count, int flags); > > start, end, and count would be passed is as the desired range and would > map to the per-function interrupt index in MSI. On return, the range > supported and negotiated by the OS, bus, and function would be filled > into these values. flags would be something like SYS_RES_MESSAGE. > Internal failure of the function would be given in the return value. > Whether failure to support MSI should be given as an error code return > value can be debated. This function will also program the MSI > configuration registers on the device to use the correct message cookie > and number of messages. Why not create a wrapper, and start at the highest requested, and slowly work your way down as the requests are rejected.. since the number of messages must be a power of two, it isn't than many rounds.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."