Received: by 10.223.164.202 with SMTP id h10csp1607232wrb; Mon, 27 Nov 2017 05:09:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMY3noIWKIhDypGN1OALZBiaHAHUTcR+Mfr51UKkwm+DXqrVoSyXm0/p2dPYBW5IbmZFIfSB X-Received: by 10.98.76.203 with SMTP id e72mr13390389pfj.91.1511788185088; Mon, 27 Nov 2017 05:09:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511788185; cv=none; d=google.com; s=arc-20160816; b=AfXWuNdtCjgXIuiG/rdStF3QGS3a9hLX7s1nhP5MFRM6apwGYYJVlSPpJAaOlqS0xk RIJjZtaJVIGEMKzoL92s6nd83j20cLQkl69yF/VKRzlSJMIvlHbdh1lsEA94UTlHfWaT YS790b9/NLe9Hrc3mYSCDryugppfWgep9gUV9AFD4LCOuGPsdNZuTLQfietgACG+cYLl ElaIRosCmwEHAofq1sDZPmExuexkzLXeJmiDlS1o2Jv+Rse9I0bjxelreOhgD+C8RYL5 Ic9Ni9ms1hkYBOtkYpnOh4J8m+Og7gBPA2e4N3AXklMDKex85yTF+8o8AD9HJls8qptM 54CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=y6tmAdeAoIaeEDPRTWBrgjYDmSpvIOvaiqQsRf1KVC4=; b=HXx8V1bvfNqRfRecg777ynrllT0VjHotXRGdlTQSfjA6gCwKvfLVCrPHfBeB+3I1UD MYaWttcp4plNc/Ktlm/j5wfuqxdXc5iqP6tDo6+gNjCKkp3Ar9Q+CkBSdhfNlooDlr9c H83kQu3fnwbhff5lodMxrjXJIgvTiYxhrP7/8aldn25dBX9TNGee5JWP55JZW/OzUNuW hQUTzwTUsQ94nNiHQBzkPrC+/bsu4zR9kWQYG/afgwd3NiN2N4RTewApGkrzUktO1/nn pI6KRHXQsHCignZHkCj+jLEVDz5vOmCeVjLukZ3bZdAxQjaPtwSeAMNY+WNijmIPV44L NzxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EFlf6w66; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si22519525pgq.740.2017.11.27.05.09.31; Mon, 27 Nov 2017 05:09:45 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=EFlf6w66; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752406AbdK0MyB (ORCPT + 77 others); Mon, 27 Nov 2017 07:54:01 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:40220 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369AbdK0Mxx (ORCPT ); Mon, 27 Nov 2017 07:53:53 -0500 Received: by mail-pg0-f66.google.com with SMTP id u3so18644027pgn.7; Mon, 27 Nov 2017 04:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=y6tmAdeAoIaeEDPRTWBrgjYDmSpvIOvaiqQsRf1KVC4=; b=EFlf6w66fh1pKFY6ffEdRGqhvrmsqk0RZvh+cXXwYmB6FpEK6qJdVEhFhysAEgRgk8 MQ0TZQG3kkDDwHglXU5tbcrvQiKqpgKGpAs7Y3h8rMdPQMUFMci7FIZLzjCrOeeMClL2 SnjbjQTwAll483vwSP/gLNC/HZvWcJHcJXcDYgO6LXkSxvl5ypHx6/ldfRvzWwUcar6S V68Ts5FV5GHYhYqf/6QkGqOSxlwpJu4yMhB/9ktKK7DpT04yHquyFiCWmeqN2gzlZFfC u9WYElGGfyEwxdsb6beOzHbAHb7FY6re/peU6GbfRUcbqKs30vENN0mF2Mycu6L8/GoL TLRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=y6tmAdeAoIaeEDPRTWBrgjYDmSpvIOvaiqQsRf1KVC4=; b=UE2LoZ82aCG/9xIo7rfhQV7JUP/szfk7MfjpFcAcI3onGiWw8Moxv7CPMIwVNBgH0G BvqN8hraDY3A2pDA0iI8ZWOrS9AU/5OJ4UOOIl00UeHf3XFXu0OqhhmNbNd00ODBPY4T HFYnEU+JE7ojU47j1LHtNpnUs33ZZIPx+LUnOp00rxPwRsyqF2zDReAalBMklfgzJc8c 6ae1MASXaqQUCEzz2FdjyoqNSc8wzEW/E7eS7tntN5VQ6wD09SaHI5BM+WiuUbjPabdY 7aft9dkIR1KYLFCyzB/OQUiwzffcWPXa8kbU9GQFJzme0Rl20bTdzIA34LpRQFzAhJyA vx3g== X-Gm-Message-State: AJaThX6dPRp6kqqoXn8zMYf1jI07m2zXfYFm7DgA5hWnI1/9nmCdwlAS 08R9Dcu/lox9kPKbjqe2fng= X-Received: by 10.99.165.75 with SMTP id r11mr37009477pgu.331.1511787232725; Mon, 27 Nov 2017 04:53:52 -0800 (PST) Received: from app09.andestech.com ([118.163.51.199]) by smtp.gmail.com with ESMTPSA id w64sm55225459pfj.62.2017.11.27.04.53.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 04:53:52 -0800 (PST) From: Greentime Hu To: greentime@andestech.com, linux-kernel@vger.kernel.org, arnd@arndb.de, linux-arch@vger.kernel.org, tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, robh+dt@kernel.org, netdev@vger.kernel.org, deanbo422@gmail.com, devicetree@vger.kernel.org, viro@zeniv.linux.org.uk, dhowells@redhat.com, will.deacon@arm.com, daniel.lezcano@linaro.org, linux-serial@vger.kernel.org Cc: green.hu@gmail.com, Vincent Chen Subject: [PATCH v2 09/35] nds32: IRQ handling Date: Mon, 27 Nov 2017 20:27:56 +0800 Message-Id: <0e52bbdb4843d023b161f414aa206370d9f7771a.1511785528.git.green.hu@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greentime Hu This patch includes irq related functions and irqchip_init(). Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu --- arch/nds32/include/asm/irqflags.h | 49 +++++++++++++++++++++++++++++++++++++ arch/nds32/kernel/irq.c | 22 +++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 arch/nds32/include/asm/irqflags.h create mode 100644 arch/nds32/kernel/irq.c diff --git a/arch/nds32/include/asm/irqflags.h b/arch/nds32/include/asm/irqflags.h new file mode 100644 index 0000000..7c1940f --- /dev/null +++ b/arch/nds32/include/asm/irqflags.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2005-2017 Andes Technology Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include + +#define arch_local_irq_disable() \ + GIE_DISABLE(); + +#define arch_local_irq_enable() \ + GIE_ENABLE(); +static inline unsigned long arch_local_irq_save(void) +{ + unsigned long flags; + flags = __nds32__mfsr(NDS32_SR_PSW) & PSW_mskGIE; + GIE_DISABLE(); + return flags; +} + +static inline unsigned long arch_local_save_flags(void) +{ + unsigned long flags; + flags = __nds32__mfsr(NDS32_SR_PSW) & PSW_mskGIE; + return flags; +} + +static inline void arch_local_irq_restore(unsigned long flags) +{ + if(flags) + GIE_ENABLE(); +} + +static inline int arch_irqs_disabled_flags(unsigned long flags) +{ + return !flags; +} diff --git a/arch/nds32/kernel/irq.c b/arch/nds32/kernel/irq.c new file mode 100644 index 0000000..119dc9f --- /dev/null +++ b/arch/nds32/kernel/irq.c @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2005-2017 Andes Technology Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include + +void __init init_IRQ(void) +{ + irqchip_init(); +} -- 1.7.9.5 From 1585560637556002513@xxx Fri Dec 01 06:07:37 +0000 2017 X-GM-THRID: 1585560637556002513 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread