Merge branch 'for-3.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
[linux/fpc-iii.git] / arch / unicore32 / include / asm / irqflags.h
blob6d8a28dfdbae0a9ab5004cb88172560c2dd1557f
1 /*
2 * linux/arch/unicore32/include/asm/irqflags.h
4 * Code specific to PKUnity SoC and UniCore ISA
6 * Copyright (C) 2001-2010 GUAN Xue-tao
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 #ifndef __UNICORE_IRQFLAGS_H__
13 #define __UNICORE_IRQFLAGS_H__
15 #ifdef __KERNEL__
17 #include <asm/ptrace.h>
19 #define ARCH_IRQ_DISABLED (PRIV_MODE | PSR_I_BIT)
20 #define ARCH_IRQ_ENABLED (PRIV_MODE)
23 * Save the current interrupt enable state.
25 static inline unsigned long arch_local_save_flags(void)
27 unsigned long temp;
29 asm volatile("mov %0, asr" : "=r" (temp) : : "memory", "cc");
31 return temp & PSR_c;
35 * restore saved IRQ state
37 static inline void arch_local_irq_restore(unsigned long flags)
39 unsigned long temp;
41 asm volatile(
42 "mov %0, asr\n"
43 "mov.a asr, %1\n"
44 "mov.f asr, %0"
45 : "=&r" (temp)
46 : "r" (flags)
47 : "memory", "cc");
50 #include <asm-generic/irqflags.h>
52 #endif
53 #endif