From: Andi Kleen Subject: Re: [RFC, PATCH 4/24] i386 Vmi inline implementation Date: Wed, 22 Mar 2006 21:12:50 +0100 Message-ID: <200603222112.52385.ak@suse.de> References: <200603131802.k2DI22OK005657@zach-dev.vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200603131802.k2DI22OK005657@zach-dev.vmware.com> Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org To: virtualization@lists.osdl.org Cc: Zachary Amsden , Linus Torvalds , Linux Kernel Mailing List , Xen-devel , Andrew Morton , Dan Hecht , Dan Arai , Anne Holler , Pratap Subrahmanyam , Christopher Li , Joshua LeVasseur , Chris Wright , Rik Van Riel , Jyothy Reddy , Jack Lo , Kip Macy , Jan Beulich , Ky Srinivasan , Wim Coekaerts , Leendert van Doorn List-Id: xen-devel@lists.xenproject.org On Monday 13 March 2006 19:02, Zachary Amsden wrote: > +#define MAKESTR(x) #x > +#define XSTR(x) MAKESTR(x) > +#define XCONC(args...) args > +#define CONCSTR(x...) #x > +#define XCSTR(x...) CONCSTR(x) We have legions of these all over the tree. How about you put them into some central file and gc a few? > +/* > + * Propagate these definitions as strings up to C code for convenient use > + * in stringized assembler as pseudo-mnemonics; we must emit assembler > + * directives to generate equates for the VMI_CALL_XXX symbols, since they > + * will not be available otherwise to the assembler, and we can't emit > + * the C versions of these functions from within an inline assembler > + * string. > + */ > +asm(".equ VMI_CALL_CUR, 0;\n\t"); The standard way to do this is to use asm-offsets.c > +#define VDEF(call) \ > + asm (".equ VMI_CALL_" #call ", VMI_CALL_CUR;\n\t"); \ > + asm (".equ VMI_CALL_CUR, VMI_CALL_CUR+1;\n\t"); > +VMI_CALLS Hmmm? This doesn't look like something a header file should be doing. How about you put that big list and the definition into a .c ? > +#if defined(CONFIG_VMI_C_CONVENTION) I don't think that file can be reviewed in any meaningful way before you don't get rid of the macro mess and the unneeded calling conventions. -Andi