V4L/DVB: cx231xx: improve error handling
[wandboard.git] / arch / sh / kernel / irq_64.c
blob32365ba0e039868bddce2eb3a3ce7b6aee64b907
1 /*
2 * SHmedia irqflags support
4 * Copyright (C) 2006 - 2009 Paul Mundt
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10 #include <linux/irqflags.h>
11 #include <linux/module.h>
12 #include <cpu/registers.h>
14 void notrace raw_local_irq_restore(unsigned long flags)
16 unsigned long long __dummy;
18 if (flags == RAW_IRQ_DISABLED) {
19 __asm__ __volatile__ (
20 "getcon " __SR ", %0\n\t"
21 "or %0, %1, %0\n\t"
22 "putcon %0, " __SR "\n\t"
23 : "=&r" (__dummy)
24 : "r" (RAW_IRQ_DISABLED)
26 } else {
27 __asm__ __volatile__ (
28 "getcon " __SR ", %0\n\t"
29 "and %0, %1, %0\n\t"
30 "putcon %0, " __SR "\n\t"
31 : "=&r" (__dummy)
32 : "r" (~RAW_IRQ_DISABLED)
36 EXPORT_SYMBOL(raw_local_irq_restore);
38 unsigned long notrace __raw_local_save_flags(void)
40 unsigned long flags;
42 __asm__ __volatile__ (
43 "getcon " __SR ", %0\n\t"
44 "and %0, %1, %0"
45 : "=&r" (flags)
46 : "r" (RAW_IRQ_DISABLED)
49 return flags;
51 EXPORT_SYMBOL(__raw_local_save_flags);