From patchwork Sun Apr 11 16:36:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 91916 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3BGaQnW030824 for ; Sun, 11 Apr 2010 16:36:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752176Ab0DKQgS (ORCPT ); Sun, 11 Apr 2010 12:36:18 -0400 Received: from hiauly1.hia.nrc.ca ([132.246.100.193]:3281 "EHLO hiauly1.hia.nrc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173Ab0DKQgR (ORCPT ); Sun, 11 Apr 2010 12:36:17 -0400 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id 012EE5057; Sun, 11 Apr 2010 12:36:14 -0400 (EDT) Date: Sun, 11 Apr 2010 12:36:14 -0400 From: John David Anglin To: "Carlos O'Donell" Cc: dave.anglin@nrc-cnrc.gc.ca, deller@gmx.de, gniibe@fsij.org, linux-parisc@vger.kernel.org Subject: [PATCH] Call pagefault_disable/pagefault_enable in kmap_atomic/kunmap_atomic Message-ID: <20100411163613.GA7365@hiauly1.hia.nrc.ca> Reply-To: John David Anglin References: <20100408215453.GA18445@hiauly1.hia.nrc.ca> <20100408224446.96F294FA3@hiauly1.hia.nrc.ca> <20100409151330.GA23889@hiauly1.hia.nrc.ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100409151330.GA23889@hiauly1.hia.nrc.ca> Organization: nrc.ca User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 11 Apr 2010 16:36:26 +0000 (UTC) diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h index 7a73b61..ab87176 100644 --- a/arch/parisc/include/asm/cacheflush.h +++ b/arch/parisc/include/asm/cacheflush.h @@ -2,6 +2,7 @@ #define _PARISC_CACHEFLUSH_H #include +#include /* The usual comment is "Caches aren't brain-dead on the ". * Unfortunately, that doesn't apply to PA-RISC. */ @@ -113,11 +114,20 @@ static inline void *kmap(struct page *page) #define kunmap(page) kunmap_parisc(page_address(page)) -#define kmap_atomic(page, idx) page_address(page) +static inline void *kmap_atomic(struct page *page, enum km_type idx) +{ + pagefault_disable(); + return page_address(page); +} -#define kunmap_atomic(addr, idx) kunmap_parisc(addr) +static inline void kunmap_atomic(void *addr, enum km_type idx) +{ + kunmap_parisc(addr); + pagefault_enable(); +} -#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn)) +#define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) +#define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) #define kmap_atomic_to_page(ptr) virt_to_page(ptr) #endif