Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5861068ybl; Tue, 27 Aug 2019 10:40:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4IK6XYvRxa9NpKL8vubbifi7BwiZO7lhIMjq4lC8eHzufw2CDrsyDET6eJQNVgWRZt9Ih X-Received: by 2002:a62:764f:: with SMTP id r76mr26945664pfc.149.1566927628719; Tue, 27 Aug 2019 10:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566927628; cv=none; d=google.com; s=arc-20160816; b=GjzIc1G5JlB9EZUW98jHMOtvFK+fyt89UPerFmAydwLvVrBt5IsRmTqG4L795ntz0l q1MTF9FTt1V5FrkSMby1Hl0j4Ie6sMn8gAc2VzEpNYpDJupbCbNLSV18yDVJJg2S5VOO gCgQEN43FOcDrRszzFdhMiKs8qiCz1zYwn0FZ5s0/QooHNrZ9I1WkbrTlPrqIq/SKH2S /WCJH+awa1WKlJy6mKaQo/sS8G6M33Vr2nvNFGGkSPDwBWcxivVv53Km2r5AQLqrGjgl Bfrc0mcqj8Pc+22QM+k4nC0fno8yr9JrbfRuuvndN8G8JJhE2rMOceOKkvpwMV1hGx5Z aNhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=0gPnQpLf9Wqj7O9R7C4EIhWCHGiWw04JtalxldivfQk=; b=orG6vVhebu0JuGCCi/EY+Rq3GomlmgozzmzQ+TKjgJ09fEBOgmc1pAuw39vOVNa8of mAlVyAVJ7NhH3FgGBBl8Fj/cHKfxq7+rK7UcwFnAzJEpIeFtXM6SmVGVXonAWzHjJKSn lLwdNcK94UgqaemMF/liDfEbMwRX9wABZoNx6nuQ8jNLL6au+HNJSSsWda35wlLYMwxG mrH+U8bJIUkI4TRq+Sl56nHyXcqNPrdQ7M99/jQ19Rb5fNED9bvWDPZakR25VeAUcDmI RpCZxWWB1qr/SewOHrqCSi+EciwSLs5JgjsrsIRX4XQbx2ID5oiDeMu30O7qTu4nNKeq QBgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=AXC0Iinr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si13219557pgt.258.2019.08.27.10.39.49; Tue, 27 Aug 2019 10:40:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=AXC0Iinr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730575AbfH0Rgh (ORCPT + 99 others); Tue, 27 Aug 2019 13:36:37 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:28536 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730538AbfH0Rgh (ORCPT ); Tue, 27 Aug 2019 13:36:37 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 46Hwz632mTz9tyrl; Tue, 27 Aug 2019 19:36:34 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=AXC0Iinr; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id cuWs3_gLhMA1; Tue, 27 Aug 2019 19:36:34 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 46Hwz61y2Wz9tyrk; Tue, 27 Aug 2019 19:36:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1566927394; bh=0gPnQpLf9Wqj7O9R7C4EIhWCHGiWw04JtalxldivfQk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=AXC0IinrG+UQC9iKNtf3Y2TOhFWGci8meumdvTe0uYdjywUrHHP3HE9a8vCiH+5Aj 3RbPZCoxuN+ejy+t8PBTP+rdM+V/0AUAiLxZ3O1akQypiRVRu5QjhDGEddYo1+uBKT eBmTQWHlg9FW7z6rS4WgxFXP4x4e4B4Q6oJD7mnU= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0B9FC8B847; Tue, 27 Aug 2019 19:36:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id bnlc51y8JHfR; Tue, 27 Aug 2019 19:36:35 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 778B58B842; Tue, 27 Aug 2019 19:36:35 +0200 (CEST) Subject: Re: [PATCH 2/2] powerpc: cleanup hw_irq.h To: Segher Boessenkool , Nicholas Piggin Cc: Benjamin Herrenschmidt , Michael Ellerman , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <0f7e164afb5d1b022441559fe5a999bb6d3c0a23.1566893505.git.christophe.leroy@c-s.fr> <81f39fa06ae582f4a783d26abd2b310204eba8f4.1566893505.git.christophe.leroy@c-s.fr> <1566909844.x4jee1jjda.astroid@bobo.none> <20190827172909.GA31406@gate.crashing.org> From: Christophe Leroy Message-ID: <1410046b-e1a3-b892-2add-6c1d353cb781@c-s.fr> Date: Tue, 27 Aug 2019 19:36:35 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190827172909.GA31406@gate.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 27/08/2019 à 19:29, Segher Boessenkool a écrit : > On Tue, Aug 27, 2019 at 10:48:24PM +1000, Nicholas Piggin wrote: >> Christophe Leroy's on August 27, 2019 6:13 pm: >>> +#define wrtee(val) asm volatile("wrtee %0" : : "r" (val) : "memory") >>> +#define wrteei(val) asm volatile("wrteei %0" : : "i" (val) : "memory") >> >> Can you implement just one macro that uses __builtin_constant_p to >> select between the imm and reg versions? I forgot if there's some >> corner cases that prevent that working with inline asm i constraints. > > static inline void wrtee(long val) > { > asm volatile("wrtee%I0 %0" : : "n"(val) : "memory"); > } Great, didn't know that possibility. Can it be used with any insn, for instance with add/addi ? Or with mr/li ? > > (This output modifier goes back to the dark ages, some 2.4 or something). Hope Clang support it ... Christophe > > > Segher >