Linux Audio

Check our new training course

Loading...
v4.6
 
 1/*
 2 * SHmedia irqflags support
 3 *
 4 * Copyright (C) 2006 - 2009 Paul Mundt
 5 *
 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>
13
14void notrace arch_local_irq_restore(unsigned long flags)
15{
16	unsigned long long __dummy;
17
18	if (flags == ARCH_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" (ARCH_IRQ_DISABLED)
25		);
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" (~ARCH_IRQ_DISABLED)
33		);
34	}
35}
36EXPORT_SYMBOL(arch_local_irq_restore);
37
38unsigned long notrace arch_local_save_flags(void)
39{
40	unsigned long flags;
41
42	__asm__ __volatile__ (
43		"getcon	" __SR ", %0\n\t"
44		"and	%0, %1, %0"
45		: "=&r" (flags)
46		: "r" (ARCH_IRQ_DISABLED)
47	);
48
49	return flags;
50}
51EXPORT_SYMBOL(arch_local_save_flags);
v5.4
 1// SPDX-License-Identifier: GPL-2.0
 2/*
 3 * SHmedia irqflags support
 4 *
 5 * Copyright (C) 2006 - 2009 Paul Mundt
 
 
 
 
 6 */
 7#include <linux/irqflags.h>
 8#include <linux/module.h>
 9#include <cpu/registers.h>
10
11void notrace arch_local_irq_restore(unsigned long flags)
12{
13	unsigned long long __dummy;
14
15	if (flags == ARCH_IRQ_DISABLED) {
16		__asm__ __volatile__ (
17			"getcon	" __SR ", %0\n\t"
18			"or	%0, %1, %0\n\t"
19			"putcon	%0, " __SR "\n\t"
20			: "=&r" (__dummy)
21			: "r" (ARCH_IRQ_DISABLED)
22		);
23	} else {
24		__asm__ __volatile__ (
25			"getcon	" __SR ", %0\n\t"
26			"and	%0, %1, %0\n\t"
27			"putcon	%0, " __SR "\n\t"
28			: "=&r" (__dummy)
29			: "r" (~ARCH_IRQ_DISABLED)
30		);
31	}
32}
33EXPORT_SYMBOL(arch_local_irq_restore);
34
35unsigned long notrace arch_local_save_flags(void)
36{
37	unsigned long flags;
38
39	__asm__ __volatile__ (
40		"getcon	" __SR ", %0\n\t"
41		"and	%0, %1, %0"
42		: "=&r" (flags)
43		: "r" (ARCH_IRQ_DISABLED)
44	);
45
46	return flags;
47}
48EXPORT_SYMBOL(arch_local_save_flags);