From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964931AbXDAUlU (ORCPT ); Sun, 1 Apr 2007 16:41:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965026AbXDAUlU (ORCPT ); Sun, 1 Apr 2007 16:41:20 -0400 Received: from pasmtpa.tele.dk ([80.160.77.114]:51287 "EHLO pasmtpA.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964931AbXDAUlT (ORCPT ); Sun, 1 Apr 2007 16:41:19 -0400 Date: Sun, 1 Apr 2007 22:42:03 +0200 From: Sam Ravnborg To: Oleg Verych Cc: LKML , Andi Kleen , Andrew Morton Subject: Re: [pp] kbuild: asm-offsets generalized Message-ID: <20070401204203.GA10761@uranus.ravnborg.org> References: <1171012827.2718.42.camel@localhost.localdomain> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070216155929.GA14713@flower.upol.cz> User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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". > [] > > [patch proposition] kbuild: asm-offsets generalized > > * scripts/mkCconstants: > - asm-offsets magic demystified, generalized, > > * (hopefully) more readable sed scripts, > > * top Kbuild may be updated... > > * file needs `chmod u+x`, i don't know, how it's done in patch(1). Can I ask you to provide a complete patch that replaces the current asm-offset stuff with your more readable script version. Name the script: mkasm-offset.sh to make a direct connection to the resulting .h file name. Thanks, Sam > > pp-by: Oleg Verych > --- > scripts/mkCconstants | 50 +++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 50 insertions(+), 0 deletions(-) > > Index: linux-2.6.20/scripts/mkCconstants > =================================================================== > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > +++ linux-2.6.20/scripts/mkCconstants 2007-02-16 15:33:51.696900750 +0100 > @@ -0,0 +1,50 @@ > +#!/bin/sh > + > +# Input file, where values of interest are stored is produced by > +# `cmd_cc_s_c'. It yields calculation of constants, needed in > +# assembler modules. Output is a suitable header file. > +# > +# $1 - input filename; > +# $2 - output filename; > +# $3 - header file format: "normal" (default), "mips". > + > +set -e > + > +[ -z "$1" ] || [ -z "$2" ] && exit 1 > + > +case $3 in > + mips) > + SED_SCRIPT=' > +/^@@@/{ > +s/^@@@//; > +s/ \#.*\$//; > +p; > +}' > + ;; > + normal | *) > + SED_SCRIPT=' > +/^->/{ > +s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; > +s:->::; > +p; > +}' > + ;; > +esac > + > +cat << "EOF" > $2 > +#ifndef __ASM_OFFSETS_H__ > +#define __ASM_OFFSETS_H__ > + > +/* > + * This file was generated by scripts/mkCconstants > + */ > + > +EOF > + > +sed -ne "$SED_SCRIPT" $1 >> $2 > + > +cat << "EOF" >> $2 > + > +#endif > + > +EOF > > -- > -o--=O`C info emacs : not found > #oo'L O info make : not found > <___=E M man gcc : not found