Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Cadence Design Systems Inc. |
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 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 |