Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) #ifndef __ASM_GENERIC_IRQFLAGS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) #define __ASM_GENERIC_IRQFLAGS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * All architectures should implement at least the first two functions,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  * usually inline assembly will be the best way.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #ifndef ARCH_IRQ_DISABLED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define ARCH_IRQ_DISABLED 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define ARCH_IRQ_ENABLED 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) /* read interrupt enabled status */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #ifndef arch_local_save_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) unsigned long arch_local_save_flags(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) /* set interrupt enabled status */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #ifndef arch_local_irq_restore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) void arch_local_irq_restore(unsigned long flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /* get status and disable interrupts */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #ifndef arch_local_irq_save
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) static inline unsigned long arch_local_irq_save(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	flags = arch_local_save_flags();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	arch_local_irq_restore(ARCH_IRQ_DISABLED);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	return flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /* test flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #ifndef arch_irqs_disabled_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) static inline int arch_irqs_disabled_flags(unsigned long flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	return flags == ARCH_IRQ_DISABLED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) /* unconditionally enable interrupts */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #ifndef arch_local_irq_enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) static inline void arch_local_irq_enable(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	arch_local_irq_restore(ARCH_IRQ_ENABLED);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) /* unconditionally disable interrupts */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #ifndef arch_local_irq_disable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) static inline void arch_local_irq_disable(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	arch_local_irq_restore(ARCH_IRQ_DISABLED);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) /* test hardware interrupt enable bit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #ifndef arch_irqs_disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) static inline int arch_irqs_disabled(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 	return arch_irqs_disabled_flags(arch_local_save_flags());
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) #endif /* __ASM_GENERIC_IRQFLAGS_H */