summaryrefslogtreecommitdiff
path: root/arch/nds32/include/asm/irqflags.h
blob: fb45ec46bb1b2e7be861a236a3773c090ca65b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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;
}