Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m32r: Autogenerate offsets in struct thread_info

Maintaining offsets by hand is no fun.

Signed-off-by: Richard Weinberger <richard@nod.at>

+17 -13
+1
arch/m32r/include/asm/asm-offsets.h
··· 1 + #include <generated/asm-offsets.h>
+1 -12
arch/m32r/include/asm/thread_info.h
··· 38 38 __u8 supervisor_stack[0]; 39 39 }; 40 40 41 - #else /* !__ASSEMBLY__ */ 42 - 43 - /* offsets into the thread_info struct for assembly code access */ 44 - #define TI_TASK 0x00000000 45 - #define TI_EXEC_DOMAIN 0x00000004 46 - #define TI_FLAGS 0x00000008 47 - #define TI_STATUS 0x0000000C 48 - #define TI_CPU 0x00000010 49 - #define TI_PRE_COUNT 0x00000014 50 - #define TI_ADDR_LIMIT 0x00000018 51 - 52 - #endif 41 + #endif /* !__ASSEMBLY__ */ 53 42 54 43 #define THREAD_SIZE (PAGE_SIZE << 1) 55 44 #define THREAD_SIZE_ORDER 1
+14 -1
arch/m32r/kernel/asm-offsets.c
··· 1 - /* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */ 1 + #include <linux/thread_info.h> 2 + #include <linux/kbuild.h> 3 + 4 + int foo(void) 5 + { 6 + OFFSET(TI_TASK, thread_info, task); 7 + OFFSET(TI_FLAGS, thread_info, flags); 8 + OFFSET(TI_STATUS, thread_info, status); 9 + OFFSET(TI_CPU, thread_info, cpu); 10 + OFFSET(TI_PRE_COUNT, thread_info, preempt_count); 11 + OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); 12 + 13 + return 0; 14 + }
+1
arch/m32r/kernel/entry.S
··· 65 65 #include <asm/page.h> 66 66 #include <asm/m32r.h> 67 67 #include <asm/mmu_context.h> 68 + #include <asm/asm-offsets.h> 68 69 69 70 #if !defined(CONFIG_MMU) 70 71 #define sys_madvise sys_ni_syscall