From patchwork Thu Jan 27 11:44:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot for Dave Martin X-Patchwork-Id: 511241 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0RBikFJ012166 for ; Thu, 27 Jan 2011 11:44:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754221Ab1A0Loo (ORCPT ); Thu, 27 Jan 2011 06:44:44 -0500 Received: from mail-bw0-f46.google.com ([209.85.214.46]:51313 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753846Ab1A0Lon (ORCPT ); Thu, 27 Jan 2011 06:44:43 -0500 Received: by bwz15 with SMTP id 15so2108145bwz.19 for ; Thu, 27 Jan 2011 03:44:42 -0800 (PST) Received: by 10.204.76.145 with SMTP id c17mr1432841bkk.52.1296128681623; Thu, 27 Jan 2011 03:44:41 -0800 (PST) Received: from arm.com (host86-144-160-160.range86-144.btcentralplus.com [86.144.160.160]) by mx.google.com with ESMTPS id rc9sm6620246bkb.14.2011.01.27.03.44.39 (version=SSLv3 cipher=RC4-MD5); Thu, 27 Jan 2011 03:44:40 -0800 (PST) Date: Thu, 27 Jan 2011 11:44:31 +0000 From: "Dave P. Martin" To: Nicolas Pitre Cc: Dave Martin , Russell King - ARM Linux , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 03/14] ARM: v6k: remove CPU_32v6K dependencies in asm/spinlock.h Message-ID: <20110127114431.GA3194@arm.com> References: <20110125165919.GD17286@n2100.arm.linux.org.uk> <20110125174636.GE17286@n2100.arm.linux.org.uk> <20110126155203.GA10141@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 27 Jan 2011 11:44:46 +0000 (UTC) diff -Nur filt-as filt-as --- filt-as 1970-01-01 01:00:00.000000000 +0100 +++ filt-as 2011-01-27 11:30:11.858552002 +0000 @@ -0,0 +1,30 @@ +#!/bin/sh + +case "$1" in + as|*/as|*-as) ;; + *) exec "$@" +esac + +real_as=$1 +shift + +out=a.out +in=- + +while [ $# != 0 ]; do + case "$1" in + -o) + out=$2 + shift + ;; + *.s) + in=$1 + ;; + *) + args=$args\ $1 + esac + shift +done + +gasfilter <"$in" \ +| "$real_as" $args -o "$out" diff -Nur gasfilter gasfilter --- gasfilter 1970-01-01 01:00:00.000000000 +0100 +++ gasfilter 2011-01-27 11:10:01.478552002 +0000 @@ -0,0 +1,68 @@ +#!/usr/bin/perl + +use strict; + +my $xpushsection_defined; + +my @section_stack = ( undef ); + +sub setsection ($$) { + my ($name, $line) = @_; + + print ".purgem __xpushsection\n" if $xpushsection_defined; + + print +".macro __xpushsection name:req, flags + .pushsection \"$name.\\name\", \"\\flags\" +.endm +"; + + $section_stack[$#section_stack] = $name; + + $xpushsection_defined = 1; + + print $line +} + +sub popsection ($) +{ + pop @section_stack; + setsection $section_stack[$#section_stack], $_[0]; +} + +sub pushsection ($$) +{ + my ($name, $line) = @_; + + push @section_stack, $name; + setsection $name, $line; +} + +sub xpushsection ($$) { + my ($name, $rest) = @_; + + print "__xpushsection \"$name\"$rest\n" +} + +sub process_line { + $_ = $_[0] if defined $_[0]; + + if (/^\s*(\.(text|data|bss))(\s|$)/) { + setsection $1, $_ + } elsif (/^\s*\.section\s+([\$._0-9A-Za-z]+).*/) { + setsection $1, $_ + } elsif (/^\s*\.pushsection\s+([\$._0-9A-Za-z]+).*/) { + pushsection $1, $_ + } elsif (/^\s*\.popsection(\s|$)/) { + popsection $_ + } elsif (/^\s*\.xpushsection\s+([\$._0-9A-Za-z]+)(.*)/) { + xpushsection $1, $2 + } elsif (/^\s*\.xpopsection(\s|$)/) { + print ".popsection\n" + } else { + print + } +} + +process_line ".text\n"; +process_line while <>; diff -Nur tst.s tst.s --- tst.s 1970-01-01 01:00:00.000000000 +0100 +++ tst.s 2011-01-27 11:07:39.338552001 +0000 @@ -0,0 +1,23 @@ +.macro fixup + _fixup \@ +.endm + +.macro _fixup num +__fixup_\num : + .xpushsection fixup, "a" + .long __fixup_\num + .xpopsection +.endm + +.globl main +main: + fixup + nop + +.section .text.init, "ax" +.globl init +init: nop + + fixup + nop +