From patchwork Fri Apr 4 21:27:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 3941061 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C11F49F1EE for ; Fri, 4 Apr 2014 21:30:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E78BE20381 for ; Fri, 4 Apr 2014 21:30:57 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A590E202FF for ; Fri, 4 Apr 2014 21:30:56 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WWBfu-0007He-7W; Fri, 04 Apr 2014 21:29:23 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WWBfg-00087Y-EK; Fri, 04 Apr 2014 21:29:08 +0000 Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WWBfJ-000830-G1 for linux-arm-kernel@lists.infradead.org; Fri, 04 Apr 2014 21:28:46 +0000 Received: by mail-lb0-f170.google.com with SMTP id s7so2950359lbd.1 for ; Fri, 04 Apr 2014 14:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=jWAjYvQM+H5FFOSlZ1kxNuM4RqZymqxb2WBvABxKVfA=; b=PzBIaFC847xj9gigQGVQuR2MLJks8L0w2fTh7HFz8W2Xf20ldKQAldBZcpDyQboL8G f1poayk7I7xEgsF2yEjQd/oxVQ1v0ze/NEKezFtSpQU9yDkftsAeFROBnnnKzDh43Bfa Uc72vt90R+On9CsPnTeTsh/hsLLVuNJdowPX/wMwkaIsQLjx4DKG485krTsowsbD3Q5n RaU3s+7+lvAu+6aACjNWrIIXQScUojlxwPFFvI3MyxhD/Op8dhuc/lGM7gD+l8qKXtww LqnIoS1b65hV76l+hT9JTU6ghKgf4tEXsvAFOPK0L/loZkoECnvzhYYbQ9D0n7AQRXpW Hxmg== X-Received: by 10.152.4.201 with SMTP id m9mr166831lam.61.1396646902186; Fri, 04 Apr 2014 14:28:22 -0700 (PDT) Received: from localhost.localdomain (217-211-190-200-no39.tbcn.telia.com. [217.211.190.200]) by mx.google.com with ESMTPSA id dl4sm6419114lbc.4.2014.04.04.14.28.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Apr 2014 14:28:21 -0700 (PDT) From: Rabin Vincent To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] arm: fixmap: implement __set_fixmap() Date: Fri, 4 Apr 2014 23:27:49 +0200 Message-Id: <1396646870-29695-1-git-send-email-rabin@rab.in> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140404_172845_731121_D7122EFE X-CRM114-Status: GOOD ( 11.24 ) X-Spam-Score: -1.9 (-) Cc: Jon Medhurst , Rabin Vincent , Laura Abbott , linux-kernel@vger.kernel.org, Kees Cook X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is used from set_fixmap() and clear_fixmap() via asm-generic/fixmap.h. Signed-off-by: Rabin Vincent --- Needs "arm: use generic fixmap.h", available in linux-next. arch/arm/include/asm/fixmap.h | 2 ++ arch/arm/mm/mmu.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h index 68ea615..55ed076 100644 --- a/arch/arm/include/asm/fixmap.h +++ b/arch/arm/include/asm/fixmap.h @@ -23,6 +23,8 @@ enum fixed_addresses { __end_of_fixed_addresses }; +void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot); + #include #endif diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 3e16307..61bdfb1 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -388,6 +389,12 @@ SET_MEMORY_FN(rw, pte_set_rw) SET_MEMORY_FN(x, pte_set_x) SET_MEMORY_FN(nx, pte_set_nx) +void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot) +{ + BUG_ON(idx >= __end_of_fixed_addresses); + set_top_pte(__fix_to_virt(idx), pfn_pte(__phys_to_pfn(phys), prot)); +} + /* * Adjust the PMD section entries according to the CPU in use. */