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) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * IRQ flags handling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) #ifndef _ASM_IRQFLAGS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) #define _ASM_IRQFLAGS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #ifndef __ASSEMBLY__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)  * Get definitions for arch_local_save_flags(x), etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <asm/hw_irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #ifdef CONFIG_TRACE_IRQFLAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #ifdef CONFIG_IRQSOFF_TRACER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)  * Since the ftrace irqsoff latency trace checks CALLER_ADDR1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)  * which is the stack frame here, we need to force a stack frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)  * in case we came from user space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define TRACE_WITH_FRAME_BUFFER(func)		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	mflr	r0;				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	stdu	r1, -STACK_FRAME_OVERHEAD(r1);	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 	std	r0, 16(r1);			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	stdu	r1, -STACK_FRAME_OVERHEAD(r1);	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 	bl func;				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	ld	r1, 0(r1);			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	ld	r1, 0(r1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define TRACE_WITH_FRAME_BUFFER(func)		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	bl func;
^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) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)  * These are calls to C code, so the caller must be prepared for volatiles to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)  * be clobbered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define TRACE_ENABLE_INTS	TRACE_WITH_FRAME_BUFFER(trace_hardirqs_on)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #define TRACE_DISABLE_INTS	TRACE_WITH_FRAME_BUFFER(trace_hardirqs_off)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)  * This is used by assembly code to soft-disable interrupts first and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)  * reconcile irq state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)  * NB: This may call C code, so the caller must be prepared for volatiles to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)  * be clobbered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define RECONCILE_IRQ_STATE(__rA, __rB)		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 	lbz	__rA,PACAIRQSOFTMASK(r13);	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	lbz	__rB,PACAIRQHAPPENED(r13);	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	andi.	__rA,__rA,IRQS_DISABLED;	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 	li	__rA,IRQS_DISABLED;		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 	ori	__rB,__rB,PACA_IRQ_HARD_DIS;	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	stb	__rB,PACAIRQHAPPENED(r13);	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 	bne	44f;				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 	stb	__rA,PACAIRQSOFTMASK(r13);	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	TRACE_DISABLE_INTS;			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 44:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define TRACE_ENABLE_INTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #define TRACE_DISABLE_INTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #define RECONCILE_IRQ_STATE(__rA, __rB)		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) 	lbz	__rA,PACAIRQHAPPENED(r13);	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 	li	__rB,IRQS_DISABLED;		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 	ori	__rA,__rA,PACA_IRQ_HARD_DIS;	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 	stb	__rB,PACAIRQSOFTMASK(r13);	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) 	stb	__rA,PACAIRQHAPPENED(r13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #endif