Received: by 10.223.164.202 with SMTP id h10csp1193775wrb; Tue, 7 Nov 2017 23:52:01 -0800 (PST) X-Google-Smtp-Source: ABhQp+QE5qySZd+yzQGvAZhX2EChgmzHElxc2m+nqaBi7yzHDxylIfaVg51COO3MA3iCrZbMZudU X-Received: by 10.101.65.198 with SMTP id b6mr1478484pgq.136.1510127521118; Tue, 07 Nov 2017 23:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510127521; cv=none; d=google.com; s=arc-20160816; b=b37DZwkeOhXHNsGA8G/QgvMah6v+KbroSQzSdM1tIWaXvcheNOFKG26lqIDPBpRUGs E1yVXiW4gGgtnOBTbyL6fXg4Lm1x1K/AZz97OZ7WJ0q+Nf0trN/1/q4B4IfK+LG4iyUt vFi+i8GRAIIG2YeShsS1T9Sg/w/elNqJDLATVY0ow46lDkPT8Hxsna99S+1rNxmuoIgP /kmHdBKHG5jyMy4ly3QnNMWbmctB+9GM95gSzXkWywbHcn8nq48WyO4vAKjcEjQ4k9Em W0LRi186YkHpuyNzeGWRoKL2GxG1VAYhWl8krTAZy2VY6MYIV7+5E/azeCU/YToI26dt FYLg== 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=opB1C4pxvbrN1XMCNgv6cUwMwsRULbjReV+vbtLouNk=; b=XkaYDY4wrVetpoyaXgp6XHPS/TKwWRHRQiprS9U2xvPEKo1ZdiQJTQK1QKME0y64qv HjC3naAz906MbtMcyOGmHavD8tZ1P97mTuQY3adr69HFBIMmx4+FKuRqkEc9XO/wVPkZ NCaiQVSJ1AUlYi5PErh//u54cJcLLRn54DZtUANcdPaAdLo3CpQurvX2rMDpj4sOGc6G kEG2/xDAXOSYDnLzSqC62+41ow1WXHAvfeJ5bAU3KxJGidaCTFo/Ed9XBx2IdDHFNtBl 9FBUSWlX9QxVk5SCXPhF+JnrIDEe8rmdE4kFMcQNi1QKLMT6w3vDWV0JrxuY86/3pusW +Qvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jvNaft4t; 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 n185si3168009pgn.51.2017.11.07.23.51.48; Tue, 07 Nov 2017 23:52:01 -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=jvNaft4t; 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 S1755290AbdKHG2a (ORCPT + 91 others); Wed, 8 Nov 2017 01:28:30 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:44414 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725AbdKHGUW (ORCPT ); Wed, 8 Nov 2017 01:20:22 -0500 Received: by mail-pl0-f68.google.com with SMTP id g16so668519plj.1; Tue, 07 Nov 2017 22:20:22 -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=opB1C4pxvbrN1XMCNgv6cUwMwsRULbjReV+vbtLouNk=; b=jvNaft4tZBRCiBYRXcfoRDZYawmnjH4z36boA8OGctRuVAhrtBxp6EuubM89lUaWrz nGq8rm9qSw9glPqeuoLhs0W4hsy4L5DH/vIJziaYuU4o0bsdQmeblBOWNeRjqi3a3RcQ xfXrWzuUplM6r9kV4gYwznyqOHp2YDOb1iB9vC1+zIkYZcc5kF9pZAeFy0ngKJRFgjbB YYbgUT/8bkFUKauHQ76iSXO8HkmVLvuI9l0LnMl5yYcDAZIJaEd8AZP9TzwilBeN7Qt/ p3pecNvpkQFBItRS+9LFp3ha8z0ErEHc9AfHgp5pUAduIovgpuCu903BaBNYim2JFo/0 uqPg== 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=opB1C4pxvbrN1XMCNgv6cUwMwsRULbjReV+vbtLouNk=; b=YkNKqfirr8qLeh4ouDF89BrwXrI5bwFGXqNIymnhZ2hjc4u+lMfm0+rm3U2H18NAmK 0BpnLLxEYh+phUPhrUvlbuxW5Od89K3vXNKM09gIq81GRvslw+RDkOZ36cXs3hvAgJ9Q HV4pY0Qns6EOrWjphyoD3VKEw9TZsUeCSLwGCyEQ1sOS5muUMhIa3AeDEFL5/7s4Jk2K +YXzQq5A3RAqh5nAiUiPGWpLwG2ny00r8/0k5xRk8+yYbkjJKRaIGo4F+I6QtVgj0rsA 9ywjYr8wT2tLrCZqOj4jOKqg/8J9D00R9NpQdT8B1lSI5STTZUD+O5X9KDecmorXljdv T+dw== X-Gm-Message-State: AJaThX6mbMstySAihV4C5ikEZnh4adMXXbbL4HilD8V1R/HThDaKFkqh P7dKwTUeDvGODu/AQCo9RfE= X-Received: by 10.159.218.135 with SMTP id w7mr1254603plp.229.1510122021750; Tue, 07 Nov 2017 22:20:21 -0800 (PST) Received: from app09.andestech.com ([118.163.51.199]) by smtp.gmail.com with ESMTPSA id a4sm6581339pfj.72.2017.11.07.22.20.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 22:20:20 -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 Cc: green.hu@gmail.com, Vincent Chen Subject: [PATCH 10/31] nds32: IRQ handling Date: Wed, 8 Nov 2017 13:54:58 +0800 Message-Id: <9dea9004aa59acc2e02405b192887b8e60449100.1510118606.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 Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu --- arch/nds32/include/asm/irqflags.h | 49 +++++++++++++++++++++++++++++++++++++ arch/nds32/kernel/irq.c | 34 +++++++++++++++++++++++++ 2 files changed, 83 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..1b935f7 --- /dev/null +++ b/arch/nds32/kernel/irq.c @@ -0,0 +1,34 @@ +/* + * 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(); +} + +#ifdef CONFIG_TRACE_IRQFLAGS +void notrace arch_trace_hardirqs_on(void) +{ + trace_hardirqs_on(); +} + +void notrace arch_trace_hardirqs_off(void) +{ + trace_hardirqs_off(); +} +#endif -- 1.7.9.5 From 1583457009109928232@xxx Wed Nov 08 00:51:20 +0000 2017 X-GM-THRID: 1583447452219913014 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread