Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f13c34b9 authored by Greentime Hu's avatar Greentime Hu
Browse files

nds32: IRQ handling



This patch includes irq related functions and irqchip_init().

Signed-off-by: default avatarVincent Chen <vincentc@andestech.com>
Signed-off-by: default avatarGreentime Hu <greentime@andestech.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
parent a15e9ffa
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2005-2017 Andes Technology Corporation

#include <asm/nds32.h>
#include <nds32_intrinsic.h>

#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;
}
+9 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2005-2017 Andes Technology Corporation

#include <linux/irqchip.h>

void __init init_IRQ(void)
{
	irqchip_init();
}