1 // SPDX-License-Identifier: GPL-2.0
3 * SHmedia irqflags support
5 * Copyright (C) 2006 - 2009 Paul Mundt
7 #include <linux/irqflags.h>
8 #include <linux/module.h>
9 #include <cpu/registers.h>
11 void notrace arch_local_irq_restore(unsigned long flags)
13 unsigned long long __dummy;
15 if (flags == ARCH_IRQ_DISABLED) {
16 __asm__ __volatile__ (
17 "getcon " __SR ", %0\n\t"
19 "putcon %0, " __SR "\n\t"
21 : "r" (ARCH_IRQ_DISABLED)
24 __asm__ __volatile__ (
25 "getcon " __SR ", %0\n\t"
27 "putcon %0, " __SR "\n\t"
29 : "r" (~ARCH_IRQ_DISABLED)
33 EXPORT_SYMBOL(arch_local_irq_restore);
35 unsigned long notrace arch_local_save_flags(void)
39 __asm__ __volatile__ (
40 "getcon " __SR ", %0\n\t"
43 : "r" (ARCH_IRQ_DISABLED)
48 EXPORT_SYMBOL(arch_local_save_flags);