blob: a241568f603f8c862cfa49c8160f74ef7207076b [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Chris Zankelc978b522016-08-10 18:36:44 +03002/*
3 * Copyright (C) 2016 Cadence Design Systems Inc.
Chris Zankelc978b522016-08-10 18:36:44 +03004 */
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