diff mbox

[03/14] ARM: v6k: remove CPU_32v6K dependencies in asm/spinlock.h

Message ID 20110127114431.GA3194@arm.com (mailing list archive)
State Awaiting Upstream, archived
Headers show

Commit Message

tip-bot for Dave Martin Jan. 27, 2011, 11:44 a.m. UTC
None
diff mbox

Patch

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
+