PageRenderTime 26ms CodeModel.GetById 24ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/arch/um/include/asm/system.h

https://bitbucket.org/ndreys/linux-sunxi
C++ Header | 47 lines | 37 code | 10 blank | 0 comment | 1 complexity | 2e1e3e897063182ed9159b3e2da8ec2d MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
 1#ifndef __UM_SYSTEM_GENERIC_H
 2#define __UM_SYSTEM_GENERIC_H
 3
 4#include "sysdep/system.h"
 5
 6extern int get_signals(void);
 7extern int set_signals(int enable);
 8extern void block_signals(void);
 9extern void unblock_signals(void);
10
11static inline unsigned long arch_local_save_flags(void)
12{
13	return get_signals();
14}
15
16static inline void arch_local_irq_restore(unsigned long flags)
17{
18	set_signals(flags);
19}
20
21static inline void arch_local_irq_enable(void)
22{
23	unblock_signals();
24}
25
26static inline void arch_local_irq_disable(void)
27{
28	block_signals();
29}
30
31static inline unsigned long arch_local_irq_save(void)
32{
33	unsigned long flags;
34	flags = arch_local_save_flags();
35	arch_local_irq_disable();
36	return flags;
37}
38
39static inline bool arch_irqs_disabled(void)
40{
41	return arch_local_save_flags() == 0;
42}
43
44extern void *_switch_to(void *prev, void *next, void *last);
45#define switch_to(prev, next, last) prev = _switch_to(prev, next, last)
46
47#endif