diff options
author | Greentime Hu <greentime@andestech.com> | 2017-10-24 10:50:45 +0300 |
---|---|---|
committer | Greentime Hu <greentime@andestech.com> | 2018-02-22 05:44:32 +0300 |
commit | f13c34b9066745910bd96f94bd35895af2d4f2b8 (patch) | |
tree | a2aab75acb2f58ec97ce8b86cce3fd0d9bd5c6f0 /arch/nds32/include | |
parent | a15e9ffa877852e529db33cc615c132bad2fc60a (diff) | |
download | linux-f13c34b9066745910bd96f94bd35895af2d4f2b8.tar.xz |
nds32: IRQ handling
This patch includes irq related functions and irqchip_init().
Signed-off-by: Vincent Chen <vincentc@andestech.com>
Signed-off-by: Greentime Hu <greentime@andestech.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/nds32/include')
-rw-r--r-- | arch/nds32/include/asm/irqflags.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/nds32/include/asm/irqflags.h b/arch/nds32/include/asm/irqflags.h new file mode 100644 index 000000000000..2bfd00f8bc48 --- /dev/null +++ b/arch/nds32/include/asm/irqflags.h @@ -0,0 +1,36 @@ +// 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; +} |