xref: /linux/arch/hexagon/include/asm/irqflags.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*08dbd0f8SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
299a70aa0SRichard Kuo /*
399a70aa0SRichard Kuo  * IRQ support for the Hexagon architecture
499a70aa0SRichard Kuo  *
5e1858b2aSRichard Kuo  * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
699a70aa0SRichard Kuo  */
799a70aa0SRichard Kuo 
899a70aa0SRichard Kuo #ifndef _ASM_IRQFLAGS_H
999a70aa0SRichard Kuo #define _ASM_IRQFLAGS_H
1099a70aa0SRichard Kuo 
1199a70aa0SRichard Kuo #include <asm/hexagon_vm.h>
1299a70aa0SRichard Kuo #include <linux/types.h>
1399a70aa0SRichard Kuo 
arch_local_save_flags(void)1499a70aa0SRichard Kuo static inline unsigned long arch_local_save_flags(void)
1599a70aa0SRichard Kuo {
1699a70aa0SRichard Kuo 	return __vmgetie();
1799a70aa0SRichard Kuo }
1899a70aa0SRichard Kuo 
arch_local_irq_save(void)1999a70aa0SRichard Kuo static inline unsigned long arch_local_irq_save(void)
2099a70aa0SRichard Kuo {
2199a70aa0SRichard Kuo 	return __vmsetie(VM_INT_DISABLE);
2299a70aa0SRichard Kuo }
2399a70aa0SRichard Kuo 
arch_irqs_disabled_flags(unsigned long flags)2499a70aa0SRichard Kuo static inline bool arch_irqs_disabled_flags(unsigned long flags)
2599a70aa0SRichard Kuo {
2699a70aa0SRichard Kuo 	return !flags;
2799a70aa0SRichard Kuo }
2899a70aa0SRichard Kuo 
arch_irqs_disabled(void)2999a70aa0SRichard Kuo static inline bool arch_irqs_disabled(void)
3099a70aa0SRichard Kuo {
3199a70aa0SRichard Kuo 	return !__vmgetie();
3299a70aa0SRichard Kuo }
3399a70aa0SRichard Kuo 
arch_local_irq_enable(void)3499a70aa0SRichard Kuo static inline void arch_local_irq_enable(void)
3599a70aa0SRichard Kuo {
3699a70aa0SRichard Kuo 	__vmsetie(VM_INT_ENABLE);
3799a70aa0SRichard Kuo }
3899a70aa0SRichard Kuo 
arch_local_irq_disable(void)3999a70aa0SRichard Kuo static inline void arch_local_irq_disable(void)
4099a70aa0SRichard Kuo {
4199a70aa0SRichard Kuo 	__vmsetie(VM_INT_DISABLE);
4299a70aa0SRichard Kuo }
4399a70aa0SRichard Kuo 
arch_local_irq_restore(unsigned long flags)4499a70aa0SRichard Kuo static inline void arch_local_irq_restore(unsigned long flags)
4599a70aa0SRichard Kuo {
4699a70aa0SRichard Kuo 	__vmsetie(flags);
4799a70aa0SRichard Kuo }
4899a70aa0SRichard Kuo 
4999a70aa0SRichard Kuo #endif
50