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)  * This program is used to generate definitions needed by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * assembly language modules.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * We use the technique used in the OSF Mach kernel code:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  * generate asm statements containing #defines,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  * compile this file to assembler, and then extract the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9)  * #defines from the assembly-language output.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/stddef.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/kernel_stat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/ptrace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/hardirq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/kbuild.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <asm/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <asm/ptrace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) int main(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	/* offsets into the task struct */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	OFFSET(TASK_STATE, task_struct, state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 	OFFSET(TASK_FLAGS, task_struct, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	OFFSET(TASK_PTRACE, task_struct, ptrace);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 	OFFSET(TASK_BLOCKED, task_struct, blocked);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	OFFSET(TASK_THREAD, task_struct, thread);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	OFFSET(TASK_THREAD_INFO, task_struct, stack);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	OFFSET(TASK_MM, task_struct, mm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	OFFSET(TASK_ACTIVE_MM, task_struct, active_mm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	/* offsets into the irq_cpustat_t struct */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 						 __softirq_pending));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	/* offsets into the thread struct */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	OFFSET(THREAD_KSP, thread_struct, ksp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	OFFSET(THREAD_USP, thread_struct, usp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	OFFSET(THREAD_CCR, thread_struct, ccr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 	/* offsets into the pt_regs struct */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 	DEFINE(LER0,  offsetof(struct pt_regs, er0)      - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 	DEFINE(LER1,  offsetof(struct pt_regs, er1)      - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 	DEFINE(LER2,  offsetof(struct pt_regs, er2)      - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 	DEFINE(LER3,  offsetof(struct pt_regs, er3)      - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	DEFINE(LER4,  offsetof(struct pt_regs, er4)      - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 	DEFINE(LER5,  offsetof(struct pt_regs, er5)      - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 	DEFINE(LER6,  offsetof(struct pt_regs, er6)      - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 	DEFINE(LORIG, offsetof(struct pt_regs, orig_er0) - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	DEFINE(LSP,   offsetof(struct pt_regs, sp)       - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	DEFINE(LCCR,  offsetof(struct pt_regs, ccr)      - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 	DEFINE(LVEC,  offsetof(struct pt_regs, vector)   - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #if defined(CONFIG_CPU_H8S)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	DEFINE(LEXR,  offsetof(struct pt_regs, exr)      - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 	DEFINE(LRET,  offsetof(struct pt_regs, pc)       - sizeof(long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 	DEFINE(PT_PTRACED, PT_PTRACED);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 	/* offsets in thread_info structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 	OFFSET(TI_TASK, thread_info, task);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 	OFFSET(TI_FLAGS, thread_info, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 	OFFSET(TI_CPU, thread_info, cpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 	OFFSET(TI_PRE, thread_info, preempt_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #ifdef CONFIG_PREEMPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 	DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) }