From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v1 7/8] xen/arm: vgic: Introduce helpers to read/write/clear/set vGIC register ... Date: Tue, 29 Sep 2015 14:48:45 +0100 Message-ID: <560A96BD.2020902@citrix.com> References: <1443192698-16163-1-git-send-email-julien.grall@citrix.com> <1443192698-16163-8-git-send-email-julien.grall@citrix.com> <1443533006.16718.70.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZgvIH-0004x8-Jk for xen-devel@lists.xenproject.org; Tue, 29 Sep 2015 13:50:09 +0000 In-Reply-To: <1443533006.16718.70.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , xen-devel@lists.xenproject.org Cc: Vijaya.Kumar@caviumnetworks.com, stefano.stabellini@citrix.com, manish.jaggi@caviumnetworks.com, vijay.kilari@gmail.com List-Id: xen-devel@lists.xenproject.org On 29/09/15 14:23, Ian Campbell wrote: > On Fri, 2015-09-25 at 15:51 +0100, Julien Grall wrote: >> and use them in the vGIC emulation. >> >> The GIC registers may support different access sizes. Rather than open >> coding the access for every registers, provide a set of helpers to access >> them. >> >> The caller will have to call vgic_regN_* where N is the size of the >> emulated registers. > > These helpers end up as e.g. vgic_regN_read/write, but they don't really > read or write anything, they just extract the required bits into a register > or update the bits into a variable. > > Can we think of a better name? encode/decode? Encode/decode would be the best. I will replace read by decode and write by encode. > > This might be more apparent (maybe without the need to rename) if the > helpers took info->dabt.size instead of info. We also need info to get the MMIO adddress. I would prefer to keep info and avoid having another parameter here. >> [...] >> +static inline void vgic_reg_clearbit(unsigned long *reg, register_t bits, > > Please call these ones clearbits/setbits to avoid giving the impression > that they take a bit offset and just set/clear that one. Will do. -- Julien Grall