Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946274AbXBPVrr (ORCPT ); Fri, 16 Feb 2007 16:47:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1946277AbXBPVrr (ORCPT ); Fri, 16 Feb 2007 16:47:47 -0500 Received: from raven.upol.cz ([158.194.120.4]:44542 "EHLO raven.upol.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946274AbXBPVrq (ORCPT ); Fri, 16 Feb 2007 16:47:46 -0500 Date: Fri, 16 Feb 2007 22:56:17 +0100 To: Sam Ravnborg Cc: LKML , Andi Kleen , Andrew Morton , Rusty Russell Subject: Re: [pp] kbuild: asm-offsets generalized Message-ID: <20070216215617.GA15861@flower.upol.cz> References: <200702091109.20061.ak@muc.de> <1171024771.2718.129.camel@localhost.localdomain> <20070209141728.GA26749@uranus.ravnborg.org> <1171034599.2718.190.camel@localhost.localdomain> <1171323696.19842.29.camel@localhost.localdomain> <20070213031044.GA17046@flower.upol.cz> <20070216155527.GA14687@flower.upol.cz> <20070216155929.GA14713@flower.upol.cz> <20070216185635.GA16601@uranus.ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070216185635.GA16601@uranus.ravnborg.org> Organization: Palacky University in Olomouc, experimental physics department. User-Agent: Mutt/1.5.13 (2006-08-11) From: Oleg Verych Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3944 Lines: 140 Hallo. On Fri, Feb 16, 2007 at 07:56:35PM +0100, Sam Ravnborg wrote: > On Fri, Feb 16, 2007 at 04:59:29PM +0100, Oleg Verych wrote: > > > > > > > > Proposition will follow. > > > > > > > [] > > > > > > [patch proposition] kbuild: lguest with private asm-offsets > > [] > > > * needs "asm-offsets magic demystified, generalized". > > [] > > To make asm-offset generic I had in mind something like the > following. Then i misunderstood, what you mean, sorry. > It uses the currect functionality, and allows for architecture override > as needed - but default not used. And architecture override is kept in a > architecture specific location. > > Sam > > commit df95bb04b04ff2f64805dfa8459099ffe469c8a5 > Author: Sam Ravnborg > Date: Fri Feb 16 19:51:29 2007 +0100 > > kbuild: Make asm-offset generic > > Signed-off-by: Sam Ravnborg > > diff --git a/include/asm-generic/asm-offset b/include/asm-generic/asm-offset > new file mode 100644 > index 0000000..5e5629e > --- /dev/null > +++ b/include/asm-generic/asm-offset > @@ -0,0 +1,30 @@ > +# > +# Support generating constant useable from assembler but defined on C-level > +# > +# See usage in top-level Kbuild file > + > +# Default sed regexp - multiline due to syntax constraints > +define sed-y > + "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" > +endef > + > +# let architectures override the sed expression as needed > +-include include/asm/asm-offset > + > +quiet_cmd_offsets = GEN $@ > +define cmd_offsets > + (set -e; \ > + echo "#ifndef __ASM_OFFSETS_H__"; \ > + echo "#define __ASM_OFFSETS_H__"; \ > + echo "/*"; \ > + echo " * DO NOT MODIFY."; \ > + echo " *"; \ > + echo " * This file was generated by Kbuild"; \ > + echo " *"; \ > + echo " */"; \ > + echo ""; \ > + sed -ne $(sed-y) $<; \ > + echo ""; \ > + echo "#endif" ) > $@ > +endef > + > diff --git a/include/asm-mips/asm-offset b/include/asm-mips/asm-offset > new file mode 100644 > index 0000000..b2eb959 > --- /dev/null > +++ b/include/asm-mips/asm-offset > @@ -0,0 +1,4 @@ > +# Override default sed for MIPS when generating asm-offset > +sed-$(CONFIG_MIPS) := "/^@@@/{s/^@@@//; s/ \#.*\$$//; p;}" > + > + > diff --git a/Kbuild b/Kbuild > index 0451f69..0a32f5f 100644 > --- a/Kbuild > +++ b/Kbuild > @@ -1,5 +1,8 @@ > # > # Kbuild for top-level directory of the kernel > + > + > + > # This file takes care of the following: > # 1) Generate asm-offsets.h > > @@ -7,36 +10,14 @@ ##### > # 1) Generate asm-offsets.h > # > > +include include/asm-generic/asm-offset > + > offsets-file := include/asm-$(ARCH)/asm-offsets.h > > always := $(offsets-file) > targets := $(offsets-file) > targets += arch/$(ARCH)/kernel/asm-offsets.s > > -# Default sed regexp - multiline due to syntax constraints > -define sed-y > - "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" > -endef > -# Override default regexp for specific architectures > -sed-$(CONFIG_MIPS) := "/^@@@/{s/^@@@//; s/ \#.*\$$//; p;}" > - > -quiet_cmd_offsets = GEN $@ > -define cmd_offsets > - (set -e; \ > - echo "#ifndef __ASM_OFFSETS_H__"; \ > - echo "#define __ASM_OFFSETS_H__"; \ > - echo "/*"; \ > - echo " * DO NOT MODIFY."; \ > - echo " *"; \ > - echo " * This file was generated by Kbuild"; \ > - echo " *"; \ > - echo " */"; \ > - echo ""; \ > - sed -ne $(sed-y) $<; \ > - echo ""; \ > - echo "#endif" ) > $@ > -endef > - > # We use internal kbuild rules to avoid the "is up to date" message from make > arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE > $(Q)mkdir -p $(dir $@) Thanks. ____ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/