Blame view

arch/sh/kernel/irq_64.c 1.06 KB
03fdb7089   Paul Mundt   sh: Convert to as...
1
2
3
4
5
6
7
8
9
10
11
12
  /*
   * SHmedia irqflags support
   *
   * Copyright (C) 2006 - 2009 Paul Mundt
   *
   * This file is subject to the terms and conditions of the GNU General Public
   * License. See the file "COPYING" in the main directory of this archive
   * for more details.
   */
  #include <linux/irqflags.h>
  #include <linux/module.h>
  #include <cpu/registers.h>
31b37c73c   Paul Mundt   sh64: update for ...
13
  void notrace arch_local_irq_restore(unsigned long flags)
03fdb7089   Paul Mundt   sh: Convert to as...
14
15
  {
  	unsigned long long __dummy;
31b37c73c   Paul Mundt   sh64: update for ...
16
  	if (flags == ARCH_IRQ_DISABLED) {
03fdb7089   Paul Mundt   sh: Convert to as...
17
18
19
20
21
22
23
24
  		__asm__ __volatile__ (
  			"getcon	" __SR ", %0
  \t"
  			"or	%0, %1, %0
  \t"
  			"putcon	%0, " __SR "
  \t"
  			: "=&r" (__dummy)
31b37c73c   Paul Mundt   sh64: update for ...
25
  			: "r" (ARCH_IRQ_DISABLED)
03fdb7089   Paul Mundt   sh: Convert to as...
26
27
28
29
30
31
32
33
34
35
  		);
  	} else {
  		__asm__ __volatile__ (
  			"getcon	" __SR ", %0
  \t"
  			"and	%0, %1, %0
  \t"
  			"putcon	%0, " __SR "
  \t"
  			: "=&r" (__dummy)
31b37c73c   Paul Mundt   sh64: update for ...
36
  			: "r" (~ARCH_IRQ_DISABLED)
03fdb7089   Paul Mundt   sh: Convert to as...
37
38
39
  		);
  	}
  }
31b37c73c   Paul Mundt   sh64: update for ...
40
  EXPORT_SYMBOL(arch_local_irq_restore);
03fdb7089   Paul Mundt   sh: Convert to as...
41

31b37c73c   Paul Mundt   sh64: update for ...
42
  unsigned long notrace arch_local_save_flags(void)
03fdb7089   Paul Mundt   sh: Convert to as...
43
44
45
46
47
48
49
50
  {
  	unsigned long flags;
  
  	__asm__ __volatile__ (
  		"getcon	" __SR ", %0
  \t"
  		"and	%0, %1, %0"
  		: "=&r" (flags)
31b37c73c   Paul Mundt   sh64: update for ...
51
  		: "r" (ARCH_IRQ_DISABLED)
03fdb7089   Paul Mundt   sh: Convert to as...
52
53
54
55
  	);
  
  	return flags;
  }
31b37c73c   Paul Mundt   sh64: update for ...
56
  EXPORT_SYMBOL(arch_local_save_flags);