-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Greentime Hu
committed
Feb 22, 2018
1 parent
a15e9ff
commit f13c34b
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
// Copyright (C) 2005-2017 Andes Technology Corporation | ||
|
||
#include <linux/irqchip.h> | ||
|
||
void __init init_IRQ(void) | ||
{ | ||
irqchip_init(); | ||
} |