xref: /openbmc/u-boot/arch/xtensa/include/asm/system.h (revision 3ba98ed8)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2016 Cadence Design Systems Inc.
4  */
5 
6 #ifndef _XTENSA_SYSTEM_H
7 #define _XTENSA_SYSTEM_H
8 
9 #include <asm/arch/core.h>
10 
11 #if XCHAL_HAVE_INTERRUPTS
12 #define local_irq_save(flags) \
13 	__asm__ __volatile__ ("rsil %0, %1" \
14 			      : "=a"(flags) \
15 			      : "I"(XCHAL_EXCM_LEVEL) \
16 			      : "memory")
17 #define local_irq_restore(flags) \
18 	__asm__ __volatile__ ("wsr %0, ps\n\t" \
19 			      "rsync" \
20 			      :: "a"(flags) : "memory")
21 #else
22 #define local_irq_save(flags) ((void)(flags))
23 #define local_irq_restore(flags) ((void)(flags))
24 #endif
25 
26 #endif
27