From patchwork Thu Feb 6 14:16:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 3596321 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 8E0999F382 for ; Thu, 6 Feb 2014 14:17:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C11D720163 for ; Thu, 6 Feb 2014 14:17:34 +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 B951820136 for ; Thu, 6 Feb 2014 14:17:33 +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 1WBPlL-0008N7-BY; Thu, 06 Feb 2014 14:17:07 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBPlH-0008WI-0n; Thu, 06 Feb 2014 14:17:03 +0000 Received: from mail-we0-f174.google.com ([74.125.82.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBPl5-0008UK-Hv for linux-arm-kernel@lists.infradead.org; Thu, 06 Feb 2014 14:16:52 +0000 Received: by mail-we0-f174.google.com with SMTP id x55so1325898wes.19 for ; Thu, 06 Feb 2014 06:16:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DrLrJq2+i793YcufHRGJG6LSYtTc6O92XJ+x9xIeZzA=; b=esqqTp6uTdWf2y3fLTbLA44A81XIK8Tq4j1sIhyQiRrR2akoC3ldI8lKH0iRVesVIC D7SpFQoC8NdHw9Vfnn6GObmI4dyAzZyocHV5ycBCFpTZS95yc+OXmA8dx7ed5u5I4A/z dTddFmcVZwBSo5FqSLnfNcoeXJBo8HK9EhoJDlFEOddLnPxe6fjKOykVI0pqXDKd7edj KUZg0WA38BPc7aEDel1F9n4DB9kKGpeTXWQ10IW/AkcEeQpn4lsHp17js2Fiwpk7TBg9 bzJ+GVx4WSaZiNi1QqSzqN7i5HLzZ+DYFc2ptGim7NVYBNDijnrr5tjtBhVlysweHqUA 45oQ== X-Gm-Message-State: ALoCoQnFngnnJU2Hlrx4DKy4w6Ogu40Ut1wGPD80Jxy60jn/Slrau+svHBa91Aq6OkHZ7EaVob1k X-Received: by 10.194.21.193 with SMTP id x1mr5903019wje.33.1391696182675; Thu, 06 Feb 2014 06:16:22 -0800 (PST) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id ci4sm2719045wjc.21.2014.02.06.06.16.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Feb 2014 06:16:22 -0800 (PST) From: Steve Capper To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] arm64: mm: Remove PMD_BIT_FUNC macro Date: Thu, 6 Feb 2014 14:16:09 +0000 Message-Id: <1391696171-8922-2-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391696171-8922-1-git-send-email-steve.capper@linaro.org> References: <1391696171-8922-1-git-send-email-steve.capper@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140206_091651_684706_E5481B32 X-CRM114-Status: UNSURE ( 7.98 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: catalin.marinas@arm.com, will.deacon@arm.com, Steve Capper , linux@arm.linux.org.uk 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, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 Expand out the pmd thp manipulation functions. This makes our life easier when using things like tags and cscope. Signed-off-by: Steve Capper --- arch/arm64/include/asm/pgtable.h | 51 ++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index b524dcd..a3fb1e4 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -247,16 +247,47 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, #define pmd_trans_splitting(pmd) (pmd_val(pmd) & PMD_SECT_SPLITTING) #endif -#define PMD_BIT_FUNC(fn,op) \ -static inline pmd_t pmd_##fn(pmd_t pmd) { pmd_val(pmd) op; return pmd; } - -PMD_BIT_FUNC(wrprotect, |= PMD_SECT_RDONLY); -PMD_BIT_FUNC(mkold, &= ~PMD_SECT_AF); -PMD_BIT_FUNC(mksplitting, |= PMD_SECT_SPLITTING); -PMD_BIT_FUNC(mkwrite, &= ~PMD_SECT_RDONLY); -PMD_BIT_FUNC(mkdirty, |= PMD_SECT_DIRTY); -PMD_BIT_FUNC(mkyoung, |= PMD_SECT_AF); -PMD_BIT_FUNC(mknotpresent, &= ~PMD_TYPE_MASK); +static inline pmd_t pmd_wrprotect(pmd_t pmd) +{ + pmd_val(pmd) |= PMD_SECT_RDONLY; + return pmd; +} + +static inline pmd_t pmd_mkold(pmd_t pmd) +{ + pmd_val(pmd) &= ~PMD_SECT_AF; + return pmd; +} + +static inline pmd_t pmd_mksplitting(pmd_t pmd) +{ + pmd_val(pmd) |= PMD_SECT_SPLITTING; + return pmd; +} + +static inline pmd_t pmd_mkwrite(pmd_t pmd) +{ + pmd_val(pmd) &= ~PMD_SECT_RDONLY; + return pmd; +} + +static inline pmd_t pmd_mkdirty(pmd_t pmd) +{ + pmd_val(pmd) |= PMD_SECT_DIRTY; + return pmd; +} + +static inline pmd_t pmd_mkyoung(pmd_t pmd) +{ + pmd_val(pmd) |= PMD_SECT_AF; + return pmd; +} + +static inline pmd_t pmd_mknotpresent(pmd_t pmd) +{ + pmd_val(pmd) &= ~PMD_TYPE_MASK; + return pmd; +} #define pmd_mkhuge(pmd) (__pmd(pmd_val(pmd) & ~PMD_TABLE_BIT))