From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCPon-0007yq-Cj for qemu-devel@nongnu.org; Mon, 04 Mar 2013 02:28:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCPod-0003M1-EH for qemu-devel@nongnu.org; Mon, 04 Mar 2013 02:28:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCPod-0003LQ-2q for qemu-devel@nongnu.org; Mon, 04 Mar 2013 02:28:07 -0500 Message-ID: <51344D00.20707@redhat.com> Date: Mon, 04 Mar 2013 08:28:00 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <11e3c93f4c64bda4ef46ec9de8dd8b4fa88b3ec5.1362290776.git.peter.crosthwaite@xilinx.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v1 2/4] bitops: Add UInt32StateInfo and helper functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Blue Swirl , peter.maydell@linaro.org, Anthony Liguori , qemu-devel@nongnu.org, "Michael S. Tsirkin" Hi, >> For maximum flexibility, a callback could be specified but then we >> overlap memory API. > > I think this is a good idea, but continuing on the theme of what this > API is trying to achieve I think there should be capability for > per-bit function definitions. On the topic I think Gerd has played > with the idea of per-register callbacks for some device models in the > past. hw/intel-hda.c is it. Predates memory api though and thus doesn't integrated with it, although it makes sense of course. Could be as simple as a generic MemoryRegionOps. I'm not sure it is that useful to have per-bit callbacks. For "normal" devices you rarely need that, and for gpio arrays probably want more than just callbacks per bit (qemu_irqs for example). cheers, Gerd