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

[CRIS] Merge asm-offsets.c for both arches into one file.

Eliminates the link to arch specific asm-offsets.c from CRIS
architecture build system.

Resulting asm-offsets.s are identical before and after change
for both arch-v10 and arch-v32.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>

+35 -69
+2 -4
arch/cris/Makefile
··· 95 95 endif 96 96 @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S 97 97 @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S 98 - @rm -rf $(SRC_ARCH)/kernel/asm-offsets.c 99 - @ln -sfn ../$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c 100 98 @touch $@ 101 99 102 100 archclean: ··· 114 116 $(SRC_ARCH)/boot \ 115 117 $(SRC_ARCH)/lib \ 116 118 $(SRC_ARCH)/arch \ 117 - $(SRC_ARCH)/kernel/vmlinux.lds.S \ 118 - $(SRC_ARCH)/kernel/asm-offsets.c 119 + $(SRC_ARCH)/kernel/vmlinux.lds.S 120 + 119 121 120 122 define archhelp 121 123 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
-47
arch/cris/arch-v10/kernel/asm-offsets.c
··· 1 - #include <linux/sched.h> 2 - #include <asm/thread_info.h> 3 - 4 - /* 5 - * Generate definitions needed by assembly language modules. 6 - * This code generates raw asm output which is post-processed to extract 7 - * and format the required data. 8 - */ 9 - 10 - #define DEFINE(sym, val) \ 11 - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 12 - 13 - #define BLANK() asm volatile("\n->" : : ) 14 - 15 - int main(void) 16 - { 17 - #define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry)) 18 - ENTRY(orig_r10); 19 - ENTRY(r13); 20 - ENTRY(r12); 21 - ENTRY(r11); 22 - ENTRY(r10); 23 - ENTRY(r9); 24 - ENTRY(mof); 25 - ENTRY(dccr); 26 - ENTRY(srp); 27 - BLANK(); 28 - #undef ENTRY 29 - #define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry)) 30 - ENTRY(task); 31 - ENTRY(flags); 32 - ENTRY(preempt_count); 33 - BLANK(); 34 - #undef ENTRY 35 - #define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry)) 36 - ENTRY(ksp); 37 - ENTRY(usp); 38 - ENTRY(dccr); 39 - BLANK(); 40 - #undef ENTRY 41 - #define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry)) 42 - ENTRY(pid); 43 - BLANK(); 44 - DEFINE(LCLONE_VM, CLONE_VM); 45 - DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED); 46 - return 0; 47 - }
+33 -18
arch/cris/arch-v32/kernel/asm-offsets.c arch/cris/kernel/asm-offsets.c
··· 1 1 #include <linux/sched.h> 2 2 #include <asm/thread_info.h> 3 + #include <linux/autoconf.h> 3 4 4 5 /* 5 6 * Generate definitions needed by assembly language modules. ··· 9 8 */ 10 9 11 10 #define DEFINE(sym, val) \ 12 - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 11 + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 13 12 14 13 #define BLANK() asm volatile("\n->" : : ) 14 + 15 + #if !defined(CONFIG_ETRAX_ARCH_V10) && !defined(CONFIG_ETRAX_ARCH_V32) 16 + #error One of ARCH v10 and ARCH v32 must be true! 17 + #endif 15 18 16 19 int main(void) 17 20 { ··· 24 19 ENTRY(r13); 25 20 ENTRY(r12); 26 21 ENTRY(r11); 27 - ENTRY(r10); 28 - ENTRY(r9); 22 + ENTRY(r10); 23 + ENTRY(r9); 24 + #ifdef CONFIG_ETRAX_ARCH_V32 29 25 ENTRY(acr); 30 26 ENTRY(srs); 31 - ENTRY(mof); 32 - ENTRY(ccs); 33 - ENTRY(srp); 27 + #endif 28 + ENTRY(mof); 29 + #ifdef CONFIG_ETRAX_ARCH_V10 30 + ENTRY(dccr); 31 + #else 32 + ENTRY(ccs); 33 + #endif 34 + ENTRY(srp); 34 35 BLANK(); 35 36 #undef ENTRY 36 37 #define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry)) 37 - ENTRY(task); 38 - ENTRY(flags); 39 - ENTRY(preempt_count); 40 - BLANK(); 38 + ENTRY(task); 39 + ENTRY(flags); 40 + ENTRY(preempt_count); 41 + BLANK(); 41 42 #undef ENTRY 42 43 #define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry)) 43 44 ENTRY(ksp); 44 - ENTRY(usp); 45 - ENTRY(ccs); 46 - BLANK(); 45 + ENTRY(usp); 46 + #ifdef CONFIG_ETRAX_ARCH_V10 47 + ENTRY(dccr); 48 + #else 49 + ENTRY(ccs); 50 + #endif 51 + BLANK(); 47 52 #undef ENTRY 48 53 #define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry)) 49 - ENTRY(pid); 50 - BLANK(); 51 - DEFINE(LCLONE_VM, CLONE_VM); 52 - DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED); 53 - return 0; 54 + ENTRY(pid); 55 + BLANK(); 56 + DEFINE(LCLONE_VM, CLONE_VM); 57 + DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED); 58 + return 0; 54 59 }