From patchwork Wed Oct 6 07:18:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 234931 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 o967GEXN009690 for ; Wed, 6 Oct 2010 07:16:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932146Ab0JFHQO (ORCPT ); Wed, 6 Oct 2010 03:16:14 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:47407 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932110Ab0JFHQO (ORCPT ); Wed, 6 Oct 2010 03:16:14 -0400 Received: by mail-pz0-f46.google.com with SMTP id 34so1840541pzk.19 for ; Wed, 06 Oct 2010 00:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=Ki80effxLC9y/4s33y8IfTBSFQgFo78M8obqnd2O5QQ=; b=mFaz3G+qAGfRXIrvSAJdvMyWef+xJ2XTU594i0U93xx2OZHMBcHwMTcbTlXw2au9zX X1l9+qPFneIWodgAnUzb6J/WAO+oN/Or8+eIpASftF3PfIb0pDDo95HR1cY7jk+R2gGE 7Jpp8WykVg83p/wVbQ/tWTXIjYNHvmEU47etU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=bUq9XPuIehbKIKgnw7uZ/JK/s823syX+580F1cbaKwmfPuPb+dgzWGP5alxZqY+7Ic T4s5INdFMQkbv//8Cqo+TKYqCId3YhW8fJ9WDjUyhuEgjoMjuT1fPdmwlpOj6Pawt0Vq +At5TgQsQ5+OLZgowXkbA+rzzEnCligvXEh3g= Received: by 10.114.66.8 with SMTP id o8mr14960693waa.215.1286349373747; Wed, 06 Oct 2010 00:16:13 -0700 (PDT) Received: from [127.0.0.1] (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id d39sm839548wam.4.2010.10.06.00.16.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 06 Oct 2010 00:16:13 -0700 (PDT) From: Magnus Damm To: linux@arm.linux.org.uk Cc: grant.likely@secretlab.ca, Magnus Damm , lethal@linux-sh.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org Date: Wed, 06 Oct 2010 16:18:21 +0900 Message-Id: <20101006071821.28048.16107.sendpatchset@t400s> In-Reply-To: <20101006071731.28048.89938.sendpatchset@t400s> References: <20101006071731.28048.89938.sendpatchset@t400s> Subject: [PATCH 06/08] ARM: Add setup_irq_stubs() function Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 06 Oct 2010 07:16:15 +0000 (UTC) --- 0001/arch/arm/include/asm/traps.h +++ work/arch/arm/include/asm/traps.h 2010-10-05 20:26:18.000000000 +0900 @@ -24,6 +24,7 @@ static inline int in_exception_text(unsi ptr < (unsigned long)&__exception_text_end; } +extern void __init setup_irq_stubs(void *irq_usr, void *irq_svr); extern void __init early_trap_init(void); extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame); --- 0008/arch/arm/kernel/entry-armv.S +++ work/arch/arm/kernel/entry-armv.S 2010-10-05 20:28:22.000000000 +0900 @@ -883,6 +883,8 @@ __stubs_start: */ vector_stub irq, IRQ_MODE, 4 + .globl __stubs_irq +__stubs_irq: .long __irq_usr_default @ 0 (USR_26 / USR_32) .long __irq_invalid @ 1 (FIQ_26 / FIQ_32) .long __irq_invalid @ 2 (IRQ_26 / IRQ_32) --- 0001/arch/arm/kernel/traps.c +++ work/arch/arm/kernel/traps.c 2010-10-05 20:27:11.000000000 +0900 @@ -757,6 +757,20 @@ static void __init kuser_get_tls_init(un memcpy((void *)vectors + 0xfe0, (void *)vectors + 0xfe8, 4); } +void __init setup_irq_stubs(void *usr_handler, void *svc_handler) +{ + unsigned long vectors = CONFIG_VECTORS_BASE; + extern char __stubs_start[], __stubs_irq[]; + void **stubs_ptr; + + stubs_ptr = (void *)vectors + 0x200 + (__stubs_irq - __stubs_start); + + stubs_ptr[0] = usr_handler; + stubs_ptr[3] = svc_handler; + + flush_icache_range(vectors, vectors + PAGE_SIZE); +} + void __init early_trap_init(void) { unsigned long vectors = CONFIG_VECTORS_BASE;